ccxt 4.2.40 → 4.2.42

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 (44) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +261 -58
  3. package/dist/ccxt.browser.min.js +2 -2
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/binance.js +189 -22
  6. package/dist/cjs/src/bingx.js +22 -3
  7. package/dist/cjs/src/bitforex.js +2 -2
  8. package/dist/cjs/src/bitget.js +9 -2
  9. package/dist/cjs/src/bitrue.js +7 -15
  10. package/dist/cjs/src/currencycom.js +1 -1
  11. package/dist/cjs/src/digifinex.js +4 -1
  12. package/dist/cjs/src/gate.js +4 -1
  13. package/dist/cjs/src/gemini.js +4 -1
  14. package/dist/cjs/src/htx.js +1 -1
  15. package/dist/cjs/src/mexc.js +5 -2
  16. package/dist/cjs/src/phemex.js +4 -1
  17. package/dist/cjs/src/poloniex.js +4 -1
  18. package/dist/cjs/src/pro/cex.js +1 -1
  19. package/dist/cjs/src/pro/gemini.js +1 -1
  20. package/dist/cjs/src/pro/hitbtc.js +1 -1
  21. package/dist/cjs/src/pro/poloniex.js +1 -1
  22. package/js/ccxt.d.ts +1 -1
  23. package/js/ccxt.js +1 -1
  24. package/js/src/base/Exchange.d.ts +20 -20
  25. package/js/src/binance.js +189 -22
  26. package/js/src/bingx.d.ts +1 -0
  27. package/js/src/bingx.js +22 -3
  28. package/js/src/bitforex.js +2 -2
  29. package/js/src/bitget.d.ts +2 -2
  30. package/js/src/bitget.js +9 -2
  31. package/js/src/bitrue.js +7 -15
  32. package/js/src/currencycom.js +1 -1
  33. package/js/src/digifinex.js +4 -1
  34. package/js/src/gate.js +4 -1
  35. package/js/src/gemini.js +4 -1
  36. package/js/src/htx.js +1 -1
  37. package/js/src/mexc.js +5 -2
  38. package/js/src/phemex.js +4 -1
  39. package/js/src/poloniex.js +4 -1
  40. package/js/src/pro/cex.js +1 -1
  41. package/js/src/pro/gemini.js +1 -1
  42. package/js/src/pro/hitbtc.js +1 -1
  43. package/js/src/pro/poloniex.js +1 -1
  44. package/package.json +1 -1
package/js/src/mexc.js CHANGED
@@ -4330,7 +4330,10 @@ export default class mexc extends Exchange {
4330
4330
  'coin': currency['id'],
4331
4331
  };
4332
4332
  const networkCode = this.safeString(params, 'network');
4333
- const networkId = this.networkCodeToId(networkCode, code);
4333
+ let networkId = undefined;
4334
+ if (networkCode !== undefined) {
4335
+ networkId = this.networkCodeToId(networkCode, code);
4336
+ }
4334
4337
  if (networkId !== undefined) {
4335
4338
  request['network'] = networkId;
4336
4339
  }
@@ -4756,7 +4759,7 @@ export default class mexc extends Exchange {
4756
4759
  const marginType = (openType === '1') ? 'isolated' : 'cross';
4757
4760
  const leverage = this.safeNumber(position, 'leverage');
4758
4761
  const liquidationPrice = this.safeNumber(position, 'liquidatePrice');
4759
- const timestamp = this.safeNumber(position, 'updateTime');
4762
+ const timestamp = this.safeInteger(position, 'updateTime');
4760
4763
  return this.safePosition({
4761
4764
  'info': position,
4762
4765
  'id': undefined,
package/js/src/phemex.js CHANGED
@@ -4666,7 +4666,10 @@ export default class phemex extends Exchange {
4666
4666
  const currency = this.currency(code);
4667
4667
  let networkCode = undefined;
4668
4668
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
4669
- let networkId = this.networkCodeToId(networkCode);
4669
+ let networkId = undefined;
4670
+ if (networkCode !== undefined) {
4671
+ networkId = this.networkCodeToId(networkCode);
4672
+ }
4670
4673
  const stableCoins = this.safeValue(this.options, 'stableCoins');
4671
4674
  if (networkId === undefined) {
4672
4675
  if (!(this.inArray(code, stableCoins))) {
@@ -714,7 +714,10 @@ export default class poloniex extends Exchange {
714
714
  const code = this.safeCurrencyCode(id);
715
715
  const name = this.safeString(currency, 'name');
716
716
  const networkId = this.safeString(currency, 'blockchain');
717
- const networkCode = this.networkIdToCode(networkId, code);
717
+ let networkCode = undefined;
718
+ if (networkId !== undefined) {
719
+ networkCode = this.networkIdToCode(networkId, code);
720
+ }
718
721
  const delisted = this.safeValue(currency, 'delisted');
719
722
  const walletEnabled = this.safeString(currency, 'walletState') === 'ENABLED';
720
723
  const depositEnabled = this.safeString(currency, 'walletDepositState') === 'ENABLED';
package/js/src/pro/cex.js CHANGED
@@ -188,7 +188,7 @@ export default class cex extends cexRest {
188
188
  trade = trade.split(':');
189
189
  }
190
190
  const side = this.safeString(trade, 0);
191
- const timestamp = this.safeNumber(trade, 1);
191
+ const timestamp = this.safeInteger(trade, 1);
192
192
  const amount = this.safeString(trade, 2);
193
193
  const price = this.safeString(trade, 3);
194
194
  const id = this.safeString(trade, 4);
@@ -644,7 +644,7 @@ export default class gemini extends geminiRest {
644
644
  // "socket_sequence": 139
645
645
  // }
646
646
  //
647
- const timestamp = this.safeNumber(order, 'timestampms');
647
+ const timestamp = this.safeInteger(order, 'timestampms');
648
648
  const status = this.safeString(order, 'type');
649
649
  const marketId = this.safeString(order, 'symbol');
650
650
  const typeId = this.safeString(order, 'order_type');
@@ -174,7 +174,7 @@ export default class hitbtc extends hitbtcRest {
174
174
  await this.loadMarkets();
175
175
  await this.authenticate();
176
176
  const url = this.urls['api']['ws']['private'];
177
- const messageHash = this.nonce();
177
+ const messageHash = this.nonce().toString();
178
178
  const subscribe = {
179
179
  'method': name,
180
180
  'params': params,
@@ -175,7 +175,7 @@ export default class poloniex extends poloniexRest {
175
175
  * @returns {object} data from the websocket stream
176
176
  */
177
177
  const url = this.urls['api']['ws']['private'];
178
- const messageHash = this.nonce();
178
+ const messageHash = this.nonce().toString();
179
179
  const subscribe = {
180
180
  'id': messageHash,
181
181
  'event': name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.40",
3
+ "version": "4.2.42",
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",