ccxt 4.2.88 → 4.2.89

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 (125) hide show
  1. package/README.md +3 -3
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +234 -128
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/ascendex.js +2 -0
  7. package/dist/cjs/src/base/Exchange.js +15 -7
  8. package/dist/cjs/src/binance.js +2 -0
  9. package/dist/cjs/src/bitflyer.js +2 -0
  10. package/dist/cjs/src/bitget.js +7 -1
  11. package/dist/cjs/src/bitmart.js +2 -0
  12. package/dist/cjs/src/bitstamp.js +83 -99
  13. package/dist/cjs/src/blofin.js +2 -0
  14. package/dist/cjs/src/bybit.js +2 -0
  15. package/dist/cjs/src/coinsph.js +2 -0
  16. package/dist/cjs/src/digifinex.js +2 -0
  17. package/dist/cjs/src/gate.js +2 -0
  18. package/dist/cjs/src/hitbtc.js +2 -0
  19. package/dist/cjs/src/htx.js +2 -0
  20. package/dist/cjs/src/kucoin.js +39 -15
  21. package/dist/cjs/src/latoken.js +4 -0
  22. package/dist/cjs/src/lbank.js +3 -1
  23. package/dist/cjs/src/luno.js +2 -0
  24. package/dist/cjs/src/mexc.js +54 -6
  25. package/dist/cjs/src/okx.js +2 -0
  26. package/dist/cjs/src/pro/bitget.js +2 -0
  27. package/dist/cjs/src/timex.js +2 -0
  28. package/js/ccxt.d.ts +1 -1
  29. package/js/ccxt.js +1 -1
  30. package/js/src/ascendex.d.ts +3 -3
  31. package/js/src/ascendex.js +2 -0
  32. package/js/src/base/Exchange.d.ts +8 -8
  33. package/js/src/base/Exchange.js +15 -7
  34. package/js/src/base/types.d.ts +34 -1
  35. package/js/src/bigone.d.ts +2 -2
  36. package/js/src/binance.d.ts +5 -15
  37. package/js/src/binance.js +2 -0
  38. package/js/src/bingx.d.ts +2 -2
  39. package/js/src/bit2c.d.ts +2 -2
  40. package/js/src/bitbank.d.ts +2 -2
  41. package/js/src/bitfinex.d.ts +2 -2
  42. package/js/src/bitfinex2.d.ts +3 -3
  43. package/js/src/bitflyer.d.ts +2 -7
  44. package/js/src/bitflyer.js +2 -0
  45. package/js/src/bitget.d.ts +6 -9
  46. package/js/src/bitget.js +7 -1
  47. package/js/src/bitmart.d.ts +4 -14
  48. package/js/src/bitmart.js +2 -0
  49. package/js/src/bitmex.d.ts +2 -2
  50. package/js/src/bitopro.d.ts +3 -3
  51. package/js/src/bitrue.d.ts +2 -2
  52. package/js/src/bitso.d.ts +2 -2
  53. package/js/src/bitstamp.d.ts +7 -19
  54. package/js/src/bitstamp.js +83 -99
  55. package/js/src/bitteam.d.ts +2 -2
  56. package/js/src/bitvavo.d.ts +3 -3
  57. package/js/src/bl3p.d.ts +2 -2
  58. package/js/src/blockchaincom.d.ts +2 -2
  59. package/js/src/blofin.d.ts +2 -7
  60. package/js/src/blofin.js +2 -0
  61. package/js/src/bybit.d.ts +5 -15
  62. package/js/src/bybit.js +2 -0
  63. package/js/src/cex.d.ts +3 -3
  64. package/js/src/coinbase.d.ts +2 -2
  65. package/js/src/coinbaseinternational.d.ts +2 -2
  66. package/js/src/coinbasepro.d.ts +3 -3
  67. package/js/src/coincheck.d.ts +2 -2
  68. package/js/src/coinex.d.ts +5 -19
  69. package/js/src/coinlist.d.ts +3 -3
  70. package/js/src/coinmate.d.ts +2 -9
  71. package/js/src/coinmetro.d.ts +2 -2
  72. package/js/src/coinone.d.ts +2 -2
  73. package/js/src/coinsph.d.ts +4 -14
  74. package/js/src/coinsph.js +2 -0
  75. package/js/src/currencycom.d.ts +3 -3
  76. package/js/src/delta.d.ts +2 -2
  77. package/js/src/deribit.d.ts +3 -3
  78. package/js/src/digifinex.d.ts +4 -14
  79. package/js/src/digifinex.js +2 -0
  80. package/js/src/exmo.d.ts +3 -3
  81. package/js/src/gate.d.ts +6 -9
  82. package/js/src/gate.js +2 -0
  83. package/js/src/gemini.d.ts +3 -3
  84. package/js/src/hitbtc.d.ts +5 -15
  85. package/js/src/hitbtc.js +2 -0
  86. package/js/src/hollaex.d.ts +3 -3
  87. package/js/src/htx.d.ts +4 -14
  88. package/js/src/htx.js +2 -0
  89. package/js/src/huobijp.d.ts +2 -2
  90. package/js/src/hyperliquid.d.ts +2 -2
  91. package/js/src/idex.d.ts +3 -3
  92. package/js/src/independentreserve.d.ts +2 -2
  93. package/js/src/kraken.d.ts +3 -10
  94. package/js/src/kucoin.d.ts +3 -10
  95. package/js/src/kucoin.js +39 -15
  96. package/js/src/kuna.d.ts +2 -2
  97. package/js/src/latoken.d.ts +7 -8
  98. package/js/src/latoken.js +4 -0
  99. package/js/src/lbank.d.ts +4 -9
  100. package/js/src/lbank.js +3 -1
  101. package/js/src/luno.d.ts +2 -7
  102. package/js/src/luno.js +2 -0
  103. package/js/src/lykke.d.ts +2 -2
  104. package/js/src/mexc.d.ts +3 -3
  105. package/js/src/mexc.js +54 -6
  106. package/js/src/ndax.d.ts +2 -2
  107. package/js/src/oceanex.d.ts +2 -2
  108. package/js/src/okcoin.d.ts +2 -2
  109. package/js/src/okx.d.ts +4 -14
  110. package/js/src/okx.js +2 -0
  111. package/js/src/onetrading.d.ts +3 -3
  112. package/js/src/phemex.d.ts +2 -2
  113. package/js/src/poloniex.d.ts +3 -3
  114. package/js/src/pro/bitget.js +2 -0
  115. package/js/src/pro/bitvavo.d.ts +2 -2
  116. package/js/src/probit.d.ts +2 -2
  117. package/js/src/timex.d.ts +4 -14
  118. package/js/src/timex.js +2 -0
  119. package/js/src/upbit.d.ts +2 -9
  120. package/js/src/wazirx.d.ts +2 -2
  121. package/js/src/whitebit.d.ts +3 -3
  122. package/js/src/woo.d.ts +3 -3
  123. package/js/src/yobit.d.ts +2 -2
  124. package/package.json +1 -1
  125. package/skip-tests.json +6 -1
@@ -5171,6 +5171,8 @@ class ascendex extends _abstract_ascendex_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
5171
5171
  'symbol': symbol,
5172
5172
  'maker': this.safeNumber(takerMaker, 'maker'),
5173
5173
  'taker': this.safeNumber(takerMaker, 'taker'),
5174
+ 'percentage': undefined,
5175
+ 'tierBased': undefined,
5174
5176
  };
5175
5177
  }
5176
5178
  return result;
@@ -7317,7 +7319,7 @@ class Exchange {
7317
7319
  this.markets_by_id = undefined;
7318
7320
  this.symbols = undefined;
7319
7321
  this.ids = undefined;
7320
- this.currencies = undefined;
7322
+ this.currencies = {};
7321
7323
  this.baseCurrencies = undefined;
7322
7324
  this.quoteCurrencies = undefined;
7323
7325
  this.currencies_by_id = undefined;
@@ -11004,11 +11006,11 @@ class Exchange {
11004
11006
  if (currencyId !== undefined) {
11005
11007
  code = this.commonCurrencyCode(currencyId.toUpperCase());
11006
11008
  }
11007
- return {
11009
+ return this.safeCurrencyStructure({
11008
11010
  'id': currencyId,
11009
11011
  'code': code,
11010
11012
  'precision': undefined,
11011
- };
11013
+ });
11012
11014
  }
11013
11015
  safeMarket(marketId, market = undefined, delimiter = undefined, marketType = undefined) {
11014
11016
  const result = this.safeMarketStructure({
@@ -11777,11 +11779,18 @@ class Exchange {
11777
11779
  'total': undefined,
11778
11780
  };
11779
11781
  }
11780
- commonCurrencyCode(currency) {
11782
+ commonCurrencyCode(code) {
11781
11783
  if (!this.substituteCommonCurrencyCodes) {
11782
- return currency;
11784
+ return code;
11785
+ }
11786
+ // if the provided code already exists as a value in commonCurrencies dict, then we should not again transform it
11787
+ // more details at: https://github.com/ccxt/ccxt/issues/21112#issuecomment-2031293691
11788
+ const commonCurrencies = Object.values(this.commonCurrencies);
11789
+ const exists = this.inArray(code, commonCurrencies);
11790
+ if (exists) {
11791
+ return code;
11783
11792
  }
11784
- return this.safeString(this.commonCurrencies, currency, currency);
11793
+ return this.safeString(this.commonCurrencies, code, code);
11785
11794
  }
11786
11795
  currency(code) {
11787
11796
  if (this.currencies === undefined) {
@@ -12244,7 +12253,8 @@ class Exchange {
12244
12253
  if (!this.has['fetchTradingFees']) {
12245
12254
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchTradingFee() is not supported yet');
12246
12255
  }
12247
- return await this.fetchTradingFees(params);
12256
+ const fees = await this.fetchTradingFees(params);
12257
+ return this.safeDict(fees, symbol);
12248
12258
  }
12249
12259
  parseOpenInterest(interest, market = undefined) {
12250
12260
  throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' parseOpenInterest () is not supported yet');
@@ -27197,6 +27207,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27197
27207
  'symbol': symbol,
27198
27208
  'maker': this.safeNumber2(fee, 'makerCommission', 'makerCommissionRate'),
27199
27209
  'taker': this.safeNumber2(fee, 'takerCommission', 'takerCommissionRate'),
27210
+ 'percentage': undefined,
27211
+ 'tierBased': undefined,
27200
27212
  };
27201
27213
  }
27202
27214
  async fetchTradingFee(symbol, params = {}) {
@@ -44988,6 +45000,8 @@ class bitflyer extends _abstract_bitflyer_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
44988
45000
  'symbol': market['symbol'],
44989
45001
  'maker': fee,
44990
45002
  'taker': fee,
45003
+ 'percentage': undefined,
45004
+ 'tierBased': undefined,
44991
45005
  };
44992
45006
  }
44993
45007
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -48147,7 +48161,11 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48147
48161
  //
48148
48162
  const marketId = this.safeString(ticker, 'symbol');
48149
48163
  const close = this.safeString(ticker, 'lastPr');
48150
- const timestamp = this.safeInteger(ticker, 'ts');
48164
+ const timestampString = this.omitZero(this.safeString(ticker, 'ts')); // exchange sometimes provided 0
48165
+ let timestamp = undefined;
48166
+ if (timestampString !== undefined) {
48167
+ timestamp = this.parseToInt(timestampString);
48168
+ }
48151
48169
  const change = this.safeString(ticker, 'change24h');
48152
48170
  const open24 = this.safeString(ticker, 'open24');
48153
48171
  const open = this.safeString(ticker, 'open');
@@ -48800,6 +48818,8 @@ class bitget extends _abstract_bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
48800
48818
  'symbol': this.safeSymbol(marketId, market),
48801
48819
  'maker': this.safeNumber(data, 'makerFeeRate'),
48802
48820
  'taker': this.safeNumber(data, 'takerFeeRate'),
48821
+ 'percentage': undefined,
48822
+ 'tierBased': undefined,
48803
48823
  };
48804
48824
  }
48805
48825
  parseOHLCV(ohlcv, market = undefined) {
@@ -57281,6 +57301,8 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
57281
57301
  'symbol': symbol,
57282
57302
  'maker': this.safeNumber(fee, 'maker_fee_rate'),
57283
57303
  'taker': this.safeNumber(fee, 'taker_fee_rate'),
57304
+ 'percentage': undefined,
57305
+ 'tierBased': undefined,
57284
57306
  };
57285
57307
  }
