diff options
Diffstat (limited to 'packages/connect/src')
-rw-r--r-- | packages/connect/src/ws_orderbook_channel.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/connect/src/ws_orderbook_channel.ts b/packages/connect/src/ws_orderbook_channel.ts index 3d9230792..425ba8afb 100644 --- a/packages/connect/src/ws_orderbook_channel.ts +++ b/packages/connect/src/ws_orderbook_channel.ts @@ -1,4 +1,5 @@ import * as _ from 'lodash'; +import { v4 as uuid } from 'uuid'; import * as WebSocket from 'websocket'; import { @@ -50,11 +51,10 @@ export class WebSocketOrderbookChannel implements OrderbookChannel { assert.isOrderbookChannelSubscriptionOpts('subscriptionOpts', subscriptionOpts); assert.assert(this._client.readyState === WebSocket.w3cwebsocket.OPEN, 'WebSocket connection is closed'); this._subscriptionOptsList.push(subscriptionOpts); - // TODO: update requestId management to use UUIDs for v2 const subscribeMessage = { type: 'subscribe', channel: 'orderbook', - requestId: this._subscriptionOptsList.length - 1, + requestId: uuid(), payload: subscriptionOpts, }; this._client.send(JSON.stringify(subscribeMessage)); |