Skip to content

Commit 58727ff

Browse files
authored
Merge pull request #403 from tiagosiebler/depth
v2.10.0: fix(#402) ws diff book depth update speed for futures. Change default update speed to 100ms.
2 parents 0d3c20b + 788f1c0 commit 58727ff

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "binance",
3-
"version": "2.9.6",
3+
"version": "2.10.0",
44
"description": "Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & end-to-end tests.",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/websocket-client.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1593,11 +1593,16 @@ export class WebsocketClient extends EventEmitter {
15931593
}
15941594

15951595
/**
1596-
* Subscribe to spot orderbook depth updates to locally manage an order book.
1596+
* Subscribe to orderbook depth updates to locally manage an order book.
1597+
*
1598+
* Note that the updatems parameter depends on which market you're trading
1599+
*
1600+
* - Spot: https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
1601+
* - USDM Futures: https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
15971602
*/
15981603
public subscribeDiffBookDepth(
15991604
symbol: string,
1600-
updateMs: 1000 | 100 = 1000,
1605+
updateMs: 100 | 250 | 500 | 1000 = 100,
16011606
market: 'spot' | 'usdm' | 'coinm',
16021607
forceNewConnection?: boolean,
16031608
): WebSocket {

0 commit comments

Comments
 (0)