aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/src/types.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon@0xproject.com>2018-07-12 05:40:19 +0800
committerGitHub <noreply@github.com>2018-07-12 05:40:19 +0800
commitb82fdd59e70e92ef139f5eeed8ed383a89866c7d (patch)
tree41e396a32680d74dfd8122f38ac5b23b7ac7fa5e /packages/connect/src/types.ts
parent8fcc7aefa7651311c5a6348101eb023d28799934 (diff)
parent6190ac7791cec92b6f4be0735a5914ce2d418ab5 (diff)
downloaddexon-sol-tools-b82fdd59e70e92ef139f5eeed8ed383a89866c7d.tar
dexon-sol-tools-b82fdd59e70e92ef139f5eeed8ed383a89866c7d.tar.gz
dexon-sol-tools-b82fdd59e70e92ef139f5eeed8ed383a89866c7d.tar.bz2
dexon-sol-tools-b82fdd59e70e92ef139f5eeed8ed383a89866c7d.tar.lz
dexon-sol-tools-b82fdd59e70e92ef139f5eeed8ed383a89866c7d.tar.xz
dexon-sol-tools-b82fdd59e70e92ef139f5eeed8ed383a89866c7d.tar.zst
dexon-sol-tools-b82fdd59e70e92ef139f5eeed8ed383a89866c7d.zip
Merge pull request #626 from 0xProject/refactor/connect/browser-websocket-support
Add support for browser websocket client and fix multiple subscriptions bug
Diffstat (limited to 'packages/connect/src/types.ts')
-rw-r--r--packages/connect/src/types.ts13
1 files changed, 3 insertions, 10 deletions
diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts
index f5e52f50d..fc7a4b24d 100644
--- a/packages/connect/src/types.ts
+++ b/packages/connect/src/types.ts
@@ -11,18 +11,11 @@ export interface Client {
}
export interface OrderbookChannel {
- subscribe: (subscriptionOpts: OrderbookChannelSubscriptionOpts, handler: OrderbookChannelHandler) => void;
+ subscribe: (subscriptionOpts: OrderbookChannelSubscriptionOpts) => void;
close: () => void;
}
/**
- * heartbeatInterval: Interval in milliseconds that the orderbook channel should ping the underlying websocket. Default: 15000
- */
-export interface WebSocketOrderbookChannelConfig {
- heartbeatIntervalMs?: number;
-}
-
-/**
* 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
@@ -46,8 +39,8 @@ export interface OrderbookChannelHandler {
subscriptionOpts: OrderbookChannelSubscriptionOpts,
order: SignedOrder,
) => void;
- onError: (channel: OrderbookChannel, subscriptionOpts: OrderbookChannelSubscriptionOpts, err: Error) => void;
- onClose: (channel: OrderbookChannel, subscriptionOpts: OrderbookChannelSubscriptionOpts) => void;
+ onError: (channel: OrderbookChannel, err: Error, subscriptionOpts?: OrderbookChannelSubscriptionOpts) => void;
+ onClose: (channel: OrderbookChannel) => void;
}
export type OrderbookChannelMessage =