Skip to content

Commit

Permalink
fix: input type for uintN[], N > 51 (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-p authored Aug 2, 2024
1 parent 928175a commit 49e5167
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/helpers/get-equivalent-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 49e5167

Please sign in to comment.