From 3dd170774b04022b2caed3138af5eb95585f6afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8C=E1=85=A5=E1=86=BC=E1=84=8C=E1=85=AE=E1=84=92?= =?UTF-8?q?=E1=85=A9?= Date: Mon, 17 Jan 2022 23:53:23 +0900 Subject: [PATCH] depth levels add --- node-binance-api.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node-binance-api.js b/node-binance-api.js index 615485fc..fce2ff3f 100644 --- a/node-binance-api.js +++ b/node-binance-api.js @@ -5530,20 +5530,20 @@ let api = function Binance( options = {} ) { * @param {function} callback - callback function * @return {string} the websocket endpoint */ - depth: function depth ( symbols, callback ) { + depth: function depth ( symbols, levels, callback ) { let reconnect = () => { - if ( Binance.options.reconnect ) depth( symbols, callback ); + if ( Binance.options.reconnect ) depth( symbols, levels, callback ); }; let subscription; if ( Array.isArray( symbols ) ) { if ( !isArrayUnique( symbols ) ) throw Error( 'depth: "symbols" cannot contain duplicate elements.' ); let streams = symbols.map( function ( symbol ) { - return symbol.toLowerCase() + '@depth@100ms'; + return symbol.toLowerCase() + '@depth'+ levels +'@100ms'; } ); subscription = subscribeCombined( streams, callback, reconnect ); } else { let symbol = symbols; - subscription = subscribe( symbol.toLowerCase() + '@depth@100ms', callback, reconnect ); + subscription = subscribe( symbol.toLowerCase() + '@depth'+ levels +'@100ms', callback, reconnect ); } return subscription.endpoint; },