ccxt 4.4.62 → 4.4.64

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.
package/dist/cjs/ccxt.js CHANGED
@@ -199,7 +199,7 @@ var xt$1 = require('./src/pro/xt.js');
199
199
 
200
200
  //-----------------------------------------------------------------------------
201
201
  // this is updated by vss.js when building
202
- const version = '4.4.62';
202
+ const version = '4.4.64';
203
203
  Exchange["default"].ccxtVersion = version;
204
204
  const exchanges = {
205
205
  'ace': ace,
@@ -2513,6 +2513,9 @@ class Exchange {
2513
2513
  }
2514
2514
  safeCurrencyStructure(currency) {
2515
2515
  // derive data from networks: deposit, withdraw, active, fee, limits, precision
2516
+ const currencyDeposit = this.safeBool(currency, 'deposit');
2517
+ const currencyWithdraw = this.safeBool(currency, 'withdraw');
2518
+ const currencyActive = this.safeBool(currency, 'active');
2516
2519
  const networks = this.safeDict(currency, 'networks', {});
2517
2520
  const keys = Object.keys(networks);
2518
2521
  const length = keys.length;
@@ -2520,15 +2523,15 @@ class Exchange {
2520
2523
  for (let i = 0; i < length; i++) {
2521
2524
  const network = networks[keys[i]];
2522
2525
  const deposit = this.safeBool(network, 'deposit');
2523
- if (currency['deposit'] === undefined || deposit) {
2526
+ if (currencyDeposit === undefined || deposit) {
2524
2527
  currency['deposit'] = deposit;
2525
2528
  }
2526
2529
  const withdraw = this.safeBool(network, 'withdraw');
2527
- if (currency['withdraw'] === undefined || withdraw) {
2530
+ if (currencyWithdraw === undefined || withdraw) {
2528
2531
  currency['withdraw'] = withdraw;
2529
2532
  }
2530
2533
  const active = this.safeBool(network, 'active');
2531
- if (currency['active'] === undefined || active) {
2534
+ if (currencyActive === undefined || active) {
2532
2535
  currency['active'] = active;
2533
2536
  }
2534
2537
  // find lowest fee (which is more desired)
@@ -3896,7 +3899,10 @@ class Exchange {
3896
3899
  // if networkCode was not provided by user, then we try to use the default network (if it was defined in "defaultNetworks"), otherwise, we just return the first network entry
3897
3900
  const defaultNetworkCode = this.defaultNetworkCode(currencyCode);
3898
3901
  const defaultNetworkId = isIndexedByUnifiedNetworkCode ? defaultNetworkCode : this.networkCodeToId(defaultNetworkCode, currencyCode);
3899
- chosenNetworkId = (defaultNetworkId in indexedNetworkEntries) ? defaultNetworkId : availableNetworkIds[0];
3902
+ if (defaultNetworkId in indexedNetworkEntries) {
3903
+ return defaultNetworkId;
3904
+ }
3905
+ throw new errors.NotSupported(this.id + ' - can not determine the default network, please pass param["network"] one from : ' + availableNetworkIds.join(', '));
3900
3906
  }
3901
3907
  }
3902
3908
  return chosenNetworkId;
@@ -480,6 +480,7 @@ class binance extends binance$1 {
480
480
  'portfolio/margin-asset-leverage': 5,
481
481
  'portfolio/balance': 2,
482
482
  'portfolio/negative-balance-exchange-record': 2,
483
+ 'portfolio/pmloan-history': 5,
483
484
  // staking
484
485
  'staking/productList': 0.1,
485
486
  'staking/position': 0.1,
@@ -6394,11 +6395,10 @@ class binance extends binance$1 {
6394
6395
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
6395
6396
  await this.loadMarkets();
6396
6397
  const market = this.market(symbol);
6398
+ // don't handle/omit params here, omitting happens inside createOrderRequest
6397
6399
  const marketType = this.safeString(params, 'type', market['type']);
6398
- let marginMode = undefined;
6399
- [marginMode, params] = this.handleMarginModeAndParams('createOrder', params);
6400
- let isPortfolioMargin = undefined;
6401
- [isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'createOrder', 'papi', 'portfolioMargin', false);
6400
+ const marginMode = this.safeString(params, 'marginMode');
6401
+ const isPortfolioMargin = this.safeBool2(params, 'papi', 'portfolioMargin', false);
6402
6402
  const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
6403
6403
  const stopLossPrice = this.safeString(params, 'stopLossPrice');
6404
6404
  const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
@@ -4686,7 +4686,7 @@ class bingx extends bingx$1 {
4686
4686
  }
4687
4687
  else if (type === 'spot') {
4688
4688
  if (limit !== undefined) {
4689
- request['limit'] = limit;
4689
+ request['pageSize'] = limit;
4690
4690
  }
4691
4691
  response = await this.spotV1PrivateGetTradeHistoryOrders(this.extend(request, params));
4692
4692
  //