ccxt 4.2.29 → 4.2.31

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 (164) hide show
  1. package/README.md +5 -6
  2. package/dist/ccxt.browser.js +2196 -601
  3. package/dist/ccxt.browser.min.js +7 -7
  4. package/dist/cjs/ccxt.js +3 -1
  5. package/dist/cjs/src/ascendex.js +5 -5
  6. package/dist/cjs/src/base/Exchange.js +33 -25
  7. package/dist/cjs/src/base/errors.js +3 -3
  8. package/dist/cjs/src/base/functions/type.js +12 -0
  9. package/dist/cjs/src/bigone.js +2 -2
  10. package/dist/cjs/src/binance.js +897 -218
  11. package/dist/cjs/src/bingx.js +1 -1
  12. package/dist/cjs/src/bitfinex.js +1 -1
  13. package/dist/cjs/src/bitfinex2.js +457 -93
  14. package/dist/cjs/src/bitforex.js +3 -0
  15. package/dist/cjs/src/bitget.js +8 -4
  16. package/dist/cjs/src/bitmart.js +3 -3
  17. package/dist/cjs/src/bitmex.js +4 -4
  18. package/dist/cjs/src/bitrue.js +1 -1
  19. package/dist/cjs/src/bitso.js +1 -1
  20. package/dist/cjs/src/bitteam.js +2 -2
  21. package/dist/cjs/src/btcalpha.js +1 -1
  22. package/dist/cjs/src/bybit.js +3 -3
  23. package/dist/cjs/src/coinbase.js +22 -5
  24. package/dist/cjs/src/coincheck.js +1 -1
  25. package/dist/cjs/src/coinex.js +2 -2
  26. package/dist/cjs/src/coinlist.js +1 -1
  27. package/dist/cjs/src/coinmate.js +1 -1
  28. package/dist/cjs/src/coinmetro.js +2 -2
  29. package/dist/cjs/src/coinsph.js +1 -1
  30. package/dist/cjs/src/cryptocom.js +3 -3
  31. package/dist/cjs/src/deribit.js +1 -0
  32. package/dist/cjs/src/digifinex.js +6 -4
  33. package/dist/cjs/src/exmo.js +2 -2
  34. package/dist/cjs/src/gate.js +5 -5
  35. package/dist/cjs/src/gemini.js +3 -3
  36. package/dist/cjs/src/hitbtc.js +14 -20
  37. package/dist/cjs/src/hollaex.js +2 -2
  38. package/dist/cjs/src/htx.js +6 -6
  39. package/dist/cjs/src/huobijp.js +1 -1
  40. package/dist/cjs/src/kraken.js +3 -1
  41. package/dist/cjs/src/krakenfutures.js +4 -1
  42. package/dist/cjs/src/kucoin.js +17 -17
  43. package/dist/cjs/src/kucoinfutures.js +3 -3
  44. package/dist/cjs/src/lbank.js +28 -27
  45. package/dist/cjs/src/mexc.js +7 -7
  46. package/dist/cjs/src/novadax.js +1 -1
  47. package/dist/cjs/src/okcoin.js +2 -2
  48. package/dist/cjs/src/okx.js +23 -8
  49. package/dist/cjs/src/p2b.js +1 -0
  50. package/dist/cjs/src/phemex.js +3 -3
  51. package/dist/cjs/src/poloniexfutures.js +6 -3
  52. package/dist/cjs/src/pro/alpaca.js +1 -1
  53. package/dist/cjs/src/pro/binance.js +4 -4
  54. package/dist/cjs/src/pro/bitget.js +1 -1
  55. package/dist/cjs/src/pro/bitmart.js +1 -1
  56. package/dist/cjs/src/pro/bitmex.js +49 -6
  57. package/dist/cjs/src/pro/bitvavo.js +1 -1
  58. package/dist/cjs/src/pro/bybit.js +2 -2
  59. package/dist/cjs/src/pro/cex.js +2 -2
  60. package/dist/cjs/src/pro/independentreserve.js +1 -1
  61. package/dist/cjs/src/pro/okx.js +1 -1
  62. package/dist/cjs/src/pro/onetrading.js +2 -2
  63. package/dist/cjs/src/pro/p2b.js +432 -0
  64. package/dist/cjs/src/pro/probit.js +5 -5
  65. package/dist/cjs/src/pro/whitebit.js +1 -1
  66. package/dist/cjs/src/probit.js +1 -1
  67. package/dist/cjs/src/timex.js +2 -2
  68. package/dist/cjs/src/tokocrypto.js +3 -3
  69. package/dist/cjs/src/wavesexchange.js +2 -2
  70. package/dist/cjs/src/whitebit.js +3 -3
  71. package/dist/cjs/src/woo.js +3 -3
  72. package/dist/cjs/src/yobit.js +1 -1
  73. package/dist/cjs/src/zaif.js +1 -1
  74. package/dist/cjs/src/zonda.js +3 -3
  75. package/js/ccxt.d.ts +4 -1
  76. package/js/ccxt.js +3 -1
  77. package/js/src/abstract/bybit.d.ts +2 -2
  78. package/js/src/abstract/coinbase.d.ts +10 -0
  79. package/js/src/abstract/okx.d.ts +12 -1
  80. package/js/src/ascendex.js +5 -5
  81. package/js/src/base/Exchange.d.ts +2 -2
  82. package/js/src/base/Exchange.js +33 -25
  83. package/js/src/base/errorHierarchy.d.ts +7 -6
  84. package/js/src/base/errorHierarchy.js +7 -6
  85. package/js/src/base/errors.d.ts +3 -3
  86. package/js/src/base/errors.js +3 -3
  87. package/js/src/base/functions/type.js +12 -0
  88. package/js/src/bigone.js +2 -2
  89. package/js/src/binance.d.ts +1 -0
  90. package/js/src/binance.js +898 -219
  91. package/js/src/bingx.js +1 -1
  92. package/js/src/bitfinex.js +1 -1
  93. package/js/src/bitfinex2.d.ts +6 -1
  94. package/js/src/bitfinex2.js +457 -93
  95. package/js/src/bitforex.js +3 -0
  96. package/js/src/bitget.js +8 -4
  97. package/js/src/bitmart.js +3 -3
  98. package/js/src/bitmex.js +4 -4
  99. package/js/src/bitrue.js +1 -1
  100. package/js/src/bitso.d.ts +1 -1
  101. package/js/src/bitso.js +1 -1
  102. package/js/src/bitteam.js +2 -2
  103. package/js/src/btcalpha.js +1 -1
  104. package/js/src/bybit.js +3 -3
  105. package/js/src/coinbase.js +22 -5
  106. package/js/src/coincheck.js +1 -1
  107. package/js/src/coinex.js +2 -2
  108. package/js/src/coinlist.js +1 -1
  109. package/js/src/coinmate.js +1 -1
  110. package/js/src/coinmetro.d.ts +1 -1
  111. package/js/src/coinmetro.js +2 -2
  112. package/js/src/coinsph.js +1 -1
  113. package/js/src/cryptocom.js +3 -3
  114. package/js/src/deribit.js +1 -0
  115. package/js/src/digifinex.js +6 -4
  116. package/js/src/exmo.js +2 -2
  117. package/js/src/gate.js +5 -5
  118. package/js/src/gemini.d.ts +1 -1
  119. package/js/src/gemini.js +3 -3
  120. package/js/src/hitbtc.js +14 -20
  121. package/js/src/hollaex.js +2 -2
  122. package/js/src/htx.js +6 -6
  123. package/js/src/huobijp.js +1 -1
  124. package/js/src/kraken.js +3 -1
  125. package/js/src/krakenfutures.js +4 -1
  126. package/js/src/kucoin.js +17 -17
  127. package/js/src/kucoinfutures.js +3 -3
  128. package/js/src/lbank.d.ts +1 -1
  129. package/js/src/lbank.js +28 -27
  130. package/js/src/mexc.js +7 -7
  131. package/js/src/novadax.js +1 -1
  132. package/js/src/okcoin.js +2 -2
  133. package/js/src/okx.js +23 -8
  134. package/js/src/p2b.js +1 -0
  135. package/js/src/phemex.js +3 -3
  136. package/js/src/poloniexfutures.js +6 -3
  137. package/js/src/pro/alpaca.js +1 -1
  138. package/js/src/pro/binance.js +4 -4
  139. package/js/src/pro/bitget.js +1 -1
  140. package/js/src/pro/bitmart.js +1 -1
  141. package/js/src/pro/bitmex.d.ts +2 -1
  142. package/js/src/pro/bitmex.js +49 -6
  143. package/js/src/pro/bitvavo.js +1 -1
  144. package/js/src/pro/bybit.js +2 -2
  145. package/js/src/pro/cex.js +2 -2
  146. package/js/src/pro/independentreserve.js +1 -1
  147. package/js/src/pro/okx.js +1 -1
  148. package/js/src/pro/onetrading.js +2 -2
  149. package/js/src/pro/p2b.d.ts +23 -0
  150. package/js/src/pro/p2b.js +433 -0
  151. package/js/src/pro/probit.js +5 -5
  152. package/js/src/pro/whitebit.js +1 -1
  153. package/js/src/probit.js +1 -1
  154. package/js/src/timex.js +2 -2
  155. package/js/src/tokocrypto.js +3 -3
  156. package/js/src/wavesexchange.js +2 -2
  157. package/js/src/whitebit.js +3 -3
  158. package/js/src/woo.js +3 -3
  159. package/js/src/yobit.js +1 -1
  160. package/js/src/zaif.js +1 -1
  161. package/js/src/zonda.d.ts +1 -1
  162. package/js/src/zonda.js +3 -3
  163. package/package.json +1 -1
  164. package/skip-tests.json +3 -10
