ccxt 4.2.43 → 4.2.45

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 (46) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +1489 -463
  3. package/dist/ccxt.browser.min.js +6 -6
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +54 -0
  6. package/dist/cjs/src/binance.js +627 -51
  7. package/dist/cjs/src/bingx.js +46 -6
  8. package/dist/cjs/src/bitstamp.js +1 -1
  9. package/dist/cjs/src/blofin.js +2 -1
  10. package/dist/cjs/src/bybit.js +96 -43
  11. package/dist/cjs/src/coinbase.js +221 -41
  12. package/dist/cjs/src/deribit.js +1 -1
  13. package/dist/cjs/src/krakenfutures.js +3 -2
  14. package/dist/cjs/src/kucoin.js +9 -5
  15. package/dist/cjs/src/mexc.js +348 -266
  16. package/dist/cjs/src/pro/gate.js +76 -42
  17. package/dist/cjs/src/pro/hitbtc.js +1 -0
  18. package/dist/cjs/src/probit.js +3 -3
  19. package/js/ccxt.d.ts +1 -1
  20. package/js/ccxt.js +1 -1
  21. package/js/src/abstract/coinbase.d.ts +1 -0
  22. package/js/src/base/Exchange.d.ts +4 -0
  23. package/js/src/base/Exchange.js +54 -0
  24. package/js/src/binance.d.ts +1 -0
  25. package/js/src/binance.js +627 -51
  26. package/js/src/bingx.d.ts +2 -1
  27. package/js/src/bingx.js +46 -6
  28. package/js/src/bitstamp.js +1 -1
  29. package/js/src/blofin.js +2 -1
  30. package/js/src/bybit.d.ts +4 -1
  31. package/js/src/bybit.js +96 -43
  32. package/js/src/coinbase.d.ts +10 -4
  33. package/js/src/coinbase.js +221 -41
  34. package/js/src/coinbasepro.d.ts +1 -1
  35. package/js/src/deribit.js +1 -1
  36. package/js/src/krakenfutures.js +3 -2
  37. package/js/src/kucoin.js +9 -5
  38. package/js/src/mexc.d.ts +4 -5
  39. package/js/src/mexc.js +348 -266
  40. package/js/src/pro/gate.d.ts +4 -0
  41. package/js/src/pro/gate.js +76 -42
  42. package/js/src/pro/hitbtc.js +1 -0
  43. package/js/src/probit.js +3 -3
  44. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/skip-tests.json +2 -0
package/dist/cjs/ccxt.js CHANGED
@@ -177,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
177
177
 
178
178
  //-----------------------------------------------------------------------------
179
179
  // this is updated by vss.js when building
180
- const version = '4.2.43';
180
+ const version = '4.2.45';
181
181
  Exchange["default"].ccxtVersion = version;
