ccxt 4.4.69 → 4.4.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +5 -8
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +1 -6
  4. package/dist/cjs/src/abstract/poloniexfutures.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +22 -1
  6. package/dist/cjs/src/binance.js +107 -102
  7. package/dist/cjs/src/bingx.js +64 -42
  8. package/dist/cjs/src/bitget.js +50 -340
  9. package/dist/cjs/src/bitmart.js +15 -1
  10. package/dist/cjs/src/bitopro.js +1 -0
  11. package/dist/cjs/src/bitrue.js +1 -0
  12. package/dist/cjs/src/bybit.js +7 -0
  13. package/dist/cjs/src/cex.js +1 -0
  14. package/dist/cjs/src/coinbase.js +24 -4
  15. package/dist/cjs/src/coinbaseexchange.js +1 -0
  16. package/dist/cjs/src/deribit.js +1 -0
  17. package/dist/cjs/src/hashkey.js +4 -2
  18. package/dist/cjs/src/hyperliquid.js +18 -7
  19. package/dist/cjs/src/kraken.js +83 -6
  20. package/dist/cjs/src/kucoin.js +4 -2
  21. package/dist/cjs/src/mexc.js +8 -4
  22. package/dist/cjs/src/okx.js +62 -46
  23. package/dist/cjs/src/poloniex.js +1311 -81
  24. package/dist/cjs/src/poloniexfutures.js +1 -1
  25. package/dist/cjs/src/pro/binance.js +94 -94
  26. package/dist/cjs/src/pro/bingx.js +63 -52
  27. package/dist/cjs/src/pro/bitget.js +40 -7
  28. package/dist/cjs/src/pro/bybit.js +86 -38
  29. package/dist/cjs/src/pro/poloniexfutures.js +1 -1
  30. package/dist/cjs/src/tradeogre.js +22 -4
  31. package/dist/cjs/src/whitebit.js +4 -2
  32. package/js/ccxt.d.ts +3 -9
  33. package/js/ccxt.js +2 -6
  34. package/js/src/abstract/bingx.d.ts +1 -0
  35. package/js/src/abstract/bitmart.d.ts +1 -0
  36. package/js/src/abstract/bybit.d.ts +4 -0
  37. package/js/src/abstract/myokx.d.ts +3 -0
  38. package/js/src/abstract/okx.d.ts +3 -0
  39. package/js/src/abstract/poloniex.d.ts +36 -0
  40. package/js/src/abstract/poloniexfutures.js +6 -0
  41. package/js/src/abstract/tradeogre.d.ts +1 -1
  42. package/js/src/base/Exchange.d.ts +11 -2
  43. package/js/src/base/Exchange.js +22 -1
  44. package/js/src/base/types.d.ts +33 -2
  45. package/js/src/binance.d.ts +98 -97
  46. package/js/src/binance.js +107 -102
  47. package/js/src/bingx.js +64 -42
  48. package/js/src/bitget.d.ts +0 -1
  49. package/js/src/bitget.js +50 -340
  50. package/js/src/bitmart.d.ts +1 -0
  51. package/js/src/bitmart.js +15 -1
  52. package/js/src/bitopro.js +1 -0
  53. package/js/src/bitrue.js +1 -0
  54. package/js/src/bybit.js +7 -0
  55. package/js/src/cex.js +1 -0
  56. package/js/src/coinbase.js +24 -4
  57. package/js/src/coinbaseexchange.js +1 -0
  58. package/js/src/deribit.js +1 -0
  59. package/js/src/hashkey.js +4 -2
  60. package/js/src/hyperliquid.js +18 -7
  61. package/js/src/kraken.d.ts +1 -0
  62. package/js/src/kraken.js +83 -6
  63. package/js/src/kucoin.js +4 -2
  64. package/js/src/mexc.js +8 -4
  65. package/js/src/okx.d.ts +1 -0
  66. package/js/src/okx.js +62 -46
  67. package/js/src/poloniex.d.ts +109 -1
  68. package/js/src/poloniex.js +1311 -81
  69. package/js/src/poloniexfutures.js +6 -0
  70. package/js/src/pro/binance.d.ts +94 -94
  71. package/js/src/pro/binance.js +94 -94
  72. package/js/src/pro/bingx.js +63 -52
  73. package/js/src/pro/bitget.js +40 -7
  74. package/js/src/pro/bybit.d.ts +1 -0
  75. package/js/src/pro/bybit.js +86 -38
  76. package/js/src/pro/poloniexfutures.js +6 -0
  77. package/js/src/tradeogre.d.ts +1 -0
  78. package/js/src/tradeogre.js +22 -4
  79. package/js/src/whitebit.js +4 -2
  80. package/package.json +1 -1
