From 2e5e8c8987c681ffd0dd1535cb26874a39b8abec Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 2 Jun 2017 20:54:44 +0200 Subject: Consolidate the ExchangeContract type and flesh out type definition for isValidSignature.call --- src/types.ts | 39 +++++++++++++++++++-------------------- 1 file 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; +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; + }; + LogFill: CreateContractEvent; + LogCancel: CreateContractEvent; + LogError: CreateContractEvent; + ZRX: { + call: () => Promise; + }; getUnavailableValueT: { call: (orderHash: string) => BigNumber.BigNumber; }; @@ -56,25 +74,6 @@ export interface ExchangeContract { }; } -export type EventCallbackAsync = (err: Error, event: ContractEvent) => Promise; -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; - }; -} - export interface TokenContract { balanceOf: { call: (address: string) => Promise; -- cgit v1.2.3