diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2017-11-28 06:34:34 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2017-11-28 06:34:34 +0800 |
commit | 426a412ba1a0e3cd955d11bbe6d7426a61e5dd63 (patch) | |
tree | 5d3e9f2749411ba91fa567f96ce81d1206d273be /packages/connect/src/types.ts | |
parent | 4a17f5e82074b01e74ae6982e82419a037eebdb4 (diff) | |
download | dexon-0x-contracts-426a412ba1a0e3cd955d11bbe6d7426a61e5dd63.tar dexon-0x-contracts-426a412ba1a0e3cd955d11bbe6d7426a61e5dd63.tar.gz dexon-0x-contracts-426a412ba1a0e3cd955d11bbe6d7426a61e5dd63.tar.bz2 dexon-0x-contracts-426a412ba1a0e3cd955d11bbe6d7426a61e5dd63.tar.lz dexon-0x-contracts-426a412ba1a0e3cd955d11bbe6d7426a61e5dd63.tar.xz dexon-0x-contracts-426a412ba1a0e3cd955d11bbe6d7426a61e5dd63.tar.zst dexon-0x-contracts-426a412ba1a0e3cd955d11bbe6d7426a61e5dd63.zip |
Move all connect types into types.ts
Diffstat (limited to 'packages/connect/src/types.ts')
-rw-r--r-- | packages/connect/src/types.ts | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts index 75b6b8020..eb6df3ba9 100644 --- a/packages/connect/src/types.ts +++ b/packages/connect/src/types.ts @@ -15,6 +15,19 @@ export interface OrderbookChannel { close: () => void; } +/* + * baseTokenAddress: The address of token designated as the baseToken in the currency pair calculation of price + * quoteTokenAddress: The address of token designated as the quoteToken in the currency pair calculation of price + * snapshot: If true, a snapshot of the orderbook will be sent before the updates to the orderbook + * limit: Maximum number of bids and asks in orderbook snapshot + */ +export interface OrderbookChannelSubscriptionOpts { + baseTokenAddress: string; + quoteTokenAddress: string; + snapshot: boolean; + limit: number; +} + export interface OrderbookChannelHandler { onSnapshot: (channel: OrderbookChannel, snapshot: OrderbookResponse) => void; onUpdate: (channel: OrderbookChannel, order: SignedOrder) => void; @@ -48,17 +61,15 @@ export interface UnknownOrderbookChannelMessage { payload: undefined; } -/* - * baseTokenAddress: The address of token designated as the baseToken in the currency pair calculation of price - * quoteTokenAddress: The address of token designated as the quoteToken in the currency pair calculation of price - * snapshot: If true, a snapshot of the orderbook will be sent before the updates to the orderbook - * limit: Maximum number of bids and asks in orderbook snapshot - */ -export interface OrderbookChannelSubscriptionOpts { - baseTokenAddress: string; - quoteTokenAddress: string; - snapshot: boolean; - limit: number; +export enum WebsocketConnectionEventType { + Close = 'close', + Error = 'error', + Message = 'message', +} + +export enum WebsocketClientEventType { + Connect = 'connect', + ConnectFailed = 'connectFailed', } export interface TokenPairsRequest { @@ -118,3 +129,13 @@ export interface FeesResponse { makerFee: BigNumber; takerFee: BigNumber; } + +export interface HttpRequestOptions { + params?: object; + payload?: object; +} + +export enum HttpRequestType { + Get = 'GET', + Post = 'POST', +} |