ccxt 4.5.6 → 4.5.7

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 (84) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/apex.js +2 -2
  5. package/dist/cjs/src/binance.js +3 -0
  6. package/dist/cjs/src/bitbank.js +1 -0
  7. package/dist/cjs/src/bitbns.js +1 -0
  8. package/dist/cjs/src/bitflyer.js +1 -0
  9. package/dist/cjs/src/bithumb.js +1 -0
  10. package/dist/cjs/src/bitso.js +1 -0
  11. package/dist/cjs/src/bitvavo.js +26 -40
  12. package/dist/cjs/src/blockchaincom.js +1 -0
  13. package/dist/cjs/src/btcalpha.js +1 -0
  14. package/dist/cjs/src/btcbox.js +1 -0
  15. package/dist/cjs/src/btcmarkets.js +1 -0
  16. package/dist/cjs/src/btcturk.js +1 -0
  17. package/dist/cjs/src/deribit.js +3 -2
  18. package/dist/cjs/src/digifinex.js +1 -1
  19. package/dist/cjs/src/gate.js +8 -12
  20. package/dist/cjs/src/gemini.js +3 -3
  21. package/dist/cjs/src/htx.js +11 -1
  22. package/dist/cjs/src/independentreserve.js +1 -0
  23. package/dist/cjs/src/indodax.js +17 -6
  24. package/dist/cjs/src/kraken.js +25 -6
  25. package/dist/cjs/src/krakenfutures.js +1 -0
  26. package/dist/cjs/src/mercado.js +1 -0
  27. package/dist/cjs/src/mexc.js +80 -36
  28. package/dist/cjs/src/novadax.js +1 -0
  29. package/dist/cjs/src/oceanex.js +1 -0
  30. package/dist/cjs/src/okx.js +18 -5
  31. package/dist/cjs/src/pro/apex.js +7 -4
  32. package/dist/cjs/src/pro/backpack.js +6 -4
  33. package/dist/cjs/src/pro/bingx.js +206 -220
  34. package/dist/cjs/src/pro/htx.js +1 -1
  35. package/dist/cjs/src/upbit.js +1 -0
  36. package/dist/cjs/src/wavesexchange.js +1 -0
  37. package/dist/cjs/src/yobit.js +1 -0
  38. package/dist/cjs/src/zaif.js +1 -0
  39. package/dist/cjs/src/zonda.js +1 -0
  40. package/js/ccxt.d.ts +1 -1
  41. package/js/ccxt.js +1 -1
  42. package/js/src/abstract/mexc.d.ts +1 -0
  43. package/js/src/apex.js +2 -2
  44. package/js/src/binance.js +3 -0
  45. package/js/src/bitbank.js +1 -0
  46. package/js/src/bitbns.js +1 -0
  47. package/js/src/bitflyer.js +1 -0
  48. package/js/src/bithumb.js +1 -0
  49. package/js/src/bitso.js +1 -0
  50. package/js/src/bitvavo.d.ts +0 -2
  51. package/js/src/bitvavo.js +27 -41
  52. package/js/src/blockchaincom.js +1 -0
  53. package/js/src/btcalpha.js +1 -0
  54. package/js/src/btcbox.js +1 -0
  55. package/js/src/btcmarkets.js +1 -0
  56. package/js/src/btcturk.js +1 -0
  57. package/js/src/deribit.js +3 -2
  58. package/js/src/digifinex.js +1 -1
  59. package/js/src/gate.d.ts +2 -2
  60. package/js/src/gate.js +8 -12
  61. package/js/src/gemini.js +3 -3
  62. package/js/src/htx.js +11 -1
  63. package/js/src/independentreserve.js +1 -0
  64. package/js/src/indodax.js +17 -6
  65. package/js/src/kraken.d.ts +1 -1
  66. package/js/src/kraken.js +25 -6
  67. package/js/src/krakenfutures.js +1 -0
  68. package/js/src/mercado.js +1 -0
  69. package/js/src/mexc.d.ts +4 -1
  70. package/js/src/mexc.js +80 -36
  71. package/js/src/novadax.js +1 -0
  72. package/js/src/oceanex.js +1 -0
  73. package/js/src/okx.js +18 -5
  74. package/js/src/pro/apex.js +7 -4
  75. package/js/src/pro/backpack.js +6 -4
  76. package/js/src/pro/bingx.d.ts +53 -33
  77. package/js/src/pro/bingx.js +207 -221
  78. package/js/src/pro/htx.js +1 -1
  79. package/js/src/upbit.js +1 -0
  80. package/js/src/wavesexchange.js +1 -0
  81. package/js/src/yobit.js +1 -0
  82. package/js/src/zaif.js +1 -0
  83. package/js/src/zonda.js +1 -0
  84. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -194,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
