aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/src
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-17 07:51:55 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-17 07:51:55 +0800
commite079790f7fe82452471fc69fa9583c07848f801d (patch)
tree8301bc0048ae5de6ef83ccb1f9c7c6b572058324 /packages/connect/src
parent89174cd63fb8c178c33d456d3b9d1d645ee07e91 (diff)
downloaddexon-sol-tools-e079790f7fe82452471fc69fa9583c07848f801d.tar
dexon-sol-tools-e079790f7fe82452471fc69fa9583c07848f801d.tar.gz
dexon-sol-tools-e079790f7fe82452471fc69fa9583c07848f801d.tar.bz2
dexon-sol-tools-e079790f7fe82452471fc69fa9583c07848f801d.tar.lz
dexon-sol-tools-e079790f7fe82452471fc69fa9583c07848f801d.tar.xz
dexon-sol-tools-e079790f7fe82452471fc69fa9583c07848f801d.tar.zst
dexon-sol-tools-e079790f7fe82452471fc69fa9583c07848f801d.zip
Use uuid as string for requestId
Diffstat (limited to 'packages/connect/src')
-rw-r--r--packages/connect/src/ws_orderbook_channel.ts4
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));