diff --git a/library/package-lock.json b/library/package-lock.json index 2c22ca8..a458279 100644 --- a/library/package-lock.json +++ b/library/package-lock.json @@ -1,6 +1,6 @@ { "name": "solidity-typescript-generator", - "version": "1.1.6", + "version": "1.1.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/library/package.json b/library/package.json index 281336b..330694f 100644 --- a/library/package.json +++ b/library/package.json @@ -1,6 +1,6 @@ { "name": "@augurproject/solidity-typescript-generator", - "version": "1.1.6", + "version": "1.1.8", "description": "Takes in a solidity file and generates a set of TypeScript classes for interacting with the contract.", "main": "output/index.js", "scripts": { diff --git a/library/source/index.ts b/library/source/index.ts index 16353a2..d8655e7 100644 --- a/library/source/index.ts +++ b/library/source/index.ts @@ -1,6 +1,6 @@ import { keccak256 } from 'js-sha3' -type Primitive = 'uint8' | 'uint64' | 'uint256' | 'bool' | 'string' | 'address' | 'bytes4' | 'bytes20' | 'bytes32' | 'bytes' | 'bytes[]' | 'int256' | 'tuple' | 'address[]' | 'uint8[]' | 'uint256[]' | 'int256[]' | 'bytes32[]' | 'tuple[]' +type Primitive = 'uint8' | 'uint64' | 'uint128' | 'uint256' | 'bool' | 'string' | 'address' | 'bytes4' | 'bytes20' | 'bytes32' | 'bytes' | 'bytes[]' | 'int256' | 'tuple' | 'address[]' | 'uint8[]' | 'uint256[]' | 'int256[]' | 'bytes32[]' | 'tuple[]' | 'bool[]' interface AbiParameter { name: string, @@ -70,7 +70,7 @@ export function generateContractInterfaces(contractsOutput: CompilerOutput): str return `// THIS FILE IS AUTOMATICALLY GENERATED BY \`generateContractInterfaces.ts\`. DO NOT EDIT BY HAND' -export type Primitive = 'uint8' | 'uint64' | 'uint256' | 'bool' | 'string' | 'address' | 'bytes4' | 'bytes20' | 'bytes32' | 'bytes' | 'bytes[]' | 'int256' | 'tuple' | 'address[]' | 'uint8[]' | 'uint256[]' | 'int256[]' | 'bytes32[]' | 'tuple[]' +export type Primitive = 'uint8' | 'uint64' | 'uint128' | 'uint256' | 'bool' | 'string' | 'address' | 'bytes4' | 'bytes20' | 'bytes32' | 'bytes' | 'bytes[]' | 'int256' | 'tuple' | 'address[]' | 'uint8[]' | 'uint256[]' | 'int256[]' | 'bytes32[]' | 'tuple[]' | 'bool[]' export interface AbiParameter { name: string @@ -356,6 +356,7 @@ function toTsTypeString(abiParameter: AbiParameter, errorContext: { contractName switch(abiParameter.type) { case 'uint8': case 'uint64': + case 'uint128': case 'uint256': case 'int256': { return 'TBigNumber' @@ -371,6 +372,9 @@ function toTsTypeString(abiParameter: AbiParameter, errorContext: { contractName case 'bool': { return 'boolean' } + case 'bool[]': { + return 'Array' + } case 'tuple': { return `{ ${abiParameter.components!.map(component => `${component.name}: ${toTsTypeString(component, errorContext)}`).join(', ')} }` } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + +