ccxt 4.2.29 → 4.2.30

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 (154) hide show
  1. package/README.md +4 -4
  2. package/dist/ccxt.browser.js +1709 -533
  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 +21 -21
  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 +896 -217
  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 +52 -62
  14. package/dist/cjs/src/bitget.js +8 -4
  15. package/dist/cjs/src/bitmart.js +3 -3
  16. package/dist/cjs/src/bitmex.js +4 -4
  17. package/dist/cjs/src/bitrue.js +1 -1
  18. package/dist/cjs/src/bitso.js +1 -1
  19. package/dist/cjs/src/bitteam.js +2 -2
  20. package/dist/cjs/src/btcalpha.js +1 -1
  21. package/dist/cjs/src/bybit.js +3 -3
  22. package/dist/cjs/src/coinbase.js +12 -5
  23. package/dist/cjs/src/coincheck.js +1 -1
  24. package/dist/cjs/src/coinex.js +2 -2
  25. package/dist/cjs/src/coinlist.js +1 -1
  26. package/dist/cjs/src/coinmate.js +1 -1
  27. package/dist/cjs/src/coinmetro.js +2 -2
  28. package/dist/cjs/src/coinsph.js +1 -1
  29. package/dist/cjs/src/cryptocom.js +3 -3
  30. package/dist/cjs/src/digifinex.js +6 -4
  31. package/dist/cjs/src/exmo.js +2 -2
  32. package/dist/cjs/src/gate.js +5 -5
  33. package/dist/cjs/src/gemini.js +3 -3
  34. package/dist/cjs/src/hitbtc.js +14 -20
  35. package/dist/cjs/src/hollaex.js +2 -2
  36. package/dist/cjs/src/htx.js +5 -5
  37. package/dist/cjs/src/huobijp.js +1 -1
  38. package/dist/cjs/src/krakenfutures.js +1 -1
  39. package/dist/cjs/src/kucoin.js +17 -17
  40. package/dist/cjs/src/kucoinfutures.js +3 -3
  41. package/dist/cjs/src/lbank.js +1 -1
  42. package/dist/cjs/src/mexc.js +7 -7
  43. package/dist/cjs/src/novadax.js +1 -1
  44. package/dist/cjs/src/okcoin.js +2 -2
  45. package/dist/cjs/src/okx.js +7 -6
  46. package/dist/cjs/src/p2b.js +1 -0
  47. package/dist/cjs/src/phemex.js +3 -3
  48. package/dist/cjs/src/poloniexfutures.js +3 -3
  49. package/dist/cjs/src/pro/alpaca.js +1 -1
  50. package/dist/cjs/src/pro/binance.js +4 -4
  51. package/dist/cjs/src/pro/bitget.js +1 -1
  52. package/dist/cjs/src/pro/bitmart.js +1 -1
  53. package/dist/cjs/src/pro/bitmex.js +49 -6
  54. package/dist/cjs/src/pro/bitvavo.js +1 -1
  55. package/dist/cjs/src/pro/bybit.js +2 -2
  56. package/dist/cjs/src/pro/cex.js +2 -2
  57. package/dist/cjs/src/pro/independentreserve.js +1 -1
  58. package/dist/cjs/src/pro/okx.js +1 -1
  59. package/dist/cjs/src/pro/onetrading.js +2 -2
  60. package/dist/cjs/src/pro/p2b.js +432 -0
  61. package/dist/cjs/src/pro/probit.js +5 -5
  62. package/dist/cjs/src/pro/whitebit.js +1 -1
  63. package/dist/cjs/src/probit.js +1 -1
  64. package/dist/cjs/src/timex.js +1 -1
  65. package/dist/cjs/src/tokocrypto.js +3 -3
  66. package/dist/cjs/src/wavesexchange.js +2 -2
  67. package/dist/cjs/src/whitebit.js +2 -2
  68. package/dist/cjs/src/woo.js +3 -3
  69. package/dist/cjs/src/yobit.js +1 -1
  70. package/dist/cjs/src/zaif.js +1 -1
  71. package/dist/cjs/src/zonda.js +3 -3
  72. package/js/ccxt.d.ts +4 -1
  73. package/js/ccxt.js +3 -1
  74. package/js/src/abstract/bybit.d.ts +2 -2
  75. package/js/src/ascendex.js +5 -5
  76. package/js/src/base/Exchange.d.ts +1 -1
  77. package/js/src/base/Exchange.js +21 -21
  78. package/js/src/base/errorHierarchy.d.ts +7 -6
  79. package/js/src/base/errorHierarchy.js +7 -6
  80. package/js/src/base/errors.d.ts +3 -3
  81. package/js/src/base/errors.js +3 -3
  82. package/js/src/base/functions/type.js +12 -0
  83. package/js/src/bigone.js +2 -2
  84. package/js/src/binance.d.ts +1 -0
  85. package/js/src/binance.js +897 -218
  86. package/js/src/bingx.js +1 -1
  87. package/js/src/bitfinex.js +1 -1
  88. package/js/src/bitfinex2.js +52 -62
  89. package/js/src/bitget.js +8 -4
  90. package/js/src/bitmart.js +3 -3
  91. package/js/src/bitmex.js +4 -4
  92. package/js/src/bitrue.js +1 -1
  93. package/js/src/bitso.d.ts +1 -1
  94. package/js/src/bitso.js +1 -1
  95. package/js/src/bitteam.js +2 -2
  96. package/js/src/btcalpha.js +1 -1
  97. package/js/src/bybit.js +3 -3
  98. package/js/src/coinbase.js +12 -5
  99. package/js/src/coincheck.js +1 -1
  100. package/js/src/coinex.js +2 -2
  101. package/js/src/coinlist.js +1 -1
  102. package/js/src/coinmate.js +1 -1
  103. package/js/src/coinmetro.d.ts +1 -1
  104. package/js/src/coinmetro.js +2 -2
  105. package/js/src/coinsph.js +1 -1
  106. package/js/src/cryptocom.js +3 -3
  107. package/js/src/digifinex.js +6 -4
  108. package/js/src/exmo.js +2 -2
  109. package/js/src/gate.js +5 -5
  110. package/js/src/gemini.d.ts +1 -1
  111. package/js/src/gemini.js +3 -3
  112. package/js/src/hitbtc.js +14 -20
  113. package/js/src/hollaex.js +2 -2
  114. package/js/src/htx.js +5 -5
  115. package/js/src/huobijp.js +1 -1
  116. package/js/src/krakenfutures.js +1 -1
  117. package/js/src/kucoin.js +17 -17
  118. package/js/src/kucoinfutures.js +3 -3
  119. package/js/src/lbank.js +1 -1
  120. package/js/src/mexc.js +7 -7
  121. package/js/src/novadax.js +1 -1
  122. package/js/src/okcoin.js +2 -2
  123. package/js/src/okx.js +7 -6
  124. package/js/src/p2b.js +1 -0
  125. package/js/src/phemex.js +3 -3
  126. package/js/src/poloniexfutures.js +3 -3
  127. package/js/src/pro/alpaca.js +1 -1
  128. package/js/src/pro/binance.js +4 -4
  129. package/js/src/pro/bitget.js +1 -1
  130. package/js/src/pro/bitmart.js +1 -1
  131. package/js/src/pro/bitmex.d.ts +2 -1
  132. package/js/src/pro/bitmex.js +49 -6
  133. package/js/src/pro/bitvavo.js +1 -1
  134. package/js/src/pro/bybit.js +2 -2
  135. package/js/src/pro/cex.js +2 -2
  136. package/js/src/pro/independentreserve.js +1 -1
  137. package/js/src/pro/okx.js +1 -1
  138. package/js/src/pro/onetrading.js +2 -2
  139. package/js/src/pro/p2b.d.ts +23 -0
  140. package/js/src/pro/p2b.js +433 -0
  141. package/js/src/pro/probit.js +5 -5
  142. package/js/src/pro/whitebit.js +1 -1
  143. package/js/src/probit.js +1 -1
  144. package/js/src/timex.js +1 -1
  145. package/js/src/tokocrypto.js +3 -3
  146. package/js/src/wavesexchange.js +2 -2
  147. package/js/src/whitebit.js +2 -2
  148. package/js/src/woo.js +3 -3
  149. package/js/src/yobit.js +1 -1
  150. package/js/src/zaif.js +1 -1
  151. package/js/src/zonda.d.ts +1 -1
  152. package/js/src/zonda.js +3 -3
  153. package/package.json +1 -1
  154. package/skip-tests.json +3 -10
