ccxt 4.2.58 → 4.2.60

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 (92) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +3 -3
  3. package/build.sh +1 -1
  4. package/cleanup.sh +3 -0
  5. package/dist/ccxt.browser.js +716 -382
  6. package/dist/ccxt.browser.min.js +3 -3
  7. package/dist/cjs/ccxt.js +1 -1
  8. package/dist/cjs/src/ascendex.js +10 -12
  9. package/dist/cjs/src/base/Exchange.js +2 -0
  10. package/dist/cjs/src/binance.js +2 -2
  11. package/dist/cjs/src/bingx.js +41 -3
  12. package/dist/cjs/src/bitfinex2.js +21 -4
  13. package/dist/cjs/src/bitget.js +10 -3
  14. package/dist/cjs/src/bitmart.js +41 -23
  15. package/dist/cjs/src/bitmex.js +1 -1
  16. package/dist/cjs/src/blofin.js +60 -2
  17. package/dist/cjs/src/coinbase.js +24 -14
  18. package/dist/cjs/src/hitbtc.js +1 -1
  19. package/dist/cjs/src/htx.js +4 -1
  20. package/dist/cjs/src/kraken.js +42 -39
  21. package/dist/cjs/src/kucoinfutures.js +1 -0
  22. package/dist/cjs/src/lbank.js +1 -1
  23. package/dist/cjs/src/mexc.js +1 -1
  24. package/dist/cjs/src/okx.js +1 -1
  25. package/dist/cjs/src/phemex.js +1 -1
  26. package/dist/cjs/src/pro/binance.js +17 -4
  27. package/dist/cjs/src/pro/bitfinex2.js +1 -1
  28. package/dist/cjs/src/pro/bitget.js +1 -1
  29. package/dist/cjs/src/pro/bitmart.js +51 -89
  30. package/dist/cjs/src/pro/bitvavo.js +1 -1
  31. package/dist/cjs/src/pro/bybit.js +1 -1
  32. package/dist/cjs/src/pro/coinex.js +1 -1
  33. package/dist/cjs/src/pro/cryptocom.js +1 -1
  34. package/dist/cjs/src/pro/deribit.js +201 -84
  35. package/dist/cjs/src/pro/gate.js +1 -1
  36. package/dist/cjs/src/pro/independentreserve.js +1 -1
  37. package/dist/cjs/src/pro/kraken.js +1 -1
  38. package/dist/cjs/src/pro/kucoinfutures.js +1 -1
  39. package/dist/cjs/src/pro/mexc.js +5 -3
  40. package/dist/cjs/src/pro/okx.js +1 -1
  41. package/dist/cjs/src/pro/woo.js +1 -1
  42. package/dist/cjs/src/wazirx.js +6 -1
  43. package/dist/cjs/src/woo.js +159 -79
  44. package/js/ccxt.d.ts +1 -1
  45. package/js/ccxt.js +1 -1
  46. package/js/src/abstract/blofin.d.ts +1 -0
  47. package/js/src/abstract/wazirx.d.ts +5 -0
  48. package/js/src/ascendex.d.ts +2 -2
  49. package/js/src/ascendex.js +10 -12
  50. package/js/src/base/Exchange.js +2 -0
  51. package/js/src/binance.js +2 -2
  52. package/js/src/bingx.d.ts +3 -1
  53. package/js/src/bingx.js +41 -3
  54. package/js/src/bitfinex2.js +21 -4
  55. package/js/src/bitget.js +10 -3
  56. package/js/src/bitmart.d.ts +9 -2
  57. package/js/src/bitmart.js +41 -23
  58. package/js/src/bitmex.js +1 -1
  59. package/js/src/blofin.d.ts +2 -1
  60. package/js/src/blofin.js +60 -2
  61. package/js/src/coinbase.js +24 -14
  62. package/js/src/hitbtc.js +1 -1
  63. package/js/src/htx.js +4 -1
  64. package/js/src/kraken.js +42 -39
  65. package/js/src/kucoinfutures.js +1 -0
  66. package/js/src/lbank.js +1 -1
  67. package/js/src/mexc.js +1 -1
  68. package/js/src/okx.js +1 -1
  69. package/js/src/phemex.js +1 -1
  70. package/js/src/pro/binance.js +17 -4
  71. package/js/src/pro/bitfinex2.js +1 -1
  72. package/js/src/pro/bitget.js +1 -1
  73. package/js/src/pro/bitmart.d.ts +2 -2
  74. package/js/src/pro/bitmart.js +51 -89
  75. package/js/src/pro/bitvavo.js +1 -1
  76. package/js/src/pro/bybit.js +1 -1
  77. package/js/src/pro/coinex.js +1 -1
  78. package/js/src/pro/cryptocom.js +1 -1
  79. package/js/src/pro/deribit.d.ts +5 -0
  80. package/js/src/pro/deribit.js +202 -85
  81. package/js/src/pro/gate.js +1 -1
  82. package/js/src/pro/independentreserve.js +1 -1
  83. package/js/src/pro/kraken.js +1 -1
  84. package/js/src/pro/kucoinfutures.js +1 -1
  85. package/js/src/pro/mexc.js +6 -4
  86. package/js/src/pro/okx.js +1 -1
  87. package/js/src/pro/woo.js +1 -1
  88. package/js/src/wazirx.js +6 -1
  89. package/js/src/woo.d.ts +8 -0
  90. package/js/src/woo.js +159 -79
  91. package/package.json +1 -1
  92. package/skip-tests.json +44 -18
