ccxt 4.3.86 → 4.3.88

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 (91) hide show
  1. package/README.md +6 -5
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +2 -1
  4. package/dist/cjs/src/base/Exchange.js +2 -2
  5. package/dist/cjs/src/base/errors.js +8 -1
  6. package/dist/cjs/src/bingx.js +7 -1
  7. package/dist/cjs/src/hashkey.js +3 -4
  8. package/dist/cjs/src/kraken.js +37 -6
  9. package/dist/cjs/src/kucoin.js +2 -0
  10. package/dist/cjs/src/pro/bitfinex.js +1 -0
  11. package/dist/cjs/src/pro/bitfinex2.js +1 -0
  12. package/dist/cjs/src/pro/bitget.js +164 -19
  13. package/dist/cjs/src/pro/bitopro.js +1 -0
  14. package/dist/cjs/src/pro/bitstamp.js +1 -0
  15. package/dist/cjs/src/pro/blockchaincom.js +1 -0
  16. package/dist/cjs/src/pro/cex.js +1 -0
  17. package/dist/cjs/src/pro/coincheck.js +1 -0
  18. package/dist/cjs/src/pro/coinone.js +1 -0
  19. package/dist/cjs/src/pro/hashkey.js +1 -0
  20. package/dist/cjs/src/pro/hitbtc.js +1 -0
  21. package/dist/cjs/src/pro/hollaex.js +1 -0
  22. package/dist/cjs/src/pro/htx.js +1 -0
  23. package/dist/cjs/src/pro/huobijp.js +1 -0
  24. package/dist/cjs/src/pro/hyperliquid.js +7 -0
  25. package/dist/cjs/src/pro/independentreserve.js +1 -0
  26. package/dist/cjs/src/pro/lbank.js +1 -0
  27. package/dist/cjs/src/pro/luno.js +1 -0
  28. package/dist/cjs/src/pro/ndax.js +5 -0
  29. package/dist/cjs/src/pro/okcoin.js +7 -0
  30. package/dist/cjs/src/pro/onetrading.js +1 -0
  31. package/dist/cjs/src/pro/p2b.js +34 -7
  32. package/dist/cjs/src/pro/paradex.js +1 -0
  33. package/dist/cjs/src/pro/poloniex.js +36 -3
  34. package/dist/cjs/src/pro/poloniexfutures.js +1 -0
  35. package/dist/cjs/src/pro/probit.js +2 -0
  36. package/dist/cjs/src/pro/upbit.js +48 -3
  37. package/dist/cjs/src/pro/vertex.js +1 -0
  38. package/dist/cjs/src/pro/wazirx.js +3 -0
  39. package/dist/cjs/src/pro/whitebit.js +9 -0
  40. package/dist/cjs/src/upbit.js +1 -1
  41. package/js/ccxt.d.ts +3 -3
  42. package/js/ccxt.js +3 -3
  43. package/js/src/abstract/kucoin.d.ts +1 -0
  44. package/js/src/abstract/kucoinfutures.d.ts +1 -0
  45. package/js/src/base/Exchange.d.ts +1 -1
  46. package/js/src/base/Exchange.js +2 -2
  47. package/js/src/base/errorHierarchy.d.ts +1 -0
  48. package/js/src/base/errorHierarchy.js +1 -0
  49. package/js/src/base/errors.d.ts +5 -1
  50. package/js/src/base/errors.js +8 -2
  51. package/js/src/bingx.js +7 -1
  52. package/js/src/coinex.d.ts +1 -1
  53. package/js/src/hashkey.js +3 -4
  54. package/js/src/kraken.js +37 -6
  55. package/js/src/kucoin.js +2 -0
  56. package/js/src/pro/bitfinex.js +1 -0
  57. package/js/src/pro/bitfinex2.js +1 -0
  58. package/js/src/pro/bitget.d.ts +8 -0
  59. package/js/src/pro/bitget.js +165 -20
  60. package/js/src/pro/bitopro.js +1 -0
  61. package/js/src/pro/bitstamp.js +1 -0
  62. package/js/src/pro/blockchaincom.js +1 -0
  63. package/js/src/pro/cex.js +1 -0
  64. package/js/src/pro/coincheck.js +1 -0
  65. package/js/src/pro/coinone.js +1 -0
  66. package/js/src/pro/hashkey.js +1 -0
  67. package/js/src/pro/hitbtc.js +1 -0
  68. package/js/src/pro/hollaex.js +1 -0
  69. package/js/src/pro/htx.js +1 -0
  70. package/js/src/pro/huobijp.js +1 -0
  71. package/js/src/pro/hyperliquid.js +7 -0
  72. package/js/src/pro/independentreserve.js +1 -0
  73. package/js/src/pro/lbank.js +1 -0
  74. package/js/src/pro/luno.js +1 -0
  75. package/js/src/pro/ndax.js +5 -0
  76. package/js/src/pro/okcoin.js +7 -0
  77. package/js/src/pro/onetrading.js +1 -0
  78. package/js/src/pro/p2b.d.ts +1 -0
  79. package/js/src/pro/p2b.js +34 -7
  80. package/js/src/pro/paradex.js +1 -0
  81. package/js/src/pro/poloniex.d.ts +1 -0
  82. package/js/src/pro/poloniex.js +36 -3
  83. package/js/src/pro/poloniexfutures.js +1 -0
  84. package/js/src/pro/probit.js +2 -0
  85. package/js/src/pro/upbit.d.ts +1 -0
  86. package/js/src/pro/upbit.js +48 -3
  87. package/js/src/pro/vertex.js +1 -0
  88. package/js/src/pro/wazirx.js +3 -0
  89. package/js/src/pro/whitebit.js +9 -0
  90. package/js/src/upbit.js +1 -1
  91. package/package.json +1 -1
