ccxt 4.4.73 → 4.4.75

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 (89) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -11
  4. package/dist/cjs/src/ace.js +9 -6
  5. package/dist/cjs/src/alpaca.js +3 -0
  6. package/dist/cjs/src/ascendex.js +6 -0
  7. package/dist/cjs/src/base/Exchange.js +36 -14
  8. package/dist/cjs/src/bequant.js +1 -0
  9. package/dist/cjs/src/binanceusdm.js +1 -1
  10. package/dist/cjs/src/bit2c.js +30 -4
  11. package/dist/cjs/src/bitbank.js +32 -0
  12. package/dist/cjs/src/bitbns.js +1 -1
  13. package/dist/cjs/src/bitflyer.js +1 -0
  14. package/dist/cjs/src/bithumb.js +34 -0
  15. package/dist/cjs/src/bitmart.js +74 -7
  16. package/dist/cjs/src/bitopro.js +37 -0
  17. package/dist/cjs/src/blofin.js +1 -1
  18. package/dist/cjs/src/bybit.js +14 -1
  19. package/dist/cjs/src/coinlist.js +87 -11
  20. package/dist/cjs/src/deribit.js +29 -1
  21. package/dist/cjs/src/gate.js +12 -7
  22. package/dist/cjs/src/hitbtc.js +7 -1
  23. package/dist/cjs/src/okx.js +29 -25
  24. package/dist/cjs/src/pro/ascendex.js +1 -1
  25. package/dist/cjs/src/pro/bingx.js +10 -1
  26. package/dist/cjs/src/pro/bitget.js +10 -1
  27. package/dist/cjs/src/pro/bitmart.js +10 -1
  28. package/dist/cjs/src/pro/bitopro.js +5 -4
  29. package/dist/cjs/src/pro/onetrading.js +7 -7
  30. package/js/ccxt.d.ts +2 -14
  31. package/js/ccxt.js +2 -10
  32. package/js/src/abstract/bitmart.d.ts +2 -0
  33. package/js/src/abstract/coinlist.d.ts +3 -0
  34. package/js/src/ace.js +9 -6
  35. package/js/src/alpaca.js +3 -0
  36. package/js/src/ascendex.js +6 -0
  37. package/js/src/base/Exchange.d.ts +1 -0
  38. package/js/src/base/Exchange.js +36 -14
  39. package/js/src/bequant.js +1 -0
  40. package/js/src/binanceusdm.js +1 -1
  41. package/js/src/bit2c.js +30 -4
  42. package/js/src/bitbank.js +32 -0
  43. package/js/src/bitbns.js +1 -1
  44. package/js/src/bitflyer.js +1 -0
  45. package/js/src/bithumb.js +34 -0
  46. package/js/src/bitmart.d.ts +24 -0
  47. package/js/src/bitmart.js +74 -7
  48. package/js/src/bitopro.js +37 -0
  49. package/js/src/blofin.js +1 -1
  50. package/js/src/bybit.js +14 -1
  51. package/js/src/coinlist.js +87 -11
  52. package/js/src/deribit.js +29 -1
  53. package/js/src/gate.js +12 -7
  54. package/js/src/hitbtc.js +7 -1
  55. package/js/src/okx.js +29 -25
  56. package/js/src/pro/ascendex.js +1 -1
  57. package/js/src/pro/bingx.js +10 -1
  58. package/js/src/pro/bitget.js +10 -1
  59. package/js/src/pro/bitmart.js +10 -1
  60. package/js/src/pro/bitopro.js +5 -4
  61. package/js/src/pro/onetrading.d.ts +7 -7
  62. package/js/src/pro/onetrading.js +7 -7
  63. package/package.json +1 -1
  64. package/js/src/abstract/bitcoincom.d.ts +0 -118
  65. package/js/src/abstract/bitcoincom.js +0 -11
  66. package/js/src/abstract/bitfinex1.d.ts +0 -72
  67. package/js/src/abstract/bitfinex1.js +0 -11
  68. package/js/src/abstract/bitpanda.d.ts +0 -26
  69. package/js/src/abstract/bitpanda.js +0 -11
  70. package/js/src/abstract/poloniexfutures.d.ts +0 -51
  71. package/js/src/abstract/poloniexfutures.js +0 -11
  72. package/js/src/abstract/wazirx.d.ts +0 -33
  73. package/js/src/abstract/wazirx.js +0 -11
  74. package/js/src/bitcoincom.d.ts +0 -4
  75. package/js/src/bitcoincom.js +0 -18
  76. package/js/src/bitpanda.d.ts +0 -4
  77. package/js/src/bitpanda.js +0 -17
  78. package/js/src/poloniexfutures.d.ts +0 -321
  79. package/js/src/poloniexfutures.js +0 -1941
  80. package/js/src/pro/bitcoincom.d.ts +0 -4
  81. package/js/src/pro/bitcoincom.js +0 -34
  82. package/js/src/pro/bitpanda.d.ts +0 -4
  83. package/js/src/pro/bitpanda.js +0 -17
  84. package/js/src/pro/poloniexfutures.d.ts +0 -108
  85. package/js/src/pro/poloniexfutures.js +0 -1042
  86. package/js/src/pro/wazirx.d.ts +0 -102
  87. package/js/src/pro/wazirx.js +0 -784
  88. package/js/src/static_dependencies/starknet/utils/json.d.ts +0 -24
  89. package/js/src/static_dependencies/starknet/utils/json.js +0 -43
