Skip to content

Commit

Permalink
Parameterize objectToArray value type
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree committed Apr 3, 2024
1 parent ab71bc9 commit 1564ca4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/evm-client/src/contract/utils/objectToArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export function objectToArray<
TItemType extends AbiItemType,
TName extends AbiEntryName<TAbi, TItemType>,
TParameterKind extends AbiParameterKind,
TValue extends AbiObjectType<TAbi, TItemType, TName, TParameterKind>,
>({
abi,
type,
Expand All @@ -63,11 +64,9 @@ export function objectToArray<
}: {
abi: TAbi;
name: TName;
value?: Abi extends TAbi
? Record<string, unknown> // <- fallback for unknown ABI type
: Partial<AbiObjectType<TAbi, TItemType, TName, TParameterKind>>;
kind: TParameterKind;
type: TItemType;
value?: Abi extends TAbi ? Record<string, unknown> : TValue;
}): AbiArrayType<TAbi, TItemType, TName, TParameterKind> {
const abiEntry = getAbiEntry({ abi, type, name });

Expand Down

0 comments on commit 1564ca4

Please sign in to comment.