@@ -18,6 +18,7 @@ class lbank extends lbank$1 {
18
18
  'watchTicker': true,
19
19
  'watchTickers': false,
20
20
  'watchTrades': true,
21
+ 'watchTradesForSymbols': false,
21
22
  'watchMyTrades': false,
22
23
  'watchOrders': true,
23
24
  'watchOrderBook': true,
@@ -13,6 +13,7 @@ class luno extends luno$1 {
13
13
  'watchTicker': false,
14
14
  'watchTickers': false,
15
15
  'watchTrades': true,
16
+ 'watchTradesForSymbols': false,
16
17
  'watchMyTrades': false,
17
18
  'watchOrders': undefined,
18
19
  'watchOrderBook': true,
@@ -12,6 +12,7 @@ class ndax extends ndax$1 {
12
12
  'ws': true,
13
13
  'watchOrderBook': true,
14
14
  'watchTrades': true,
15
+ 'watchTradesForSymbols': false,
15
16
  'watchTicker': true,
16
17
  'watchOHLCV': true,
17
18
  },
@@ -40,6 +41,7 @@ class ndax extends ndax$1 {
40
41
  * @method
41
42
  * @name ndax#watchTicker
42
43
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
44
+ * @see https://apidoc.ndax.io/#subscribelevel1
43
45
  * @param {string} symbol unified symbol of the market to fetch the ticker for
44
46
  * @param {object} [params] extra parameters specific to the exchange API endpoint
45
47
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -105,6 +107,7 @@ class ndax extends ndax$1 {
105
107
  * @method
106
108
  * @name ndax#watchTrades
107
109
  * @description get the list of most recent trades for a particular symbol
110
+ * @see https://apidoc.ndax.io/#subscribetrades
108
111
  * @param {string} symbol unified symbol of the market to fetch trades for
109
112
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
110
113
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -186,6 +189,7 @@ class ndax extends ndax$1 {
186
189
  * @method
187
190
  * @name ndax#watchOHLCV
188
191
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
192
+ * @see https://apidoc.ndax.io/#subscribeticker
189
193
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
190
194
  * @param {string} timeframe the length of time each candle represents
191
195
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -318,6 +322,7 @@ class ndax extends ndax$1 {
318
322
  * @method
319
323
  * @name ndax#watchOrderBook
320
324
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
325
+ * @see https://apidoc.ndax.io/#subscribelevel2
321
326
  * @param {string} symbol unified symbol of the market to fetch the order book for
322
327
  * @param {int} [limit] the maximum amount of order book entries to return
323
328
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -17,6 +17,7 @@ class okcoin extends okcoin$1 {
17
17
  'watchOrderBook': true,
18
18
  'watchOrders': true,
19
19
  'watchTrades': true,
20
+ 'watchTradesForSymbols': false,
20
21
  'watchBalance': true,
21
22
  'watchOHLCV': true,
22
23
  },
@@ -67,6 +68,7 @@ class okcoin extends okcoin$1 {
67
68
  * @method
68
69
  * @name okcoin#watchTrades
69
70
  * @description get the list of most recent trades for a particular symbol
71
+ * @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-trades-channel
70
72
  * @param {string} symbol unified symbol of the market to fetch trades for
71
73
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
72
74
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -86,6 +88,7 @@ class okcoin extends okcoin$1 {
86
88
  * @method
87
89
  * @name okcoin#watchOrders
88
90
  * @description watches information on multiple orders made by the user
91
+ * @see https://www.okcoin.com/docs-v5/en/#websocket-api-private-channel-order-channel
89
92
  * @param {string} symbol unified market symbol of the market orders were made in
90
93
  * @param {int} [since] the earliest time in ms to fetch orders for
91
94
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -172,6 +175,7 @@ class okcoin extends okcoin$1 {
172
175
  * @method
173
176
  * @name okcoin#watchTicker
174
177
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
178
+ * @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-tickers-channel
175
179
  * @param {string} symbol unified symbol of the market to fetch the ticker for
176
180
  * @param {object} [params] extra parameters specific to the exchange API endpoint
177
181
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -252,6 +256,7 @@ class okcoin extends okcoin$1 {
252
256
  * @method
253
257
  * @name okcoin#watchOHLCV
254
258
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
259
+ * @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-candlesticks-channel
255
260
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
256
261
  * @param {string} timeframe the length of time each candle represents
257
262
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -319,6 +324,7 @@ class okcoin extends okcoin$1 {
319
324
  * @method
320
325
  * @name okcoin#watchOrderBook
321
326
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
327
+ * @see https://www.okcoin.com/docs-v5/en/#websocket-api-public-channel-order-book-channel
322
328
  * @param {string} symbol unified symbol of the market to fetch the order book for
323
329
  * @param {int} [limit] the maximum amount of order book entries to return
324
330
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -482,6 +488,7 @@ class okcoin extends okcoin$1 {
482
488
  * @method
483
489
  * @name okcoin#watchBalance
484
490
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
491
+ * @see https://www.okcoin.com/docs-v5/en/#websocket-api-private-channel-account-channel
485
492
  * @param {object} [params] extra parameters specific to the exchange API endpoint
486
493
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
487
494
  */
@@ -16,6 +16,7 @@ class onetrading extends onetrading$1 {
16
16
  'watchTicker': true,
17
17
  'watchTickers': true,
18
18
  'watchTrades': false,
19
+ 'watchTradesForSymbols': false,
19
20
  'watchMyTrades': true,
20
21
  'watchOrders': true,
21
22
  'watchOrderBook': true,
@@ -29,6 +29,7 @@ class p2b extends p2b$1 {
29
29
  'watchTicker': true,
30
30
  'watchTickers': false,
31
31
  'watchTrades': true,
32
+ 'watchTradesForSymbols': true,
32
33
  },
33
34
  'urls': {
34
35
  'api': {
@@ -144,15 +145,41 @@ class p2b extends p2b$1 {
144
145
  * @param {object} [params] extra parameters specific to the exchange API endpoint
145
146
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
146
147
  */
148
+ return await this.watchTradesForSymbols([symbol], since, limit, params);
149
+ }
150
+ async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
151
+ /**
152
+ * @method
153
+ * @name p2b#watchTradesForSymbols
154
+ * @description get the list of most recent trades for a list of symbols
155
+ * @see https://github.com/P2B-team/P2B-WSS-Public/blob/main/wss_documentation.md#deals
156
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
157
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
158
+ * @param {int} [limit] the maximum amount of trades to fetch
159
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
160
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
161
+ */
147
162
  await this.loadMarkets();
148
- const market = this.market(symbol);
149
- const request = [
150
- market['id'],
151
- ];
152
- const messageHash = 'deals::' + market['symbol'];
153
- const trades = await this.subscribe('deals.subscribe', messageHash, request, params);
163
+ symbols = this.marketSymbols(symbols, undefined, false, true, true);
164
+ const messageHashes = [];
165
+ if (symbols !== undefined) {
166
+ for (let i = 0; i < symbols.length; i++) {
167
+ messageHashes.push('deals::' + symbols[i]);
168
+ }
169
+ }
170
+ const marketIds = this.marketIds(symbols);
171
+ const url = this.urls['api']['ws'];
172
+ const subscribe = {
173
+ 'method': 'deals.subscribe',
174
+ 'params': marketIds,
175
+ 'id': this.milliseconds(),
176
+ };
177
+ const query = this.extend(subscribe, params);
178
+ const trades = await this.watchMultiple(url, messageHashes, query, messageHashes);
154
179
  if (this.newUpdates) {
155
- limit = trades.getLimit(symbol, limit);
180
+ const first = this.safeValue(trades, 0);
181
+ const tradeSymbol = this.safeString(first, 'symbol');
182
+ limit = trades.getLimit(tradeSymbol, limit);
156
183
  }
157
184
  return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
158
185
  }
@@ -15,6 +15,7 @@ class paradex extends paradex$1 {
15
15
  'watchOrderBook': true,
16
16
  'watchOrders': false,
17
17
  'watchTrades': true,
18
+ 'watchTradesForSymbols': false,
18
19
  'watchBalance': false,
19
20
  'watchOHLCV': false,
20
21
  },
@@ -18,6 +18,7 @@ class poloniex extends poloniex$1 {
18
18
  'watchTicker': true,
19
19
  'watchTickers': true,
20
20
  'watchTrades': true,
21
+ 'watchTradesForSymbols': true,
21
22
  'watchBalance': true,
22
23
  'watchStatus': false,
23
24
  'watchOrders': true,
@@ -395,12 +396,44 @@ class poloniex extends poloniex$1 {
395
396
  * @param {object} [params] extra parameters specific to the exchange API endpoint
396
397
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
397
398
  */
399
+ return await this.watchTradesForSymbols([symbol], since, limit, params);
400
+ }
401
+ async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
402
+ /**
403
+ * @method
404
+ * @name poloniex#watchTradesForSymbols
405
+ * @description get the list of most recent trades for a list of symbols
406
+ * @see https://api-docs.poloniex.com/spot/websocket/market-data#trades
407
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
408
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
409
+ * @param {int} [limit] the maximum amount of trades to fetch
410
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
411
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
412
+ */
398
413
  await this.loadMarkets();
399
- symbol = this.symbol(symbol);
414
+ symbols = this.marketSymbols(symbols, undefined, false, true, true);
400
415
  const name = 'trades';
401
- const trades = await this.subscribe(name, name, false, [symbol], params);
416
+ const url = this.urls['api']['ws']['public'];
417
+ const marketIds = this.marketIds(symbols);
418
+ const subscribe = {
419
+ 'event': 'subscribe',
420
+ 'channel': [
421
+ name,
422
+ ],
423
+ 'symbols': marketIds,
424
+ };
425
+ const request = this.extend(subscribe, params);
426
+ const messageHashes = [];
427
+ if (symbols !== undefined) {
428
+ for (let i = 0; i < symbols.length; i++) {
429
+ messageHashes.push(name + '::' + symbols[i]);
430
+ }
431
+ }
432
+ const trades = await this.watchMultiple(url, messageHashes, request, messageHashes);
402
433
  if (this.newUpdates) {
403
- limit = trades.getLimit(symbol, limit);
434
+ const first = this.safeValue(trades, 0);
435
+ const tradeSymbol = this.safeString(first, 'symbol');
436
+ limit = trades.getLimit(tradeSymbol, limit);
404
437
  }
405
438
  return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
406
439
  }
@@ -25,6 +25,7 @@ class poloniexfutures extends poloniexfutures$1 {
25
25
  'watchTicker': true,
26
26
  'watchTickers': false,
27
27
  'watchTrades': true,
28
+ 'watchTradesForSymbols': false,
28
29
  'watchBalance': true,
29
30
  'watchOrders': true,
30
31
  'watchMyTrades': false,
@@ -15,6 +15,7 @@ class probit extends probit$1 {
15
15
  'watchTicker': true,
16
16
  'watchTickers': false,
17
17
  'watchTrades': true,
18
+ 'watchTradesForSymbols': false,
18
19
  'watchMyTrades': true,
19
20
  'watchOrders': true,
20
21
  'watchOrderBook': true,
@@ -222,6 +223,7 @@ class probit extends probit$1 {
222
223
  * @method
223
224
  * @name probit#watchMyTrades
224
225
  * @description get the list of trades associated with the user
226
+ * @see https://docs-en.probit.com/reference/trade_history
225
227
  * @param {string} symbol unified symbol of the market to fetch trades for
226
228
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
227
229
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -15,6 +15,7 @@ class upbit extends upbit$1 {
15
15
  'watchOrderBook': true,
16
16
  'watchTicker': true,
17
17
  'watchTrades': true,
18
+ 'watchTradesForSymbols': true,
18
19
  'watchOrders': true,
19
20
  'watchMyTrades': true,
20
21
  'watchBalance': true,
@@ -79,11 +80,55 @@ class upbit extends upbit$1 {
79
80
  * @param {object} [params] extra parameters specific to the exchange API endpoint
80
81
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
81
82
  */
83
+ return await this.watchTradesForSymbols([symbol], since, limit, params);
84
+ }
85
+ async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
86
+ /**
87
+ * @method
88
+ * @name upbit#watchTradesForSymbols
89
+ * @description get the list of most recent trades for a list of symbols
90
+ * @see https://global-docs.upbit.com/reference/websocket-trade
91
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
92
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
93
+ * @param {int} [limit] the maximum amount of trades to fetch
94
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
95
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
96
+ */
82
97
  await this.loadMarkets();
83
- symbol = this.symbol(symbol);
84
- const trades = await this.watchPublic(symbol, 'trade');
98
+ symbols = this.marketSymbols(symbols, undefined, false, true, true);
99
+ const channel = 'trade';
100
+ const messageHashes = [];
101
+ const url = this.implodeParams(this.urls['api']['ws'], {
102
+ 'hostname': this.hostname,
103
+ });
104
+ if (symbols !== undefined) {
105
+ for (let i = 0; i < symbols.length; i++) {
106
+ const market = this.market(symbols[i]);
107
+ const marketId = market['id'];
108
+ const symbol = market['symbol'];
109
+ this.options[channel] = this.safeValue(this.options, channel, {});
110
+ this.options[channel][symbol] = true;
111
+ messageHashes.push(channel + ':' + marketId);
112
+ }
113
+ }
114
+ const optionSymbols = Object.keys(this.options[channel]);
115
+ const marketIds = this.marketIds(optionSymbols);
116
+ const request = [
117
+ {
118
+ 'ticket': this.uuid(),
119
+ },
120
+ {
121
+ 'type': channel,
122
+ 'codes': marketIds,
123
+ // 'isOnlySnapshot': false,
124
+ // 'isOnlyRealtime': false,
125
+ },
126
+ ];
127
+ const trades = await this.watchMultiple(url, messageHashes, request, messageHashes);
85
128
  if (this.newUpdates) {
86
- limit = trades.getLimit(symbol, limit);
129
+ const first = this.safeValue(trades, 0);
130
+ const tradeSymbol = this.safeString(first, 'symbol');
131
+ limit = trades.getLimit(tradeSymbol, limit);
87
132
  }
88
133
  return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
89
134
  }
@@ -20,6 +20,7 @@ class vertex extends vertex$1 {
20
20
  'watchTicker': true,
21
21
  'watchTickers': false,
22
22
  'watchTrades': true,
23
+ 'watchTradesForSymbols': false,
23
24
  'watchPositions': true,
24
25
  },
25
26
  'urls': {
@@ -15,6 +15,7 @@ class wazirx extends wazirx$1 {
15
15
  'watchTicker': true,
16
16
  'watchTickers': true,
17
17
  'watchTrades': true,
18
+ 'watchTradesForSymbols': false,
18
19
  'watchMyTrades': true,
19
20
  'watchOrders': true,
20
21
  'watchOrderBook': true,
@@ -284,6 +285,7 @@ class wazirx extends wazirx$1 {
284
285
  * @method
285
286
  * @name wazirx#watchTrades
286
287
  * @description get the list of most recent trades for a particular symbol
288
+ * @see https://docs.wazirx.com/#trade-streams
287
289
  * @param {string} symbol unified symbol of the market to fetch trades for
288
290
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
289
291
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -381,6 +383,7 @@ class wazirx extends wazirx$1 {
381
383
  * @method
382
384
  * @name wazirx#watchOHLCV
383
385
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
386
+ * @see https://docs.wazirx.com/#kline-candlestick-stream
384
387
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
385
388
  * @param {string} timeframe the length of time each candle represents
386
389
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -19,6 +19,7 @@ class whitebit extends whitebit$1 {
19
19
  'watchOrders': true,
20
20
  'watchTicker': true,
21
21
  'watchTrades': true,
22
+ 'watchTradesForSymbols': false,
22
23
  },
23
24
  'urls': {
24
25
  'api': {
@@ -61,6 +62,7 @@ class whitebit extends whitebit$1 {
61
62
  * @method
62
63
  * @name whitebit#watchOHLCV
63
64
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
65
+ * @see https://docs.whitebit.com/public/websocket/#kline
64
66
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
65
67
  * @param {string} timeframe the length of time each candle represents
66
68
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -135,6 +137,7 @@ class whitebit extends whitebit$1 {
135
137
  * @method
136
138
  * @name whitebit#watchOrderBook
137
139
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
140
+ * @see https://docs.whitebit.com/public/websocket/#market-depth
138
141
  * @param {string} symbol unified symbol of the market to fetch the order book for
139
142
  * @param {int} [limit] the maximum amount of order book entries to return
140
143
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -240,6 +243,7 @@ class whitebit extends whitebit$1 {
240
243
  * @method
241
244
  * @name whitebit#watchTicker
242
245
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
246
+ * @see https://docs.whitebit.com/public/websocket/#market-statistics
243
247
  * @param {string} symbol unified symbol of the market to fetch the ticker for
244
248
  * @param {object} [params] extra parameters specific to the exchange API endpoint
245
249
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -306,6 +310,7 @@ class whitebit extends whitebit$1 {
306
310
  * @method
307
311
  * @name whitebit#watchTrades
308
312
  * @description get the list of most recent trades for a particular symbol
313
+ * @see https://docs.whitebit.com/public/websocket/#market-trades
309
314
  * @param {string} symbol unified symbol of the market to fetch trades for
310
315
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
311
316
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -372,6 +377,7 @@ class whitebit extends whitebit$1 {
372
377
  * @method
373
378
  * @name whitebit#watchMyTrades
374
379
  * @description watches trades made by the user
380
+ * @see https://docs.whitebit.com/private/websocket/#deals
375
381
  * @param {str} symbol unified market symbol
376
382
  * @param {int} [since] the earliest time in ms to fetch trades for
377
383
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -471,6 +477,7 @@ class whitebit extends whitebit$1 {
471
477
  * @method
472
478
  * @name whitebit#watchOrders
473
479
  * @description watches information on multiple orders made by the user
480
+ * @see https://docs.whitebit.com/private/websocket/#orders-pending
474
481
  * @param {string} symbol unified market symbol of the market orders were made in
475
482
  * @param {int} [since] the earliest time in ms to fetch orders for
476
483
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -646,6 +653,8 @@ class whitebit extends whitebit$1 {
646
653
  * @method
647
654
  * @name whitebit#watchBalance
648
655
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
656
+ * @see https://docs.whitebit.com/private/websocket/#balance-spot
657
+ * @see https://docs.whitebit.com/private/websocket/#balance-margin
649
658
  * @param {object} [params] extra parameters specific to the exchange API endpoint
650
659
  * @param {str} [params.type] spot or contract if not provided this.options['defaultType'] is used
651
660
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
@@ -2001,7 +2001,7 @@ class upbit extends upbit$1 {
2001
2001
  headers['Content-Type'] = 'application/json';
2002
2002
  }
2003
2003
  if (hasQuery) {
2004
- auth = this.urlencode(query);
2004
+ auth = this.rawencode(query);
2005
2005
  }
2006
2006
  if (auth !== undefined) {
2007
2007
  const hash = this.hash(this.encode(auth), sha512.sha512);
package/js/ccxt.d.ts CHANGED
@@ -3,8 +3,8 @@ import { Precise } from './src/base/Precise.js';
3
3
  import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers } from './src/base/types.js';
6
- import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
7
- declare const version = "4.3.85";
6
+ import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
+ declare const version = "4.3.87";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -561,5 +561,5 @@ declare const ccxt: {
561
561
  zaif: typeof zaif;
562
562
  zonda: typeof zonda;
563
563
  } & typeof functions & typeof errors;
564
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
564
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
565
565
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -35,10 +35,10 @@ import { Exchange } from './src/base/Exchange.js';
35
35
  import { Precise } from './src/base/Precise.js';
36
36
  import * as functions from './src/base/functions.js';
37
37
  import * as errors from './src/base/errors.js';
38
- import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending } from './src/base/errors.js';
38
+ import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.3.86';
41
+ const version = '4.3.88';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -420,6 +420,6 @@ pro.exchanges = Object.keys(pro);
420
420
  pro['Exchange'] = Exchange; // now the same for rest and ts
421
421
  //-----------------------------------------------------------------------------
422
422
  const ccxt = Object.assign({ version, Exchange, Precise, 'exchanges': Object.keys(exchanges), 'pro': pro }, exchanges, functions, errors);
423
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
423
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseadvanced, coinbaseexchange, coinbaseinternational, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hashkey, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, oxfun, p2b, paradex, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, vertex, wavesexchange, wazirx, whitebit, woo, woofipro, xt, yobit, zaif, zonda, };
424
424
  export default ccxt;
425
425
  //-----------------------------------------------------------------------------
@@ -197,6 +197,7 @@ interface Exchange {
197
197
  brokerGetBrokerNdAccount(params?: {}): Promise<implicitReturnType>;
198
198
  brokerGetBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
199
199
  brokerGetBrokerNdRebaseDownload(params?: {}): Promise<implicitReturnType>;
200
+ brokerGetAssetNdbrokerDepositList(params?: {}): Promise<implicitReturnType>;
200
201
  brokerGetBrokerNdTransferDetail(params?: {}): Promise<implicitReturnType>;
201
202
  brokerGetBrokerNdDepositDetail(params?: {}): Promise<implicitReturnType>;
202
203
  brokerGetBrokerNdWithdrawDetail(params?: {}): Promise<implicitReturnType>;
@@ -218,6 +218,7 @@ interface kucoin {
218
218
  brokerGetBrokerNdAccount(params?: {}): Promise<implicitReturnType>;
219
219
  brokerGetBrokerNdAccountApikey(params?: {}): Promise<implicitReturnType>;
220
220
  brokerGetBrokerNdRebaseDownload(params?: {}): Promise<implicitReturnType>;
221
+ brokerGetAssetNdbrokerDepositList(params?: {}): Promise<implicitReturnType>;
221
222
  brokerGetBrokerNdTransferDetail(params?: {}): Promise<implicitReturnType>;
222
223
  brokerGetBrokerNdDepositDetail(params?: {}): Promise<implicitReturnType>;
223
224
  brokerGetBrokerNdWithdrawDetail(params?: {}): Promise<implicitReturnType>;
@@ -1143,7 +1143,7 @@ export default class Exchange {
1143
1143
  convertExpireDate(date: string): string;
1144
1144
  convertExpireDateToMarketIdDate(date: string): string;
1145
1145
  convertMarketIdExpireDate(date: string): string;
1146
- fetchPositionHistory(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Position>;
1146
+ fetchPositionHistory(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
1147
1147
  fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
1148
1148
  parseMarginModification(data: Dict, market?: Market): MarginModification;
1149
1149
  parseMarginModifications(response: object[], symbols?: Strings, symbolKey?: Str, marketType?: MarketType): MarginModification[];
@@ -5982,7 +5982,7 @@ export default class Exchange {
5982
5982
  errors = 0;
5983
5983
  result = this.arrayConcat(result, response);
5984
5984
  const last = this.safeValue(response, responseLength - 1);
5985
- paginationTimestamp = this.safeInteger(last, 'timestamp') - 1;
5985
+ paginationTimestamp = this.safeInteger(last, 'timestamp') + 1;
5986
5986
  if ((until !== undefined) && (paginationTimestamp >= until)) {
5987
5987
  break;
5988
5988
  }
@@ -6432,7 +6432,7 @@ export default class Exchange {
6432
6432
  */
6433
6433
  if (this.has['fetchPositionsHistory']) {
6434
6434
  const positions = await this.fetchPositionsHistory([symbol], since, limit, params);
6435
- return this.safeDict(positions, 0);
6435
+ return positions;
6436
6436
  }
6437
6437
  else {
6438
6438
  throw new NotSupported(this.id + ' fetchPositionHistory () is not supported yet');
@@ -51,6 +51,7 @@ declare const errorHierarchy: {
51
51
  };
52
52
  CancelPending: {};
53
53
  };
54
+ UnsubscribeError: {};
54
55
  };
55
56
  };
56
57
  export default errorHierarchy;
@@ -57,6 +57,7 @@ const errorHierarchy = {
57
57
  },
58
58
  'CancelPending': {},
59
59
  },
60
+ 'UnsubscribeError': {},
60
61
  },
61
62
  };
62
63
  export default errorHierarchy;
@@ -115,7 +115,10 @@ declare class NullResponse extends BadResponse {
115
115
  declare class CancelPending extends OperationFailed {
116
116
  constructor(message: string);
117
117
  }
118
- export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
118
+ declare class UnsubscribeError extends BaseError {
119
+ constructor(message: string);
120
+ }
121
+ export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError };
119
122
  declare const _default: {
120
123
  BaseError: typeof BaseError;
121
124
  ExchangeError: typeof ExchangeError;
@@ -156,5 +159,6 @@ declare const _default: {
156
159
  BadResponse: typeof BadResponse;
157
160
  NullResponse: typeof NullResponse;
158
161
  CancelPending: typeof CancelPending;
162
+ UnsubscribeError: typeof UnsubscribeError;
159
163
  };
160
164
  export default _default;
@@ -239,5 +239,11 @@ class CancelPending extends OperationFailed {
239
239
  this.name = 'CancelPending';
240
240
  }
241
241
  }
242
- export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
243
- export default { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending };
242
+ class UnsubscribeError extends BaseError {
243
+ constructor(message) {
244
+ super(message);
245
+ this.name = 'UnsubscribeError';
246
+ }
247
+ }
248
+ export { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError };
249
+ export default { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError };
package/js/src/bingx.js CHANGED
@@ -750,7 +750,13 @@ export default class bingx extends Exchange {
750
750
  }
751
751
  const fees = this.safeDict(this.fees, type, {});
752
752
  const contractSize = (swap) ? this.parseNumber('1') : undefined;
753
- const isActive = this.safeString(market, 'status') === '1';
753
+ let isActive = false;
754
+ if ((this.safeString(market, 'apiStateOpen') === 'true') && (this.safeString(market, 'apiStateClose') === 'true')) {
755
+ isActive = true; // swap active
756
+ }
757
+ else if (this.safeBool(market, 'apiStateSell') && this.safeBool(market, 'apiStateBuy')) {
758
+ isActive = true; // spot active
759
+ }
754
760
  const isInverse = (spot) ? undefined : checkIsInverse;
755
761
  const isLinear = (spot) ? undefined : checkIsLinear;
756
762
  let timeOnline = this.safeInteger(market, 'timeOnline');