From 06f095ca23054b4cd8ee1846283c26aea4e93ad9 Mon Sep 17 00:00:00 2001 From: fabioberger Date: Wed, 2 Oct 2019 19:06:54 +0800 Subject: [PATCH] Move types part of pkg exported interfaces to @0x/types from base-contract so more easily accessible --- packages/0x.js/src/index.ts | 4 ++-- .../src/generated-wrappers/asset_proxy_owner.ts | 10 ++-------- .../src/generated-wrappers/coordinator.ts | 2 +- .../generated-wrappers/coordinator_registry.ts | 10 ++-------- .../src/generated-wrappers/dev_utils.ts | 2 +- .../src/generated-wrappers/dummy_erc20_token.ts | 10 ++-------- .../src/generated-wrappers/dummy_erc721_token.ts | 10 ++-------- .../src/generated-wrappers/dutch_auction.ts | 2 +- .../src/generated-wrappers/erc1155_proxy.ts | 10 ++-------- .../src/generated-wrappers/erc20_proxy.ts | 10 ++-------- .../src/generated-wrappers/erc20_token.ts | 10 ++-------- .../src/generated-wrappers/erc721_proxy.ts | 10 ++-------- .../src/generated-wrappers/erc721_token.ts | 10 ++-------- .../generated-wrappers/eth_balance_checker.ts | 2 +- .../src/generated-wrappers/exchange.ts | 10 ++-------- .../src/generated-wrappers/forwarder.ts | 2 +- .../src/generated-wrappers/i_asset_proxy.ts | 2 +- .../src/generated-wrappers/i_validator.ts | 2 +- .../src/generated-wrappers/i_wallet.ts | 2 +- .../src/generated-wrappers/multi_asset_proxy.ts | 10 ++-------- .../src/generated-wrappers/order_validator.ts | 2 +- .../src/generated-wrappers/static_call_proxy.ts | 2 +- .../src/generated-wrappers/weth9.ts | 10 ++-------- .../src/generated-wrappers/zrx_token.ts | 10 ++-------- .../templates/TypeScript/contract.handlebars | 4 +--- .../test-cli/output/typescript/abi_gen_dummy.ts | 10 ++-------- .../test-cli/output/typescript/lib_dummy.ts | 2 +- .../test-cli/output/typescript/test_lib_dummy.ts | 2 +- packages/base-contract/src/utils/filter_utils.ts | 3 +-- packages/contract-wrappers/src/index.ts | 6 +++--- packages/contract-wrappers/src/types.ts | 16 ---------------- packages/types/src/index.ts | 16 +++++++++++++++- 32 files changed, 62 insertions(+), 151 deletions(-) diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts index 397643924d..3417235c35 100644 --- a/packages/0x.js/src/index.ts +++ b/packages/0x.js/src/index.ts @@ -43,7 +43,6 @@ export { ZRXTokenTransferEventArgs, ZRXTokenApprovalEventArgs, ZRXTokenContract, - EventCallback, ExchangeProtocolFeeCollectorAddressEventArgs, ExchangeProtocolFeeMultiplierEventArgs, ExchangeTransactionExecutionEventArgs, @@ -84,6 +83,8 @@ export { SimpleEvmOutput, SimpleEvmBytecodeOutput, EIP712DomainWithDefaultSchema, + EventCallback, + IndexedFilterValues, } from '@0x/types'; export { @@ -132,6 +133,5 @@ export { OutputField, ParamDescription, EvmBytecodeOutput, - IndexedFilterValues, RevertErrorAbi, } from 'ethereum-types'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts b/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts index 36a086ff87..7f9cb9d1e0 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/asset_proxy_owner.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/coordinator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/coordinator.ts index b551fb32ae..482663decc 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/coordinator.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/coordinator.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/coordinator_registry.ts b/packages/abi-gen-wrappers/src/generated-wrappers/coordinator_registry.ts index 67de768648..827b221b04 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/coordinator_registry.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/coordinator_registry.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dev_utils.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dev_utils.ts index 4f01ed273d..ea3cf1904a 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/dev_utils.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/dev_utils.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts index fa8cd6b349..b8b2279a97 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc20_token.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts index 3e27072ac8..5540962892 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/dummy_erc721_token.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts b/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts index 24bb4d63e6..c0d8d3fb7c 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/dutch_auction.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc1155_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc1155_proxy.ts index cc56db6cfb..ad2fcd745e 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc1155_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc1155_proxy.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts index 7b9d371297..f50041fe22 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_proxy.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts index cb9f048b64..7ce2e25780 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc20_token.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts index bc6005e547..c93e5df751 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_proxy.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts index 21739ad79a..6609198dec 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/erc721_token.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/eth_balance_checker.ts b/packages/abi-gen-wrappers/src/generated-wrappers/eth_balance_checker.ts index f7322ed7e0..c973546cf0 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/eth_balance_checker.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/eth_balance_checker.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts index c658f65453..bb8fc0584c 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/exchange.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts b/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts index faf0339639..64e7d4abd3 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/forwarder.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/i_asset_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/i_asset_proxy.ts index c609bc220c..4a91819df5 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/i_asset_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_asset_proxy.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts index 05a99e2ba2..d1cd5b401b 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_validator.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts b/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts index 05e5680ed8..9c8399f017 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/i_wallet.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts index e0f5f3f784..ddac12e1de 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/multi_asset_proxy.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts index b899390542..de5099cd21 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/order_validator.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/static_call_proxy.ts b/packages/abi-gen-wrappers/src/generated-wrappers/static_call_proxy.ts index 56ff0492ea..954be6b254 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/static_call_proxy.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/static_call_proxy.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts b/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts index 4d60c5763d..699f18d94c 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/weth9.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts b/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts index fc5c8953cb..6f60e3abab 100644 --- a/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts +++ b/packages/abi-gen-wrappers/src/generated-wrappers/zrx_token.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen/templates/TypeScript/contract.handlebars b/packages/abi-gen/templates/TypeScript/contract.handlebars index 55aaa4d941..d7dd089680 100644 --- a/packages/abi-gen/templates/TypeScript/contract.handlebars +++ b/packages/abi-gen/templates/TypeScript/contract.handlebars @@ -2,8 +2,6 @@ // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable import { BaseContract{{#if events}}, - EventCallback, - IndexedFilterValues, SubscriptionManager{{/if}},PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { @@ -22,7 +20,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen/test-cli/output/typescript/abi_gen_dummy.ts b/packages/abi-gen/test-cli/output/typescript/abi_gen_dummy.ts index c002380fc9..5b149586fb 100644 --- a/packages/abi-gen/test-cli/output/typescript/abi_gen_dummy.ts +++ b/packages/abi-gen/test-cli/output/typescript/abi_gen_dummy.ts @@ -1,13 +1,7 @@ // tslint:disable:no-consecutive-blank-lines ordered-imports align trailing-comma // tslint:disable:whitespace no-unbound-method no-trailing-whitespace // tslint:disable:no-unused-variable -import { - BaseContract, - EventCallback, - IndexedFilterValues, - SubscriptionManager, - PromiseWithTransactionHash, -} from '@0x/base-contract'; +import { BaseContract, SubscriptionManager, PromiseWithTransactionHash } from '@0x/base-contract'; import { schemas } from '@0x/json-schemas'; import { BlockParam, @@ -25,7 +19,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen/test-cli/output/typescript/lib_dummy.ts b/packages/abi-gen/test-cli/output/typescript/lib_dummy.ts index e060513c2a..2d71295e25 100644 --- a/packages/abi-gen/test-cli/output/typescript/lib_dummy.ts +++ b/packages/abi-gen/test-cli/output/typescript/lib_dummy.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/abi-gen/test-cli/output/typescript/test_lib_dummy.ts b/packages/abi-gen/test-cli/output/typescript/test_lib_dummy.ts index e914908a52..275781c69c 100644 --- a/packages/abi-gen/test-cli/output/typescript/test_lib_dummy.ts +++ b/packages/abi-gen/test-cli/output/typescript/test_lib_dummy.ts @@ -18,7 +18,7 @@ import { SupportedProvider, } from 'ethereum-types'; import { BigNumber, classUtils, logUtils, providerUtils } from '@0x/utils'; -import { SimpleContractArtifact } from '@0x/types'; +import { SimpleContractArtifact, EventCallback, IndexedFilterValues } from '@0x/types'; import { Web3Wrapper } from '@0x/web3-wrapper'; import { assert } from '@0x/assert'; import * as ethers from 'ethers'; diff --git a/packages/base-contract/src/utils/filter_utils.ts b/packages/base-contract/src/utils/filter_utils.ts index db6077c5e6..8611a86541 100644 --- a/packages/base-contract/src/utils/filter_utils.ts +++ b/packages/base-contract/src/utils/filter_utils.ts @@ -1,3 +1,4 @@ +import { IndexedFilterValues } from '@0x/types'; import { BigNumber } from '@0x/utils'; import { BlockRange, ContractAbi, EventAbi, FilterObject, LogEntry } from 'ethereum-types'; import * as ethUtil from 'ethereumjs-util'; @@ -5,8 +6,6 @@ import * as jsSHA3 from 'js-sha3'; import * as _ from 'lodash'; import * as uuid from 'uuid/v4'; -import { IndexedFilterValues } from '../types'; - const TOPIC_LENGTH = 32; export const filterUtils = { diff --git a/packages/contract-wrappers/src/index.ts b/packages/contract-wrappers/src/index.ts index 9b54b4936a..9da6d1ace8 100644 --- a/packages/contract-wrappers/src/index.ts +++ b/packages/contract-wrappers/src/index.ts @@ -83,13 +83,10 @@ export { ForwarderError, CoordinatorServerCancellationResponse, CoordinatorServerError, - IndexedFilterValues, ContractWrappersConfig, OrderTransactionOpts, TransactionOpts, OrderInfo, - EventCallback, - DecodedLogEvent, } from './types'; export { @@ -158,6 +155,9 @@ export { SimpleEvmOutput, SimpleEvmBytecodeOutput, EIP712DomainWithDefaultSchema, + EventCallback, + DecodedLogEvent, + IndexedFilterValues, } from '@0x/types'; export { AbiDecoder, DecodedCalldata } from '@0x/utils'; diff --git a/packages/contract-wrappers/src/types.ts b/packages/contract-wrappers/src/types.ts index 46f189790f..048e08981d 100644 --- a/packages/contract-wrappers/src/types.ts +++ b/packages/contract-wrappers/src/types.ts @@ -1,18 +1,6 @@ import { ContractAddresses } from '@0x/contract-addresses'; import { BigNumber } from '@0x/utils'; -import { ContractEventArg, DecodedLogArgs, LogWithDecodedArgs } from 'ethereum-types'; - -export interface DecodedLogEvent { - isRemoved: boolean; - log: LogWithDecodedArgs; -} - -export type EventCallback = ( - err: null | Error, - log?: DecodedLogEvent, -) => void; - export interface TxOpts { from: string; gas?: number; @@ -20,10 +8,6 @@ export interface TxOpts { gasPrice?: BigNumber; } -export interface IndexedFilterValues { - [index: string]: ContractEventArg; -} - export enum ForwarderError { CompleteFillFailed = 'COMPLETE_FILL_FAILED', } diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 4d385fd8e4..41beb802b0 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,7 +1,7 @@ // tslint:disable:max-file-line-count import { BigNumber } from 'bignumber.js'; -import { ContractAbi, ContractNetworks, DevdocOutput } from 'ethereum-types'; +import { ContractAbi, ContractEventArg, ContractNetworks, DecodedLogArgs, DevdocOutput, LogWithDecodedArgs } from 'ethereum-types'; export interface Order { chainId: number; @@ -841,3 +841,17 @@ export interface OrderInfo { orderHash: string; orderTakerAssetFilledAmount: BigNumber; } + +export interface DecodedLogEvent { + isRemoved: boolean; + log: LogWithDecodedArgs; +} + +export type EventCallback = ( + err: null | Error, + log?: DecodedLogEvent, +) => void; + +export interface IndexedFilterValues { + [index: string]: ContractEventArg; +}