diff --git a/.changeset/strange-hornets-punch.md b/.changeset/strange-hornets-punch.md new file mode 100644 index 00000000..b1e0356c --- /dev/null +++ b/.changeset/strange-hornets-punch.md @@ -0,0 +1,5 @@ +--- +"@delvtech/evm-client": patch +--- + +Fix error with `NamedEventInput` type which was broken and causing broken downstream types such as `EventFilter` diff --git a/packages/evm-client/src/contract/types/Event.ts b/packages/evm-client/src/contract/types/Event.ts index 7e5d1426..28e51a6f 100644 --- a/packages/evm-client/src/contract/types/Event.ts +++ b/packages/evm-client/src/contract/types/Event.ts @@ -19,7 +19,7 @@ type NamedEventInput< TAbi extends Abi, TEventName extends EventName, > = Extract< - AbiParameters, + AbiParameters[number], NamedAbiParameter >; diff --git a/packages/evm-client/src/contract/utils/objectToArray.ts b/packages/evm-client/src/contract/utils/objectToArray.ts index c7a9cfd3..f733fcf8 100644 --- a/packages/evm-client/src/contract/utils/objectToArray.ts +++ b/packages/evm-client/src/contract/utils/objectToArray.ts @@ -54,6 +54,7 @@ export function objectToArray< TItemType extends AbiItemType, TName extends AbiEntryName, TParameterKind extends AbiParameterKind, + TValue extends AbiObjectType, >({ abi, type, @@ -63,11 +64,9 @@ export function objectToArray< }: { abi: TAbi; name: TName; - value?: Abi extends TAbi - ? Record // <- fallback for unknown ABI type - : Partial>; kind: TParameterKind; type: TItemType; + value?: Abi extends TAbi ? Record : TValue; }): AbiArrayType { const abiEntry = getAbiEntry({ abi, type, name });