From bb72cad000bdc72db86f46a254df4fc2ed09475b Mon Sep 17 00:00:00 2001 From: Christophe Date: Tue, 2 Jul 2024 09:57:33 +0000 Subject: [PATCH] Refine ActionParameters type --- src/types/Actions.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/types/Actions.ts b/src/types/Actions.ts index 9072c656..0327ffba 100644 --- a/src/types/Actions.ts +++ b/src/types/Actions.ts @@ -1,8 +1,6 @@ import { Address } from 'viem'; import { Prettify } from './utils'; -type RemoveUndefinedArgs = T extends { args?: undefined } ? Omit : T; - /** * Actions require contract address, but as part of decorators, the address might have been passed already to the decorator. * @@ -11,8 +9,8 @@ type RemoveUndefinedArgs = T extends { args?: undefined } ? Omit : */ export type ActionParameters = Prettify< Curried extends false - ? RemoveUndefinedArgs - : Args extends { args?: undefined } + ? Args & { [key in ContractName]: Address } + : Args extends Record ? | { [key in ContractName]: Address;