@@ -100,7 +100,7 @@ export default class probit extends probitRest {
100
100
  // }
101
101
  // }
102
102
  //
103
- const reset = this.safeValue(message, 'reset', false);
103
+ const reset = this.safeBool(message, 'reset', false);
104
104
  const data = this.safeValue(message, 'data', {});
105
105
  const currencyIds = Object.keys(data);
106
106
  if (reset) {
@@ -206,7 +206,7 @@ export default class probit extends probitRest {
206
206
  const symbol = this.safeSymbol(marketId);
207
207
  const market = this.safeMarket(marketId);
208
208
  const trades = this.safeValue(message, 'recent_trades', []);
209
- const reset = this.safeValue(message, 'reset', false);
209
+ const reset = this.safeBool(message, 'reset', false);
210
210
  const messageHash = 'trades:' + symbol;
211
211
  let stored = this.safeValue(this.trades, symbol);
212
212
  if (stored === undefined || reset) {
@@ -279,7 +279,7 @@ export default class probit extends probitRest {
279
279
  if (length === 0) {
280
280
  return;
281
281
  }
282
- const reset = this.safeValue(message, 'reset', false);
282
+ const reset = this.safeBool(message, 'reset', false);
283
283
  const messageHash = 'myTrades';
284
284
  let stored = this.myTrades;
285
285
  if ((stored === undefined) || reset) {
@@ -367,7 +367,7 @@ export default class probit extends probitRest {
367
367
  return;
368
368
  }
369
369
  const messageHash = 'orders';
370
- const reset = this.safeValue(message, 'reset', false);
370
+ const reset = this.safeBool(message, 'reset', false);
371
371
  let stored = this.orders;
372
372
  if (stored === undefined || reset) {
373
373
  const limit = this.safeInteger(this.options, 'ordersLimit', 1000);
@@ -459,7 +459,7 @@ export default class probit extends probitRest {
459
459
  storedOrderBook = this.orderBook({});
460
460
  this.orderbooks[symbol] = storedOrderBook;
461
461
  }
462
- const reset = this.safeValue(message, 'reset', false);
462
+ const reset = this.safeBool(message, 'reset', false);
463
463
  if (reset) {
464
464
  const snapshot = this.parseOrderBook(dataBySide, symbol, undefined, 'buy', 'sell', 'price', 'quantity');
465
465
  storedOrderBook.reset(snapshot);
@@ -741,7 +741,7 @@ export default class whitebit extends whitebitRest {
741
741
  let hasSymbolSubscription = true;
742
742
  const market = this.market(symbol);
743
743
  const marketId = market['id'];
744
- const isSubscribed = this.safeValue(subscription, marketId, false);
744
+ const isSubscribed = this.safeBool(subscription, marketId, false);
745
745
  if (!isSubscribed) {
746
746
  subscription[marketId] = true;
747
747
  hasSymbolSubscription = false;
package/js/src/probit.js CHANGED
@@ -287,7 +287,7 @@ export default class probit extends Exchange {
287
287
  const quoteId = this.safeString(market, 'quote_currency_id');
288
288
  const base = this.safeCurrencyCode(baseId);
289
289
  const quote = this.safeCurrencyCode(quoteId);
290
- const closed = this.safeValue(market, 'closed', false);
290
+ const closed = this.safeBool(market, 'closed', false);
291
291
  const takerFeeRate = this.safeString(market, 'taker_fee_rate');
292
292
  const taker = Precise.stringDiv(takerFeeRate, '100');
293
293
  const makerFeeRate = this.safeString(market, 'maker_fee_rate');
package/js/src/timex.js CHANGED
@@ -724,7 +724,7 @@ export default class timex extends Exchange {
724
724
  const market = this.market(symbol);
725
725
  const uppercaseSide = side.toUpperCase();
726
726
  let uppercaseType = type.toUpperCase();
727
- const postOnly = this.safeValue(params, 'postOnly', false);
727
+ const postOnly = this.safeBool(params, 'postOnly', false);
728
728
  if (postOnly) {
729
729
  uppercaseType = 'POST_ONLY';
730
730
  params = this.omit(params, ['postOnly']);
@@ -692,7 +692,7 @@ export default class tokocrypto extends Exchange {
692
692
  break;
693
693
  }
694
694
  }
695
- const isMarginTradingAllowed = this.safeValue(market, 'isMarginTradingAllowed', false);
695
+ const isMarginTradingAllowed = this.safeBool(market, 'isMarginTradingAllowed', false);
696
696
  const entry = {
697
697
  'id': id,
698
698
  'lowercaseId': lowercaseId,
@@ -1591,7 +1591,7 @@ export default class tokocrypto extends Exchange {
1591
1591
  await this.loadMarkets();
1592
1592
  const market = this.market(symbol);
1593
1593
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'clientId');
1594
- const postOnly = this.safeValue(params, 'postOnly', false);
1594
+ const postOnly = this.safeBool(params, 'postOnly', false);
1595
1595
  // only supported for spot/margin api
1596
1596
  if (postOnly) {
1597
1597
  type = 'LIMIT_MAKER';
@@ -2465,7 +2465,7 @@ export default class tokocrypto extends Exchange {
2465
2465
  }
2466
2466
  // check success value for wapi endpoints
2467
2467
  // response in format {'msg': 'The coin does not exist.', 'success': true/false}
2468
- const success = this.safeValue(response, 'success', true);
2468
+ const success = this.safeBool(response, 'success', true);
2469
2469
  if (!success) {
2470
2470
  const messageInner = this.safeString(response, 'msg');
2471
2471
  let parsedMessage = undefined;
@@ -398,7 +398,7 @@ export default class wavesexchange extends Exchange {
398
398
  // "matcherFee":"4077612"
399
399
  // }
400
400
  // }
401
- const isDiscountFee = this.safeValue(params, 'isDiscountFee', false);
401
+ const isDiscountFee = this.safeBool(params, 'isDiscountFee', false);
402
402
  let mode = undefined;
403
403
  if (isDiscountFee) {
404
404
  mode = this.safeValue(response, 'discount');
@@ -2415,7 +2415,7 @@ export default class wavesexchange extends Exchange {
2415
2415
  }
2416
2416
  handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
2417
2417
  const errorCode = this.safeString(response, 'error');
2418
- const success = this.safeValue(response, 'success', true);
2418
+ const success = this.safeBool(response, 'success', true);
2419
2419
  const Exception = this.safeValue(this.exceptions, errorCode);
2420
2420
  if (Exception !== undefined) {
2421
2421
  const messageInner = this.safeString(response, 'message');
@@ -425,8 +425,8 @@ export default class whitebit extends Exchange {
425
425
  const currency = response[id];
426
426
  // breaks down in Python due to utf8 encoding issues on the exchange side
427
427
  // const name = this.safeString (currency, 'name');
428
- const canDeposit = this.safeValue(currency, 'can_deposit', true);
429
- const canWithdraw = this.safeValue(currency, 'can_withdraw', true);
428
+ const canDeposit = this.safeBool(currency, 'can_deposit', true);
429
+ const canWithdraw = this.safeBool(currency, 'can_withdraw', true);
430
430
  const active = canDeposit && canWithdraw;
431
431
  const code = this.safeCurrencyCode(id);
432
432
  result[code] = {
package/js/src/woo.js CHANGED
@@ -1136,7 +1136,7 @@ export default class woo extends Exchange {
1136
1136
  * @param {boolean} [params.stop] whether the order is a stop/algo order
1137
1137
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1138
1138
  */
1139
- const stop = this.safeValue(params, 'stop', false);
1139
+ const stop = this.safeBool(params, 'stop', false);
1140
1140
  params = this.omit(params, 'stop');
1141
1141
  if (!stop && (symbol === undefined)) {
1142
1142
  throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
@@ -1304,7 +1304,7 @@ export default class woo extends Exchange {
1304
1304
  const request = {};
1305
1305
  let market = undefined;
1306
1306
  const stop = this.safeValue(params, 'stop');
1307
- const trailing = this.safeValue(params, 'trailing', false);
1307
+ const trailing = this.safeBool(params, 'trailing', false);
1308
1308
  params = this.omit(params, ['stop', 'trailing']);
1309
1309
  if (symbol !== undefined) {
1310
1310
  market = this.market(symbol);
@@ -2086,7 +2086,7 @@ export default class woo extends Exchange {
2086
2086
  //
2087
2087
  const transfer = this.parseTransfer(response, currency);
2088
2088
  const transferOptions = this.safeValue(this.options, 'transfer', {});
2089
- const fillResponseFromRequest = this.safeValue(transferOptions, 'fillResponseFromRequest', true);
2089
+ const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
2090
2090
  if (fillResponseFromRequest) {
2091
2091
  transfer['amount'] = amount;
2092
2092
  transfer['fromAccount'] = fromAccount;
package/js/src/yobit.js CHANGED
@@ -1291,7 +1291,7 @@ export default class yobit extends Exchange {
1291
1291
  //
1292
1292
  // To cover points 1, 2, 3 and 4 combined this handler should work like this:
1293
1293
  //
1294
- let success = this.safeValue(response, 'success', false);
1294
+ let success = this.safeBool(response, 'success', false);
1295
1295
  if (typeof success === 'string') {
1296
1296
  if ((success === 'true') || (success === '1')) {
1297
1297
  success = true;
package/js/src/zaif.js CHANGED
@@ -728,7 +728,7 @@ export default class zaif extends Exchange {
728
728
  this.throwBroadlyMatchedException(this.exceptions['broad'], error, feedback);
729
729
  throw new ExchangeError(feedback); // unknown message
730
730
  }
731
- const success = this.safeValue(response, 'success', true);
731
+ const success = this.safeBool(response, 'success', true);
732
732
  if (!success) {
733
733
  throw new ExchangeError(feedback);
734
734
  }
package/js/src/zonda.d.ts CHANGED
@@ -42,7 +42,7 @@ export default class zonda extends Exchange {
42
42
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
43
43
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<Order>;
44
44
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
45
- isFiat(currency: any): any;
45
+ isFiat(currency: any): boolean;
46
46
  parseDepositAddress(depositAddress: any, currency?: Currency): {
47
47
  currency: string;
48
48
  address: string;
package/js/src/zonda.js CHANGED
@@ -1439,7 +1439,7 @@ export default class zonda extends Exchange {
1439
1439
  // }
1440
1440
  //
1441
1441
  const id = this.safeString2(response, 'offerId', 'stopOfferId');
1442
- const completed = this.safeValue(response, 'completed', false);
1442
+ const completed = this.safeBool(response, 'completed', false);
1443
1443
  const status = completed ? 'closed' : 'open';
1444
1444
  const transactions = this.safeValue(response, 'transactions');
1445
1445
  return this.safeOrder({
@@ -1501,7 +1501,7 @@ export default class zonda extends Exchange {
1501
1501
  'EUR': true,
1502
1502
  'PLN': true,
1503
1503
  };
1504
- return this.safeValue(fiatCurrencies, currency, false);
1504
+ return this.safeBool(fiatCurrencies, currency, false);
1505
1505
  }
1506
1506
  parseDepositAddress(depositAddress, currency = undefined) {
1507
1507
  //
@@ -1638,7 +1638,7 @@ export default class zonda extends Exchange {
1638
1638
  //
1639
1639
  const transfer = this.parseTransfer(response, currency);
1640
1640
  const transferOptions = this.safeValue(this.options, 'transfer', {});
1641
- const fillResponseFromRequest = this.safeValue(transferOptions, 'fillResponseFromRequest', true);
1641
+ const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
1642
1642
  if (fillResponseFromRequest) {
1643
1643
  transfer['amount'] = amount;
1644
1644
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.29",
3
+ "version": "4.2.30",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",
package/skip-tests.json CHANGED
@@ -380,16 +380,8 @@
380
380
  "fetchTrades": {
381
381
  "side": "not set"
382
382
  },
383
- "fetchTickers": {
384
- "quoteVolume": "quoteVolume >= baseVolume * low is failing",
385
- "baseVolume": "quoteVolume >= baseVolume * low is failing",
386
- "bid": "bid ask crossed",
387
- "ask": "bid ask crossed"
388
- },
389
- "fetchTicker": {
390
- "quoteVolume": "quoteVolume >= baseVolume * low is failing",
391
- "baseVolume": "quoteVolume >= baseVolume * low is failing"
392
- }
383
+ "fetchTickers": "skip",
384
+ "fetchTicker": "skip"
393
385
  }
394
386
  },
395
387
  "bitso": {
@@ -1324,6 +1316,7 @@
1324
1316
  },
1325
1317
  "p2b": {
1326
1318
  "skip": "temp issues",
1319
+ "skipWs": "flaky",
1327
1320
  "httpsProxy": "http://51.83.140.52:11230",
1328
1321
  "skipMethods": {
1329
1322
  "loadMarkets": "invalid URL",