package/js/src/hollaex.js CHANGED
@@ -1094,7 +1094,7 @@ export default class hollaex extends Exchange {
1094
1094
  const filled = this.safeString(order, 'filled');
1095
1095
  const status = this.parseOrderStatus(this.safeString(order, 'status'));
1096
1096
  const meta = this.safeValue(order, 'meta', {});
1097
- const postOnly = this.safeValue(meta, 'post_only', false);
1097
+ const postOnly = this.safeBool(meta, 'post_only', false);
1098
1098
  return this.safeOrder({
1099
1099
  'id': id,
1100
1100
  'clientOrderId': undefined,
@@ -1148,7 +1148,7 @@ export default class hollaex extends Exchange {
1148
1148
  };
1149
1149
  const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'stop']);
1150
1150
  const meta = this.safeValue(params, 'meta', {});
1151
- const exchangeSpecificParam = this.safeValue(meta, 'post_only', false);
1151
+ const exchangeSpecificParam = this.safeBool(meta, 'post_only', false);
1152
1152
  const isMarketOrder = type === 'market';
1153
1153
  const postOnly = this.isPostOnly(isMarketOrder, exchangeSpecificParam, params);
1154
1154
  if (!isMarketOrder) {
package/js/src/htx.js CHANGED
@@ -3984,7 +3984,7 @@ export default class htx extends Exchange {
3984
3984
  let response = undefined;
3985
3985
  const stop = this.safeValue(params, 'stop');
3986
3986
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
3987
- const trailing = this.safeValue(params, 'trailing', false);
3987
+ const trailing = this.safeBool(params, 'trailing', false);
3988
3988
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
3989
3989
  if (stop || stopLossTakeProfit || trailing) {
3990
3990
  if (limit !== undefined) {
@@ -4359,7 +4359,7 @@ export default class htx extends Exchange {
4359
4359
  request['contract_code'] = market['id'];
4360
4360
  const stop = this.safeValue(params, 'stop');
4361
4361
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
4362
- const trailing = this.safeValue(params, 'trailing', false);
4362
+ const trailing = this.safeBool(params, 'trailing', false);
4363
4363
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
4364
4364
  if (market['linear']) {
4365
4365
  let marginMode = undefined;
@@ -5012,7 +5012,7 @@ export default class htx extends Exchange {
5012
5012
  const marketId = this.safeString2(order, 'contract_code', 'symbol');
5013
5013
  market = this.safeMarket(marketId, market);
5014
5014
  const timestamp = this.safeIntegerN(order, ['created_at', 'created-at', 'create_date']);
5015
- const clientOrderId = this.safeString2(order, 'client_order_id', 'client-order-id');
5015
+ const clientOrderId = this.safeString2(order, 'client_order_id', 'client-or' + 'der-id'); // transpiler regex trick for php issue
5016
5016
  let cost = undefined;
5017
5017
  let amount = undefined;
5018
5018
  if ((type !== undefined) && (type.indexOf('market') >= 0)) {
@@ -5738,7 +5738,7 @@ export default class htx extends Exchange {
5738
5738
  }
5739
5739
  const stop = this.safeValue(params, 'stop');
5740
5740
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
5741
- const trailing = this.safeValue(params, 'trailing', false);
5741
+ const trailing = this.safeBool(params, 'trailing', false);
5742
5742
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
5743
5743
  if (market['linear']) {
5744
5744
  let marginMode = undefined;
@@ -6063,7 +6063,7 @@ export default class htx extends Exchange {
6063
6063
  request['contract_code'] = market['id'];
6064
6064
  const stop = this.safeValue(params, 'stop');
6065
6065
  const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
6066
- const trailing = this.safeValue(params, 'trailing', false);
6066
+ const trailing = this.safeBool(params, 'trailing', false);
6067
6067
  params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
6068
6068
  if (market['linear']) {
6069
6069
  let marginMode = undefined;
@@ -6529,7 +6529,7 @@ export default class htx extends Exchange {
6529
6529
  }
6530
6530
  amount = parseFloat(this.currencyToPrecision(code, amount, networkCode));
6531
6531
  const withdrawOptions = this.safeValue(this.options, 'withdraw', {});
6532
- if (this.safeValue(withdrawOptions, 'includeFee', false)) {
6532
+ if (this.safeBool(withdrawOptions, 'includeFee', false)) {
6533
6533
  let fee = this.safeNumber(params, 'fee');
6534
6534
  if (fee === undefined) {
6535
6535
  const currencies = await this.fetchCurrencies();
package/js/src/huobijp.js CHANGED
@@ -1046,7 +1046,7 @@ export default class huobijp extends Exchange {
1046
1046
  const depositEnabled = this.safeValue(currency, 'deposit-enabled');
1047
1047
  const withdrawEnabled = this.safeValue(currency, 'withdraw-enabled');
1048
1048
  const countryDisabled = this.safeValue(currency, 'country-disabled');
1049
- const visible = this.safeValue(currency, 'visible', false);
1049
+ const visible = this.safeBool(currency, 'visible', false);
1050
1050
  const state = this.safeString(currency, 'state');
1051
1051
  const active = visible && depositEnabled && withdrawEnabled && (state === 'online') && !countryDisabled;
1052
1052
  const name = this.safeString(currency, 'display-name');
package/js/src/kraken.js CHANGED
@@ -978,7 +978,9 @@ export default class kraken extends Exchange {
978
978
  request['interval'] = timeframe;
979
979
  }
980
980
  if (since !== undefined) {
981
- request['since'] = this.parseToInt((since - 1) / 1000);
981
+ // contrary to kraken's api documentation, the since parameter must be passed in nanoseconds
982
+ // the adding of '000000' is copied from the fetchTrades function
983
+ request['since'] = this.numberToString(since) + '000000'; // expected to be in nanoseconds
982
984
  }
983
985
  const response = await this.publicGetOHLC(this.extend(request, params));
984
986
  //
@@ -45,6 +45,9 @@ export default class krakenfutures extends Exchange {
45
45
  'fetchClosedOrders': undefined,
46
46
  'fetchCrossBorrowRate': false,
47
47
  'fetchCrossBorrowRates': false,
48
+ 'fetchDepositAddress': false,
49
+ 'fetchDepositAddresses': false,
50
+ 'fetchDepositAddressesByNetwork': false,
48
51
  'fetchFundingHistory': undefined,
49
52
  'fetchFundingRate': 'emulated',
50
53
  'fetchFundingRateHistory': true,
@@ -548,7 +551,7 @@ export default class krakenfutures extends Exchange {
548
551
  const volume = this.safeString(ticker, 'vol24h');
549
552
  let baseVolume = undefined;
550
553
  let quoteVolume = undefined;
551
- const isIndex = this.safeValue(market, 'index', false);
554
+ const isIndex = this.safeBool(market, 'index', false);
552
555
  if (!isIndex) {
553
556
  if (market['linear']) {
554
557
  baseVolume = volume;
package/js/src/kucoin.js CHANGED
@@ -943,7 +943,7 @@ export default class kucoin extends Exchange {
943
943
  //
944
944
  const data = this.safeValue(response, 'data');
945
945
  const options = this.safeValue(this.options, 'fetchMarkets', {});
946
- const fetchTickersFees = this.safeValue(options, 'fetchTickersFees', true);
946
+ const fetchTickersFees = this.safeBool(options, 'fetchTickersFees', true);
947
947
  let tickersResponse = {};
948
948
  if (fetchTickersFees) {
949
949
  tickersResponse = await this.publicGetMarketAllTickers(params);
@@ -1151,14 +1151,14 @@ export default class kucoin extends Exchange {
1151
1151
  const chain = chains[j];
1152
1152
  const chainId = this.safeString(chain, 'chainId');
1153
1153
  const networkCode = this.networkIdToCode(chainId);
1154
- const chainWithdrawEnabled = this.safeValue(chain, 'isWithdrawEnabled', false);
1154
+ const chainWithdrawEnabled = this.safeBool(chain, 'isWithdrawEnabled', false);
1155
1155
  if (isWithdrawEnabled === undefined) {
1156
1156
  isWithdrawEnabled = chainWithdrawEnabled;
1157
1157
  }
1158
1158
  else {
1159
1159
  isWithdrawEnabled = isWithdrawEnabled || chainWithdrawEnabled;
1160
1160
  }
1161
- const chainDepositEnabled = this.safeValue(chain, 'isDepositEnabled', false);
1161
+ const chainDepositEnabled = this.safeBool(chain, 'isDepositEnabled', false);
1162
1162
  if (isDepositEnabled === undefined) {
1163
1163
  isDepositEnabled = chainDepositEnabled;
1164
1164
  }
@@ -1916,9 +1916,9 @@ export default class kucoin extends Exchange {
1916
1916
  */
1917
1917
  await this.loadMarkets();
1918
1918
  const market = this.market(symbol);
1919
- const testOrder = this.safeValue(params, 'test', false);
1919
+ const testOrder = this.safeBool(params, 'test', false);
1920
1920
  params = this.omit(params, 'test');
1921
- const isHf = this.safeValue(params, 'hf', false);
1921
+ const isHf = this.safeBool(params, 'hf', false);
1922
1922
  const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
1923
1923
  const tradeType = this.safeString(params, 'tradeType'); // keep it for backward compatibility
1924
1924
  const isTriggerOrder = (triggerPrice || stopLossPrice || takeProfitPrice);
@@ -2045,7 +2045,7 @@ export default class kucoin extends Exchange {
2045
2045
  'symbol': market['id'],
2046
2046
  'orderList': ordersRequests,
2047
2047
  };
2048
- const hf = this.safeValue(params, 'hf', false);
2048
+ const hf = this.safeBool(params, 'hf', false);
2049
2049
  params = this.omit(params, 'hf');
2050
2050
  let response = undefined;
2051
2051
  if (hf) {
@@ -2227,7 +2227,7 @@ export default class kucoin extends Exchange {
2227
2227
  const request = {};
2228
2228
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
2229
2229
  const stop = this.safeValue2(params, 'stop', 'trigger', false);
2230
- const hf = this.safeValue(params, 'hf', false);
2230
+ const hf = this.safeBool(params, 'hf', false);
2231
2231
  if (hf) {
2232
2232
  if (symbol === undefined) {
2233
2233
  throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol parameter for hf orders');
@@ -2282,8 +2282,8 @@ export default class kucoin extends Exchange {
2282
2282
  */
2283
2283
  await this.loadMarkets();
2284
2284
  const request = {};
2285
- const stop = this.safeValue(params, 'stop', false);
2286
- const hf = this.safeValue(params, 'hf', false);
2285
+ const stop = this.safeBool(params, 'stop', false);
2286
+ const hf = this.safeBool(params, 'hf', false);
2287
2287
  params = this.omit(params, ['stop', 'hf']);
2288
2288
  const [marginMode, query] = this.handleMarginModeAndParams('cancelAllOrders', params);
2289
2289
  if (symbol !== undefined) {
@@ -2340,8 +2340,8 @@ export default class kucoin extends Exchange {
2340
2340
  await this.loadMarkets();
2341
2341
  let lowercaseStatus = status.toLowerCase();
2342
2342
  const until = this.safeInteger2(params, 'until', 'till');
2343
- const stop = this.safeValue(params, 'stop', false);
2344
- const hf = this.safeValue(params, 'hf', false);
2343
+ const stop = this.safeBool(params, 'stop', false);
2344
+ const hf = this.safeBool(params, 'hf', false);
2345
2345
  params = this.omit(params, ['stop', 'hf', 'till', 'until']);
2346
2346
  const [marginMode, query] = this.handleMarginModeAndParams('fetchOrdersByStatus', params);
2347
2347
  if (lowercaseStatus === 'open') {
@@ -2515,8 +2515,8 @@ export default class kucoin extends Exchange {
2515
2515
  await this.loadMarkets();
2516
2516
  const request = {};
2517
2517
  const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
2518
- const stop = this.safeValue(params, 'stop', false);
2519
- const hf = this.safeValue(params, 'hf', false);
2518
+ const stop = this.safeBool(params, 'stop', false);
2519
+ const hf = this.safeBool(params, 'hf', false);
2520
2520
  let market = undefined;
2521
2521
  if (symbol !== undefined) {
2522
2522
  market = this.market(symbol);
@@ -2693,10 +2693,10 @@ export default class kucoin extends Exchange {
2693
2693
  const marketId = this.safeString(order, 'symbol');
2694
2694
  const timestamp = this.safeInteger(order, 'createdAt');
2695
2695
  const feeCurrencyId = this.safeString(order, 'feeCurrency');
2696
- const cancelExist = this.safeValue(order, 'cancelExist', false);
2696
+ const cancelExist = this.safeBool(order, 'cancelExist', false);
2697
2697
  const responseStop = this.safeString(order, 'stop');
2698
2698
  const stop = responseStop !== undefined;
2699
- const stopTriggered = this.safeValue(order, 'stopTriggered', false);
2699
+ const stopTriggered = this.safeBool(order, 'stopTriggered', false);
2700
2700
  const isActive = this.safeValue2(order, 'isActive', 'active');
2701
2701
  const responseStatus = this.safeString(order, 'status');
2702
2702
  let status = undefined;
@@ -2793,7 +2793,7 @@ export default class kucoin extends Exchange {
2793
2793
  return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params);
2794
2794
  }
2795
2795
  let request = {};
2796
- const hf = this.safeValue(params, 'hf', false);
2796
+ const hf = this.safeBool(params, 'hf', false);
2797
2797
  if (hf && symbol === undefined) {
2798
2798
  throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol parameter for hf orders');
2799
2799
  }
@@ -3472,7 +3472,7 @@ export default class kucoin extends Exchange {
3472
3472
  const accountsByType = this.safeValue(this.options, 'accountsByType');
3473
3473
  let type = this.safeString(accountsByType, requestedType, requestedType);
3474
3474
  params = this.omit(params, 'type');
3475
- const isHf = this.safeValue(params, 'hf', false);
3475
+ const isHf = this.safeBool(params, 'hf', false);
3476
3476
  if (isHf) {
3477
3477
  type = 'trade_hf';
3478
3478
  }
@@ -1124,7 +1124,7 @@ export default class kucoinfutures extends kucoin {
1124
1124
  */
1125
1125
  await this.loadMarkets();
1126
1126
  const market = this.market(symbol);
1127
- const testOrder = this.safeValue(params, 'test', false);
1127
+ const testOrder = this.safeBool(params, 'test', false);
1128
1128
  params = this.omit(params, 'test');
1129
1129
  const orderRequest = this.createContractOrderRequest(symbol, type, side, amount, price, params);
1130
1130
  let response = undefined;
@@ -1787,7 +1787,7 @@ export default class kucoinfutures extends kucoin {
1787
1787
  // const average = Precise.stringDiv (cost, Precise.stringMul (filled, market['contractSize']));
1788
1788
  // bool
1789
1789
  const isActive = this.safeValue(order, 'isActive');
1790
- const cancelExist = this.safeValue(order, 'cancelExist', false);
1790
+ const cancelExist = this.safeBool(order, 'cancelExist', false);
1791
1791
  let status = undefined;
1792
1792
  if (isActive !== undefined) {
1793
1793
  status = isActive ? 'open' : 'closed';
@@ -2511,7 +2511,7 @@ export default class kucoinfutures extends kucoin {
2511
2511
  await this.loadMarkets();
2512
2512
  const market = this.market(symbol);
2513
2513
  let clientOrderId = this.safeString(params, 'clientOrderId');
2514
- const testOrder = this.safeValue(params, 'test', false);
2514
+ const testOrder = this.safeBool(params, 'test', false);
2515
2515
  params = this.omit(params, ['test', 'clientOrderId']);
2516
2516
  if (clientOrderId === undefined) {
2517
2517
  clientOrderId = this.numberToString(this.nonce());
package/js/src/lbank.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import Exchange from './abstract/lbank.js';
2
2
  import type { Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
3
3
  /**
4
- * @class lbank2
4
+ * @class lbank
5
5
  * @augments Exchange
6
6
  */
7
7
  export default class lbank extends Exchange {
package/js/src/lbank.js CHANGED
@@ -14,7 +14,7 @@ import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
14
14
  import { rsa } from './base/functions/rsa.js';
15
15
  // ---------------------------------------------------------------------------
16
16
  /**
17
- * @class lbank2
17
+ * @class lbank
18
18
  * @augments Exchange
19
19
  */
20
20
  export default class lbank extends Exchange {
@@ -52,6 +52,7 @@ export default class lbank extends Exchange {
52
52
  'fetchClosedOrders': false,
53
53
  'fetchCrossBorrowRate': false,
54
54
  'fetchCrossBorrowRates': false,
55
+ 'fetchDepositAddress': true,
55
56
  'fetchDepositWithdrawFee': 'emulated',
56
57
  'fetchDepositWithdrawFees': true,
57
58
  'fetchFundingHistory': false,
@@ -300,7 +301,7 @@ export default class lbank extends Exchange {
300
301
  async fetchTime(params = {}) {
301
302
  /**
302
303
  * @method
303
- * @name lbank2#fetchTime
304
+ * @name lbank#fetchTime
304
305
  * @description fetches the current integer timestamp in milliseconds from the exchange server
305
306
  * @see https://www.lbank.com/en-US/docs/index.html#get-timestamp
306
307
  * @see https://www.lbank.com/en-US/docs/contract.html#get-the-current-time
@@ -341,8 +342,8 @@ export default class lbank extends Exchange {
341
342
  async fetchMarkets(params = {}) {
342
343
  /**
343
344
  * @method
344
- * @name lbank2#fetchMarkets
345
- * @description retrieves data on all markets for lbank2
345
+ * @name lbank#fetchMarkets
346
+ * @description retrieves data on all markets for lbank
346
347
  * @see https://www.lbank.com/en-US/docs/index.html#trading-pairs
347
348
  * @see https://www.lbank.com/en-US/docs/contract.html#query-contract-information-list
348
349
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -595,7 +596,7 @@ export default class lbank extends Exchange {
595
596
  async fetchTicker(symbol, params = {}) {
596
597
  /**
597
598
  * @method
598
- * @name lbank2#fetchTicker
599
+ * @name lbank#fetchTicker
599
600
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
600
601
  * @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
601
602
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -640,7 +641,7 @@ export default class lbank extends Exchange {
640
641
  async fetchTickers(symbols = undefined, params = {}) {
641
642
  /**
642
643
  * @method
643
- * @name lbank2#fetchTickers
644
+ * @name lbank#fetchTickers
644
645
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
645
646
  * @see https://www.lbank.com/en-US/docs/index.html#query-current-market-data-new
646
647
  * @see https://www.lbank.com/en-US/docs/contract.html#query-contract-market-list
@@ -720,7 +721,7 @@ export default class lbank extends Exchange {
720
721
  async fetchOrderBook(symbol, limit = undefined, params = {}) {
721
722
  /**
722
723
  * @method
723
- * @name lbank2#fetchOrderBook
724
+ * @name lbank#fetchOrderBook
724
725
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
725
726
  * @see https://www.lbank.com/en-US/docs/index.html#query-market-depth
726
727
  * @see https://www.lbank.com/en-US/docs/contract.html#get-handicap
@@ -909,7 +910,7 @@ export default class lbank extends Exchange {
909
910
  async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
910
911
  /**
911
912
  * @method
912
- * @name lbank2#fetchTrades
913
+ * @name lbank#fetchTrades
913
914
  * @description get the list of most recent trades for a particular symbol
914
915
  * @see https://www.lbank.com/en-US/docs/index.html#query-historical-transactions
915
916
  * @see https://www.lbank.com/en-US/docs/index.html#recent-transactions-list
@@ -986,7 +987,7 @@ export default class lbank extends Exchange {
986
987
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
987
988
  /**
988
989
  * @method
989
- * @name lbank2#fetchOHLCV
990
+ * @name lbank#fetchOHLCV
990
991
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
991
992
  * @see https://www.lbank.com/en-US/docs/index.html#query-k-bar-data
992
993
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -1171,7 +1172,7 @@ export default class lbank extends Exchange {
1171
1172
  async fetchBalance(params = {}) {
1172
1173
  /**
1173
1174
  * @method
1174
- * @name lbank2#fetchBalance
1175
+ * @name lbank#fetchBalance
1175
1176
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
1176
1177
  * @see https://www.lbank.com/en-US/docs/index.html#asset-information
1177
1178
  * @see https://www.lbank.com/en-US/docs/index.html#account-information
@@ -1245,7 +1246,7 @@ export default class lbank extends Exchange {
1245
1246
  async fetchTradingFee(symbol, params = {}) {
1246
1247
  /**
1247
1248
  * @method
1248
- * @name lbank2#fetchTradingFee
1249
+ * @name lbank#fetchTradingFee
1249
1250
  * @description fetch the trading fees for a market
1250
1251
  * @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
1251
1252
  * @param {string} symbol unified market symbol
@@ -1259,7 +1260,7 @@ export default class lbank extends Exchange {
1259
1260
  async fetchTradingFees(params = {}) {
1260
1261
  /**
1261
1262
  * @method
1262
- * @name lbank2#fetchTradingFees
1263
+ * @name lbank#fetchTradingFees
1263
1264
  * @description fetch the trading fees for multiple markets
1264
1265
  * @see https://www.lbank.com/en-US/docs/index.html#transaction-fee-rate-query
1265
1266
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1300,7 +1301,7 @@ export default class lbank extends Exchange {
1300
1301
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1301
1302
  /**
1302
1303
  * @method
1303
- * @name lbank2#createOrder
1304
+ * @name lbank#createOrder
1304
1305
  * @description create a trade order
1305
1306
  * @see https://www.lbank.com/en-US/docs/index.html#place-order
1306
1307
  * @see https://www.lbank.com/en-US/docs/index.html#place-an-order
@@ -1315,7 +1316,7 @@ export default class lbank extends Exchange {
1315
1316
  await this.loadMarkets();
1316
1317
  const market = this.market(symbol);
1317
1318
  const clientOrderId = this.safeString2(params, 'custom_id', 'clientOrderId');
1318
- const postOnly = this.safeValue(params, 'postOnly', false);
1319
+ const postOnly = this.safeBool(params, 'postOnly', false);
1319
1320
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
1320
1321
  params = this.omit(params, ['custom_id', 'clientOrderId', 'timeInForce', 'postOnly']);
1321
1322
  const request = {
@@ -1544,7 +1545,7 @@ export default class lbank extends Exchange {
1544
1545
  async fetchOrder(id, symbol = undefined, params = {}) {
1545
1546
  /**
1546
1547
  * @method
1547
- * @name lbank2#fetchOrder
1548
+ * @name lbank#fetchOrder
1548
1549
  * @description fetches information on an order made by the user
1549
1550
  * @see https://www.lbank.com/en-US/docs/index.html#query-order
1550
1551
  * @see https://www.lbank.com/en-US/docs/index.html#query-order-new
@@ -1648,7 +1649,7 @@ export default class lbank extends Exchange {
1648
1649
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1649
1650
  /**
1650
1651
  * @method
1651
- * @name lbank2#fetchMyTrades
1652
+ * @name lbank#fetchMyTrades
1652
1653
  * @description fetch all trades made by the user
1653
1654
  * @see https://www.lbank.com/en-US/docs/index.html#past-transaction-details
1654
1655
  * @param {string} symbol unified market symbol
@@ -1707,7 +1708,7 @@ export default class lbank extends Exchange {
1707
1708
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1708
1709
  /**
1709
1710
  * @method
1710
- * @name lbank2#fetchOrders
1711
+ * @name lbank#fetchOrders
1711
1712
  * @description fetches information on multiple orders made by the user
1712
1713
  * @see https://www.lbank.com/en-US/docs/index.html#query-all-orders
1713
1714
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1767,7 +1768,7 @@ export default class lbank extends Exchange {
1767
1768
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1768
1769
  /**
1769
1770
  * @method
1770
- * @name lbank2#fetchOpenOrders
1771
+ * @name lbank#fetchOpenOrders
1771
1772
  * @description fetch all unfilled currently open orders
1772
1773
  * @see https://www.lbank.com/en-US/docs/index.html#current-pending-order
1773
1774
  * @param {string} symbol unified market symbol
@@ -1824,7 +1825,7 @@ export default class lbank extends Exchange {
1824
1825
  async cancelOrder(id, symbol = undefined, params = {}) {
1825
1826
  /**
1826
1827
  * @method
1827
- * @name lbank2#cancelOrder
1828
+ * @name lbank#cancelOrder
1828
1829
  * @description cancels an open order
1829
1830
  * @see https://www.lbank.com/en-US/docs/index.html#cancel-order-new
1830
1831
  * @param {string} id order id
@@ -1866,7 +1867,7 @@ export default class lbank extends Exchange {
1866
1867
  async cancelAllOrders(symbol = undefined, params = {}) {
1867
1868
  /**
1868
1869
  * @method
1869
- * @name lbank2#cancelAllOrders
1870
+ * @name lbank#cancelAllOrders
1870
1871
  * @description cancel all open orders in a market
1871
1872
  * @see https://www.lbank.com/en-US/docs/index.html#cancel-all-pending-orders-for-a-single-trading-pair
1872
1873
  * @param {string} symbol unified market symbol of the market to cancel orders in
@@ -1913,7 +1914,7 @@ export default class lbank extends Exchange {
1913
1914
  async fetchDepositAddress(code, params = {}) {
1914
1915
  /**
1915
1916
  * @method
1916
- * @name lbank2#fetchDepositAddress
1917
+ * @name lbank#fetchDepositAddress
1917
1918
  * @description fetch the deposit address for a currency associated with this account
1918
1919
  * @see https://www.lbank.com/en-US/docs/index.html#get-deposit-address
1919
1920
  * @see https://www.lbank.com/en-US/docs/index.html#the-user-obtains-the-deposit-address
@@ -2017,7 +2018,7 @@ export default class lbank extends Exchange {
2017
2018
  async withdraw(code, amount, address, tag = undefined, params = {}) {
2018
2019
  /**
2019
2020
  * @method
2020
- * @name lbank2#withdraw
2021
+ * @name lbank#withdraw
2021
2022
  * @description make a withdrawal
2022
2023
  * @see https://www.lbank.com/en-US/docs/index.html#withdrawal
2023
2024
  * @param {string} code unified currency code
@@ -2183,7 +2184,7 @@ export default class lbank extends Exchange {
2183
2184
  async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
2184
2185
  /**
2185
2186
  * @method
2186
- * @name lbank2#fetchDeposits
2187
+ * @name lbank#fetchDeposits
2187
2188
  * @description fetch all deposits made to an account
2188
2189
  * @see https://www.lbank.com/en-US/docs/index.html#get-recharge-history
2189
2190
  * @param {string} code unified currency code
@@ -2236,7 +2237,7 @@ export default class lbank extends Exchange {
2236
2237
  async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
2237
2238
  /**
2238
2239
  * @method
2239
- * @name lbank2#fetchWithdrawals
2240
+ * @name lbank#fetchWithdrawals
2240
2241
  * @description fetch all withdrawals made from an account
2241
2242
  * @see https://www.lbank.com/en-US/docs/index.html#get-withdrawal-history
2242
2243
  * @param {string} code unified currency code
@@ -2293,10 +2294,10 @@ export default class lbank extends Exchange {
2293
2294
  async fetchTransactionFees(codes = undefined, params = {}) {
2294
2295
  /**
2295
2296
  * @method
2296
- * @name lbank2#fetchTransactionFees
2297
+ * @name lbank#fetchTransactionFees
2297
2298
  * @deprecated
2298
2299
  * @description please use fetchDepositWithdrawFees instead
2299
- * @param {string[]|undefined} codes not used by lbank2 fetchTransactionFees ()
2300
+ * @param {string[]|undefined} codes not used by lbank fetchTransactionFees ()
2300
2301
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2301
2302
  * @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
2302
2303
  */
@@ -2442,7 +2443,7 @@ export default class lbank extends Exchange {
2442
2443
  async fetchDepositWithdrawFees(codes = undefined, params = {}) {
2443
2444
  /**
2444
2445
  * @method
2445
- * @name lbank2#fetchDepositWithdrawFees
2446
+ * @name lbank#fetchDepositWithdrawFees
2446
2447
  * @description when using private endpoint, only returns information for currencies with non-zero balance, use public method by specifying this.options['fetchDepositWithdrawFees']['method'] = 'fetchPublicDepositWithdrawFees'
2447
2448
  * @see https://www.lbank.com/en-US/docs/index.html#get-all-coins-information
2448
2449
  * @see https://www.lbank.com/en-US/docs/index.html#withdrawal-configurations
package/js/src/mexc.js CHANGED
@@ -958,8 +958,8 @@ export default class mexc extends Exchange {
958
958
  const chain = chains[j];
959
959
  const networkId = this.safeString(chain, 'network');
960
960
  const network = this.safeNetwork(networkId);
961
- const isDepositEnabled = this.safeValue(chain, 'depositEnable', false);
962
- const isWithdrawEnabled = this.safeValue(chain, 'withdrawEnable', false);
961
+ const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
962
+ const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
963
963
  const active = (isDepositEnabled && isWithdrawEnabled);
964
964
  currencyActive = active || currencyActive;
965
965
  const withdrawMin = this.safeString(chain, 'withdrawMin');
@@ -2218,7 +2218,7 @@ export default class mexc extends Exchange {
2218
2218
  await this.loadMarkets();
2219
2219
  const symbol = market['symbol'];
2220
2220
  const unavailableContracts = this.safeValue(this.options, 'unavailableContracts', {});
2221
- const isContractUnavaiable = this.safeValue(unavailableContracts, symbol, false);
2221
+ const isContractUnavaiable = this.safeBool(unavailableContracts, symbol, false);
2222
2222
  if (isContractUnavaiable) {
2223
2223
  throw new NotSupported(this.id + ' createSwapOrder() does not support yet this symbol:' + symbol);
2224
2224
  }
@@ -2286,7 +2286,7 @@ export default class mexc extends Exchange {
2286
2286
  throw new ArgumentsRequired(this.id + ' createSwapOrder() requires a leverage parameter for isolated margin orders');
2287
2287
  }
2288
2288
  }
2289
- const reduceOnly = this.safeValue(params, 'reduceOnly', false);
2289
+ const reduceOnly = this.safeBool(params, 'reduceOnly', false);
2290
2290
  if (reduceOnly) {
2291
2291
  request['side'] = (side === 'buy') ? 2 : 4;
2292
2292
  }
@@ -3622,7 +3622,7 @@ export default class mexc extends Exchange {
3622
3622
  const request = {};
3623
3623
  [marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
3624
3624
  const marginMode = this.safeString(params, 'marginMode');
3625
- const isMargin = this.safeValue(params, 'margin', false);
3625
+ const isMargin = this.safeBool(params, 'margin', false);
3626
3626
  params = this.omit(params, ['margin', 'marginMode']);
3627
3627
  let response = undefined;
3628
3628
  if ((marginMode !== undefined) || (isMargin) || (marketType === 'margin')) {
@@ -5300,7 +5300,7 @@ export default class mexc extends Exchange {
5300
5300
  * @returns {Array} the marginMode in lowercase
5301
5301
  */
5302
5302
  const defaultType = this.safeString(this.options, 'defaultType');
5303
- const isMargin = this.safeValue(params, 'margin', false);
5303
+ const isMargin = this.safeBool(params, 'margin', false);
5304
5304
  let marginMode = undefined;
5305
5305
  [marginMode, params] = super.handleMarginModeAndParams(methodName, params, defaultValue);
5306
5306
  if ((defaultType === 'margin') || (isMargin === true)) {
@@ -5392,7 +5392,7 @@ export default class mexc extends Exchange {
5392
5392
  // {"code":10216,"msg":"No available deposit address"}
5393
5393
  // {"success":true, "code":0, "data":1634095541710}
5394
5394
  //
5395
- const success = this.safeValue(response, 'success', false); // v1
5395
+ const success = this.safeBool(response, 'success', false); // v1
5396
5396
  if (success === true) {
5397
5397
  return undefined;
5398
5398
  }
package/js/src/novadax.js CHANGED
@@ -1165,7 +1165,7 @@ export default class novadax extends Exchange {
1165
1165
  //
1166
1166
  const transfer = this.parseTransfer(response, currency);
1167
1167
  const transferOptions = this.safeValue(this.options, 'transfer', {});
1168
- const fillResponseFromRequest = this.safeValue(transferOptions, 'fillResponseFromRequest', true);
1168
+ const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
1169
1169
  if (fillResponseFromRequest) {
1170
1170
  transfer['fromAccount'] = fromAccount;
1171
1171
  transfer['toAccount'] = toAccount;
package/js/src/okcoin.js CHANGED
@@ -860,7 +860,7 @@ export default class okcoin extends Exchange {
860
860
  const symbol = market['symbol'];
861
861
  const last = this.safeString(ticker, 'last');
862
862
  const open = this.safeString(ticker, 'open24h');
863
- const spot = this.safeValue(market, 'spot', false);
863
+ const spot = this.safeBool(market, 'spot', false);
864
864
  const quoteVolume = spot ? this.safeString(ticker, 'volCcy24h') : undefined;
865
865
  const baseVolume = this.safeString(ticker, 'vol24h');
866
866
  const high = this.safeString(ticker, 'high24h');
@@ -1404,7 +1404,7 @@ export default class okcoin extends Exchange {
1404
1404
  }
1405
1405
  else {
1406
1406
  marginMode = defaultMarginMode;
1407
- margin = this.safeValue(params, 'margin', false);
1407
+ margin = this.safeBool(params, 'margin', false);
1408
1408
  }
1409
1409
  if (margin) {
1410
1410
  const defaultCurrency = (side === 'buy') ? market['quote'] : market['base'];