@@ -21,7 +21,10 @@ class kraken extends kraken$1 {
21
21
  'name': 'Kraken',
22
22
  'countries': ['US'],
23
23
  'version': '0',
24
- 'rateLimit': 3000,
24
+ // rate-limits: https://support.kraken.com/hc/en-us/articles/206548367-What-are-the-API-rate-limits-#1
25
+ // for public: 1 req/s
26
+ // for private: every second 0.33 weight added to your allowed capacity (some private endpoints need 1 weight, some need 2)
27
+ 'rateLimit': 1000,
25
28
  'certified': false,
26
29
  'pro': true,
27
30
  'has': {
@@ -151,7 +154,7 @@ class kraken extends kraken$1 {
151
154
  },
152
155
  'public': {
153
156
  'get': {
154
- // public endpoint rate-limits are described in article: https://support.kraken.com/hc/en-us/articles/206548367-What-are-the-API-rate-limits-#1
157
+ // rate-limits explained in comment in the top of this file
155
158
  'Assets': 1,
156
159
  'AssetPairs': 1,
157
160
  'Depth': 1,
@@ -167,48 +170,48 @@ class kraken extends kraken$1 {
167
170
  'post': {
168
171
  'AddOrder': 0,
169
172
  'AddOrderBatch': 0,
170
- 'AddExport': 1,
171
- 'Balance': 1,
172
- 'CancelAll': 1,
173
- 'CancelAllOrdersAfter': 1,
173
+ 'AddExport': 3,
174
+ 'Balance': 3,
175
+ 'CancelAll': 3,
176
+ 'CancelAllOrdersAfter': 3,
174
177
  'CancelOrder': 0,
175
178
  'CancelOrderBatch': 0,
176
- 'ClosedOrders': 1,
177
- 'DepositAddresses': 1,
178
- 'DepositMethods': 1,
179
- 'DepositStatus': 1,
179
+ 'ClosedOrders': 3,
180
+ 'DepositAddresses': 3,
181
+ 'DepositMethods': 3,
182
+ 'DepositStatus': 3,
180
183
  'EditOrder': 0,
181
- 'ExportStatus': 1,
182
- 'GetWebSocketsToken': 1,
183
- 'Ledgers': 2,
184
- 'OpenOrders': 1,
185
- 'OpenPositions': 1,
186
- 'QueryLedgers': 1,
187
- 'QueryOrders': 1,
188
- 'QueryTrades': 1,
189
- 'RetrieveExport': 1,
190
- 'RemoveExport': 1,
191
- 'BalanceEx': 1,
192
- 'TradeBalance': 1,
193
- 'TradesHistory': 2,
194
- 'TradeVolume': 1,
195
- 'Withdraw': 1,
196
- 'WithdrawCancel': 1,
197
- 'WithdrawInfo': 1,
198
- 'WithdrawMethods': 1,
199
- 'WithdrawAddresses': 1,
200
- 'WithdrawStatus': 1,
201
- 'WalletTransfer': 1,
184
+ 'ExportStatus': 3,
185
+ 'GetWebSocketsToken': 3,
186
+ 'Ledgers': 6,
187
+ 'OpenOrders': 3,
188
+ 'OpenPositions': 3,
189
+ 'QueryLedgers': 3,
190
+ 'QueryOrders': 3,
191
+ 'QueryTrades': 3,
192
+ 'RetrieveExport': 3,
193
+ 'RemoveExport': 3,
194
+ 'BalanceEx': 3,
195
+ 'TradeBalance': 3,
196
+ 'TradesHistory': 6,
197
+ 'TradeVolume': 3,
198
+ 'Withdraw': 3,
199
+ 'WithdrawCancel': 3,
200
+ 'WithdrawInfo': 3,
201
+ 'WithdrawMethods': 3,
202
+ 'WithdrawAddresses': 3,
203
+ 'WithdrawStatus': 3,
204
+ 'WalletTransfer': 3,
202
205
  // sub accounts
203
- 'CreateSubaccount': 1,
204
- 'AccountTransfer': 1,
206
+ 'CreateSubaccount': 3,
207
+ 'AccountTransfer': 3,
205
208
  // earn
206
- 'Earn/Allocate': 1,
207
- 'Earn/Deallocate': 1,
208
- 'Earn/AllocateStatus': 1,
209
- 'Earn/DeallocateStatus': 1,
210
- 'Earn/Strategies': 1,
211
- 'Earn/Allocations': 1,
209
+ 'Earn/Allocate': 3,
210
+ 'Earn/Deallocate': 3,
211
+ 'Earn/AllocateStatus': 3,
212
+ 'Earn/DeallocateStatus': 3,
213
+ 'Earn/Strategies': 3,
214
+ 'Earn/Allocations': 3,
212
215
  },
213
216
  },
214
217
  },
@@ -33,6 +33,7 @@ class kucoinfutures extends kucoinfutures$1 {
33
33
  'addMargin': true,
34
34
  'cancelAllOrders': true,
35
35
  'cancelOrder': true,
36
+ 'closeAllPositions': false,
36
37
  'closePosition': true,
37
38
  'closePositions': false,
38
39
  'createDepositAddress': true,
@@ -2691,7 +2691,7 @@ class lbank extends lbank$1 {
2691
2691
  const uppercaseHash = hash.toUpperCase();
2692
2692
  let sign = undefined;
2693
2693
  if (signatureMethod === 'RSA') {
2694
- const cacheSecretAsPem = this.safeValue(this.options, 'cacheSecretAsPem', true);
2694
+ const cacheSecretAsPem = this.safeBool(this.options, 'cacheSecretAsPem', true);
2695
2695
  let pem = undefined;
2696
2696
  if (cacheSecretAsPem) {
2697
2697
  pem = this.safeValue(this.options, 'pem');
@@ -5496,7 +5496,7 @@ class mexc extends mexc$1 {
5496
5496
  'source': this.safeString(this.options, 'broker', 'CCXT'),
5497
5497
  };
5498
5498
  }
5499
- if ((method === 'POST') || (method === 'PUT')) {
5499
+ if ((method === 'POST') || (method === 'PUT') || (method === 'DELETE')) {
5500
5500
  headers['Content-Type'] = 'application/json';
5501
5501
  }
5502
5502
  }
@@ -1557,7 +1557,7 @@ class okx extends okx$1 {
1557
1557
  // while fetchCurrencies is a public API method by design
1558
1558
  // therefore we check the keys here
1559
1559
  // and fallback to generating the currencies from the markets
1560
- const isSandboxMode = this.safeValue(this.options, 'sandboxMode', false);
1560
+ const isSandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1561
1561
  if (!this.checkRequiredCredentials(false) || isSandboxMode) {
1562
1562
  return undefined;
1563
1563
  }
@@ -2419,7 +2419,7 @@ class phemex extends phemex$1 {
2419
2419
  }
2420
2420
  parseOrder(order, market = undefined) {
2421
2421
  const isSwap = this.safeBool(market, 'swap', false);
2422
- const hasPnl = ('closedPnl' in order);
2422
+ const hasPnl = ('closedPnl' in order) || ('closedPnlRv' in order) || ('totalPnlRv' in order);
2423
2423
  if (isSwap || hasPnl) {
2424
2424
  return this.parseSwapOrder(order, market);
2425
2425
  }
@@ -2465,7 +2465,7 @@ class binance extends binance$1 {
2465
2465
  this.setBalanceCache(client, type, isPortfolioMargin);
2466
2466
  this.setPositionsCache(client, type, symbols, isPortfolioMargin);
2467
2467
  const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', true);
2468
- const awaitPositionsSnapshot = this.safeValue('watchPositions', 'awaitPositionsSnapshot', true);
2468
+ const awaitPositionsSnapshot = this.safeBool('watchPositions', 'awaitPositionsSnapshot', true);
2469
2469
  const cache = this.safeValue(this.positions, type);
2470
2470
  if (fetchPositionsSnapshot && awaitPositionsSnapshot && cache === undefined) {
2471
2471
  const snapshot = await client.future(type + ':fetchPositionsSnapshot');
@@ -2599,8 +2599,21 @@ class binance extends binance$1 {
2599
2599
  // }
2600
2600
  //
2601
2601
  const marketId = this.safeString(position, 's');
2602
- const positionSide = this.safeStringLower(position, 'ps');
2603
- const hedged = positionSide !== 'both';
2602
+ const contracts = this.safeString(position, 'pa');
2603
+ const contractsAbs = Precise["default"].stringAbs(this.safeString(position, 'pa'));
2604
+ let positionSide = this.safeStringLower(position, 'ps');
2605
+ let hedged = true;
2606
+ if (positionSide === 'both') {
2607
+ hedged = false;
2608
+ if (!Precise["default"].stringEq(contracts, '0')) {
2609
+ if (Precise["default"].stringLt(contracts, '0')) {
2610
+ positionSide = 'short';
2611
+ }
2612
+ else {
2613
+ positionSide = 'long';
2614
+ }
2615
+ }
2616
+ }
2604
2617
  return this.safePosition({
2605
2618
  'info': position,
2606
2619
  'id': undefined,
@@ -2611,7 +2624,7 @@ class binance extends binance$1 {
2611
2624
  'entryPrice': this.safeNumber(position, 'ep'),
2612
2625
  'unrealizedPnl': this.safeNumber(position, 'up'),
2613
2626
  'percentage': undefined,
2614
- 'contracts': this.safeNumber(position, 'pa'),
2627
+ 'contracts': this.parseNumber(contractsAbs),
2615
2628
  'contractSize': undefined,
2616
2629
  'markPrice': undefined,
2617
2630
  'side': positionSide,
@@ -53,7 +53,7 @@ class bitfinex2 extends bitfinex2$1 {
53
53
  'symbol': marketId,
54
54
  };
55
55
  const result = await this.watch(url, messageHash, this.deepExtend(request, params), messageHash, { 'checksum': false });
56
- const checksum = this.safeValue(this.options, 'checksum', true);
56
+ const checksum = this.safeBool(this.options, 'checksum', true);
57
57
  if (checksum && !client.subscriptions[messageHash]['checksum'] && (channel === 'book')) {
58
58
  client.subscriptions[messageHash]['checksum'] = true;
59
59
  await client.send({
@@ -536,7 +536,7 @@ class bitget extends bitget$1 {
536
536
  this.handleDeltas(storedOrderBook['bids'], bids);
537
537
  storedOrderBook['timestamp'] = timestamp;
538
538
  storedOrderBook['datetime'] = this.iso8601(timestamp);
539
- const checksum = this.safeValue(this.options, 'checksum', true);
539
+ const checksum = this.safeBool(this.options, 'checksum', true);
540
540
  const isSnapshot = this.safeString(message, 'action') === 'snapshot'; // snapshot does not have a checksum
541
541
  if (!isSnapshot && checksum) {
542
542
  const storedAsks = storedOrderBook['asks'];
@@ -107,11 +107,12 @@ class bitmart extends bitmart$1 {
107
107
  }
108
108
  return await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
109
109
  }
110
- async subscribeMultiple(channel, type, symbols, params = {}) {
110
+ async subscribeMultiple(channel, type, symbols = undefined, params = {}) {
111
+ symbols = this.marketSymbols(symbols, type, false, true);
111
112
  const url = this.implodeHostname(this.urls['api']['ws'][type]['public']);
112
113
  const channelType = (type === 'spot') ? 'spot' : 'futures';
113
114
  const actionType = (type === 'spot') ? 'op' : 'action';
114
- const rawSubscriptions = [];
115
+ let rawSubscriptions = [];
115
116
  const messageHashes = [];
116
117
  for (let i = 0; i < symbols.length; i++) {
117
118
  const market = this.market(symbols[i]);
@@ -119,6 +120,10 @@ class bitmart extends bitmart$1 {
119
120
  rawSubscriptions.push(message);
120
121
  messageHashes.push(channel + ':' + market['symbol']);
121
122
  }
123
+ // as an exclusion, futures "tickers" need one generic request for all symbols
124
+ if ((type !== 'spot') && (channel === 'ticker')) {
125
+ rawSubscriptions = [channelType + '/' + channel];
126
+ }
122
127
  const request = {
123
128
  'args': rawSubscriptions,
124
129
  };
@@ -321,13 +326,8 @@ class bitmart extends bitmart$1 {
321
326
  */
322
327
  await this.loadMarkets();
323
328
  symbol = this.symbol(symbol);
324
- const market = this.market(symbol);
325
- let type = 'spot';
326
- [type, params] = this.handleMarketTypeAndParams('watchTicker', market, params);
327
- if (type === 'swap') {
328
- throw new errors.NotSupported(this.id + ' watchTicker() does not support ' + type + ' markets. Use watchTickers() instead');
329
- }
330
- return await this.subscribe('ticker', symbol, type, params);
329
+ const tickers = await this.watchTickers([symbol], params);
330
+ return tickers[symbol];
331
331
  }
332
332
  async watchTickers(symbols = undefined, params = {}) {
333
333
  /**
@@ -341,40 +341,12 @@ class bitmart extends bitmart$1 {
341
341
  */
342
342
  await this.loadMarkets();
343
343
  const market = this.getMarketFromSymbols(symbols);
344
- let type = 'spot';
345
- [type, params] = this.handleMarketTypeAndParams('watchTickers', market, params);
346
- const url = this.implodeHostname(this.urls['api']['ws'][type]['public']);
347
- symbols = this.marketSymbols(symbols);
348
- let messageHash = 'tickers::' + type;
349
- if (symbols !== undefined) {
350
- messageHash += '::' + symbols.join(',');
351
- }
352
- let request = undefined;
353
- let tickers = undefined;
354
- const isSpot = (type === 'spot');
355
- if (isSpot) {
356
- if (symbols === undefined) {
357
- throw new errors.ArgumentsRequired(this.id + ' watchTickers() for ' + type + ' market type requires symbols argument to be provided');
358
- }
359
- const marketIds = this.marketIds(symbols);
360
- const finalArray = [];
361
- for (let i = 0; i < marketIds.length; i++) {
362
- finalArray.push('spot/ticker:' + marketIds[i]);
363
- }
364
- request = {
365
- 'op': 'subscribe',
366
- 'args': finalArray,
367
- };
368
- tickers = await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
369
- }
370
- else {
371
- request = {
372
- 'action': 'subscribe',
373
- 'args': ['futures/ticker'],
374
- };
375
- tickers = await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
376
- }
344
+ let marketType = undefined;
345
+ [marketType, params] = this.handleMarketTypeAndParams('watchTickers', market, params);
346
+ const ticker = await this.subscribeMultiple('ticker', marketType, symbols, params);
377
347
  if (this.newUpdates) {
348
+ const tickers = {};
349
+ tickers[ticker['symbol']] = ticker;
378
350
  return tickers;
379
351
  }
380
352
  return this.filterByArray(this.tickers, 'symbol', symbols);
@@ -850,21 +822,34 @@ class bitmart extends bitmart$1 {
850
822
  if (data === undefined) {
851
823
  return;
852
824
  }
853
- let stored = undefined;
854
825
  let symbol = undefined;
855
- for (let i = 0; i < data.length; i++) {
856
- const trade = this.parseWsTrade(data[i]);
857
- symbol = trade['symbol'];
858
- const tradesLimit = this.safeInteger(this.options, 'tradesLimit', 1000);
859
- stored = this.safeValue(this.trades, symbol);
860
- if (stored === undefined) {
861
- stored = new Cache.ArrayCache(tradesLimit);
862
- this.trades[symbol] = stored;
826
+ const length = data.length;
827
+ const isSwap = ('group' in message);
828
+ if (isSwap) {
829
+ // in swap, chronologically decreasing: 1709536849322, 1709536848954,
830
+ const maxLen = Math.max(length - 1, 0);
831
+ for (let i = maxLen; i >= 0; i--) {
832
+ symbol = this.handleTradeLoop(data[i]);
833
+ }
834
+ }
835
+ else {
836
+ // in spot, chronologically increasing: 1709536771200, 1709536771226,
837
+ for (let i = 0; i < length; i++) {
838
+ symbol = this.handleTradeLoop(data[i]);
863
839
  }
864
- stored.append(trade);
865
840
  }
866
- const messageHash = 'trade:' + symbol;
867
- client.resolve(stored, messageHash);
841
+ client.resolve(this.trades[symbol], 'trade:' + symbol);
842
+ }
843
+ handleTradeLoop(entry) {
844
+ const trade = this.parseWsTrade(entry);
845
+ const symbol = trade['symbol'];
846
+ const tradesLimit = this.safeInteger(this.options, 'tradesLimit', 1000);
847
+ if (this.safeValue(this.trades, symbol) === undefined) {
848
+ this.trades[symbol] = new Cache.ArrayCache(tradesLimit);
849
+ }
850
+ const stored = this.trades[symbol];
851
+ stored.append(trade);
852
+ return symbol;
868
853
  }
869
854
  parseWsTrade(trade, market = undefined) {
870
855
  // spot
@@ -943,45 +928,22 @@ class bitmart extends bitmart$1 {
943
928
  //
944
929
  const table = this.safeString(message, 'table');
945
930
  const isSpot = (table !== undefined);
946
- const data = this.safeValue(message, 'data');
947
- if (data === undefined) {
948
- return;
949
- }
931
+ let rawTickers = [];
950
932
  if (isSpot) {
951
- for (let i = 0; i < data.length; i++) {
952
- const ticker = this.parseTicker(data[i]);
953
- const symbol = ticker['symbol'];
954
- const marketId = this.safeString(ticker['info'], 'symbol');
955
- const messageHash = table + ':' + marketId;
956
- this.tickers[symbol] = ticker;
957
- client.resolve(ticker, messageHash);
958
- this.resolveMessageHashesForSymbol(client, symbol, ticker, 'tickers::');
959
- }
933
+ rawTickers = this.safeList(message, 'data', []);
960
934
  }
961
935
  else {
962
- // on each update for contract markets, single ticker is provided
963
- const ticker = this.parseWsSwapTicker(data);
964
- const symbol = this.safeString(ticker, 'symbol');
965
- this.tickers[symbol] = ticker;
966
- client.resolve(ticker, 'tickers::swap');
967
- this.resolveMessageHashesForSymbol(client, symbol, ticker, 'tickers::');
936
+ rawTickers = [this.safeValue(message, 'data', {})];
968
937
  }
969
- }
970
- resolveMessageHashesForSymbol(client, symbol, result, prexif) {
971
- const prefixSeparator = '::';
972
- const symbolsSeparator = ',';
973
- const messageHashes = this.findMessageHashes(client, prexif);
974
- for (let i = 0; i < messageHashes.length; i++) {
975
- const messageHash = messageHashes[i];
976
- const parts = messageHash.split(prefixSeparator);
977
- const length = parts.length;
978
- const symbolsString = parts[length - 1];
979
- const symbols = symbolsString.split(symbolsSeparator);
980
- if (this.inArray(symbol, symbols)) {
981
- const response = {};
982
- response[symbol] = result;
983
- client.resolve(response, messageHash);
984
- }
938
+ if (!rawTickers.length) {
939
+ return;
940
+ }
941
+ for (let i = 0; i < rawTickers.length; i++) {
942
+ const ticker = isSpot ? this.parseTicker(rawTickers[i]) : this.parseWsSwapTicker(rawTickers[i]);
943
+ const symbol = ticker['symbol'];
944
+ this.tickers[symbol] = ticker;
945
+ const messageHash = 'ticker:' + symbol;
946
+ client.resolve(ticker, messageHash);
985
947
  }
986
948
  }
987
949
  parseWsSwapTicker(ticker, market = undefined) {
@@ -1084,7 +1084,7 @@ class bitvavo extends bitvavo$1 {
1084
1084
  return messageHash;
1085
1085
  }
1086
1086
  checkMessageHashDoesNotExist(messageHash) {
1087
- const supressMultipleWsRequestsError = this.safeValue(this.options, 'supressMultipleWsRequestsError', false);
1087
+ const supressMultipleWsRequestsError = this.safeBool(this.options, 'supressMultipleWsRequestsError', false);
1088
1088
  if (!supressMultipleWsRequestsError) {
1089
1089
  const client = this.safeValue(this.clients, this.urls['api']['ws']);
1090
1090
  if (client !== undefined) {
@@ -939,7 +939,7 @@ class bybit extends bybit$1 {
939
939
  this.setPositionsCache(client, symbols);
940
940
  const cache = this.positions;
941
941
  const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', true);
942
- const awaitPositionsSnapshot = this.safeValue('watchPositions', 'awaitPositionsSnapshot', true);
942
+ const awaitPositionsSnapshot = this.safeBool('watchPositions', 'awaitPositionsSnapshot', true);
943
943
  if (fetchPositionsSnapshot && awaitPositionsSnapshot && cache === undefined) {
944
944
  const snapshot = await client.future('fetchPositionsSnapshot');
945
945
  return this.filterBySymbolsSinceLimit(snapshot, symbols, since, limit, true);
@@ -546,7 +546,7 @@ class coinex extends coinex$1 {
546
546
  }
547
547
  const url = this.urls['api']['ws'][type];
548
548
  const messageHash = 'ohlcv';
549
- const watchOHLCVWarning = this.safeValue(this.options, 'watchOHLCVWarning', true);
549
+ const watchOHLCVWarning = this.safeBool(this.options, 'watchOHLCVWarning', true);
550
550
  const client = this.safeValue(this.clients, url, {});
551
551
  const clientSub = this.safeValue(client, 'subscriptions', {});
552
552
  const existingSubscription = this.safeValue(clientSub, messageHash);
@@ -553,7 +553,7 @@ class cryptocom extends cryptocom$1 {
553
553
  const client = this.client(url);
554
554
  this.setPositionsCache(client, symbols);
555
555
  const fetchPositionsSnapshot = this.handleOption('watchPositions', 'fetchPositionsSnapshot', true);
556
- const awaitPositionsSnapshot = this.safeValue('watchPositions', 'awaitPositionsSnapshot', true);
556
+ const awaitPositionsSnapshot = this.safeBool('watchPositions', 'awaitPositionsSnapshot', true);
557
557
  if (fetchPositionsSnapshot && awaitPositionsSnapshot && this.positions === undefined) {
558
558
  const snapshot = await client.future('fetchPositionsSnapshot');
559
559
  return this.filterBySymbolsSinceLimit(snapshot, symbols, since, limit, true);