@@ -540,13 +540,13 @@ export default class binance extends binanceRest {
540
540
  /**
541
541
  * @method
542
542
  * @name binance#watchOrderBook
543
- * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
544
- * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
545
- * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
546
- * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
547
- * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
548
- * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
549
543
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
544
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#partial-book-depth-streams
545
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream
546
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
547
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
548
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
549
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
550
550
  * @param {string} symbol unified symbol of the market to fetch the order book for
551
551
  * @param {int} [limit] the maximum amount of order book entries to return
552
552
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -595,13 +595,13 @@ export default class binance extends binanceRest {
595
595
  /**
596
596
  * @method
597
597
  * @name binance#watchOrderBookForSymbols
598
- * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
599
- * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
600
- * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
601
- * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
602
- * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
603
- * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
604
598
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
599
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#partial-book-depth-streams
600
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream
601
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
602
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
603
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
604
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
605
605
  * @param {string[]} symbols unified array of symbols
606
606
  * @param {int} [limit] the maximum amount of order book entries to return
607
607
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -658,13 +658,13 @@ export default class binance extends binanceRest {
658
658
  /**
659
659
  * @method
660
660
  * @name binance#unWatchOrderBookForSymbols
661
- * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
662
- * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
663
- * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
664
- * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
665
- * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
666
- * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
667
661
  * @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
662
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#partial-book-depth-streams
663
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream
664
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
665
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
666
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
667
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
668
668
  * @param {string[]} symbols unified array of symbols
669
669
  * @param {object} [params] extra parameters specific to the exchange API endpoint
670
670
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
@@ -716,13 +716,13 @@ export default class binance extends binanceRest {
716
716
  /**
717
717
  * @method
718
718
  * @name binance#unWatchOrderBook
719
- * @see https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams
720
- * @see https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream
721
- * @see https://binance-docs.github.io/apidocs/futures/en/#partial-book-depth-streams
722
- * @see https://binance-docs.github.io/apidocs/futures/en/#diff-book-depth-streams
723
- * @see https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
724
- * @see https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
725
719
  * @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
720
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#partial-book-depth-streams
721
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream
722
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
723
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
724
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams
725
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams
726
726
  * @param {string} symbol unified array of symbols
727
727
  * @param {object} [params] extra parameters specific to the exchange API endpoint
728
728
  * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
@@ -734,7 +734,7 @@ export default class binance extends binanceRest {
734
734
  * @method
735
735
  * @name binance#fetchOrderBookWs
736
736
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
737
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#order-book
737
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#order-book
738
738
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book
739
739
  * @param {string} symbol unified symbol of the market to fetch the order book for
740
740
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -1037,10 +1037,10 @@ export default class binance extends binanceRest {
1037
1037
  * @method
1038
1038
  * @name binance#watchTradesForSymbols
1039
1039
  * @description get the list of most recent trades for a list of symbols
1040
- * @see https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
1041
- * @see https://binance-docs.github.io/apidocs/spot/en/#trade-streams
1042
- * @see https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
1043
- * @see https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
1040
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
1041
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
1042
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1043
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1044
1044
  * @param {string[]} symbols unified symbol of the market to fetch trades for
1045
1045
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1046
1046
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -1100,10 +1100,10 @@ export default class binance extends binanceRest {
1100
1100
  * @method
1101
1101
  * @name binance#unWatchTradesForSymbols
1102
1102
  * @description unsubscribes from the trades channel
1103
- * @see https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
1104
- * @see https://binance-docs.github.io/apidocs/spot/en/#trade-streams
1105
- * @see https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
1106
- * @see https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
1103
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
1104
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
1105
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1106
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1107
1107
  * @param {string[]} symbols unified symbol of the market to fetch trades for
1108
1108
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1109
1109
  * @param {string} [params.name] the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
@@ -1162,10 +1162,10 @@ export default class binance extends binanceRest {
1162
1162
  * @method
1163
1163
  * @name binance#unWatchTrades
1164
1164
  * @description unsubscribes from the trades channel
1165
- * @see https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
1166
- * @see https://binance-docs.github.io/apidocs/spot/en/#trade-streams
1167
- * @see https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
1168
- * @see https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
1165
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
1166
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
1167
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1168
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1169
1169
  * @param {string} symbol unified symbol of the market to fetch trades for
1170
1170
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1171
1171
  * @param {string} [params.name] the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
@@ -1179,10 +1179,10 @@ export default class binance extends binanceRest {
1179
1179
  * @method
1180
1180
  * @name binance#watchTrades
1181
1181
  * @description get the list of most recent trades for a particular symbol
1182
- * @see https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams
1183
- * @see https://binance-docs.github.io/apidocs/spot/en/#trade-streams
1184
- * @see https://binance-docs.github.io/apidocs/futures/en/#aggregate-trade-streams
1185
- * @see https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
1182
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#aggregate-trades
1183
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
1184
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1185
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Aggregate-Trade-Streams
1186
1186
  * @param {string} symbol unified symbol of the market to fetch trades for
1187
1187
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
1188
1188
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -1379,9 +1379,9 @@ export default class binance extends binanceRest {
1379
1379
  * @method
1380
1380
  * @name binance#watchOHLCV
1381
1381
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1382
- * @see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
1383
- * @see https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
1384
- * @see https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
1382
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1383
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1384
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1385
1385
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1386
1386
  * @param {string} timeframe the length of time each candle represents
1387
1387
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -1402,9 +1402,9 @@ export default class binance extends binanceRest {
1402
1402
  * @method
1403
1403
  * @name binance#watchOHLCVForSymbols
1404
1404
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1405
- * @see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
1406
- * @see https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
1407
- * @see https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
1405
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1406
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1407
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1408
1408
  * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
1409
1409
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1410
1410
  * @param {int} [limit] the maximum amount of candles to fetch
@@ -1468,9 +1468,9 @@ export default class binance extends binanceRest {
1468
1468
  * @method
1469
1469
  * @name binance#unWatchOHLCVForSymbols
1470
1470
  * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1471
- * @see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
1472
- * @see https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
1473
- * @see https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
1471
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1472
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1473
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1474
1474
  * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
1475
1475
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1476
1476
  * @param {object} [params.timezone] if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
@@ -1535,9 +1535,9 @@ export default class binance extends binanceRest {
1535
1535
  * @method
1536
1536
  * @name binance#unWatchOHLCV
1537
1537
  * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1538
- * @see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
1539
- * @see https://binance-docs.github.io/apidocs/futures/en/#kline-candlestick-data
1540
- * @see https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
1538
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1539
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1540
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams
1541
1541
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1542
1542
  * @param {string} timeframe the length of time each candle represents
1543
1543
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1660,7 +1660,7 @@ export default class binance extends binanceRest {
1660
1660
  * @method
1661
1661
  * @name binance#fetchOHLCVWs
1662
1662
  * @description query historical candlestick data containing the open, high, low, and close price, and the volume of a market
1663
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#klines
1663
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#klines
1664
1664
  * @param {string} symbol unified symbol of the market to query OHLCV data for
1665
1665
  * @param {string} timeframe the length of time each candle represents
1666
1666
  * @param {int} since timestamp in ms of the earliest candle to fetch
@@ -1751,13 +1751,13 @@ export default class binance extends binanceRest {
1751
1751
  /**
1752
1752
  * @method
1753
1753
  * @name binance#watchTicker
1754
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1755
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1756
- * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1757
- * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1758
- * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1759
- * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1760
1754
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
1755
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-mini-ticker-stream
1756
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream
1757
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1758
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1759
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1760
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1761
1761
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1762
1762
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1763
1763
  * @param {string} [params.name] stream to use can be ticker or miniTicker
@@ -1772,8 +1772,8 @@ export default class binance extends binanceRest {
1772
1772
  /**
1773
1773
  * @method
1774
1774
  * @name binance#watchMarkPrice
1775
- * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream
1776
1775
  * @description watches a mark price for a specific market
1776
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream
1777
1777
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1778
1778
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1779
1779
  * @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
@@ -1788,8 +1788,8 @@ export default class binance extends binanceRest {
1788
1788
  /**
1789
1789
  * @method
1790
1790
  * @name binance#watchMarkPrices
1791
- * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market
1792
1791
  * @description watches the mark price for all markets
1792
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market
1793
1793
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
1794
1794
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1795
1795
  * @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
@@ -1810,13 +1810,13 @@ export default class binance extends binanceRest {
1810
1810
  /**
1811
1811
  * @method
1812
1812
  * @name binance#watchTickers
1813
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1814
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1815
- * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1816
- * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1817
- * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1818
- * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1819
1813
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
1814
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-mini-ticker-stream
1815
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream
1816
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1817
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1818
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1819
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1820
1820
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
1821
1821
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1822
1822
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -1836,13 +1836,13 @@ export default class binance extends binanceRest {
1836
1836
  /**
1837
1837
  * @method
1838
1838
  * @name binance#unWatchTickers
1839
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1840
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1841
- * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1842
- * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1843
- * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1844
- * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1845
1839
  * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
1840
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-mini-ticker-stream
1841
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream
1842
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1843
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1844
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1845
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1846
1846
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
1847
1847
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1848
1848
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -1928,13 +1928,13 @@ export default class binance extends binanceRest {
1928
1928
  /**
1929
1929
  * @method
1930
1930
  * @name binance#unWatchTicker
1931
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream
1932
- * @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams
1933
- * @see https://binance-docs.github.io/apidocs/futures/en/#all-market-mini-tickers-stream
1934
- * @see https://binance-docs.github.io/apidocs/futures/en/#individual-symbol-ticker-streams
1935
- * @see https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
1936
- * @see https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
1937
1931
  * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
1932
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-mini-ticker-stream
1933
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream
1934
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1935
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1936
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream
1937
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams
1938
1938
  * @param {string} symbol unified symbol of the market to fetch the ticker for
1939
1939
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1940
1940
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -1946,9 +1946,9 @@ export default class binance extends binanceRest {
1946
1946
  * @method
1947
1947
  * @name binance#watchBidsAsks
1948
1948
  * @description watches best bid & ask for symbols
1949
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#symbol-order-book-ticker
1950
- * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
1949
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#symbol-order-book-ticker
1951
1950
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
1951
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
1952
1952
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
1953
1953
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1954
1954
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -2505,7 +2505,7 @@ export default class binance extends binanceRest {
2505
2505
  * @name binance#fetchBalanceWs
2506
2506
  * @description fetch balance and get the amount of funds available for trading or funds locked in orders
2507
2507
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
2508
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-information-user_data
2508
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/account-requests#account-information-user_data
2509
2509
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api
2510
2510
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2511
2511
  * @param {string|undefined} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
@@ -2612,8 +2612,8 @@ export default class binance extends binanceRest {
2612
2612
  /**
2613
2613
  * @method
2614
2614
  * @name binance#fetchPositionWs
2615
- * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information
2616
2615
  * @description fetch data on an open position
2616
+ * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information
2617
2617
  * @param {string} symbol unified market symbol of the market the position is held in
2618
2618
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2619
2619
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
@@ -2875,7 +2875,7 @@ export default class binance extends binanceRest {
2875
2875
  * @method
2876
2876
  * @name binance#createOrderWs
2877
2877
  * @description create a trade order
2878
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#place-new-order-trade
2878
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#place-new-order-trade
2879
2879
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
2880
2880
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api
2881
2881
  * @param {string} symbol unified symbol of the market to create an order in
@@ -3024,7 +3024,7 @@ export default class binance extends binanceRest {
3024
3024
  * @method
3025
3025
  * @name binance#editOrderWs
3026
3026
  * @description edit a trade order
3027
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-and-replace-order-trade
3027
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-and-replace-order-trade
3028
3028
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
3029
3029
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order
3030
3030
  * @param {string} id order id
@@ -3182,7 +3182,7 @@ export default class binance extends binanceRest {
3182
3182
  * @method
3183
3183
  * @name binance#cancelOrderWs
3184
3184
  * @description cancel multiple orders
3185
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-order-trade
3185
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-order-trade
3186
3186
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
3187
3187
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order
3188
3188
  * @param {string} id order id
@@ -3229,7 +3229,7 @@ export default class binance extends binanceRest {
3229
3229
  * @method
3230
3230
  * @name binance#cancelAllOrdersWs
3231
3231
  * @description cancel all open orders in a market
3232
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-open-orders-trade
3232
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#cancel-open-orders-trade
3233
3233
  * @param {string} [symbol] unified market symbol of the market to cancel orders in
3234
3234
  * @param {object} [params] extra parameters specific to the exchange API endpoint
3235
3235
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
@@ -3264,7 +3264,7 @@ export default class binance extends binanceRest {
3264
3264
  * @method
3265
3265
  * @name binance#fetchOrderWs
3266
3266
  * @description fetches information on an order made by the user
3267
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-user_data
3267
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#query-order-user_data
3268
3268
  * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
3269
3269
  * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order
3270
3270
  * @param {string} id order id
@@ -3312,7 +3312,7 @@ export default class binance extends binanceRest {
3312
3312
  * @method
3313
3313
  * @name binance#fetchOrdersWs
3314
3314
  * @description fetches information on multiple orders made by the user
3315
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-list-user_data
3315
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#order-lists
3316
3316
  * @param {string} symbol unified market symbol of the market orders were made in
3317
3317
  * @param {int|undefined} [since] the earliest time in ms to fetch orders for
3318
3318
  * @param {int|undefined} [limit] the maximum number of order structures to retrieve
@@ -3357,7 +3357,7 @@ export default class binance extends binanceRest {
3357
3357
  * @method
3358
3358
  * @name binance#fetchClosedOrdersWs
3359
3359
  * @description fetch closed orders
3360
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-list-user_data
3360
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#order-lists
3361
3361
  * @param {string} symbol unified market symbol
3362
3362
  * @param {int} [since] the earliest time in ms to fetch open orders for
3363
3363
  * @param {int} [limit] the maximum number of open orders structures to retrieve
@@ -3379,7 +3379,7 @@ export default class binance extends binanceRest {
3379
3379
  * @method
3380
3380
  * @name binance#fetchOpenOrdersWs
3381
3381
  * @description fetch all unfilled currently open orders
3382
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#current-open-orders-user_data
3382
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests#current-open-orders-user_data
3383
3383
  * @param {string} symbol unified market symbol
3384
3384
  * @param {int|undefined} [since] the earliest time in ms to fetch open orders for
3385
3385
  * @param {int|undefined} [limit] the maximum number of open orders structures to retrieve
@@ -3942,7 +3942,7 @@ export default class binance extends binanceRest {
3942
3942
  * @method
3943
3943
  * @name binance#fetchMyTradesWs
3944
3944
  * @description fetch all trades made by the user
3945
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-trade-history-user_data
3945
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/account-requests#account-trade-history-user_data
3946
3946
  * @param {string} symbol unified market symbol
3947
3947
  * @param {int|undefined} [since] the earliest time in ms to fetch trades for
3948
3948
  * @param {int|undefined} [limit] the maximum number of trades structures to retrieve
@@ -3995,7 +3995,7 @@ export default class binance extends binanceRest {
3995
3995
  * @method
3996
3996
  * @name binance#fetchTradesWs
3997
3997
  * @description fetch all trades made by the user
3998
- * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#recent-trades
3998
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#recent-trades
3999
3999
  * @param {string} symbol unified market symbol
4000
4000
  * @param {int} [since] the earliest time in ms to fetch trades for
4001
4001
  * @param {int} [limit] the maximum number of trades structures to retrieve, default=500, max=1000
@@ -677,60 +677,67 @@ export default class bingx extends bingxRest {
677
677
  //
678
678
  // spot
679
679
  //
680
- // {
681
- // "code": 0,
682
- // "dataType": "BTC-USDT@depth20",
683
- // "data": {
684
- // "bids": [
685
- // [ '28852.9', "34.2621" ],
686
- // ...
687
- // ],
688
- // "asks": [
689
- // [ '28864.9', "23.4079" ],
690
- // ...
691
- // ]
692
- // },
693
- // "dataType": "BTC-USDT@depth20",
694
- // "success": true
695
- // }
680
+ // {
681
+ // "code":0,
682
+ // "data":
683
+ // {
684
+ // "asks":[
685
+ // ["84119.73","0.000011"],
686
+ // ["84116.52","0.000014"],
687
+ // ["84116.40","0.000039"]
688
+ // ],
689
+ // "bids":[
690
+ // ["83656.98","2.570805"],
691
+ // ["83655.51","0.000347"],
692
+ // ["83654.59","0.000082"]
693
+ // ],
694
+ // "lastUpdateId":13565694850
695
+ // },
696
+ // "dataType":"BTC-USDT@depth100",
697
+ // "success":true,
698
+ // "timestamp":1743241379958
699
+ // }
696
700
  //
697
701
  // linear swap
698
702
  //
699
- // {
700
- // "code": 0,
701
- // "dataType": "BTC-USDT@depth20@100ms", //or "all@depth20@100ms"
702
- // "data": {
703
- // "bids": [
704
- // [ '28852.9', "34.2621" ],
705
- // ...
706
- // ],
707
- // "asks": [
708
- // [ '28864.9', "23.4079" ],
709
- // ...
710
- // ],
711
- // "symbol": "BTC-USDT", // this key exists only in "all" subscription
712
- // }
713
- // }
703
+ // {
704
+ // "code":0,
705
+ // "dataType":"BTC-USDT@depth100@500ms",
706
+ // "ts":1743241563651,
707
+ // "data":
708
+ // {
709
+ // "bids":[
710
+ // ["83363.2","0.1908"],
711
+ // ["83360.0","0.0003"],
712
+ // ["83356.5","0.0245"],
713
+ // ],
714
+ // "asks":[
715
+ // ["83495.0","0.0024"],
716
+ // ["83490.0","0.0001"],
717
+ // ["83488.0","0.0004"],
718
+ // ]
719
+ // }
720
+ // }
714
721
  //
715
722
  // inverse swap
716
723
  //
717
724
  // {
718
- // "code": 0,
719
- // "dataType": "BTC-USD@depth100",
720
- // "data": {
721
- // {
722
- // "symbol": "BTC-USD",
723
- // "bids": [
724
- // { "p": "58074.2", "a": "1.422318", "v": "826.0" },
725
- // ...
726
- // ],
727
- // "asks": [
728
- // { "p": "62878.0", "a": "0.001590", "v": "1.0" },
729
- // ...
730
- // ],
731
- // "aggPrecision": "0.1",
732
- // "timestamp": 1723705093529
733
- // }
725
+ // "code":0,
726
+ // "dataType":"BTC-USD@depth100",
727
+ // "data":{
728
+ // "symbol":"BTC-USD",
729
+ // "bids":[
730
+ // {"p":"83411.2","a":"2.979216","v":"2485.0"},
731
+ // {"p":"83411.1","a":"1.592114","v":"1328.0"},
732
+ // {"p":"83410.8","a":"2.656730","v":"2216.0"},
733
+ // ],
734
+ // "asks":[
735
+ // {"p":"88200.0","a":"0.344671","v":"304.0"},
736
+ // {"p":"88023.8","a":"0.045442","v":"40.0"},
737
+ // {"p":"88001.0","a":"0.003409","v":"3.0"},
738
+ // ],
739
+ // "aggPrecision":"0.1",
740
+ // "timestamp":1743242290710
734
741
  // }
735
742
  // }
736
743
  //
@@ -744,23 +751,27 @@ export default class bingx extends bingxRest {
744
751
  const marketType = isSwap ? 'swap' : 'spot';
745
752
  const market = this.safeMarket(marketId, undefined, undefined, marketType);
746
753
  const symbol = market['symbol'];
747
- if (this.safeValue(this.orderbooks, symbol) === undefined) {
754
+ let orderbook = this.safeValue(this.orderbooks, symbol);
755
+ if (orderbook === undefined) {
748
756
  // const limit = [ 5, 10, 20, 50, 100 ]
749
757
  const subscriptionHash = dataType;
750
758
  const subscription = client.subscriptions[subscriptionHash];
751
759
  const limit = this.safeInteger(subscription, 'limit');
752
760
  this.orderbooks[symbol] = this.orderBook({}, limit);
753
761
  }
754
- const orderbook = this.orderbooks[symbol];
762
+ orderbook = this.orderbooks[symbol];
755
763
  let snapshot = undefined;
764
+ let timestamp = this.safeInteger2(message, 'timestamp', 'ts');
765
+ timestamp = this.safeInteger2(data, 'timestamp', 'ts', timestamp);
756
766
  if (market['inverse']) {
757
- snapshot = this.parseOrderBook(data, symbol, undefined, 'bids', 'asks', 'p', 'a');
767
+ snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks', 'p', 'a');
758
768
  }
759
769
  else {
760
- snapshot = this.parseOrderBook(data, symbol, undefined, 'bids', 'asks', 0, 1);
770
+ snapshot = this.parseOrderBook(data, symbol, timestamp, 'bids', 'asks', 0, 1);
761
771
  }
772
+ const nonce = this.safeInteger(data, 'lastUpdateId');
773
+ snapshot['nonce'] = nonce;
762
774
  orderbook.reset(snapshot);
763
- this.orderbooks[symbol] = orderbook;
764
775
  const messageHash = this.getMessageHash('orderbook', symbol);
765
776
  client.resolve(orderbook, messageHash);
766
777
  // resolve for "all"