57286
57308
  async fetchTradingFee(symbol, params = {}) {
@@ -69872,6 +69894,30 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
69872
69894
  'commonCurrencies': {
69873
69895
  'UST': 'USTC',
69874
69896
  },
69897
+ // exchange-specific options
69898
+ 'options': {
69899
+ 'networksById': {
69900
+ 'bitcoin-cash': 'BCH',
69901
+ 'bitcoin': 'BTC',
69902
+ 'ethereum': 'ERC20',
69903
+ 'litecoin': 'LTC',
69904
+ 'stellar': 'XLM',
69905
+ 'xrpl': 'XRP',
69906
+ 'tron': 'TRC20',
69907
+ 'algorand': 'ALGO',
69908
+ 'flare': 'FLR',
69909
+ 'hedera': 'HBAR',
69910
+ 'cardana': 'ADA',
69911
+ 'songbird': 'FLR',
69912
+ 'avalanche-c-chain': 'AVAX',
69913
+ 'solana': 'SOL',
69914
+ 'polkadot': 'DOT',
69915
+ 'near': 'NEAR',
69916
+ 'doge': 'DOGE',
69917
+ 'sui': 'SUI',
69918
+ 'casper': 'CSRP',
69919
+ },
69920
+ },
69875
69921
  'exceptions': {
69876
69922
  'exact': {
69877
69923
  'No permission found': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
@@ -70644,6 +70690,8 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
70644
70690
  'symbol': this.safeSymbol(marketId, market),
70645
70691
  'maker': this.safeNumber(fees, 'maker'),
70646
70692
  'taker': this.safeNumber(fees, 'taker'),
70693
+ 'percentage': undefined,
70694
+ 'tierBased': undefined,
70647
70695
  };
70648
70696
  }
70649
70697
  parseTradingFees(fees) {
@@ -70689,60 +70737,41 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
70689
70737
  * @name bitstamp#fetchTransactionFees
70690
70738
  * @deprecated
70691
70739
  * @description please use fetchDepositWithdrawFees instead
70692
- * @see https://www.bitstamp.net/api/#balance
70740
+ * @see https://www.bitstamp.net/api/#tag/Fees
70693
70741
  * @param {string[]|undefined} codes list of unified currency codes
70694
70742
  * @param {object} [params] extra parameters specific to the exchange API endpoint
70695
70743
  * @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
70696
70744
  */
70697
70745
  await this.loadMarkets();
70698
- const balance = await this.privatePostBalance(params);
70699
- return this.parseTransactionFees(balance);
70700
- }
70701
- parseTransactionFees(response, codes = undefined) {
70746
+ const response = await this.privatePostFeesWithdrawal(params);
70702
70747
  //
70703
- // {
70704
- // "yfi_available": "0.00000000",
70705
- // "yfi_balance": "0.00000000",
70706
- // "yfi_reserved": "0.00000000",
70707
- // "yfi_withdrawal_fee": "0.00070000",
70708
- // "yfieur_fee": "0.000",
70709
- // "yfiusd_fee": "0.000",
70710
- // "zrx_available": "0.00000000",
70711
- // "zrx_balance": "0.00000000",
70712
- // "zrx_reserved": "0.00000000",
70713
- // "zrx_withdrawal_fee": "12.00000000",
70714
- // "zrxeur_fee": "0.000",
70715
- // "zrxusd_fee": "0.000",
70716
- // ...
70717
- // }
70748
+ // [
70749
+ // {
70750
+ // "currency": "btc",
70751
+ // "fee": "0.00015000",
70752
+ // "network": "bitcoin"
70753
+ // }
70754
+ // ...
70755
+ // ]
70718
70756
  //
70719
- if (codes === undefined) {
70720
- codes = Object.keys(this.currencies);
70721
- }
70757
+ return this.parseTransactionFees(response);
70758
+ }
70759
+ parseTransactionFees(response, codes = undefined) {
70722
70760
  const result = {};
70723
- let mainCurrencyId = undefined;
70724
- const ids = Object.keys(response);
70761
+ const currencies = this.indexBy(response, 'currency');
70762
+ const ids = Object.keys(currencies);
70725
70763
  for (let i = 0; i < ids.length; i++) {
70726
70764
  const id = ids[i];
70727
- const currencyId = id.split('_')[0];
70728
- const code = this.safeCurrencyCode(currencyId);
70729
- if (codes !== undefined && !this.inArray(code, codes)) {
70765
+ const fees = this.safeValue(response, i, {});
70766
+ const code = this.safeCurrencyCode(id);
70767
+ if ((codes !== undefined) && !this.inArray(code, codes)) {
70730
70768
  continue;
70731
70769
  }
70732
- if (id.indexOf('_available') >= 0) {
70733
- mainCurrencyId = currencyId;
70734
- result[code] = {
70735
- 'deposit': undefined,
70736
- 'withdraw': undefined,
70737
- 'info': {},
70738
- };
70739
- }
70740
- if (currencyId === mainCurrencyId) {
70741
- result[code]['info'][id] = this.safeNumber(response, id);
70742
- }
70743
- if (id.indexOf('_withdrawal_fee') >= 0) {
70744
- result[code]['withdraw'] = this.safeNumber(response, id);
70745
- }
70770
+ result[code] = {
70771
+ 'withdraw_fee': this.safeNumber(fees, 'fee'),
70772
+ 'deposit': {},
70773
+ 'info': this.safeDict(currencies, id),
70774
+ };
70746
70775
  }
70747
70776
  return result;
70748
70777
  }
@@ -70757,64 +70786,41 @@ class bitstamp extends _abstract_bitstamp_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
70757
70786
  * @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
70758
70787
  */
70759
70788
  await this.loadMarkets();
70760
- const response = await this.privatePostBalance(params);
70789
+ const response = await this.privatePostFeesWithdrawal(params);
70761
70790
  //
70762
- // {
70763
- // "yfi_available": "0.00000000",
70764
- // "yfi_balance": "0.00000000",
70765
- // "yfi_reserved": "0.00000000",
70766
- // "yfi_withdrawal_fee": "0.00070000",
70767
- // "yfieur_fee": "0.000",
70768
- // "yfiusd_fee": "0.000",
70769
- // "zrx_available": "0.00000000",
70770
- // "zrx_balance": "0.00000000",
70771
- // "zrx_reserved": "0.00000000",
70772
- // "zrx_withdrawal_fee": "12.00000000",
70773
- // "zrxeur_fee": "0.000",
70774
- // "zrxusd_fee": "0.000",
70775
- // ...
70776
- // }
70791
+ // [
70792
+ // {
70793
+ // "currency": "btc",
70794
+ // "fee": "0.00015000",
70795
+ // "network": "bitcoin"
70796
+ // }
70797
+ // ...
70798
+ // ]
70777
70799
  //
70778
- return this.parseDepositWithdrawFees(response, codes);
70800
+ const responseByCurrencyId = this.groupBy(response, 'currency');
70801
+ return this.parseDepositWithdrawFees(responseByCurrencyId, codes);
70779
70802
  }
70780
- parseDepositWithdrawFees(response, codes = undefined, currencyIdKey = undefined) {
70781
- //
70782
- // {
70783
- // "yfi_available": "0.00000000",
70784
- // "yfi_balance": "0.00000000",
70785
- // "yfi_reserved": "0.00000000",
70786
- // "yfi_withdrawal_fee": "0.00070000",
70787
- // "yfieur_fee": "0.000",
70788
- // "yfiusd_fee": "0.000",
70789
- // "zrx_available": "0.00000000",
70790
- // "zrx_balance": "0.00000000",
70791
- // "zrx_reserved": "0.00000000",
70792
- // "zrx_withdrawal_fee": "12.00000000",
70793
- // "zrxeur_fee": "0.000",
70794
- // "zrxusd_fee": "0.000",
70795
- // ...
70796
- // }
70797
- //
70798
- const result = {};
70799
- const ids = Object.keys(response);
70800
- for (let i = 0; i < ids.length; i++) {
70801
- const id = ids[i];
70802
- const currencyId = id.split('_')[0];
70803
- const code = this.safeCurrencyCode(currencyId);
70804
- const dictValue = this.safeNumber(response, id);
70805
- if (codes !== undefined && !this.inArray(code, codes)) {
70806
- continue;
70807
- }
70808
- if (id.indexOf('_available') >= 0) {
70809
- result[code] = this.depositWithdrawFee({});
70810
- }
70811
- if (id.indexOf('_withdrawal_fee') >= 0) {
70812
- result[code]['withdraw']['fee'] = dictValue;
70813
- }
70814
- const resultValue = this.safeValue(result, code);
70815
- if (resultValue !== undefined) {
70816
- result[code]['info'][id] = dictValue;
70817
- }
70803
+ parseDepositWithdrawFee(fee, currency = undefined) {
70804
+ const result = this.depositWithdrawFee(fee);
70805
+ for (let j = 0; j < fee.length; j++) {
70806
+ const networkEntry = fee[j];
70807
+ const networkId = this.safeString(networkEntry, 'network');
70808
+ const networkCode = this.networkIdToCode(networkId);
70809
+ const withdrawFee = this.safeNumber(networkEntry, 'fee');
70810
+ result['withdraw'] = {
70811
+ 'fee': withdrawFee,
70812
+ 'percentage': undefined,
70813
+ };
70814
+ result['networks'][networkCode] = {
70815
+ 'withdraw': {
70816
+ 'fee': withdrawFee,
70817
+ 'percentage': undefined,
70818
+ },
70819
+ 'deposit': {
70820
+ 'fee': undefined,
70821
+ 'percentage': undefined,
70822
+ },
70823
+ };
70818
70824
  }
70819
70825
  return result;
70820
70826
  }
@@ -78810,6 +78816,8 @@ class blofin extends _abstract_blofin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
78810
78816
  // blofin returns the fees as negative values opposed to other exchanges, so the sign needs to be flipped
78811
78817
  'maker': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(this.safeString2(fee, 'maker', 'makerU'))),
78812
78818
  'taker': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(this.safeString2(fee, 'taker', 'takerU'))),
78819
+ 'percentage': undefined,
78820
+ 'tierBased': undefined,
78813
78821
  };
