From 2577d8f66267e618e633483277f1afe828764797 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 4 Sep 2017 18:23:12 +0200 Subject: Use Web3.ContractInstance type --- src/types.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/types.ts b/src/types.ts index 9f8ba9729..e90c6fab4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -40,7 +40,7 @@ export interface ContractEventObj { } export type CreateContractEvent = (indexFilterValues: IndexedFilterValues, subscriptionOpts: SubscriptionOpts) => ContractEventObj; -export interface ExchangeContract extends ContractInstance { +export interface ExchangeContract extends Web3.ContractInstance { isValidSignature: { call: (signerAddressHex: string, dataHex: string, v: number, r: string, s: string, txOpts?: TxOpts) => Promise; @@ -124,7 +124,7 @@ export interface ExchangeContract extends ContractInstance { }; } -export interface TokenContract extends ContractInstance { +export interface TokenContract extends Web3.ContractInstance { Transfer: CreateContractEvent; Approval: CreateContractEvent; balanceOf: { @@ -139,7 +139,7 @@ export interface TokenContract extends ContractInstance { approve: (proxyAddress: string, amountInBaseUnits: BigNumber.BigNumber, txOpts?: TxOpts) => Promise; } -export interface TokenRegistryContract extends ContractInstance { +export interface TokenRegistryContract extends Web3.ContractInstance { getTokenMetaData: { call: (address: string) => Promise; }; @@ -160,12 +160,12 @@ export interface TokenRegistryContract extends ContractInstance { }; } -export interface EtherTokenContract extends ContractInstance { +export interface EtherTokenContract extends Web3.ContractInstance { deposit: (txOpts: TxOpts) => Promise; withdraw: (amount: BigNumber.BigNumber, txOpts: TxOpts) => Promise; } -export interface TokenTransferProxyContract extends ContractInstance { +export interface TokenTransferProxyContract extends Web3.ContractInstance { getAuthorizedAddresses: { call: () => Promise; }; @@ -213,10 +213,6 @@ export enum ExchangeContractErrs { BatchOrdersMustHaveAtLeastOneItem = 'BATCH_ORDERS_MUST_HAVE_AT_LEAST_ONE_ITEM', } -export interface ContractResponse { - logs: ContractEvent[]; -} - export interface ContractEvent { logIndex: number; transactionIndex: number; @@ -351,11 +347,6 @@ export interface OrderFillRequest { export type AsyncMethod = (...args: any[]) => Promise; -export interface ContractInstance { - address: string; - abi: Web3.ContractAbi; -} - export interface ContractEventEmitter { watch: (eventCallback: EventCallback) => void; stopWatchingAsync: () => Promise; -- cgit v1.2.3