ccxt 4.3.89 → 4.3.91

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 (69) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +2 -2
  5. package/dist/cjs/src/ascendex.js +95 -97
  6. package/dist/cjs/src/binance.js +1 -1
  7. package/dist/cjs/src/bingx.js +31 -17
  8. package/dist/cjs/src/bitfinex2.js +21 -22
  9. package/dist/cjs/src/bitget.js +2 -2
  10. package/dist/cjs/src/bitmart.js +6 -9
  11. package/dist/cjs/src/coinbaseinternational.js +2 -1
  12. package/dist/cjs/src/coinex.js +1 -17
  13. package/dist/cjs/src/hitbtc.js +2 -0
  14. package/dist/cjs/src/htx.js +49 -49
  15. package/dist/cjs/src/huobijp.js +0 -9
  16. package/dist/cjs/src/kucoin.js +59 -21
  17. package/dist/cjs/src/kucoinfutures.js +26 -2
  18. package/dist/cjs/src/latoken.js +1 -0
  19. package/dist/cjs/src/okx.js +1 -8
  20. package/dist/cjs/src/pro/binance.js +323 -0
  21. package/dist/cjs/src/pro/bingx.js +263 -91
  22. package/dist/cjs/src/pro/bithumb.js +5 -1
  23. package/dist/cjs/src/pro/bybit.js +1 -1
  24. package/dist/cjs/src/pro/coinex.js +994 -679
  25. package/dist/cjs/src/pro/lbank.js +2 -3
  26. package/dist/cjs/src/pro/okx.js +159 -3
  27. package/dist/cjs/src/whitebit.js +5 -3
  28. package/dist/cjs/src/woo.js +1 -1
  29. package/js/ccxt.d.ts +1 -1
  30. package/js/ccxt.js +1 -1
  31. package/js/src/abstract/kucoin.d.ts +1 -0
  32. package/js/src/abstract/kucoinfutures.d.ts +1 -0
  33. package/js/src/alpaca.js +2 -2
  34. package/js/src/ascendex.js +95 -97
  35. package/js/src/binance.js +1 -1
  36. package/js/src/bingx.js +31 -17
  37. package/js/src/bitfinex2.d.ts +0 -1
  38. package/js/src/bitfinex2.js +21 -22
  39. package/js/src/bitget.js +2 -2
  40. package/js/src/bitmart.d.ts +0 -1
  41. package/js/src/bitmart.js +6 -9
  42. package/js/src/coinbaseinternational.js +2 -1
  43. package/js/src/coinex.d.ts +0 -2
  44. package/js/src/coinex.js +1 -17
  45. package/js/src/hitbtc.js +2 -0
  46. package/js/src/htx.js +49 -49
  47. package/js/src/huobijp.d.ts +0 -1
  48. package/js/src/huobijp.js +0 -9
  49. package/js/src/kucoin.d.ts +3 -1
  50. package/js/src/kucoin.js +59 -21
  51. package/js/src/kucoinfutures.d.ts +1 -0
  52. package/js/src/kucoinfutures.js +26 -2
  53. package/js/src/latoken.js +1 -0
  54. package/js/src/okx.d.ts +0 -1
  55. package/js/src/okx.js +1 -8
  56. package/js/src/pro/binance.d.ts +9 -1
  57. package/js/src/pro/binance.js +327 -1
  58. package/js/src/pro/bingx.d.ts +2 -2
  59. package/js/src/pro/bingx.js +263 -91
  60. package/js/src/pro/bithumb.js +5 -1
  61. package/js/src/pro/bybit.js +1 -1
  62. package/js/src/pro/coinex.d.ts +12 -6
  63. package/js/src/pro/coinex.js +996 -681
  64. package/js/src/pro/lbank.js +2 -3
  65. package/js/src/pro/okx.d.ts +7 -0
  66. package/js/src/pro/okx.js +162 -4
  67. package/js/src/whitebit.js +5 -3
  68. package/js/src/woo.js +1 -1
  69. package/package.json +1 -1
package/dist/cjs/ccxt.js CHANGED
@@ -196,7 +196,7 @@ var xt$1 = require('./src/pro/xt.js');
196
196
 
197
197
  //-----------------------------------------------------------------------------
198
198
  // this is updated by vss.js when building
199
- const version = '4.3.89';
199
+ const version = '4.3.91';
200
200
  Exchange["default"].ccxtVersion = version;
