diff options
Diffstat (limited to 'packages/0x.js/src/types.ts')
-rw-r--r-- | packages/0x.js/src/types.ts | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts index 4d55046b4..af4f054f0 100644 --- a/packages/0x.js/src/types.ts +++ b/packages/0x.js/src/types.ts @@ -1,9 +1,13 @@ -import * as Web3 from 'web3'; import BigNumber from 'bignumber.js'; +import * as Web3 from 'web3'; export enum ZeroExError { - ContractDoesNotExist = 'CONTRACT_DOES_NOT_EXIST', ExchangeContractDoesNotExist = 'EXCHANGE_CONTRACT_DOES_NOT_EXIST', + ZRXContractDoesNotExist = 'ZRX_CONTRACT_DOES_NOT_EXIST', + EtherTokenContractDoesNotExist = 'ETHER_TOKEN_CONTRACT_DOES_NOT_EXIST', + TokenTransferProxyContractDoesNotExist = 'TOKEN_TRANSFER_PROXY_CONTRACT_DOES_NOT_EXIST', + TokenRegistryContractDoesNotExist = 'TOKEN_REGISTRY_CONTRACT_DOES_NOT_EXIST', + TokenContractDoesNotExist = 'TOKEN_CONTRACT_DOES_NOT_EXIST', UnhandledError = 'UNHANDLED_ERROR', UserHasNoAssociatedAddress = 'USER_HAS_NO_ASSOCIATED_ADDRESSES', InvalidSignature = 'INVALID_SIGNATURE', @@ -410,17 +414,21 @@ export interface OrderStateWatcherConfig { } /* + * networkId: The id of the underlying ethereum network your provider is connected to. (1-mainnet, 42-kovan, 50-testrpc) * gasPrice: Gas price to use with every transaction * exchangeContractAddress: The address of an exchange contract to use * tokenRegistryContractAddress: The address of a token registry contract to use * etherTokenContractAddress: The address of an ether token contract to use + * tokenTransferProxyContractAddress: The address of the token transfer proxy contract to use * orderWatcherConfig: All the configs related to the orderWatcher */ export interface ZeroExConfig { - gasPrice?: BigNumber; // Gas price to use with every transaction + networkId: number; + gasPrice?: BigNumber; exchangeContractAddress?: string; tokenRegistryContractAddress?: string; etherTokenContractAddress?: string; + tokenTransferProxyContractAddress?: string; orderWatcherConfig?: OrderStateWatcherConfig; } @@ -441,11 +449,16 @@ export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt { logs: Array<LogWithDecodedArgs<DecodedLogArgs>|Web3.LogEntry>; } +export type ArtifactContractName = 'ZRX'|'TokenTransferProxy'|'TokenRegistry'|'Token'|'Exchange'|'EtherToken'; + export interface Artifact { - abi: any; - networks: {[networkId: number]: { - address: string; - }}; + contract_name: ArtifactContractName; + abi: Web3.ContractAbi; + networks: { + [networkId: number]: { + address: string; + }; + }; } /* @@ -527,4 +540,4 @@ export interface TransactionReceipt { gasUsed: number; contractAddress: string|null; logs: Web3.LogEntry[]; -} +} // tslint:disable:max-file-line-count |