Use Web3.ContractInstance type
This commit is contained in:
19
src/types.ts
19
src/types.ts
@@ -40,7 +40,7 @@ export interface ContractEventObj {
|
|||||||
}
|
}
|
||||||
export type CreateContractEvent = (indexFilterValues: IndexedFilterValues,
|
export type CreateContractEvent = (indexFilterValues: IndexedFilterValues,
|
||||||
subscriptionOpts: SubscriptionOpts) => ContractEventObj;
|
subscriptionOpts: SubscriptionOpts) => ContractEventObj;
|
||||||
export interface ExchangeContract extends ContractInstance {
|
export interface ExchangeContract extends Web3.ContractInstance {
|
||||||
isValidSignature: {
|
isValidSignature: {
|
||||||
call: (signerAddressHex: string, dataHex: string, v: number, r: string, s: string,
|
call: (signerAddressHex: string, dataHex: string, v: number, r: string, s: string,
|
||||||
txOpts?: TxOpts) => Promise<boolean>;
|
txOpts?: TxOpts) => Promise<boolean>;
|
||||||
@@ -124,7 +124,7 @@ export interface ExchangeContract extends ContractInstance {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TokenContract extends ContractInstance {
|
export interface TokenContract extends Web3.ContractInstance {
|
||||||
Transfer: CreateContractEvent;
|
Transfer: CreateContractEvent;
|
||||||
Approval: CreateContractEvent;
|
Approval: CreateContractEvent;
|
||||||
balanceOf: {
|
balanceOf: {
|
||||||
@@ -139,7 +139,7 @@ export interface TokenContract extends ContractInstance {
|
|||||||
approve: (proxyAddress: string, amountInBaseUnits: BigNumber.BigNumber, txOpts?: TxOpts) => Promise<void>;
|
approve: (proxyAddress: string, amountInBaseUnits: BigNumber.BigNumber, txOpts?: TxOpts) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TokenRegistryContract extends ContractInstance {
|
export interface TokenRegistryContract extends Web3.ContractInstance {
|
||||||
getTokenMetaData: {
|
getTokenMetaData: {
|
||||||
call: (address: string) => Promise<TokenMetadata>;
|
call: (address: string) => Promise<TokenMetadata>;
|
||||||
};
|
};
|
||||||
@@ -160,12 +160,12 @@ export interface TokenRegistryContract extends ContractInstance {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EtherTokenContract extends ContractInstance {
|
export interface EtherTokenContract extends Web3.ContractInstance {
|
||||||
deposit: (txOpts: TxOpts) => Promise<void>;
|
deposit: (txOpts: TxOpts) => Promise<void>;
|
||||||
withdraw: (amount: BigNumber.BigNumber, txOpts: TxOpts) => Promise<void>;
|
withdraw: (amount: BigNumber.BigNumber, txOpts: TxOpts) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TokenTransferProxyContract extends ContractInstance {
|
export interface TokenTransferProxyContract extends Web3.ContractInstance {
|
||||||
getAuthorizedAddresses: {
|
getAuthorizedAddresses: {
|
||||||
call: () => Promise<string[]>;
|
call: () => Promise<string[]>;
|
||||||
};
|
};
|
||||||
@@ -213,10 +213,6 @@ export enum ExchangeContractErrs {
|
|||||||
BatchOrdersMustHaveAtLeastOneItem = 'BATCH_ORDERS_MUST_HAVE_AT_LEAST_ONE_ITEM',
|
BatchOrdersMustHaveAtLeastOneItem = 'BATCH_ORDERS_MUST_HAVE_AT_LEAST_ONE_ITEM',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ContractResponse {
|
|
||||||
logs: ContractEvent[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ContractEvent {
|
export interface ContractEvent {
|
||||||
logIndex: number;
|
logIndex: number;
|
||||||
transactionIndex: number;
|
transactionIndex: number;
|
||||||
@@ -351,11 +347,6 @@ export interface OrderFillRequest {
|
|||||||
|
|
||||||
export type AsyncMethod = (...args: any[]) => Promise<any>;
|
export type AsyncMethod = (...args: any[]) => Promise<any>;
|
||||||
|
|
||||||
export interface ContractInstance {
|
|
||||||
address: string;
|
|
||||||
abi: Web3.ContractAbi;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ContractEventEmitter {
|
export interface ContractEventEmitter {
|
||||||
watch: (eventCallback: EventCallback) => void;
|
watch: (eventCallback: EventCallback) => void;
|
||||||
stopWatchingAsync: () => Promise<void>;
|
stopWatchingAsync: () => Promise<void>;
|
||||||
|
|||||||
Reference in New Issue
Block a user