From cd317f0b4c2ffe7cf49d616f85e3ebc663f4bff7 Mon Sep 17 00:00:00 2001 From: Joe Polny Date: Fri, 2 Aug 2024 07:33:42 -0400 Subject: [PATCH] fix: input type for uintN[], N > 51 --- src/client/helpers/get-equivalent-type.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/helpers/get-equivalent-type.ts b/src/client/helpers/get-equivalent-type.ts index 11a41b9..cf235d3 100644 --- a/src/client/helpers/get-equivalent-type.ts +++ b/src/client/helpers/get-equivalent-type.ts @@ -38,7 +38,13 @@ export function getEquivalentType(abiTypeStr: string, ioType: 'input' | 'output' } if (abiType instanceof ABIArrayDynamicType) { if (abiType.childType instanceof ABIByteType) return 'Uint8Array' - return `${abiTypeToTs(abiType.childType, ioType)}[]` + + const childTsType = abiTypeToTs(abiType.childType, ioType) + if (childTsType === 'bigint | number') { + return 'bigint[] | number[]' + } + + return `${childTsType}[]` } if (abiType instanceof ABIArrayStaticType) { if (abiType.childType instanceof ABIByteType) return 'Uint8Array'