From 4b50798e71b0235b599ed9097eb31bd2aa3a1ca5 Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Wed, 3 Apr 2024 12:09:53 -0500 Subject: [PATCH 1/3] Fix `NamedEventInput` type --- packages/evm-client/src/contract/types/Event.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/evm-client/src/contract/types/Event.ts b/packages/evm-client/src/contract/types/Event.ts index 7e5d142..28e51a6 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 >; From ab71bc9ed062375771d54947e90f812f3e05083e Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Wed, 3 Apr 2024 12:11:29 -0500 Subject: [PATCH 2/3] Add changeset --- .changeset/strange-hornets-punch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/strange-hornets-punch.md diff --git a/.changeset/strange-hornets-punch.md b/.changeset/strange-hornets-punch.md new file mode 100644 index 0000000..b1e0356 --- /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` From 1564ca48e7676b3d81c05d5a3b145f0902cfdc00 Mon Sep 17 00:00:00 2001 From: Ryan Goree Date: Wed, 3 Apr 2024 14:55:28 -0500 Subject: [PATCH 3/3] Parameterize `objectToArray` value type --- packages/evm-client/src/contract/utils/objectToArray.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/evm-client/src/contract/utils/objectToArray.ts b/packages/evm-client/src/contract/utils/objectToArray.ts index c7a9cfd..f733fcf 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 });