201
201
  const exchanges = {
202
202
  'ace': ace,
@@ -557,8 +557,8 @@ class alpaca extends alpaca$1 {
557
557
  // }
558
558
  // }
559
559
  //
560
- const orderbooks = this.safeValue(response, 'orderbooks', {});
561
- const rawOrderbook = this.safeValue(orderbooks, id, {});
560
+ const orderbooks = this.safeDict(response, 'orderbooks', {});
561
+ const rawOrderbook = this.safeDict(orderbooks, id, {});
562
562
  const timestamp = this.parse8601(this.safeString(rawOrderbook, 't'));
563
563
  return this.parseOrderBook(rawOrderbook, market['symbol'], timestamp, 'b', 'a', 'p', 's');
564
564
  }
@@ -439,9 +439,9 @@ class ascendex extends ascendex$1 {
439
439
  // ]
440
440
  // }
441
441
  //
442
- const assetsData = this.safeValue(assets, 'data', []);
443
- const marginData = this.safeValue(margin, 'data', []);
444
- const cashData = this.safeValue(cash, 'data', []);
442
+ const assetsData = this.safeList(assets, 'data', []);
443
+ const marginData = this.safeList(margin, 'data', []);
444
+ const cashData = this.safeList(cash, 'data', []);
445
445
  const assetsById = this.indexBy(assetsData, 'assetCode');
446
446
  const marginById = this.indexBy(marginData, 'assetCode');
447
447
  const cashById = this.indexBy(cashData, 'assetCode');
@@ -582,10 +582,10 @@ class ascendex extends ascendex$1 {
582
582
  // ]
583
583
  // }
584
584
  //
585
- const productsData = this.safeValue(products, 'data', []);
585
+ const productsData = this.safeList(products, 'data', []);
586
586
  const productsById = this.indexBy(productsData, 'symbol');
587
- const cashData = this.safeValue(cash, 'data', []);
588
- const perpetualsData = this.safeValue(perpetuals, 'data', []);
587
+ const cashData = this.safeList(cash, 'data', []);
588
+ const perpetualsData = this.safeList(perpetuals, 'data', []);
589
589
  const cashAndPerpetualsData = this.arrayConcat(cashData, perpetualsData);
590
590
  const cashAndPerpetualsById = this.indexBy(cashAndPerpetualsData, 'symbol');
591
591
  const dataById = this.deepExtend(productsById, cashAndPerpetualsById);
@@ -594,7 +594,7 @@ class ascendex extends ascendex$1 {
594
594
  for (let i = 0; i < ids.length; i++) {
595
595
  const id = ids[i];
596
596
  const market = dataById[id];
597
- const settleId = this.safeValue(market, 'settlementAsset');
597
+ const settleId = this.safeString(market, 'settlementAsset');
598
598
  const settle = this.safeCurrencyCode(settleId);
599
599
  const status = this.safeString(market, 'status');
600
600
  const domain = this.safeString(market, 'domain');
@@ -617,10 +617,10 @@ class ascendex extends ascendex$1 {
617
617
  const quote = this.safeCurrencyCode(quoteId);
618
618
  let symbol = base + '/' + quote;
619
619
  if (swap) {
620
- const lotSizeFilter = this.safeValue(market, 'lotSizeFilter');
620
+ const lotSizeFilter = this.safeDict(market, 'lotSizeFilter');
621
621
  minQty = this.safeNumber(lotSizeFilter, 'minQty');
622
622
  maxQty = this.safeNumber(lotSizeFilter, 'maxQty');
623
- const priceFilter = this.safeValue(market, 'priceFilter');
623
+ const priceFilter = this.safeDict(market, 'priceFilter');
624
624
  minPrice = this.safeNumber(priceFilter, 'minPrice');
625
625
  maxPrice = this.safeNumber(priceFilter, 'maxPrice');
626
626
  symbol = base + '/' + quote + ':' + settle;
@@ -703,7 +703,7 @@ class ascendex extends ascendex$1 {
703
703
  // }
704
704
  // }
705
705
  //
706
- const data = this.safeValue(response, 'data');
706
+ const data = this.safeDict(response, 'data', {});
707
707
  return this.safeInteger(data, 'requestReceiveAt');
708
708
  }
709
709
  async fetchAccounts(params = {}) {
@@ -734,7 +734,7 @@ class ascendex extends ascendex$1 {
734
734
  // }
735
735
  // }
736
736
  //
737
- const data = this.safeValue(response, 'data', {});
737
+ const data = this.safeDict(response, 'data', {});
738
738
  accountGroup = this.safeString(data, 'accountGroup');
739
739
  this.options['account-group'] = accountGroup;
740
740
  }
@@ -753,7 +753,7 @@ class ascendex extends ascendex$1 {
753
753
  'timestamp': undefined,
754
754
  'datetime': undefined,
755
755
  };
756
- const balances = this.safeValue(response, 'data', []);
756
+ const balances = this.safeList(response, 'data', []);
757
757
  for (let i = 0; i < balances.length; i++) {
758
758
  const balance = balances[i];
759
759
  const code = this.safeCurrencyCode(this.safeString(balance, 'asset'));
@@ -770,7 +770,7 @@ class ascendex extends ascendex$1 {
770
770
  'timestamp': undefined,
771
771
  'datetime': undefined,
772
772
  };
773
- const balances = this.safeValue(response, 'data', []);
773
+ const balances = this.safeList(response, 'data', []);
774
774
  for (let i = 0; i < balances.length; i++) {
775
775
  const balance = balances[i];
776
776
  const code = this.safeCurrencyCode(this.safeString(balance, 'asset'));
@@ -790,8 +790,8 @@ class ascendex extends ascendex$1 {
790
790
  'timestamp': undefined,
791
791
  'datetime': undefined,
792
792
  };
793
- const data = this.safeValue(response, 'data', {});
794
- const collaterals = this.safeValue(data, 'collaterals', []);
793
+ const data = this.safeDict(response, 'data', {});
794
+ const collaterals = this.safeList(data, 'collaterals', []);
795
795
  for (let i = 0; i < collaterals.length; i++) {
796
796
  const balance = collaterals[i];
797
797
  const code = this.safeCurrencyCode(this.safeString(balance, 'asset'));
@@ -824,9 +824,9 @@ class ascendex extends ascendex$1 {
824
824
  const isCross = marginMode === 'cross';
825
825
  marketType = (isMargin || isCross) ? 'margin' : marketType;
826
826
  params = this.omit(params, 'margin');
827
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
827
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
828
828
  const accountCategory = this.safeString(accountsByType, marketType, 'cash');
829
- const account = this.safeValue(this.accounts, 0, {});
829
+ const account = this.safeDict(this.accounts, 0, {});
830
830
  const accountGroup = this.safeString(account, 'id');
831
831
  const request = {
832
832
  'account-group': accountGroup,
@@ -939,8 +939,8 @@ class ascendex extends ascendex$1 {
939
939
  // }
940
940
  // }
941
941
  //
942
- const data = this.safeValue(response, 'data', {});
943
- const orderbook = this.safeValue(data, 'data', {});
942
+ const data = this.safeDict(response, 'data', {});
943
+ const orderbook = this.safeDict(data, 'data', {});
944
944
  const timestamp = this.safeInteger(orderbook, 'ts');
945
945
  const result = this.parseOrderBook(orderbook, symbol, timestamp);
946
946
  result['nonce'] = this.safeInteger(orderbook, 'seqnum');
@@ -966,8 +966,8 @@ class ascendex extends ascendex$1 {
966
966
  const delimiter = (type === 'spot') ? '/' : undefined;
967
967
  const symbol = this.safeSymbol(marketId, market, delimiter);
968
968
  const close = this.safeString(ticker, 'close');
969
- const bid = this.safeValue(ticker, 'bid', []);
970
- const ask = this.safeValue(ticker, 'ask', []);
969
+ const bid = this.safeList(ticker, 'bid', []);
970
+ const ask = this.safeList(ticker, 'ask', []);
971
971
  const open = this.safeString(ticker, 'open');
972
972
  return this.safeTicker({
973
973
  'symbol': symbol,
@@ -1041,7 +1041,7 @@ class ascendex extends ascendex$1 {
1041
1041
  const request = {};
1042
1042
  let market = undefined;
1043
1043
  if (symbols !== undefined) {
1044
- const symbol = this.safeValue(symbols, 0);
1044
+ const symbol = this.safeString(symbols, 0);
1045
1045
  market = this.market(symbol);
1046
1046
  const marketIds = this.marketIds(symbols);
1047
1047
  request['symbol'] = marketIds.join(',');
@@ -1058,22 +1058,20 @@ class ascendex extends ascendex$1 {
1058
1058
  //
1059
1059
  // {
1060
1060
  // "code":0,
1061
- // "data":[
1062
- // {
1063
- // "symbol":"QTUM/BTC",
1064
- // "open":"0.00016537",
1065
- // "close":"0.00019077",
1066
- // "high":"0.000192",
1067
- // "low":"0.00016537",
1068
- // "volume":"846.6",
1069
- // "ask":["0.00018698","26.2"],
1070
- // "bid":["0.00018408","503.7"],
1071
- // "type":"spot"
1072
- // }
1073
- // ]
1061
+ // "data": {
1062
+ // "symbol":"QTUM/BTC",
1063
+ // "open":"0.00016537",
1064
+ // "close":"0.00019077",
1065
+ // "high":"0.000192",
1066
+ // "low":"0.00016537",
1067
+ // "volume":"846.6",
1068
+ // "ask":["0.00018698","26.2"],
1069
+ // "bid":["0.00018408","503.7"],
1070
+ // "type":"spot"
1071
+ // }
1074
1072
  // }
1075
1073
  //
1076
- const data = this.safeValue(response, 'data', []);
1074
+ const data = this.safeList(response, 'data', []);
1077
1075
  if (!Array.isArray(data)) {
1078
1076
  return this.parseTickers([data], symbols);
1079
1077
  }
@@ -1095,7 +1093,7 @@ class ascendex extends ascendex$1 {
1095
1093
  // }
1096
1094
  // }
1097
1095
  //
1098
- const data = this.safeValue(ohlcv, 'data', {});
1096
+ const data = this.safeDict(ohlcv, 'data', {});
1099
1097
  return [
1100
1098
  this.safeInteger(data, 'ts'),
1101
1099
  this.safeNumber(data, 'o'),
@@ -1126,7 +1124,7 @@ class ascendex extends ascendex$1 {
1126
1124
  // if since and limit are not specified
1127
1125
  // the exchange will return just 1 last candle by default
1128
1126
  const duration = this.parseTimeframe(timeframe);
1129
- const options = this.safeValue(this.options, 'fetchOHLCV', {});
1127
+ const options = this.safeDict(this.options, 'fetchOHLCV', {});
1130
1128
  const defaultLimit = this.safeInteger(options, 'limit', 500);
1131
1129
  if (since !== undefined) {
1132
1130
  request['from'] = since;
@@ -1234,7 +1232,7 @@ class ascendex extends ascendex$1 {
1234
1232
  // }
1235
1233
  // }
1236
1234
  //
1237
- const records = this.safeValue(response, 'data', []);
1235
+ const records = this.safeDict(response, 'data', {});
1238
1236
  const trades = this.safeList(records, 'data', []);
1239
1237
  return this.parseTrades(trades, market, since, limit);
1240
1238
  }
@@ -1440,7 +1438,7 @@ class ascendex extends ascendex$1 {
1440
1438
  */
1441
1439
  await this.loadMarkets();
1442
1440
  await this.loadAccounts();
1443
- const account = this.safeValue(this.accounts, 0, {});
1441
+ const account = this.safeDict(this.accounts, 0, {});
1444
1442
  const accountGroup = this.safeString(account, 'id');
1445
1443
  const request = {
1446
1444
  'account-group': accountGroup,
@@ -1462,14 +1460,14 @@ class ascendex extends ascendex$1 {
1462
1460
  // }
1463
1461
  // }
1464
1462
  //
1465
- const data = this.safeValue(response, 'data', {});
1466
- const fees = this.safeValue(data, 'fees', []);
1463
+ const data = this.safeDict(response, 'data', {});
1464
+ const fees = this.safeList(data, 'fees', []);
1467
1465
  const result = {};
1468
1466
  for (let i = 0; i < fees.length; i++) {
1469
1467
  const fee = fees[i];
1470
1468
  const marketId = this.safeString(fee, 'symbol');
1471
1469
  const symbol = this.safeSymbol(marketId, undefined, '/');
1472
- const takerMaker = this.safeValue(fee, 'fee', {});
1470
+ const takerMaker = this.safeDict(fee, 'fee', {});
1473
1471
  result[symbol] = {
1474
1472
  'info': fee,
1475
1473
  'symbol': symbol,
@@ -1503,13 +1501,13 @@ class ascendex extends ascendex$1 {
1503
1501
  let marketType = undefined;
1504
1502
  [marginMode, params] = this.handleMarginModeAndParams('createOrderRequest', params);
1505
1503
  [marketType, params] = this.handleMarketTypeAndParams('createOrderRequest', market, params);
1506
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
1504
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
1507
1505
  let accountCategory = this.safeString(accountsByType, marketType, 'cash');
1508
1506
  if (marginMode !== undefined) {
1509
1507
  accountCategory = 'margin';
1510
1508
  }
1511
- const account = this.safeValue(this.accounts, 0, {});
1512
- const accountGroup = this.safeValue(account, 'id');
1509
+ const account = this.safeDict(this.accounts, 0, {});
1510
+ const accountGroup = this.safeString(account, 'id');
1513
1511
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'id');
1514
1512
  const request = {
1515
1513
  'account-group': accountGroup,
@@ -1527,7 +1525,7 @@ class ascendex extends ascendex$1 {
1527
1525
  const timeInForce = this.safeString(params, 'timeInForce');
1528
1526
  const postOnly = this.isPostOnly(isMarketOrder, false, params);
1529
1527
  const reduceOnly = this.safeBool(params, 'reduceOnly', false);
1530
- const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1528
+ const stopPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1531
1529
  if (isLimitOrder) {
1532
1530
  request['orderPrice'] = this.priceToPrecision(symbol, price);
1533
1531
  }
@@ -1665,8 +1663,8 @@ class ascendex extends ascendex$1 {
1665
1663
  // }
1666
1664
  // }
1667
1665
  //
1668
- const data = this.safeValue(response, 'data', {});
1669
- const order = this.safeValue2(data, 'order', 'info', {});
1666
+ const data = this.safeDict(response, 'data', {});
1667
+ const order = this.safeDict2(data, 'order', 'info', {});
1670
1668
  return this.parseOrder(order, market);
1671
1669
  }
1672
1670
  async createOrders(orders, params = {}) {
@@ -1701,9 +1699,9 @@ class ascendex extends ascendex$1 {
1701
1699
  }
1702
1700
  const type = this.safeString(rawOrder, 'type');
1703
1701
  const side = this.safeString(rawOrder, 'side');
1704
- const amount = this.safeValue(rawOrder, 'amount');
1705
- const price = this.safeValue(rawOrder, 'price');
1706
- const orderParams = this.safeValue(rawOrder, 'params', {});
1702
+ const amount = this.safeNumber(rawOrder, 'amount');
1703
+ const price = this.safeNumber(rawOrder, 'price');
1704
+ const orderParams = this.safeDict(rawOrder, 'params', {});
1707
1705
  const marginResult = this.handleMarginModeAndParams('createOrders', orderParams);
1708
1706
  const currentMarginMode = marginResult[0];
1709
1707
  if (currentMarginMode !== undefined) {
@@ -1720,13 +1718,13 @@ class ascendex extends ascendex$1 {
1720
1718
  ordersRequests.push(orderRequest);
1721
1719
  }
1722
1720
  const market = this.market(symbol);
1723
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
1721
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
1724
1722
  let accountCategory = this.safeString(accountsByType, market['type'], 'cash');
1725
1723
  if (marginMode !== undefined) {
1726
1724
  accountCategory = 'margin';
1727
1725
  }
1728
- const account = this.safeValue(this.accounts, 0, {});
1729
- const accountGroup = this.safeValue(account, 'id');
1726
+ const account = this.safeDict(this.accounts, 0, {});
1727
+ const accountGroup = this.safeString(account, 'id');
1730
1728
  const request = {};
1731
1729
  let response = undefined;
1732
1730
  if (market['swap']) {
@@ -1764,7 +1762,7 @@ class ascendex extends ascendex$1 {
1764
1762
  // }
1765
1763
  // }
1766
1764
  //
1767
- const data = this.safeValue(response, 'data', {});
1765
+ const data = this.safeDict(response, 'data', {});
1768
1766
  const info = this.safeList(data, 'info', []);
1769
1767
  return this.parseOrders(info, market);
1770
1768
  }
@@ -1787,10 +1785,10 @@ class ascendex extends ascendex$1 {
1787
1785
  market = this.market(symbol);
1788
1786
  }
1789
1787
  const [type, query] = this.handleMarketTypeAndParams('fetchOrder', market, params);
1790
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
1788
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
1791
1789
  const accountCategory = this.safeString(accountsByType, type, 'cash');
1792
- const account = this.safeValue(this.accounts, 0, {});
1793
- const accountGroup = this.safeValue(account, 'id');
1790
+ const account = this.safeDict(this.accounts, 0, {});
1791
+ const accountGroup = this.safeString(account, 'id');
1794
1792
  const request = {
1795
1793
  'account-group': accountGroup,
1796
1794
  'account-category': accountCategory,
@@ -1897,10 +1895,10 @@ class ascendex extends ascendex$1 {
1897
1895
  market = this.market(symbol);
1898
1896
  symbol = market['symbol'];
1899
1897
  }
1900
- const account = this.safeValue(this.accounts, 0, {});
1901
- const accountGroup = this.safeValue(account, 'id');
1898
+ const account = this.safeDict(this.accounts, 0, {});
1899
+ const accountGroup = this.safeString(account, 'id');
1902
1900
  const [type, query] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
1903
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
1901
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
1904
1902
  const accountCategory = this.safeString(accountsByType, type, 'cash');
1905
1903
  const request = {
1906
1904
  'account-group': accountGroup,
@@ -1984,7 +1982,7 @@ class ascendex extends ascendex$1 {
1984
1982
  // ]
1985
1983
  // }
1986
1984
  //
1987
- const data = this.safeValue(response, 'data', []);
1985
+ const data = this.safeList(response, 'data', []);
1988
1986
  if (accountCategory === 'futures') {
1989
1987
  return this.parseOrders(data, market, since, limit);
1990
1988
  }
@@ -2012,8 +2010,8 @@ class ascendex extends ascendex$1 {
2012
2010
  */
2013
2011
  await this.loadMarkets();
2014
2012
  await this.loadAccounts();
2015
- const account = this.safeValue(this.accounts, 0, {});
2016
- const accountGroup = this.safeValue(account, 'id');
2013
+ const account = this.safeDict(this.accounts, 0, {});
2014
+ const accountGroup = this.safeString(account, 'id');
2017
2015
  const request = {
2018
2016
  // 'category': accountCategory,
2019
2017
  // 'symbol': market['id'],
@@ -2031,7 +2029,7 @@ class ascendex extends ascendex$1 {
2031
2029
  request['symbol'] = market['id'];
2032
2030
  }
2033
2031
  const [type, query] = this.handleMarketTypeAndParams('fetchClosedOrders', market, params);
2034
- const options = this.safeValue(this.options, 'fetchClosedOrders', {});
2032
+ const options = this.safeDict(this.options, 'fetchClosedOrders', {});
2035
2033
  const defaultMethod = this.safeString(options, 'method', 'v2PrivateDataGetOrderHist');
2036
2034
  const method = this.getSupportedMapping(type, {
2037
2035
  'spot': defaultMethod,
@@ -2045,7 +2043,7 @@ class ascendex extends ascendex$1 {
2045
2043
  if (until !== undefined) {
2046
2044
  request['endTime'] = until;
2047
2045
  }
2048
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
2046
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
2049
2047
  const accountCategory = this.safeString(accountsByType, type, 'cash'); // margin, futures
2050
2048
  let response = undefined;
2051
2049
  if (method === 'v1PrivateAccountCategoryGetOrderHistCurrent') {
@@ -2165,10 +2163,10 @@ class ascendex extends ascendex$1 {
2165
2163
  // ]
2166
2164
  // }
2167
2165
  //
2168
- let data = this.safeValue(response, 'data');
2166
+ let data = this.safeList(response, 'data', []);
2169
2167
  const isArray = Array.isArray(data);
2170
2168
  if (!isArray) {
2171
- data = this.safeValue(data, 'data', []);
2169
+ data = this.safeList(data, 'data', []);
2172
2170
  }
2173
2171
  return this.parseOrders(data, market, since, limit);
2174
2172
  }
@@ -2191,10 +2189,10 @@ class ascendex extends ascendex$1 {
2191
2189
  await this.loadAccounts();
2192
2190
  const market = this.market(symbol);
2193
2191
  const [type, query] = this.handleMarketTypeAndParams('cancelOrder', market, params);
2194
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
2192
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
2195
2193
  const accountCategory = this.safeString(accountsByType, type, 'cash');
2196
- const account = this.safeValue(this.accounts, 0, {});
2197
- const accountGroup = this.safeValue(account, 'id');
2194
+ const account = this.safeDict(this.accounts, 0, {});
2195
+ const accountGroup = this.safeString(account, 'id');
2198
2196
  const request = {
2199
2197
  'account-group': accountGroup,
2200
2198
  'account-category': accountCategory,
@@ -2284,8 +2282,8 @@ class ascendex extends ascendex$1 {
2284
2282
  // }
2285
2283
  // }
2286
2284
  //
2287
- const data = this.safeValue(response, 'data', {});
2288
- const order = this.safeValue2(data, 'order', 'info', {});
2285
+ const data = this.safeDict(response, 'data', {});
2286
+ const order = this.safeDict2(data, 'order', 'info', {});
2289
2287
  return this.parseOrder(order, market);
2290
2288
  }
2291
2289
  async cancelAllOrders(symbol = undefined, params = {}) {
@@ -2306,10 +2304,10 @@ class ascendex extends ascendex$1 {
2306
2304
  market = this.market(symbol);
2307
2305
  }
2308
2306
  const [type, query] = this.handleMarketTypeAndParams('cancelAllOrders', market, params);
2309
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
2307
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
2310
2308
  const accountCategory = this.safeString(accountsByType, type, 'cash');
2311
- const account = this.safeValue(this.accounts, 0, {});
2312
- const accountGroup = this.safeValue(account, 'id');
2309
+ const account = this.safeDict(this.accounts, 0, {});
2310
+ const accountGroup = this.safeString(account, 'id');
2313
2311
  const request = {
2314
2312
  'account-group': accountGroup,
2315
2313
  'account-category': accountCategory,
@@ -2561,7 +2559,7 @@ class ascendex extends ascendex$1 {
2561
2559
  // }
2562
2560
  // }
2563
2561
  //
2564
- const data = this.safeValue(response, 'data', {});
2562
+ const data = this.safeDict(response, 'data', {});
2565
2563
  const transactions = this.safeList(data, 'data', []);
2566
2564
  return this.parseTransactions(transactions, currency, since, limit);
2567
2565
  }
@@ -2593,7 +2591,7 @@ class ascendex extends ascendex$1 {
2593
2591
  // }
2594
2592
  // }
2595
2593
  //
2596
- const destAddress = this.safeValue(transaction, 'destAddress', {});
2594
+ const destAddress = this.safeDict(transaction, 'destAddress', {});
2597
2595
  const address = this.safeString(destAddress, 'address');
2598
2596
  const tag = this.safeString(destAddress, 'destTag');
2599
2597
  const timestamp = this.safeInteger(transaction, 'time');
@@ -2640,7 +2638,7 @@ class ascendex extends ascendex$1 {
2640
2638
  */
2641
2639
  await this.loadMarkets();
2642
2640
  await this.loadAccounts();
2643
- const account = this.safeValue(this.accounts, 0, {});
2641
+ const account = this.safeDict(this.accounts, 0, {});
2644
2642
  const accountGroup = this.safeString(account, 'id');
2645
2643
  const request = {
2646
2644
  'account-group': accountGroup,
@@ -2685,8 +2683,8 @@ class ascendex extends ascendex$1 {
2685
2683
  // }
2686
2684
  // }
2687
2685
  //
2688
- const data = this.safeValue(response, 'data', {});
2689
- const position = this.safeValue(data, 'contracts', []);
2686
+ const data = this.safeDict(response, 'data', {});
2687
+ const position = this.safeList(data, 'contracts', []);
2690
2688
  const result = [];
2691
2689
  for (let i = 0; i < position.length; i++) {
2692
2690
  result.push(this.parsePosition(position[i]));
@@ -2832,8 +2830,8 @@ class ascendex extends ascendex$1 {
2832
2830
  // }
2833
2831
  // }
2834
2832
  //
2835
- const data = this.safeValue(response, 'data', {});
2836
- const contracts = this.safeValue(data, 'contracts', []);
2833
+ const data = this.safeDict(response, 'data', {});
2834
+ const contracts = this.safeList(data, 'contracts', []);
2837
2835
  const result = this.parseFundingRates(contracts);
2838
2836
  return this.filterByArray(result, 'symbol', symbols);
2839
2837
  }
@@ -2841,7 +2839,7 @@ class ascendex extends ascendex$1 {
2841
2839
  await this.loadMarkets();
2842
2840
  await this.loadAccounts();
2843
2841
  const market = this.market(symbol);
2844
- const account = this.safeValue(this.accounts, 0, {});
2842
+ const account = this.safeDict(this.accounts, 0, {});
2845
2843
  const accountGroup = this.safeString(account, 'id');
2846
2844
  amount = this.amountToPrecision(symbol, amount);
2847
2845
  const request = {
@@ -2935,7 +2933,7 @@ class ascendex extends ascendex$1 {
2935
2933
  if (!market['swap']) {
2936
2934
  throw new errors.BadSymbol(this.id + ' setLeverage() supports swap contracts only');
2937
2935
  }
2938
- const account = this.safeValue(this.accounts, 0, {});
2936
+ const account = this.safeDict(this.accounts, 0, {});
2939
2937
  const accountGroup = this.safeString(account, 'id');
2940
2938
  const request = {
2941
2939
  'account-group': accountGroup,
@@ -2968,7 +2966,7 @@ class ascendex extends ascendex$1 {
2968
2966
  await this.loadMarkets();
2969
2967
  await this.loadAccounts();
2970
2968
  const market = this.market(symbol);
2971
- const account = this.safeValue(this.accounts, 0, {});
2969
+ const account = this.safeDict(this.accounts, 0, {});
2972
2970
  const accountGroup = this.safeString(account, 'id');
2973
2971
  const request = {
2974
2972
  'account-group': accountGroup,
@@ -3019,7 +3017,7 @@ class ascendex extends ascendex$1 {
3019
3017
  // ]
3020
3018
  // }
3021
3019
  //
3022
- const data = this.safeValue(response, 'data');
3020
+ const data = this.safeList(response, 'data', []);
3023
3021
  symbols = this.marketSymbols(symbols);
3024
3022
  return this.parseLeverageTiers(data, symbols, 'symbol');
3025
3023
  }
@@ -3051,7 +3049,7 @@ class ascendex extends ascendex$1 {
3051
3049
  // ]
3052
3050
  // }
3053
3051
  //
3054
- const marginRequirements = this.safeValue(info, 'marginRequirements', []);
3052
+ const marginRequirements = this.safeList(info, 'marginRequirements', []);
3055
3053
  const id = this.safeString(info, 'symbol');
3056
3054
  market = this.safeMarket(id, market);
3057
3055
  const tiers = [];
@@ -3090,7 +3088,7 @@ class ascendex extends ascendex$1 {
3090
3088
  // ]
3091
3089
  // }
3092
3090
  //
3093
- const blockChains = this.safeValue(fee, 'blockChain', []);
3091
+ const blockChains = this.safeList(fee, 'blockChain', []);
3094
3092
  const blockChainsLength = blockChains.length;
3095
3093
  const result = {
3096
3094
  'info': fee,
@@ -3149,10 +3147,10 @@ class ascendex extends ascendex$1 {
3149
3147
  */
3150
3148
  await this.loadMarkets();
3151
3149
  await this.loadAccounts();
3152
- const account = this.safeValue(this.accounts, 0, {});
3150
+ const account = this.safeDict(this.accounts, 0, {});
3153
3151
  const accountGroup = this.safeString(account, 'id');
3154
3152
  const currency = this.currency(code);
3155
- const accountsByType = this.safeValue(this.options, 'accountsByType', {});
3153
+ const accountsByType = this.safeDict(this.options, 'accountsByType', {});
3156
3154
  const fromId = this.safeString(accountsByType, fromAccount, fromAccount);
3157
3155
  const toId = this.safeString(accountsByType, toAccount, toAccount);
3158
3156
  if (fromId !== 'cash' && toId !== 'cash') {
@@ -3169,7 +3167,7 @@ class ascendex extends ascendex$1 {
3169
3167
  //
3170
3168
  // { "code": "0" }
3171
3169
  //
3172
- const transferOptions = this.safeValue(this.options, 'transfer', {});
3170
+ const transferOptions = this.safeDict(this.options, 'transfer', {});
3173
3171
  const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
3174
3172
  const transfer = this.parseTransfer(response, currency);
3175
3173
  if (fillResponseFromRequest) {
@@ -3224,7 +3222,7 @@ class ascendex extends ascendex$1 {
3224
3222
  if (paginate) {
3225
3223
  return await this.fetchPaginatedCallIncremental('fetchFundingHistory', symbol, since, limit, params, 'page', 25);
3226
3224
  }
3227
- const account = this.safeValue(this.accounts, 0, {});
3225
+ const account = this.safeDict(this.accounts, 0, {});
3228
3226
  const accountGroup = this.safeString(account, 'id');
3229
3227
  const request = {
3230
3228
  'account-group': accountGroup,
@@ -3256,7 +3254,7 @@ class ascendex extends ascendex$1 {
3256
3254
  // }
3257
3255
  // }
3258
3256
  //
3259
- const data = this.safeValue(response, 'data', {});
3257
+ const data = this.safeDict(response, 'data', {});
3260
3258
  const rows = this.safeList(data, 'data', []);
3261
3259
  return this.parseIncomes(rows, market, since, limit);
3262
3260
  }
@@ -3293,7 +3291,7 @@ class ascendex extends ascendex$1 {
3293
3291
  */
3294
3292
  await this.loadMarkets();
3295
3293
  await this.loadAccounts();
3296
- const account = this.safeValue(this.accounts, 0, {});
3294
+ const account = this.safeDict(this.accounts, 0, {});
3297
3295
  const accountGroup = this.safeString(account, 'id');
3298
3296
  const request = {
3299
3297
  'account-group': accountGroup,
@@ -3364,7 +3362,7 @@ class ascendex extends ascendex$1 {
3364
3362
  */
3365
3363
  await this.loadMarkets();
3366
3364
  await this.loadAccounts();
3367
- const account = this.safeValue(this.accounts, 0, {});
3365
+ const account = this.safeDict(this.accounts, 0, {});
3368
3366
  const accountGroup = this.safeString(account, 'id');
3369
3367
  const request = {
3370
3368
  'account-group': accountGroup,
@@ -330,7 +330,7 @@ class binance extends binance$1 {
330
330
  'capital/deposit/hisrec': 0.1,
331
331
  'capital/deposit/subAddress': 0.1,
332
332
  'capital/deposit/subHisrec': 0.1,
333
- 'capital/withdraw/history': 1800,
333
+ 'capital/withdraw/history': 2,
334
334
  'capital/withdraw/address/list': 10,
335
335
  'capital/contract/convertible-coins': 4.0002,
336
336
  'convert/tradeFlow': 20.001,