@@ -158,6 +158,7 @@ export default class coinlist extends Exchange {
158
158
  'v1/leaderboard': 1,
159
159
  'v1/affiliate/{competition_code}': 1,
160
160
  'v1/competition/{competition_id}': 1,
161
+ 'v1/symbols/{symbol}/funding': 1,
161
162
  },
162
163
  },
163
164
  'private': {
@@ -181,6 +182,7 @@ export default class coinlist extends Exchange {
181
182
  'v1/credits': 1,
182
183
  'v1/positions': 1,
183
184
  'v1/accounts/{trader_id}/competitions': 1,
185
+ 'v1/closedPositions': 1,
184
186
  },
185
187
  'post': {
186
188
  'v1/keys': 1,
@@ -199,6 +201,9 @@ export default class coinlist extends Exchange {
199
201
  'v1/orders/{order_id}': 1,
200
202
  'v1/orders/bulk': 1, // not unified
201
203
  },
204
+ 'put': {
205
+ 'v1/accounts/{trader_id}/alias': 1,
206
+ },
202
207
  'delete': {
203
208
  'v1/keys/{key}': 1,
204
209
  'v1/orders': 1,
@@ -490,7 +495,7 @@ export default class coinlist extends Exchange {
490
495
  // {
491
496
  // "symbols": [
492
497
  // {
493
- // "symbol": "CQT-USDT",
498
+ // "symbol": "CQT-USDT", // spot
494
499
  // "base_currency": "CQT",
495
500
  // "is_trader_geofenced": false,
496
501
  // "list_time": "2021-06-15T00:00:00.000Z",
@@ -515,6 +520,62 @@ export default class coinlist extends Exchange {
515
520
  return this.parseMarkets(markets);
516
521
  }
517
522
  parseMarket(market) {
523
+ // perp
524
+ // {
525
+ // "symbol":"BTC-PERP",
526
+ // "base_currency":"BTC",
527
+ // "is_trader_geofenced":false,
528
+ // "expiry_name":null,
529
+ // "expiry_time":null,
530
+ // "list_time":"2024-09-16T00:00:00.000Z",
531
+ // "type":"perp-swap",
532
+ // "series_code":"BTC",
533
+ // "long_name":"Bitcoin",
534
+ // "asset_class":"CRYPTO",
535
+ // "minimum_price_increment":"0.01",
536
+ // "minimum_size_increment":"0.0001",
537
+ // "quote_currency":"USDT",
538
+ // "multiplier":"1",
539
+ // "contract_frequency":"FGHJKMNQUVXZ",
540
+ // "index_code":".BTC-USDT",
541
+ // "price_band_threshold_market":"0.05",
542
+ // "price_band_threshold_limit":"0.25",
543
+ // "maintenance_initial_ratio":"0.500000000000000000",
544
+ // "liquidation_initial_ratio":"0.500000000000000000",
545
+ // "last_price":"75881.36000000",
546
+ // "fair_price":"76256.00000000",
547
+ // "index_price":"77609.90000000",
548
+ // "mark_price":"76237.75000000",
549
+ // "mark_price_dollarizer":"0.99950000",
550
+ // "funding_interval":{
551
+ // "hours":"8"
552
+ // },
553
+ // "funding_rate_index_code":".BTC-USDT-FR8H",
554
+ // "initial_margin_base":"0.200000000000000000",
555
+ // "initial_margin_per_contract":"0.160000000000000000",
556
+ // "position_limit":"5.0000"
557
+ // }
558
+ // spot
559
+ // {
560
+ // "symbol": "CQT-USDT", // spot
561
+ // "base_currency": "CQT",
562
+ // "is_trader_geofenced": false,
563
+ // "list_time": "2021-06-15T00:00:00.000Z",
564
+ // "type": "spot",
565
+ // "series_code": "CQT-USDT-SPOT",
566
+ // "long_name": "Covalent",
567
+ // "asset_class": "CRYPTO",
568
+ // "minimum_price_increment": "0.0001",
569
+ // "minimum_size_increment": "0.0001",
570
+ // "quote_currency": "USDT",
571
+ // "index_code": null,
572
+ // "price_band_threshold_market": "0.05",
573
+ // "price_band_threshold_limit": "0.25",
574
+ // "last_price": "0.12160000",
575
+ // "fair_price": "0.12300000",
576
+ // "index_price": null
577
+ // }
578
+ const isSwap = this.safeString(market, 'type') === 'perp-swap';
518
579
  const id = this.safeString(market, 'symbol');
519
580
  const baseId = this.safeString(market, 'base_currency');
520
581
  const quoteId = this.safeString(market, 'quote_currency');
@@ -523,26 +584,41 @@ export default class coinlist extends Exchange {
523
584
  const amountPrecision = this.safeString(market, 'minimum_size_increment');
524
585
  const pricePrecision = this.safeString(market, 'minimum_price_increment');
525
586
  const created = this.safeString(market, 'list_time');
587
+ let settledId = undefined;
588
+ let settled = undefined;
589
+ let linear = undefined;
590
+ let inverse = undefined;
591
+ let contractSize = undefined;
592
+ let symbol = base + '/' + quote;
593
+ if (isSwap) {
594
+ contractSize = this.parseNumber('1');
595
+ linear = true;
596
+ inverse = false;
597
+ settledId = quoteId;
598
+ settled = quote;
599
+ symbol = symbol + ':' + quote;
600
+ }
601
+ const type = isSwap ? 'swap' : 'spot';
526
602
  return {
527
603
  'id': id,
528
- 'symbol': base + '/' + quote,
604
+ 'symbol': symbol,
529
605
  'base': base,
530
606
  'quote': quote,
531
- 'settle': undefined,
607
+ 'settle': settled,
532
608
  'baseId': baseId,
533
609
  'quoteId': quoteId,
534
- 'settleId': undefined,
535
- 'type': 'spot',
536
- 'spot': true,
610
+ 'settleId': settledId,
611
+ 'type': type,
612
+ 'spot': !isSwap,
537
613
  'margin': false,
538
- 'swap': false,
614
+ 'swap': isSwap,
539
615
  'future': false,
540
616
  'option': false,
541
617
  'active': true,
542
- 'contract': false,
543
- 'linear': undefined,
544
- 'inverse': undefined,
545
- 'contractSize': undefined,
618
+ 'contract': isSwap,
619
+ 'linear': linear,
620
+ 'inverse': inverse,
621
+ 'contractSize': contractSize,
546
622
  'expiry': undefined,
547
623
  'expiryDatetime': undefined,
548
624
  'strike': undefined,
package/js/src/deribit.js CHANGED
@@ -1336,8 +1336,21 @@ export default class deribit extends Exchange {
1336
1336
  async fetchTickers(symbols = undefined, params = {}) {
1337
1337
  await this.loadMarkets();
1338
1338
  symbols = this.marketSymbols(symbols);
1339
- const code = this.safeString2(params, 'code', 'currency');
1339
+ let code = this.safeString2(params, 'code', 'currency');
1340
+ let type = undefined;
1340
1341
  params = this.omit(params, ['code']);
1342
+ if (symbols !== undefined) {
1343
+ for (let i = 0; i < symbols.length; i++) {
1344
+ const market = this.market(symbols[i]);
1345
+ if (code !== undefined && code !== market['base']) {
1346
+ throw new BadRequest(this.id + ' fetchTickers the base currency must be the same for all symbols, this endpoint only supports one base currency at a time. Read more about it here: https://docs.deribit.com/#public-get_book_summary_by_currency');
1347
+ }
1348
+ if (code === undefined) {
1349
+ code = market['base'];
1350
+ type = market['type'];
1351
+ }
1352
+ }
1353
+ }
1341
1354
  if (code === undefined) {
1342
1355
  throw new ArgumentsRequired(this.id + ' fetchTickers requires a currency/code (eg: BTC/ETH/USDT) parameter to fetch tickers for');
1343
1356
  }
@@ -1345,6 +1358,21 @@ export default class deribit extends Exchange {
1345
1358
  const request = {
1346
1359
  'currency': currency['id'],
1347
1360
  };
1361
+ if (type !== undefined) {
1362
+ let requestType = undefined;
1363
+ if (type === 'spot') {
1364
+ requestType = 'spot';
1365
+ }
1366
+ else if (type === 'future' || (type === 'contract')) {
1367
+ requestType = 'future';
1368
+ }
1369
+ else if (type === 'option') {
1370
+ requestType = 'option';
1371
+ }
1372
+ if (requestType !== undefined) {
1373
+ request['kind'] = requestType;
1374
+ }
1375
+ }
1348
1376
  const response = await this.publicGetGetBookSummaryByCurrency(this.extend(request, params));
1349
1377
  //
1350
1378
  // {
package/js/src/gate.js CHANGED
@@ -1485,6 +1485,11 @@ export default class gate extends Exchange {
1485
1485
  const takerPercent = this.safeString(market, 'taker_fee_rate');
1486
1486
  const makerPercent = this.safeString(market, 'maker_fee_rate', takerPercent);
1487
1487
  const isLinear = quote === settle;
1488
+ let contractSize = this.safeString(market, 'quanto_multiplier');
1489
+ // exception only for one market: https://api.gateio.ws/api/v4/futures/btc/contracts
1490
+ if (contractSize === '0') {
1491
+ contractSize = '1'; // 1 USD in WEB: https://i.imgur.com/MBBUI04.png
1492
+ }
1488
1493
  return {
1489
1494
  'id': id,
1490
1495
  'symbol': symbol,
@@ -1506,7 +1511,7 @@ export default class gate extends Exchange {
1506
1511
  'inverse': !isLinear,
1507
1512
  'taker': this.parseNumber(Precise.stringDiv(takerPercent, '100')),
1508
1513
  'maker': this.parseNumber(Precise.stringDiv(makerPercent, '100')),
1509
- 'contractSize': this.safeNumber(market, 'quanto_multiplier'),
1514
+ 'contractSize': this.parseNumber(contractSize),
1510
1515
  'expiry': expiry,
1511
1516
  'expiryDatetime': this.iso8601(expiry),
1512
1517
  'strike': undefined,
@@ -1851,9 +1856,9 @@ export default class gate extends Exchange {
1851
1856
  const partFirst = this.safeString(parts, 0);
1852
1857
  // if there's an underscore then the second part is always the chain name (except the _OLD suffix)
1853
1858
  const currencyName = currencyId.endsWith('_OLD') ? currencyId : partFirst;
1854
- const withdrawEnabled = !this.safeBool(entry, 'withdraw_disabled');
1855
- const depositEnabled = !this.safeBool(entry, 'deposit_disabled');
1856
- const tradeDisabled = !this.safeBool(entry, 'trade_disabled');
1859
+ const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
1860
+ const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
1861
+ const tradeDisabled = this.safeBool(entry, 'trade_disabled', false);
1857
1862
  const precision = this.parseNumber('0.0001'); // temporary safe default, because no value provided from API
1858
1863
  const code = this.safeCurrencyCode(currencyName);
1859
1864
  // check leveraged tokens (e.g. BTC3S, ETH5L)
@@ -1883,8 +1888,8 @@ export default class gate extends Exchange {
1883
1888
  },
1884
1889
  },
1885
1890
  'active': !tradeDisabled,
1886
- 'deposit': depositEnabled,
1887
- 'withdraw': withdrawEnabled,
1891
+ 'deposit': !depositDisabled,
1892
+ 'withdraw': !withdrawDisabled,
1888
1893
  'fee': undefined,
1889
1894
  'precision': precision,
1890
1895
  };
@@ -6761,7 +6766,7 @@ export default class gate extends Exchange {
6761
6766
  queryString = this.urlencode(query);
6762
6767
  // https://github.com/ccxt/ccxt/issues/25570
6763
6768
  if (queryString.indexOf('currencies=') >= 0 && queryString.indexOf('%2C') >= 0) {
6764
- queryString = queryString.replaceAll('%2', ',');
6769
+ queryString = queryString.replaceAll('%2C', ',');
6765
6770
  }
6766
6771
  url += '?' + queryString;
6767
6772
  }
package/js/src/hitbtc.js CHANGED
@@ -30,7 +30,7 @@ export default class hitbtc extends Exchange {
30
30
  'margin': true,
31
31
  'swap': true,
32
32
  'future': false,
33
- 'option': undefined,
33
+ 'option': false,
34
34
  'addMargin': true,
35
35
  'cancelAllOrders': true,
36
36
  'cancelOrder': true,
@@ -62,6 +62,7 @@ export default class hitbtc extends Exchange {
62
62
  'fetchFundingRate': true,
63
63
  'fetchFundingRateHistory': true,
64
64
  'fetchFundingRates': true,
65
+ 'fetchGreeks': false,
65
66
  'fetchIndexOHLCV': true,
66
67
  'fetchIsolatedBorrowRate': false,
67
68
  'fetchIsolatedBorrowRates': false,
@@ -74,6 +75,7 @@ export default class hitbtc extends Exchange {
74
75
  'fetchMarkets': true,
75
76
  'fetchMarkOHLCV': true,
76
77
  'fetchMyLiquidations': false,
78
+ 'fetchMySettlementHistory': false,
77
79
  'fetchMyTrades': true,
78
80
  'fetchOHLCV': true,
79
81
  'fetchOpenInterest': true,
@@ -81,6 +83,8 @@ export default class hitbtc extends Exchange {
81
83
  'fetchOpenInterests': true,
82
84
  'fetchOpenOrder': true,
83
85
  'fetchOpenOrders': true,
86
+ 'fetchOption': false,
87
+ 'fetchOptionChain': false,
84
88
  'fetchOrder': true,
85
89
  'fetchOrderBook': true,
86
90
  'fetchOrderBooks': true,
@@ -89,12 +93,14 @@ export default class hitbtc extends Exchange {
89
93
  'fetchPosition': true,
90
94
  'fetchPositions': true,
91
95
  'fetchPremiumIndexOHLCV': true,
96
+ 'fetchSettlementHistory': false,
92
97
  'fetchTicker': true,
93
98
  'fetchTickers': true,
94
99
  'fetchTrades': true,
95
100
  'fetchTradingFee': true,
96
101
  'fetchTradingFees': true,
97
102
  'fetchTransactions': 'emulated',
103
+ 'fetchVolatilityHistory': false,
98
104
  'fetchWithdrawals': true,
99
105
  'reduceMargin': true,
100
106
  'sandbox': true,
package/js/src/okx.js CHANGED
@@ -1271,6 +1271,7 @@ export default class okx extends Exchange {
1271
1271
  },
1272
1272
  'fetchOHLCV': {
1273
1273
  'limit': 300,
1274
+ 'historical': 100,
1274
1275
  },
1275
1276
  },
1276
1277
  'spot': {
@@ -1823,33 +1824,32 @@ export default class okx extends Exchange {
1823
1824
  const chainsLength = chains.length;
1824
1825
  for (let j = 0; j < chainsLength; j++) {
1825
1826
  const chain = chains[j];
1826
- const networkId = this.safeString(chain, 'chain'); // USDT-BEP20, USDT-Avalance-C, etc
1827
- if (networkId !== undefined) {
1828
- const idParts = networkId.split('-');
1829
- const parts = this.arraySlice(idParts, 1);
1830
- const chainPart = parts.join('-');
1831
- const networkCode = this.networkIdToCode(chainPart, currency['code']);
1832
- networks[networkCode] = {
1833
- 'id': networkId,
1834
- 'network': networkCode,
1835
- 'active': undefined,
1836
- 'deposit': this.safeBool(chain, 'canDep'),
1837
- 'withdraw': this.safeBool(chain, 'canWd'),
1838
- 'fee': this.safeNumber(chain, 'fee'),
1839
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
1840
- 'limits': {
1841
- 'withdraw': {
1842
- 'min': this.safeNumber(chain, 'minWd'),
1843
- 'max': this.safeNumber(chain, 'maxWd'),
1844
- },
1845
- },
1846
- 'info': chain,
1847
- };
1848
- }
1849
- else {
1850
- // only happens for FIAT currency
1827
+ // allow empty string for rare fiat-currencies, e.g. TRY
1828
+ const networkId = this.safeString(chain, 'chain', ''); // USDT-BEP20, USDT-Avalance-C, etc
1829
+ if (networkId === '') {
1830
+ // only happens for fiat 'TRY' currency
1851
1831
  type = 'fiat';
1852
1832
  }
1833
+ const idParts = networkId.split('-');
1834
+ const parts = this.arraySlice(idParts, 1);
1835
+ const chainPart = parts.join('-');
1836
+ const networkCode = this.networkIdToCode(chainPart, currency['code']);
1837
+ networks[networkCode] = {
1838
+ 'id': networkId,
1839
+ 'network': networkCode,
1840
+ 'active': undefined,
1841
+ 'deposit': this.safeBool(chain, 'canDep'),
1842
+ 'withdraw': this.safeBool(chain, 'canWd'),
1843
+ 'fee': this.safeNumber(chain, 'fee'),
1844
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'wdTickSz'))),
1845
+ 'limits': {
1846
+ 'withdraw': {
1847
+ 'min': this.safeNumber(chain, 'minWd'),
1848
+ 'max': this.safeNumber(chain, 'maxWd'),
1849
+ },
1850
+ },
1851
+ 'info': chain,
1852
+ };
1853
1853
  }
1854
1854
  const firstChain = this.safeDict(chains, 0, {});
1855
1855
  result[code] = this.safeCurrencyStructure({
@@ -2409,6 +2409,9 @@ export default class okx extends Exchange {
2409
2409
  if (limit === undefined) {
2410
2410
  limit = 100; // default 100, max 100
2411
2411
  }
2412
+ else {
2413
+ limit = Math.min(limit, 300); // max 100
2414
+ }
2412
2415
  const duration = this.parseTimeframe(timeframe);
2413
2416
  let bar = this.safeString(this.timeframes, timeframe, timeframe);
2414
2417
  if ((timezone === 'UTC') && (duration >= 21600)) { // if utc and timeframe >= 6h
@@ -2427,6 +2430,7 @@ export default class okx extends Exchange {
2427
2430
  const historyBorder = now - ((1440 - 1) * durationInMilliseconds);
2428
2431
  if (since < historyBorder) {
2429
2432
  defaultType = 'HistoryCandles';
2433
+ limit = Math.min(limit, 100); // max 100 for historical endpoint
2430
2434
  }
2431
2435
  const startTime = Math.max(since - 1, 0);
2432
2436
  request['before'] = startTime;
@@ -426,7 +426,7 @@ export default class ascendex extends ascendexRest {
426
426
  //
427
427
  // {
428
428
  // "m": "balance",
429
- // "accountId": "cshQtyfq8XLAA9kcf19h8bXHbAwwoqDo",
429
+ // "accountId": "cshQtyfq8XLAA9kcf19h8bXHbAwwoqEo",
430
430
  // "ac": "CASH",
431
431
  // "data": {
432
432
  // "a" : "USDT",
@@ -80,6 +80,9 @@ export default class bingx extends bingxRest {
80
80
  'depth': 100,
81
81
  'interval': 500, // 100, 200, 500, 1000
82
82
  },
83
+ 'watchTrades': {
84
+ 'ignoreDuplicates': true,
85
+ },
83
86
  },
84
87
  'streaming': {
85
88
  'keepAlive': 1800000, // 30 minutes
@@ -501,7 +504,13 @@ export default class bingx extends bingxRest {
501
504
  if (this.newUpdates) {
502
505
  limit = trades.getLimit(symbol, limit);
503
506
  }
504
- return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
507
+ const result = this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
508
+ if (this.handleOption('watchTrades', 'ignoreDuplicates', true)) {
509
+ let filtered = this.removeRepeatedTradesFromArray(result);
510
+ filtered = this.sortBy(filtered, 'timestamp');
511
+ return filtered;
512
+ }
513
+ return result;
505
514
  }
506
515
  handleTrades(client, message) {
507
516
  //
@@ -73,6 +73,9 @@ export default class bitget extends bitgetRest {
73
73
  'watchOrderBook': {
74
74
  'checksum': true,
75
75
  },
76
+ 'watchTrades': {
77
+ 'ignoreDuplicates': true,
78
+ },
76
79
  },
77
80
  'streaming': {
78
81
  'ping': this.ping,
@@ -790,7 +793,13 @@ export default class bitget extends bitgetRest {
790
793
  const tradeSymbol = this.safeString(first, 'symbol');
791
794
  limit = trades.getLimit(tradeSymbol, limit);
792
795
  }
793
- return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
796
+ const result = this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
797
+ if (this.handleOption('watchTrades', 'ignoreDuplicates', true)) {
798
+ let filtered = this.removeRepeatedTradesFromArray(result);
799
+ filtered = this.sortBy(filtered, 'timestamp');
800
+ return filtered;
801
+ }
802
+ return result;
794
803
  }
795
804
  /**
796
805
  * @method
@@ -66,6 +66,9 @@ export default class bitmart extends bitmartRest {
66
66
  'watchOrderBookForSymbols': {
67
67
  'depth': 'depth/increase100',
68
68
  },
69
+ 'watchTrades': {
70
+ 'ignoreDuplicates': true,
71
+ },
69
72
  'ws': {
70
73
  'inflate': true,
71
74
  },
@@ -311,7 +314,13 @@ export default class bitmart extends bitmartRest {
311
314
  const tradeSymbol = this.safeString(first, 'symbol');
312
315
  limit = trades.getLimit(tradeSymbol, limit);
313
316
  }
314
- return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
317
+ const result = this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
318
+ if (this.handleOption('watchTrades', 'ignoreDuplicates', true)) {
319
+ let filtered = this.removeRepeatedTradesFromArray(result);
320
+ filtered = this.sortBy(filtered, 'timestamp');
321
+ return filtered;
322
+ }
323
+ return result;
315
324
  }
316
325
  getParamsForMultipleSub(methodName, symbols, limit = undefined, params = {}) {
317
326
  symbols = this.marketSymbols(symbols, undefined, false, true);
@@ -358,15 +358,16 @@ export default class bitopro extends bitoproRest {
358
358
  // }
359
359
  //
360
360
  const marketId = this.safeString(message, 'pair');
361
- const market = this.safeMarket(marketId, undefined, '_');
361
+ // market-ids are lowercase in REST API and uppercase in WS API
362
+ const market = this.safeMarket(marketId.toLowerCase(), undefined, '_');
362
363
  const symbol = market['symbol'];
363
364
  const event = this.safeString(message, 'event');
364
365
  const messageHash = event + ':' + symbol;
365
- const result = this.parseTicker(message);
366
+ const result = this.parseTicker(message, market);
367
+ result['symbol'] = this.safeString(market, 'symbol'); // symbol returned from REST's parseTicker is distorted for WS, so re-set it from market object
366
368
  const timestamp = this.safeInteger(message, 'timestamp');
367
- const datetime = this.safeString(message, 'datetime');
368
369
  result['timestamp'] = timestamp;
369
- result['datetime'] = datetime;
370
+ result['datetime'] = this.iso8601(timestamp); // we shouldn't set "datetime" string provided by server, as those values are obviously wrong offset from UTC
370
371
  this.tickers[symbol] = result;
371
372
  client.resolve(result, messageHash);
372
373
  }
@@ -5,7 +5,7 @@ export default class onetrading extends onetradingRest {
5
5
  describe(): any;
6
6
  /**
7
7
  * @method
8
- * @name bitpanda#watchBalance
8
+ * @name onetrading#watchBalance
9
9
  * @see https://developers.bitpanda.com/exchange/#account-history-channel
10
10
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
11
11
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -15,7 +15,7 @@ export default class onetrading extends onetradingRest {
15
15
  handleBalanceSnapshot(client: any, message: any): void;
16
16
  /**
17
17
  * @method
18
- * @name bitpanda#watchTicker
18
+ * @name onetrading#watchTicker
19
19
  * @see https://developers.bitpanda.com/exchange/#market-ticker-channel
20
20
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
21
21
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -25,7 +25,7 @@ export default class onetrading extends onetradingRest {
25
25
  watchTicker(symbol: string, params?: {}): Promise<Ticker>;
26
26
  /**
27
27
  * @method
28
- * @name bitpanda#watchTickers
28
+ * @name onetrading#watchTickers
29
29
  * @see https://developers.bitpanda.com/exchange/#market-ticker-channel
30
30
  * @description watches price tickers, a statistical calculation with the information for all markets or those specified.
31
31
  * @param {string} symbols unified symbols of the markets to fetch the ticker for
@@ -37,7 +37,7 @@ export default class onetrading extends onetradingRest {
37
37
  parseWSTicker(ticker: any, market?: any): Ticker;
38
38
  /**
39
39
  * @method
40
- * @name bitpanda#watchMyTrades
40
+ * @name onetrading#watchMyTrades
41
41
  * @see https://developers.bitpanda.com/exchange/#account-history-channel
42
42
  * @description get the list of trades associated with the user
43
43
  * @param {string} symbol unified symbol of the market to fetch trades for. Use 'any' to watch all trades
@@ -49,7 +49,7 @@ export default class onetrading extends onetradingRest {
49
49
  watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
50
50
  /**
51
51
  * @method
52
- * @name bitpanda#watchOrderBook
52
+ * @name onetrading#watchOrderBook
53
53
  * @see https://developers.bitpanda.com/exchange/#market-ticker-channel
54
54
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
55
55
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -63,7 +63,7 @@ export default class onetrading extends onetradingRest {
63
63
  handleDeltas(orderbook: any, deltas: any): void;
64
64
  /**
65
65
  * @method
66
- * @name bitpanda#watchOrders
66
+ * @name onetrading#watchOrders
67
67
  * @see https://developers.bitpanda.com/exchange/#account-history-channel
68
68
  * @description watches information on multiple orders made by the user
69
69
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -83,7 +83,7 @@ export default class onetrading extends onetradingRest {
83
83
  updateBalance(balance: any): void;
84
84
  /**
85
85
  * @method
86
- * @name bitpanda#watchOHLCV
86
+ * @name onetrading#watchOHLCV
87
87
  * @see https://developers.bitpanda.com/exchange/#candlesticks-channel
88
88
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
89
89
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -77,7 +77,7 @@ export default class onetrading extends onetradingRest {
77
77
  }
78
78
  /**
79
79
  * @method
80
- * @name bitpanda#watchBalance
80
+ * @name onetrading#watchBalance
81
81
  * @see https://developers.bitpanda.com/exchange/#account-history-channel
82
82
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
83
83
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -136,7 +136,7 @@ export default class onetrading extends onetradingRest {
136
136
  }
137
137
  /**
138
138
  * @method
139
- * @name bitpanda#watchTicker
139
+ * @name onetrading#watchTicker
140
140
  * @see https://developers.bitpanda.com/exchange/#market-ticker-channel
141
141
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
142
142
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -162,7 +162,7 @@ export default class onetrading extends onetradingRest {
162
162
  }
163
163
  /**
164
164
  * @method
165
- * @name bitpanda#watchTickers
165
+ * @name onetrading#watchTickers
166
166
  * @see https://developers.bitpanda.com/exchange/#market-ticker-channel
167
167
  * @description watches price tickers, a statistical calculation with the information for all markets or those specified.
168
168
  * @param {string} symbols unified symbols of the markets to fetch the ticker for
@@ -258,7 +258,7 @@ export default class onetrading extends onetradingRest {
258
258
  }
259
259
  /**
260
260
  * @method
261
- * @name bitpanda#watchMyTrades
261
+ * @name onetrading#watchMyTrades
262
262
  * @see https://developers.bitpanda.com/exchange/#account-history-channel
263
263
  * @description get the list of trades associated with the user
264
264
  * @param {string} symbol unified symbol of the market to fetch trades for. Use 'any' to watch all trades
@@ -302,7 +302,7 @@ export default class onetrading extends onetradingRest {
302
302
  }
303
303
  /**
304
304
  * @method
305
- * @name bitpanda#watchOrderBook
305
+ * @name onetrading#watchOrderBook
306
306
  * @see https://developers.bitpanda.com/exchange/#market-ticker-channel
307
307
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
308
308
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -419,7 +419,7 @@ export default class onetrading extends onetradingRest {
419
419
  }
420
420
  /**
421
421
  * @method
422
- * @name bitpanda#watchOrders
422
+ * @name onetrading#watchOrders
423
423
  * @see https://developers.bitpanda.com/exchange/#account-history-channel
424
424
  * @description watches information on multiple orders made by the user
425
425
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1034,7 +1034,7 @@ export default class onetrading extends onetradingRest {
1034
1034
  }
1035
1035
  /**
1036
1036
  * @method
1037
- * @name bitpanda#watchOHLCV
1037
+ * @name onetrading#watchOHLCV
1038
1038
  * @see https://developers.bitpanda.com/exchange/#candlesticks-channel
1039
1039
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1040
1040
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.4.73",
3
+ "version": "4.4.75",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",