78814
78822
  }
78815
78823
  async fetchBalance(params = {}) {
@@ -91153,6 +91161,8 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
91153
91161
  'symbol': symbol,
91154
91162
  'maker': this.safeNumber(fee, 'makerFeeRate'),
91155
91163
  'taker': this.safeNumber(fee, 'takerFeeRate'),
91164
+ 'percentage': undefined,
91165
+ 'tierBased': undefined,
91156
91166
  };
91157
91167
  }
91158
91168
  async fetchTradingFee(symbol, params = {}) {
@@ -116716,6 +116726,8 @@ class coinsph extends _abstract_coinsph_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
116716
116726
  'symbol': symbol,
116717
116727
  'maker': this.safeNumber(fee, 'makerCommission'),
116718
116728
  'taker': this.safeNumber(fee, 'takerCommission'),
116729
+ 'percentage': undefined,
116730
+ 'tierBased': undefined,
116719
116731
  };
116720
116732
  }
116721
116733
  async withdraw(code, amount, address, tag = undefined, params = {}) {
@@ -133264,6 +133276,8 @@ class digifinex extends _abstract_digifinex_js__WEBPACK_IMPORTED_MODULE_0__/* ["
133264
133276
  'symbol': symbol,
133265
133277
  'maker': this.safeNumber(fee, 'maker_fee_rate'),
133266
133278
  'taker': this.safeNumber(fee, 'taker_fee_rate'),
133279
+ 'percentage': undefined,
133280
+ 'tierBased': undefined,
133267
133281
  };
133268
133282
  }
133269
133283
  async fetchPositions(symbols = undefined, params = {}) {
@@ -139037,6 +139051,8 @@ class gate extends _abstract_gate_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
139037
139051
  'symbol': this.safeString(market, 'symbol'),
139038
139052
  'maker': this.safeNumber(info, makerKey),
139039
139053
  'taker': this.safeNumber(info, takerKey),
139054
+ 'percentage': undefined,
139055
+ 'tierBased': undefined,
139040
139056
  };
139041
139057
  }
139042
139058
  async fetchTransactionFees(codes = undefined, params = {}) {
@@ -147955,6 +147971,8 @@ class hitbtc extends _abstract_hitbtc_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
147955
147971
  'symbol': symbol,
147956
147972
  'taker': taker,
147957
147973
  'maker': maker,
147974
+ 'percentage': undefined,
147975
+ 'tierBased': undefined,
147958
147976
  };
147959
147977
  }
147960
147978
  async fetchTradingFee(symbol, params = {}) {
@@ -153479,6 +153497,8 @@ class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
153479
153497
  'symbol': this.safeSymbol(marketId, market),
153480
153498
  'maker': this.safeNumber(fee, 'actualMakerRate'),
153481
153499
  'taker': this.safeNumber(fee, 'actualTakerRate'),
153500
+ 'percentage': undefined,
153501
+ 'tierBased': undefined,
153482
153502
  };
153483
153503
  }
153484
153504
  async fetchTradingFee(symbol, params = {}) {
@@ -178639,9 +178659,9 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
178639
178659
  }
178640
178660
  parseBalanceHelper(entry) {
178641
178661
  const account = this.account();
178642
- account['used'] = this.safeString(entry, 'holdBalance');
178643
- account['free'] = this.safeString(entry, 'availableBalance');
178644
- account['total'] = this.safeString(entry, 'totalBalance');
178662
+ account['used'] = this.safeString2(entry, 'holdBalance', 'hold');
178663
+ account['free'] = this.safeString2(entry, 'availableBalance', 'available');
178664
+ account['total'] = this.safeString2(entry, 'totalBalance', 'total');
178645
178665
  const debt = this.safeString(entry, 'liability');
178646
178666
  const interest = this.safeString(entry, 'interest');
178647
178667
  account['debt'] = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(debt, interest);
@@ -178699,7 +178719,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
178699
178719
  response = await this.privateGetAccounts(this.extend(request, query));
178700
178720
  }
178701
178721
  //
178702
- // Spot and Cross
178722
+ // Spot
178703
178723
  //
178704
178724
  // {
178705
178725
  // "code": "200000",
@@ -178715,35 +178735,59 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
178715
178735
  // ]
178716
178736
  // }
178717
178737
  //
178738
+ // Cross
178739
+ //
178740
+ // {
178741
+ // "code": "200000",
178742
+ // "data": {
178743
+ // "debtRatio": "0",
178744
+ // "accounts": [
178745
+ // {
178746
+ // "currency": "USDT",
178747
+ // "totalBalance": "5",
178748
+ // "availableBalance": "5",
178749
+ // "holdBalance": "0",
178750
+ // "liability": "0",
178751
+ // "maxBorrowSize": "20"
178752
+ // },
178753
+ // ]
178754
+ // }
178755
+ // }
178756
+ //
178718
178757
  // Isolated
178719
178758
  //
178720
178759
  // {
178721
178760
  // "code": "200000",
178722
178761
  // "data": {
178723
- // "totalConversionBalance": "0",
178724
- // "liabilityConversionBalance": "0",
178762
+ // "totalAssetOfQuoteCurrency": "0",
178763
+ // "totalLiabilityOfQuoteCurrency": "0",
178764
+ // "timestamp": 1712085661155,
178725
178765
  // "assets": [
178726
178766
  // {
178727
178767
  // "symbol": "MANA-USDT",
178728
- // "status": "CLEAR",
178768
+ // "status": "EFFECTIVE",
178729
178769
  // "debtRatio": "0",
178730
178770
  // "baseAsset": {
178731
178771
  // "currency": "MANA",
178732
- // "totalBalance": "0",
178733
- // "holdBalance": "0",
178734
- // "availableBalance": "0",
178772
+ // "borrowEnabled": true,
178773
+ // "transferInEnabled": true,
178774
+ // "total": "0",
178775
+ // "hold": "0",
178776
+ // "available": "0",
178735
178777
  // "liability": "0",
178736
178778
  // "interest": "0",
178737
- // "borrowableAmount": "0"
178779
+ // "maxBorrowSize": "0"
178738
178780
  // },
178739
178781
  // "quoteAsset": {
178740
178782
  // "currency": "USDT",
178741
- // "totalBalance": "0",
178742
- // "holdBalance": "0",
178743
- // "availableBalance": "0",
178783
+ // "borrowEnabled": true,
178784
+ // "transferInEnabled": true,
178785
+ // "total": "0",
178786
+ // "hold": "0",
178787
+ // "available": "0",
178744
178788
  // "liability": "0",
178745
178789
  // "interest": "0",
178746
- // "borrowableAmount": "0"
178790
+ // "maxBorrowSize": "0"
178747
178791
  // }
178748
178792
  // },
178749
178793
  // ...
@@ -185385,6 +185429,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
185385
185429
  'symbol': market['symbol'],
185386
185430
  'maker': this.safeNumber(response, 'makerFee'),
185387
185431
  'taker': this.safeNumber(response, 'takerFee'),
185432
+ 'percentage': undefined,
185433
+ 'tierBased': undefined,
185388
185434
  };
185389
185435
  }
185390
185436
  async fetchPrivateTradingFee(symbol, params = {}) {
@@ -185408,6 +185454,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
185408
185454
  'symbol': market['symbol'],
185409
185455
  'maker': this.safeNumber(response, 'makerFee'),
185410
185456
  'taker': this.safeNumber(response, 'takerFee'),
185457
+ 'percentage': undefined,
185458
+ 'tierBased': undefined,
185411
185459
  };
185412
185460
  }
185413
185461
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -187511,6 +187559,8 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
187511
187559
  'symbol': symbol,
187512
187560
  'maker': this.safeNumber(fee, 'makerCommission'),
187513
187561
  'taker': this.safeNumber(fee, 'takerCommission'),
187562
+ 'percentage': undefined,
187563
+ 'tierBased': undefined,
187514
187564
  };
187515
187565
  }
187516
187566
  async fetchTradingFee(symbol, params = {}) {
@@ -187525,7 +187575,7 @@ class lbank extends _abstract_lbank_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
187525
187575
  */
187526
187576
  const market = this.market(symbol);
187527
187577
  const result = await this.fetchTradingFees(this.extend(params, { 'category': market['id'] }));
187528
- return result;
187578
+ return this.safeDict(result, symbol);
187529
187579
  }
