From d72b7299c66ea6d63eb14595b06456c02b2ad99b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 27 Mar 2018 15:19:23 +0200 Subject: Move common types out of web3 types --- packages/abi-gen/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/abi-gen/src/index.ts') 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, -- cgit v1.2.3