diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-03 02:54:44 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-06-03 02:54:44 +0800 |
commit | 2e5e8c8987c681ffd0dd1535cb26874a39b8abec (patch) | |
tree | fef753f54d92075f2a8a7866fa3d5237d2adb1dc | |
parent | 3e115eab4a100eb79ab4bfe4676656e838fb557d (diff) | |
download | dexon-0x-contracts-2e5e8c8987c681ffd0dd1535cb26874a39b8abec.tar dexon-0x-contracts-2e5e8c8987c681ffd0dd1535cb26874a39b8abec.tar.gz dexon-0x-contracts-2e5e8c8987c681ffd0dd1535cb26874a39b8abec.tar.bz2 dexon-0x-contracts-2e5e8c8987c681ffd0dd1535cb26874a39b8abec.tar.lz dexon-0x-contracts-2e5e8c8987c681ffd0dd1535cb26874a39b8abec.tar.xz dexon-0x-contracts-2e5e8c8987c681ffd0dd1535cb26874a39b8abec.tar.zst dexon-0x-contracts-2e5e8c8987c681ffd0dd1535cb26874a39b8abec.zip |
Consolidate the ExchangeContract type and flesh out type definition for isValidSignature.call
-rw-r--r-- | src/types.ts | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/types.ts b/src/types.ts index 602c63859..6a026f608 100644 --- a/src/types.ts +++ b/src/types.ts @@ -33,8 +33,26 @@ export type OrderAddresses = [string, string, string, string, string]; export type OrderValues = [BigNumber.BigNumber, BigNumber.BigNumber, BigNumber.BigNumber, BigNumber.BigNumber, BigNumber.BigNumber, BigNumber.BigNumber]; +export type EventCallbackAsync = (err: Error, event: ContractEvent) => Promise<void>; +export type EventCallbackSync = (err: Error, event: ContractEvent) => void; +export type EventCallback = EventCallbackSync|EventCallbackAsync; +export interface ContractEventObj { + watch: (eventWatch: EventCallback) => void; + stopWatching: () => void; +} +export type CreateContractEvent = (indexFilterValues: IndexFilterValues, + subscriptionOpts: SubscriptionOpts) => ContractEventObj; export interface ExchangeContract { - isValidSignature: any; + isValidSignature: { + call: (signerAddressHex: string, dataHex: string, v: number, r: string, s: string, + txOpts: TxOpts) => Promise<boolean>; + }; + LogFill: CreateContractEvent; + LogCancel: CreateContractEvent; + LogError: CreateContractEvent; + ZRX: { + call: () => Promise<string>; + }; getUnavailableValueT: { call: (orderHash: string) => BigNumber.BigNumber; }; @@ -56,25 +74,6 @@ export interface ExchangeContract { }; } -export type EventCallbackAsync = (err: Error, event: ContractEvent) => Promise<void>; -export type EventCallbackSync = (err: Error, event: ContractEvent) => void; -export type EventCallback = EventCallbackSync|EventCallbackAsync; -export interface ContractEventObj { - watch: (eventWatch: EventCallback) => void; - stopWatching: () => void; -} -export type CreateContractEvent = (indexFilterValues: IndexFilterValues, - subscriptionOpts: SubscriptionOpts) => ContractEventObj; -export interface ExchangeContract { - isValidSignature: any; - LogFill: CreateContractEvent; - LogCancel: CreateContractEvent; - LogError: CreateContractEvent; - ZRX: { - call: () => Promise<string>; - }; -} - export interface TokenContract { balanceOf: { call: (address: string) => Promise<BigNumber.BigNumber>; |