194
194
 
195
195
  //-----------------------------------------------------------------------------
196
196
  // this is updated by vss.js when building
197
- const version = '4.5.6';
197
+ const version = '4.5.7';
198
198
  Exchange["default"].ccxtVersion = version;
199
199
  const exchanges = {
200
200
  'alpaca': alpaca["default"],
@@ -805,9 +805,9 @@ class apex extends apex$1["default"] {
805
805
  limit = 200; // default is 200 when requested with `since`
806
806
  }
807
807
  request['limit'] = limit; // max 200, default 200
808
- [request, params] = this.handleUntilOption('end', request, params);
808
+ [request, params] = this.handleUntilOption('end', request, params, 0.001);
809
809
  if (since !== undefined) {
810
- request['start'] = since;
810
+ request['start'] = Math.floor(since / 1000);
811
811
  }
812
812
  const response = await this.publicGetV3Klines(this.extend(request, params));
813
813
  const data = this.safeDict(response, 'data', {});
@@ -12067,6 +12067,9 @@ class binance extends binance$1["default"] {
12067
12067
  }
12068
12068
  else if ((api === 'private') || (api === 'eapiPrivate') || (api === 'sapi' && path !== 'system/status') || (api === 'sapiV2') || (api === 'sapiV3') || (api === 'sapiV4') || (api === 'dapiPrivate') || (api === 'dapiPrivateV2') || (api === 'fapiPrivate') || (api === 'fapiPrivateV2') || (api === 'fapiPrivateV3') || (api === 'papi' && path !== 'ping')) {
12069
12069
  this.checkRequiredCredentials();
12070
+ if ((url.indexOf('testnet.binancefuture.com') > -1) && this.isSandboxModeEnabled && (!this.safeBool(this.options, 'disableFuturesSandboxWarning'))) {
12071
+ throw new errors.NotSupported(this.id + ' testnet/sandbox mode is not supported for futures anymore, please check the deprecation announcement https://t.me/ccxt_announcements/92 and consider using the demo trading instead.');
12072
+ }
12070
12073
  if (method === 'POST' && ((path === 'order') || (path === 'sor/order'))) {
12071
12074
  // inject in implicit API calls
12072
12075
  const newClientOrderId = this.safeString(params, 'newClientOrderId');
@@ -48,6 +48,7 @@ class bitbank extends bitbank$1["default"] {
48
48
  'fetchBorrowRatesPerSymbol': false,
49
49
  'fetchCrossBorrowRate': false,
50
50
  'fetchCrossBorrowRates': false,
51
+ 'fetchCurrencies': false,
51
52
  'fetchDepositAddress': true,
52
53
  'fetchDepositAddresses': false,
53
54
  'fetchDepositAddressesByNetwork': false,
@@ -37,6 +37,7 @@ class bitbns extends bitbns$1["default"] {
37
37
  'createStopOrder': true,
38
38
  'createTriggerOrder': true,
39
39
  'fetchBalance': true,
40
+ 'fechCurrencies': false,
40
41
  'fetchDepositAddress': true,
41
42
  'fetchDepositAddresses': false,
42
43
  'fetchDepositAddressesByNetwork': false,
@@ -35,6 +35,7 @@ class bitflyer extends bitflyer$1["default"] {
35
35
  'createOrder': true,
36
36
  'fetchBalance': true,
37
37
  'fetchClosedOrders': 'emulated',
38
+ 'fetchCurrencies': false,
38
39
  'fetchDeposits': true,
39
40
  'fetchFundingRate': true,
40
41
  'fetchFundingRateHistory': false,
@@ -50,6 +50,7 @@ class bithumb extends bithumb$1["default"] {
50
50
  'fetchBorrowRatesPerSymbol': false,
51
51
  'fetchCrossBorrowRate': false,
52
52
  'fetchCrossBorrowRates': false,
53
+ 'fetchCurrencies': false,
53
54
  'fetchFundingHistory': false,
54
55
  'fetchFundingInterval': false,
55
56
  'fetchFundingIntervals': false,
@@ -53,6 +53,7 @@ class bitso extends bitso$1["default"] {
53
53
  'fetchBorrowRatesPerSymbol': false,
54
54
  'fetchCrossBorrowRate': false,
55
55
  'fetchCrossBorrowRates': false,
56
+ 'fetchCurrencies': false,
56
57
  'fetchDeposit': true,
57
58
  'fetchDepositAddress': true,
58
59
  'fetchDepositAddresses': false,
@@ -382,26 +382,12 @@ class bitvavo extends bitvavo$1["default"] {
382
382
  'operatorId': undefined,
383
383
  'fiatCurrencies': ['EUR'], // only fiat atm
384
384
  },
385
- 'precisionMode': number.SIGNIFICANT_DIGITS,
385
+ 'precisionMode': number.TICK_SIZE,
386
386
  'commonCurrencies': {
387
387
  'MIOTA': 'IOTA', // https://github.com/ccxt/ccxt/issues/7487
388
388
  },
389
389
  });
390
390
  }
391
- amountToPrecision(symbol, amount) {
392
- // https://docs.bitfinex.com/docs/introduction#amount-precision
393
- // The amount field allows up to 8 decimals.
394
- // Anything exceeding this will be rounded to the 8th decimal.
395
- return this.decimalToPrecision(amount, number.TRUNCATE, this.markets[symbol]['precision']['amount'], number.DECIMAL_PLACES);
396
- }
397
- priceToPrecision(symbol, price) {
398
- price = this.decimalToPrecision(price, number.ROUND, this.markets[symbol]['precision']['price'], this.precisionMode);
399
- // https://docs.bitfinex.com/docs/introduction#price-precision
400
- // The precision level of all trading prices is based on significant figures.
401
- // All pairs on Bitfinex use up to 5 significant digits and up to 8 decimals (e.g. 1.2345, 123.45, 1234.5, 0.00012345).
402
- // Prices submit with a precision larger than 5 will be cut by the API.
403
- return this.decimalToPrecision(price, number.TRUNCATE, 8, number.DECIMAL_PLACES);
404
- }
405
391
  /**
406
392
  * @method
407
393
  * @name bitvavo#fetchTime
@@ -427,24 +413,27 @@ class bitvavo extends bitvavo$1["default"] {
427
413
  async fetchMarkets(params = {}) {
428
414
  const response = await this.publicGetMarkets(params);
429
415
  //
430
- // [
431
- // {
432
- // "market":"ADA-BTC",
433
- // "status":"trading", // "trading" "halted" "auction"
434
- // "base":"ADA",
435
- // "quote":"BTC",
436
- // "pricePrecision":5,
437
- // "minOrderInBaseAsset":"100",
438
- // "minOrderInQuoteAsset":"0.001",
439
- // "orderTypes": [ "market", "limit" ]
440
- // }
441
- // ]
416
+ // {
417
+ // "market": "BTC-EUR",
418
+ // "status": "trading",
419
+ // "base": "BTC",
420
+ // "quote": "EUR",
421
+ // "pricePrecision": "0", // deprecated, this is mostly 0 across other markets too, which is abnormal, so we ignore this.
422
+ // "tickSize": "1.00",
423
+ // "minOrderInBaseAsset": "0.00006100",
424
+ // "minOrderInQuoteAsset": "5.00",
425
+ // "maxOrderInBaseAsset": "1000000000.00000000",
426
+ // "maxOrderInQuoteAsset": "1000000000.00",
427
+ // "quantityDecimals": "8",
428
+ // "notionalDecimals": "2",
429
+ // "maxOpenOrders": "100",
430
+ // "feeCategory": "A",
431
+ // "orderTypes": [ "market", "limit", "stopLoss", "stopLossLimit", "takeProfit", "takeProfitLimit" ]
432
+ // }
442
433
  //
443
434
  return this.parseMarkets(response);
444
435
  }
445
436
  parseMarkets(markets) {
446
- const currencies = this.currencies;
447
- const currenciesById = this.indexBy(currencies, 'id');
448
437
  const result = [];
449
438
  const fees = this.fees;
450
439
  for (let i = 0; i < markets.length; i++) {
@@ -455,8 +444,6 @@ class bitvavo extends bitvavo$1["default"] {
455
444
  const base = this.safeCurrencyCode(baseId);
456
445
  const quote = this.safeCurrencyCode(quoteId);
457
446
  const status = this.safeString(market, 'status');
458
- const baseCurrency = this.safeValue(currenciesById, baseId);
459
- const basePrecision = this.safeInteger(baseCurrency, 'precision');
460
447
  result.push(this.safeMarketStructure({
461
448
  'id': id,
462
449
  'symbol': base + '/' + quote,
@@ -484,8 +471,9 @@ class bitvavo extends bitvavo$1["default"] {
484
471
  'taker': fees['trading']['taker'],
485
472
  'maker': fees['trading']['maker'],
486
473
  'precision': {
487
- 'amount': this.safeInteger(baseCurrency, 'decimals', basePrecision),
488
- 'price': this.safeInteger(market, 'pricePrecision'),
474
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityDecimals'))),
475
+ 'price': this.safeNumber(market, 'tickSize'),
476
+ 'cost': this.parseNumber(this.parsePrecision(this.safeString(market, 'notionalDecimals'))),
489
477
  },
490
478
  'limits': {
491
479
  'leverage': {
@@ -494,7 +482,7 @@ class bitvavo extends bitvavo$1["default"] {
494
482
  },
495
483
  'amount': {
496
484
  'min': this.safeNumber(market, 'minOrderInBaseAsset'),
497
- 'max': undefined,
485
+ 'max': this.safeNumber(market, 'maxOrderInBaseAsset'),
498
486
  },
499
487
  'price': {
500
488
  'min': undefined,
@@ -502,7 +490,7 @@ class bitvavo extends bitvavo$1["default"] {
502
490
  },
503
491
  'cost': {
504
492
  'min': this.safeNumber(market, 'minOrderInQuoteAsset'),
505
- 'max': undefined,
493
+ 'max': this.safeNumber(market, 'maxOrderInQuoteAsset'),
506
494
  },
507
495
  },
508
496
  'created': undefined,
@@ -603,7 +591,7 @@ class bitvavo extends bitvavo$1["default"] {
603
591
  const withdrawal = this.safeString(currency, 'withdrawalStatus') === 'OK';
604
592
  const active = deposit && withdrawal;
605
593
  const withdrawFee = this.safeNumber(currency, 'withdrawalFee');
606
- const precision = this.safeInteger(currency, 'decimals', 8);
594
+ const precision = this.safeString(currency, 'decimals', '8');
607
595
  const minWithdraw = this.safeNumber(currency, 'withdrawalMinAmount');
608
596
  // btw, absolutely all of them have 1 network atm
609
597
  for (let j = 0; j < networksArray.length; j++) {
@@ -617,7 +605,7 @@ class bitvavo extends bitvavo$1["default"] {
617
605
  'deposit': deposit,
618
606
  'withdraw': withdrawal,
619
607
  'fee': withdrawFee,
620
- 'precision': precision,
608
+ 'precision': this.parseNumber(this.parsePrecision(precision)),
621
609
  'limits': {
622
610
  'withdraw': {
623
611
  'min': minWithdraw,
@@ -636,7 +624,7 @@ class bitvavo extends bitvavo$1["default"] {
636
624
  'withdraw': withdrawal,
637
625
  'networks': networks,
638
626
  'fee': withdrawFee,
639
- 'precision': precision,
627
+ 'precision': undefined,
640
628
  'type': isFiat ? 'fiat' : 'crypto',
641
629
  'limits': {
642
630
  'amount': {
@@ -654,8 +642,6 @@ class bitvavo extends bitvavo$1["default"] {
654
642
  },
655
643
  });
656
644
  }
657
- // set currencies here to avoid calling publicGetAssets twice
658
- this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, result));
659
645
  return result;
660
646
  }
661
647
  /**
@@ -39,6 +39,7 @@ class blockchaincom extends blockchaincom$1["default"] {
39
39
  'fetchBalance': true,
40
40
  'fetchCanceledOrders': true,
41
41
  'fetchClosedOrders': true,
42
+ 'fetchCurrencies': false,
42
43
  'fetchDeposit': true,
43
44
  'fetchDepositAddress': true,
44
45
  'fetchDepositAddresses': false,
@@ -54,6 +54,7 @@ class btcalpha extends btcalpha$1["default"] {
54
54
  'fetchClosedOrders': true,
55
55
  'fetchCrossBorrowRate': false,
56
56
  'fetchCrossBorrowRates': false,
57
+ 'fetchCurrencies': false,
57
58
  'fetchDeposit': false,
58
59
  'fetchDepositAddress': false,
59
60
  'fetchDepositAddresses': false,
@@ -52,6 +52,7 @@ class btcbox extends btcbox$1["default"] {
52
52
  'fetchBorrowRatesPerSymbol': false,
53
53
  'fetchCrossBorrowRate': false,
54
54
  'fetchCrossBorrowRates': false,
55
+ 'fetchCurrencies': false,
55
56
  'fetchFundingHistory': false,
56
57
  'fetchFundingInterval': false,
57
58
  'fetchFundingIntervals': false,
@@ -54,6 +54,7 @@ class btcmarkets extends btcmarkets$1["default"] {
54
54
  'fetchClosedOrders': 'emulated',
55
55
  'fetchCrossBorrowRate': false,
56
56
  'fetchCrossBorrowRates': false,
57
+ 'fetchCurrencies': false,
57
58
  'fetchDepositAddress': false,
58
59
  'fetchDepositAddresses': false,
59
60
  'fetchDepositAddressesByNetwork': false,
@@ -51,6 +51,7 @@ class btcturk extends btcturk$1["default"] {
51
51
  'fetchBorrowRatesPerSymbol': false,
52
52
  'fetchCrossBorrowRate': false,
53
53
  'fetchCrossBorrowRates': false,
54
+ 'fetchCurrencies': false,
54
55
  'fetchDepositAddress': false,
55
56
  'fetchDepositAddresses': false,
56
57
  'fetchDepositAddressesByNetwork': false,
@@ -2710,8 +2710,9 @@ class deribit extends deribit$1["default"] {
2710
2710
  'notional': this.parseNumber(notionalStringAbs),
2711
2711
  'leverage': this.safeInteger(position, 'leverage'),
2712
2712
  'unrealizedPnl': this.parseNumber(unrealizedPnl),
2713
- 'contracts': undefined,
2714
- 'contractSize': this.safeNumber(market, 'contractSize'),
2713
+ 'realizedPnl': this.safeNumber(position, 'realized_profit_loss'),
2714
+ 'contracts': this.safeNumber(position, 'size'),
2715
+ 'contractSize': this.safeNumber(position, 'contractSize'),
2715
2716
  'marginRatio': undefined,
2716
2717
  'liquidationPrice': this.safeNumber(position, 'estimated_liquidation_price'),
2717
2718
  'markPrice': this.safeNumber(position, 'mark_price'),
@@ -528,7 +528,7 @@ class digifinex extends digifinex$1["default"] {
528
528
  const networks = {};
529
529
  for (let j = 0; j < networkEntries.length; j++) {
530
530
  const networkEntry = networkEntries[j];
531
- const networkId = this.safeString(networkEntry, 'chain');
531
+ const networkId = this.safeString2(networkEntry, 'chain', 'currency');
532
532
  const networkCode = this.networkIdToCode(networkId);
533
533
  networks[networkCode] = {
534
534
  'id': networkId,
@@ -1444,8 +1444,8 @@ class gate extends gate$1["default"] {
1444
1444
  // "leverage_min": "1",
1445
1445
  // "leverage_max": "100",
1446
1446
  // "risk_limit_max": "8000000",
1447
- // "maker_fee_rate": "-0.00025",
1448
- // "taker_fee_rate": "0.00075",
1447
+ // "maker_fee_rate": "-0.00025", // not actual value for regular users
1448
+ // "taker_fee_rate": "0.00075", // not actual value for regular users
1449
1449
  // "funding_rate": "0.002053",
1450
1450
  // "order_size_max": 1000000,
1451
1451
  // "funding_next_apply": 1610035200,
@@ -1489,8 +1489,8 @@ class gate extends gate$1["default"] {
1489
1489
  // "risk_limit_base": "140.726652109199",
1490
1490
  // "risk_limit_step": "1000000",
1491
1491
  // "risk_limit_max": "8000000",
1492
- // "maker_fee_rate": "-0.00025",
1493
- // "taker_fee_rate": "0.00075",
1492
+ // "maker_fee_rate": "-0.00025", // not actual value for regular users
1493
+ // "taker_fee_rate": "0.00075", // not actual value for regular users
1494
1494
  // "ref_discount_rate": "0",
1495
1495
  // "ref_rebate_rate": "0.2",
1496
1496
  // "order_price_deviate": "0.5",
@@ -1529,8 +1529,6 @@ class gate extends gate$1["default"] {
1529
1529
  const maxMultiplier = Precise["default"].stringAdd('1', priceDeviate);
1530
1530
  const minPrice = Precise["default"].stringMul(minMultiplier, markPrice);
1531
1531
  const maxPrice = Precise["default"].stringMul(maxMultiplier, markPrice);
1532
- const takerPercent = this.safeString(market, 'taker_fee_rate');
1533
- const makerPercent = this.safeString(market, 'maker_fee_rate', takerPercent);
1534
1532
  const isLinear = quote === settle;
1535
1533
  let contractSize = this.safeString(market, 'quanto_multiplier');
1536
1534
  // exception only for one market: https://api.gateio.ws/api/v4/futures/btc/contracts
@@ -1556,8 +1554,8 @@ class gate extends gate$1["default"] {
1556
1554
  'contract': true,
1557
1555
  'linear': isLinear,
1558
1556
  'inverse': !isLinear,
1559
- 'taker': this.parseNumber(Precise["default"].stringDiv(takerPercent, '100')),
1560
- 'maker': this.parseNumber(Precise["default"].stringDiv(makerPercent, '100')),
1557
+ 'taker': undefined,
1558
+ 'maker': undefined,
1561
1559
  'contractSize': this.parseNumber(contractSize),
1562
1560
  'expiry': expiry,
1563
1561
  'expiryDatetime': this.iso8601(expiry),
@@ -1656,8 +1654,6 @@ class gate extends gate$1["default"] {
1656
1654
  const maxMultiplier = Precise["default"].stringAdd('1', priceDeviate);
1657
1655
  const minPrice = Precise["default"].stringMul(minMultiplier, markPrice);
1658
1656
  const maxPrice = Precise["default"].stringMul(maxMultiplier, markPrice);
1659
- const takerPercent = this.safeString(market, 'taker_fee_rate');
1660
- const makerPercent = this.safeString(market, 'maker_fee_rate', takerPercent);
1661
1657
  result.push({
1662
1658
  'id': id,
1663
1659
  'symbol': symbol,
@@ -1677,8 +1673,8 @@ class gate extends gate$1["default"] {
1677
1673
  'contract': true,
1678
1674
  'linear': true,
1679
1675
  'inverse': false,
1680
- 'taker': this.parseNumber(Precise["default"].stringDiv(takerPercent, '100')),
1681
- 'maker': this.parseNumber(Precise["default"].stringDiv(makerPercent, '100')),
1676
+ 'taker': undefined,
1677
+ 'maker': undefined,
1682
1678
  'contractSize': this.parseNumber('1'),
1683
1679
  'expiry': expiry,
1684
1680
  'expiryDatetime': this.iso8601(expiry),
@@ -670,9 +670,9 @@ class gemini extends gemini$1["default"] {
670
670
  const indexedTradingPairs = this.indexBy(tradingPairs, 0);
671
671
  for (let i = 0; i < marketIds.length; i++) {
672
672
  const marketId = marketIds[i];
673
- const tradingPair = this.safeList(indexedTradingPairs, marketId.toUpperCase());
674
- if (tradingPair !== undefined && !this.inArray(tradingPair, brokenPairs)) {
675
- result.push(this.parseMarket(tradingPair));
673
+ const pairInfo = this.safeList(indexedTradingPairs, marketId.toUpperCase());
674
+ if (pairInfo !== undefined && !this.inArray(marketId, brokenPairs)) {
675
+ result.push(this.parseMarket(pairInfo));
676
676
  }
677
677
  }
678
678
  }
@@ -2796,7 +2796,17 @@ class htx extends htx$1["default"] {
2796
2796
  'currency': feeCurrency,
2797
2797
  };
2798
2798
  }
2799
- const id = this.safeStringN(trade, ['trade_id', 'trade-id', 'id']);
2799
+ // htx's multi-market trade-id is a bit complex to parse accordingly.
2800
+ // - for `id` which contains hyphen, it would be the unique id, eg. xxxxxx-1, xxxxxx-2 (this happens mostly for contract markets)
2801
+ // - otherwise the least priority is given to the `id` key
2802
+ let id = undefined;
2803
+ const safeId = this.safeString(trade, 'id');
2804
+ if (safeId !== undefined && safeId.indexOf('-') >= 0) {
2805
+ id = safeId;
2806
+ }
2807
+ else {
2808
+ id = this.safeStringN(trade, ['trade_id', 'trade-id', 'id']);
2809
+ }
2800
2810
  return this.safeTrade({
2801
2811
  'id': id,
2802
2812
  'info': trade,
@@ -52,6 +52,7 @@ class independentreserve extends independentreserve$1["default"] {
52
52
  'fetchClosedOrders': true,
53
53
  'fetchCrossBorrowRate': false,
54
54
  'fetchCrossBorrowRates': false,
55
+ 'fetchCurrencies': false,
55
56
  'fetchDepositAddress': true,
56
57
  'fetchDepositAddresses': false,
57
58
  'fetchDepositAddressesByNetwork': false,
@@ -56,6 +56,7 @@ class indodax extends indodax$1["default"] {
56
56
  'fetchClosedOrders': true,
57
57
  'fetchCrossBorrowRate': false,
58
58
  'fetchCrossBorrowRates': false,
59
+ 'fetchCurrencies': false,
59
60
  'fetchDeposit': false,
60
61
  'fetchDepositAddress': 'emulated',
61
62
  'fetchDepositAddresses': true,
@@ -365,7 +366,7 @@ class indodax extends indodax$1["default"] {
365
366
  const result = [];
366
367
  for (let i = 0; i < response.length; i++) {
367
368
  const market = response[i];
368
- const id = this.safeString(market, 'ticker_id');
369
+ const id = this.safeString(market, 'id');
369
370
  const baseId = this.safeString(market, 'traded_currency');
370
371
  const quoteId = this.safeString(market, 'base_currency');
371
372
  const base = this.safeCurrencyCode(baseId);
@@ -504,7 +505,7 @@ class indodax extends indodax$1["default"] {
504
505
  await this.loadMarkets();
505
506
  const market = this.market(symbol);
506
507
  const request = {
507
- 'pair': market['base'] + market['quote'],
508
+ 'pair': market['id'],
508
509
  };
509
510
  const orderbook = await this.publicGetApiDepthPair(this.extend(request, params));
510
511
  return this.parseOrderBook(orderbook, market['symbol'], undefined, 'buy', 'sell');
@@ -563,7 +564,7 @@ class indodax extends indodax$1["default"] {
563
564
  await this.loadMarkets();
564
565
  const market = this.market(symbol);
565
566
  const request = {
566
- 'pair': market['base'] + market['quote'],
567
+ 'pair': market['id'],
567
568
  };
568
569
  const response = await this.publicGetApiTickerPair(this.extend(request, params));
569
570
  //
@@ -612,7 +613,17 @@ class indodax extends indodax$1["default"] {
612
613
  //
613
614
  const response = await this.publicGetApiTickerAll(params);
614
615
  const tickers = this.safeDict(response, 'tickers', {});
615
- return this.parseTickers(tickers, symbols);
616
+ const keys = Object.keys(tickers);
617
+ const parsedTickers = {};
618
+ for (let i = 0; i < keys.length; i++) {
619
+ const key = keys[i];
620
+ const rawTicker = tickers[key];
621
+ const marketId = key.replace('_', '');
622
+ const market = this.safeMarket(marketId);
623
+ const parsed = this.parseTicker(rawTicker, market);
624
+ parsedTickers[marketId] = parsed;
625
+ }
626
+ return this.filterByArray(parsedTickers, 'symbol', symbols);
616
627
  }
617
628
  parseTrade(trade, market = undefined) {
618
629
  const timestamp = this.safeTimestamp(trade, 'date');
@@ -647,7 +658,7 @@ class indodax extends indodax$1["default"] {
647
658
  await this.loadMarkets();
648
659
  const market = this.market(symbol);
649
660
  const request = {
650
- 'pair': market['base'] + market['quote'],
661
+ 'pair': market['id'],
651
662
  };
652
663
  const response = await this.publicGetApiTradesPair(this.extend(request, params));
653
664
  return this.parseTrades(response, market, since, limit);
@@ -694,7 +705,7 @@ class indodax extends indodax$1["default"] {
694
705
  const request = {
695
706
  'to': until,
696
707
  'tf': selectedTimeframe,
697
- 'symbol': market['base'] + market['quote'],
708
+ 'symbol': market['id'],
698
709
  };
699
710
  if (limit === undefined) {
700
711
  limit = 1000;
@@ -236,6 +236,23 @@ class kraken extends kraken$1["default"] {
236
236
  'XBT': 'BTC',
237
237
  'XDG': 'DOGE',
238
238
  'FEE': 'KFEE',
239
+ 'XETC': 'ETC',
240
+ 'XETH': 'ETH',
241
+ 'XLTC': 'LTC',
242
+ 'XMLN': 'MLN',
243
+ 'XREP': 'REP',
244
+ 'XXBT': 'BTC',
245
+ 'XXDG': 'DOGE',
246
+ 'XXLM': 'XLM',
247
+ 'XXMR': 'XMR',
248
+ 'XXRP': 'XRP',
249
+ 'XZEC': 'ZEC',
250
+ 'ZAUD': 'AUD',
251
+ 'ZCAD': 'CAD',
252
+ 'ZEUR': 'EUR',
253
+ 'ZGBP': 'GBP',
254
+ 'ZJPY': 'JPY',
255
+ 'ZUSD': 'USD',
239
256
  },
240
257
  'options': {
241
258
  'timeDifference': 0,
@@ -616,10 +633,12 @@ class kraken extends kraken$1["default"] {
616
633
  for (let i = 0; i < keys.length; i++) {
617
634
  const id = keys[i];
618
635
  const market = markets[id];
619
- const baseId = this.safeString(market, 'base');
620
- const quoteId = this.safeString(market, 'quote');
621
- const base = this.safeCurrencyCode(baseId);
622
- const quote = this.safeCurrencyCode(quoteId);
636
+ const baseIdRaw = this.safeString(market, 'base');
637
+ const quoteIdRaw = this.safeString(market, 'quote');
638
+ const baseId = this.safeCurrencyCode(baseIdRaw);
639
+ const quoteId = this.safeCurrencyCode(quoteIdRaw);
640
+ const base = baseId;
641
+ const quote = quoteId;
623
642
  const makerFees = this.safeList(market, 'fees_maker', []);
624
643
  const firstMakerFee = this.safeList(makerFees, 0, []);
625
644
  const firstMakerFeeRate = this.safeString(firstMakerFee, 1);
@@ -2529,7 +2548,7 @@ class kraken extends kraken$1["default"] {
2529
2548
  * @name kraken#cancelAllOrders
2530
2549
  * @description cancel all open orders
2531
2550
  * @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrders
2532
- * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2551
+ * @param {string} symbol unified market symbol, not used by kraken cancelAllOrders (all open orders are cancelled)
2533
2552
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2534
2553
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2535
2554
  */
@@ -3201,7 +3220,6 @@ class kraken extends kraken$1["default"] {
3201
3220
  */
3202
3221
  async withdraw(code, amount, address, tag = undefined, params = {}) {
3203
3222
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
3204
- this.checkAddress(address);
3205
3223
  if ('key' in params) {
3206
3224
  await this.loadMarkets();
3207
3225
  const currency = this.currency(code);
@@ -3212,6 +3230,7 @@ class kraken extends kraken$1["default"] {
3212
3230
  };
3213
3231
  if (address !== undefined && address !== '') {
3214
3232
  request['address'] = address;
3233
+ this.checkAddress(address);
3215
3234
  }
3216
3235
  const response = await this.privatePostWithdraw(this.extend(request, params));
3217
3236
  //
@@ -52,6 +52,7 @@ class krakenfutures extends krakenfutures$1["default"] {
52
52
  'fetchClosedOrders': true,
53
53
  'fetchCrossBorrowRate': false,
54
54
  'fetchCrossBorrowRates': false,
55
+ 'fetchCurrencies': false,
55
56
  'fetchDepositAddress': false,
56
57
  'fetchDepositAddresses': false,
57
58
  'fetchDepositAddressesByNetwork': false,
@@ -52,6 +52,7 @@ class mercado extends mercado$1["default"] {
52
52
  'fetchBorrowRatesPerSymbol': false,
53
53
  'fetchCrossBorrowRate': false,
54
54
  'fetchCrossBorrowRates': false,
55
+ 'fetchCurrencies': false,
55
56
  'fetchDepositAddress': false,
56
57
  'fetchDepositAddresses': false,
57
58
  'fetchDepositAddressesByNetwork': false,