187530
187580
  async fetchTradingFees(params = {}) {
187531
187581
  /**
@@ -190029,6 +190079,8 @@ class luno extends _abstract_luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
190029
190079
  'symbol': symbol,
190030
190080
  'maker': this.safeNumber(response, 'maker_fee'),
190031
190081
  'taker': this.safeNumber(response, 'taker_fee'),
190082
+ 'percentage': undefined,
190083
+ 'tierBased': undefined,
190032
190084
  };
190033
190085
  }
190034
190086
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -196829,8 +196881,9 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
196829
196881
  /**
196830
196882
  * @method
196831
196883
  * @name mexc#fetchLeverageTiers
196832
- * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
196833
- * @param {string[]|undefined} symbols list of unified market symbols
196884
+ * @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes, if a market has a leverage tier of 0, then the leverage tiers cannot be obtained for this market
196885
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
196886
+ * @param {string[]} [symbols] list of unified market symbols
196834
196887
  * @param {object} [params] extra parameters specific to the exchange API endpoint
196835
196888
  * @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
196836
196889
  */
@@ -196886,10 +196939,44 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
196886
196939
  return this.parseLeverageTiers(data, symbols, 'symbol');
196887
196940
  }
196888
196941
  parseMarketLeverageTiers(info, market = undefined) {
196889
- /**
196890
- @param info {object} Exchange response for 1 market
196891
- @param market {object} CCXT market
196892
- */
196942
+ //
196943
+ // {
196944
+ // "symbol": "BTC_USDT",
196945
+ // "displayName": "BTC_USDT永续",
196946
+ // "displayNameEn": "BTC_USDT SWAP",
196947
+ // "positionOpenType": 3,
196948
+ // "baseCoin": "BTC",
196949
+ // "quoteCoin": "USDT",
196950
+ // "settleCoin": "USDT",
196951
+ // "contractSize": 0.0001,
196952
+ // "minLeverage": 1,
196953
+ // "maxLeverage": 125,
196954
+ // "priceScale": 2,
196955
+ // "volScale": 0,
196956
+ // "amountScale": 4,
196957
+ // "priceUnit": 0.5,
196958
+ // "volUnit": 1,
196959
+ // "minVol": 1,
196960
+ // "maxVol": 1000000,
196961
+ // "bidLimitPriceRate": 0.1,
196962
+ // "askLimitPriceRate": 0.1,
196963
+ // "takerFeeRate": 0.0006,
196964
+ // "makerFeeRate": 0.0002,
196965
+ // "maintenanceMarginRate": 0.004,
196966
+ // "initialMarginRate": 0.008,
196967
+ // "riskBaseVol": 10000,
196968
+ // "riskIncrVol": 200000,
196969
+ // "riskIncrMmr": 0.004,
196970
+ // "riskIncrImr": 0.004,
196971
+ // "riskLevelLimit": 5,
196972
+ // "priceCoefficientVariation": 0.1,
196973
+ // "indexOrigin": ["BINANCE","GATEIO","HUOBI","MXC"],
196974
+ // "state": 0, // 0 enabled, 1 delivery, 2 completed, 3 offline, 4 pause
196975
+ // "isNew": false,
196976
+ // "isHot": true,
196977
+ // "isHidden": false
196978
+ // }
196979
+ //
196893
196980
  let maintenanceMarginRate = this.safeString(info, 'maintenanceMarginRate');
196894
196981
  let initialMarginRate = this.safeString(info, 'initialMarginRate');
196895
196982
  const maxVol = this.safeString(info, 'maxVol');
@@ -196899,6 +196986,19 @@ class mexc extends _abstract_mexc_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
196899
196986
  let floor = '0';
196900
196987
  const tiers = [];
196901
196988
  const quoteId = this.safeString(info, 'quoteCoin');
196989
+ if (riskIncrVol === '0') {
196990
+ return [
196991
+ {
196992
+ 'tier': 0,
196993
+ 'currency': this.safeCurrencyCode(quoteId),
196994
+ 'notionalFloor': undefined,
196995
+ 'notionalCap': undefined,
196996
+ 'maintenanceMarginRate': undefined,
196997
+ 'maxLeverage': this.safeNumber(info, 'maxLeverage'),
196998
+ 'info': info,
196999
+ },
197000
+ ];
197001
+ }
196902
197002
  while (_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringLt(floor, maxVol)) {
196903
197003
  const cap = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAdd(floor, riskIncrVol);
196904
197004
  tiers.push({
@@ -208654,6 +208754,8 @@ class okx extends _abstract_okx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
208654
208754
  // OKX returns the fees as negative values opposed to other exchanges, so the sign needs to be flipped
208655
208755
  'maker': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(this.safeString2(fee, 'maker', 'makerU'))),
208656
208756
  'taker': this.parseNumber(_base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringNeg(this.safeString2(fee, 'taker', 'takerU'))),
208757
+ 'percentage': undefined,
208758
+ 'tierBased': undefined,
208657
208759
  };
208658
208760
  }
208659
208761
  async fetchTradingFee(symbol, params = {}) {
@@ -236464,6 +236566,8 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
236464
236566
  'ordersAlgo': this.handleOrder,
236465
236567
  'account': this.handleBalance,
236466
236568
  'positions': this.handlePositions,
236569
+ 'account-isolated': this.handleBalance,
236570
+ 'account-crossed': this.handleBalance,
236467
236571
  };
236468
236572
  const arg = this.safeValue(message, 'arg', {});
236469
236573
  const topic = this.safeValue(arg, 'channel', '');
@@ -299504,6 +299608,8 @@ class timex extends _abstract_timex_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
299504
299608
  'symbol': this.safeSymbol(marketId, market),
299505
299609
  'maker': rate,
299506
299610
  'taker': rate,
299611
+ 'percentage': undefined,
299612
+ 'tierBased': undefined,
299507
299613
  };
299508
299614
  }
299509
299615
  async fetchTradingFee(symbol, params = {}) {
@@ -324546,7 +324652,7 @@ SOFTWARE.
324546
324652
 
324547
324653
  //-----------------------------------------------------------------------------
324548
324654
  // this is updated by vss.js when building
324549
- const version = '4.2.88';
324655
+ const version = '4.2.89';
324550
324656
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
324551
324657
  //-----------------------------------------------------------------------------
324552
324658