diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-28 22:26:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-28 22:26:05 +0800 |
commit | 8926dac78c3ac8d75ad5ffd5b4febe36def4e53c (patch) | |
tree | 01c1b3f8dba486beb4e83e67ad0bc35c3da6a14e /packages/abi-gen/src/index.ts | |
parent | 18cac3f0927a0424e3618fd56dba73fc9dfc0288 (diff) | |
parent | 01e27426d643b525661e044dbb8c8f27734329e7 (diff) | |
download | dexon-sol-tools-8926dac78c3ac8d75ad5ffd5b4febe36def4e53c.tar dexon-sol-tools-8926dac78c3ac8d75ad5ffd5b4febe36def4e53c.tar.gz dexon-sol-tools-8926dac78c3ac8d75ad5ffd5b4febe36def4e53c.tar.bz2 dexon-sol-tools-8926dac78c3ac8d75ad5ffd5b4febe36def4e53c.tar.lz dexon-sol-tools-8926dac78c3ac8d75ad5ffd5b4febe36def4e53c.tar.xz dexon-sol-tools-8926dac78c3ac8d75ad5ffd5b4febe36def4e53c.tar.zst dexon-sol-tools-8926dac78c3ac8d75ad5ffd5b4febe36def4e53c.zip |
Merge pull request #482 from 0xProject/feature/web3-types
Move common types out of web3 types
Diffstat (limited to 'packages/abi-gen/src/index.ts')
-rw-r--r-- | packages/abi-gen/src/index.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 8932e4045..942bb12db 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -1,5 +1,6 @@ #!/usr/bin/env node +import { AbiDefinition, ConstructorAbi, EventAbi, MethodAbi } from '@0xproject/types'; import { logUtils } from '@0xproject/utils'; import chalk from 'chalk'; import * as fs from 'fs'; @@ -10,7 +11,6 @@ import * as mkdirp from 'mkdirp'; import * as yargs from 'yargs'; import toSnakeCase = require('to-snake-case'); -import * as Web3 from 'web3'; import { ContextData, ContractsBackend, ParamKind } from './types'; import { utils } from './utils'; @@ -120,12 +120,12 @@ for (const abiFileName of abiFileNames) { process.exit(1); } - let ctor = ABI.find((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as Web3.ConstructorAbi; + let ctor = ABI.find((abi: AbiDefinition) => abi.type === ABI_TYPE_CONSTRUCTOR) as ConstructorAbi; if (_.isUndefined(ctor)) { ctor = utils.getEmptyConstructor(); // The constructor exists, but it's implicit in JSON's ABI definition } - const methodAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_METHOD) as Web3.MethodAbi[]; + const methodAbis = ABI.filter((abi: AbiDefinition) => abi.type === ABI_TYPE_METHOD) as MethodAbi[]; const methodsData = _.map(methodAbis, methodAbi => { _.map(methodAbi.inputs, (input, i: number) => { if (_.isEmpty(input.name)) { @@ -142,7 +142,7 @@ for (const abiFileName of abiFileNames) { return methodData; }); - const eventAbis = ABI.filter((abi: Web3.AbiDefinition) => abi.type === ABI_TYPE_EVENT) as Web3.EventAbi[]; + const eventAbis = ABI.filter((abi: AbiDefinition) => abi.type === ABI_TYPE_EVENT) as EventAbi[]; const contextData = { contractName: namedContent.name, |