182
182
  const exchanges = {
183
183
  'ace': ace,
@@ -71,6 +71,7 @@ class Exchange {
71
71
  this.balance = {};
72
72
  this.orderbooks = {};
73
73
  this.tickers = {};
74
+ this.bidsasks = {};
74
75
  this.orders = undefined;
75
76
  this.triggerOrders = undefined;
76
77
  this.transactions = {};
@@ -3140,6 +3141,9 @@ class Exchange {
3140
3141
  * @param {string} currencyCode unified currency code, but this argument is not required by default, unless there is an exchange (like huobi) that needs an override of the method to be able to pass currencyCode argument additionally
3141
3142
  * @returns {string|undefined} exchange-specific network id
3142
3143
  */
3144
+ if (networkCode === undefined) {
3145
+ return undefined;
3146
+ }
3143
3147
  const networkIdsByCodes = this.safeValue(this.options, 'networks', {});
3144
3148
  let networkId = this.safeString(networkIdsByCodes, networkCode);
3145
3149
  // for example, if 'ETH' is passed for networkCode, but 'ETH' key not defined in `options->networks` object
@@ -3183,6 +3187,9 @@ class Exchange {
3183
3187
  * @param {string|undefined} currencyCode unified currency code, but this argument is not required by default, unless there is an exchange (like huobi) that needs an override of the method to be able to pass currencyCode argument additionally
3184
3188
  * @returns {string|undefined} unified network code
3185
3189
  */
3190
+ if (networkId === undefined) {
3191
+ return undefined;
3192
+ }
3186
3193
  const networkCodesByIds = this.safeDict(this.options, 'networksById', {});
3187
3194
  let networkCode = this.safeString(networkCodesByIds, networkId, networkId);
3188
3195
  // replace mainnet network-codes (i.e. ERC20->ETH)
@@ -3424,12 +3431,46 @@ class Exchange {
3424
3431
  const market = this.market(symbol);
3425
3432
  return this.safeString(market, 'symbol', symbol);
3426
3433
  }
3434
+ handleParamString(params, paramName, defaultValue = undefined) {
3435
+ const value = this.safeString(params, paramName, defaultValue);
3436
+ if (value !== undefined) {
3437
+ params = this.omit(params, paramName);
3438
+ }
3439
+ return [value, params];
3440
+ }
3427
3441
  resolvePath(path, params) {
3428
3442
  return [
3429
3443
  this.implodeParams(path, params),
3430
3444
  this.omit(params, this.extractParams(path)),
3431
3445
  ];
3432
3446
  }
3447
+ getListFromObjectValues(objects, key) {
3448
+ const newArray = this.toArray(objects);
3449
+ const results = [];
3450
+ for (let i = 0; i < newArray.length; i++) {
3451
+ results.push(newArray[i][key]);
3452
+ }
3453
+ return results;
3454
+ }
3455
+ getSymbolsForMarketType(marketType = undefined, subType = undefined, symbolWithActiveStatus = true, symbolWithUnknownStatus = true) {
3456
+ let filteredMarkets = this.markets;
3457
+ if (marketType !== undefined) {
3458
+ filteredMarkets = this.filterBy(filteredMarkets, 'type', marketType);
3459
+ }
3460
+ if (subType !== undefined) {
3461
+ this.checkRequiredArgument('getSymbolsForMarketType', subType, 'subType', ['linear', 'inverse', 'quanto']);
3462
+ filteredMarkets = this.filterBy(filteredMarkets, 'subType', subType);
3463
+ }
3464
+ const activeStatuses = [];
3465
+ if (symbolWithActiveStatus) {
3466
+ activeStatuses.push(true);
3467
+ }
3468
+ if (symbolWithUnknownStatus) {
3469
+ activeStatuses.push(undefined);
3470
+ }
3471
+ filteredMarkets = this.filterByArray(filteredMarkets, 'active', activeStatuses, false);
3472
+ return this.getListFromObjectValues(filteredMarkets, 'symbol');
3473
+ }
3433
3474
  filterByArray(objects, key, values = undefined, indexed = true) {
3434
3475
  objects = this.toArray(objects);
3435
3476
  // return all of them if no values were passed
@@ -4355,6 +4396,19 @@ class Exchange {
4355
4396
  return depositAddress;
4356
4397
  }
4357
4398
  }
4399
+ else if (this.has['fetchDepositAddressesByNetwork']) {
4400
+ const network = this.safeString(params, 'network');
4401
+ params = this.omit(params, 'network');
4402
+ const addressStructures = await this.fetchDepositAddressesByNetwork(code, params);
4403
+ if (network !== undefined) {
4404
+ return this.safeDict(addressStructures, network);
4405
+ }
4406
+ else {
4407
+ const keys = Object.keys(addressStructures);
4408
+ const key = this.safeString(keys, 0);
4409
+ return this.safeDict(addressStructures, key);
4410
+ }
4411
+ }
4358
4412
  else {
4359
4413
  throw new errors.NotSupported(this.id + ' fetchDepositAddress() is not supported yet');
4360
4414
  }