ccxt 4.3.94 → 4.3.95

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
@@ -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.94';
199
+ const version = '4.3.95';
200
200
  Exchange["default"].ccxtVersion = version;
201
201
  const exchanges = {
202
202
  'ace': ace,
@@ -385,7 +385,7 @@ class ascendex extends ascendex$1 {
385
385
  * @param {object} [params] extra parameters specific to the exchange API endpoint
386
386
  * @returns {object} an associative dictionary of currencies
387
387
  */
388
- const assets = await this.v1PublicGetAssets(params);
388
+ const assetsPromise = this.v1PublicGetAssets(params);
389
389
  //
390
390
  // {
391
391
  // "code":0,
@@ -402,7 +402,7 @@ class ascendex extends ascendex$1 {
402
402
  // ]
403
403
  // }
404
404
  //
405
- const margin = await this.v1PublicGetMarginAssets(params);
405
+ const marginPromise = this.v1PublicGetMarginAssets(params);
406
406
  //
407
407
  // {
408
408
  // "code":0,
@@ -422,7 +422,7 @@ class ascendex extends ascendex$1 {
422
422
  // ]
423
423
  // }
424
424
  //
425
- const cash = await this.v1PublicGetCashAssets(params);
425
+ const cashPromise = this.v1PublicGetCashAssets(params);
426
426
  //
427
427
  // {
428
428
  // "code":0,
@@ -439,6 +439,7 @@ class ascendex extends ascendex$1 {
439
439
  // ]
440
440
  // }
441
441
  //
442
+ const [assets, margin, cash] = await Promise.all([assetsPromise, marginPromise, cashPromise]);
442
443
  const assetsData = this.safeList(assets, 'data', []);
443
444
  const marginData = this.safeList(margin, 'data', []);
444
445
  const cashData = this.safeList(cash, 'data', []);
@@ -493,7 +494,7 @@ class ascendex extends ascendex$1 {
493
494
  * @param {object} [params] extra parameters specific to the exchange API endpoint
494
495
  * @returns {object[]} an array of objects representing market data
495
496
  */
496
- const products = await this.v1PublicGetProducts(params);
497
+ const productsPromise = this.v1PublicGetProducts(params);
497
498
  //
498
499
  // {
499
500
  // "code": 0,
@@ -514,7 +515,7 @@ class ascendex extends ascendex$1 {
514
515
  // ]
515
516
  // }
516
517
  //
517
- const cash = await this.v1PublicGetCashProducts(params);
518
+ const cashPromise = this.v1PublicGetCashProducts(params);
518
519
  //
519
520
  // {
520
521
  // "code": 0,
@@ -544,7 +545,7 @@ class ascendex extends ascendex$1 {
544
545
  // ]
545
546
  // }
546
547
  //
547
- const perpetuals = await this.v2PublicGetFuturesContract(params);
548
+ const perpetualsPromise = this.v2PublicGetFuturesContract(params);
548
549
  //
549
550
  // {
550
551
  // "code": 0,
@@ -582,6 +583,7 @@ class ascendex extends ascendex$1 {
582
583
  // ]
583
584
  // }
584
585
  //
586
+ const [products, cash, perpetuals] = await Promise.all([productsPromise, cashPromise, perpetualsPromise]);
585
587
  const productsData = this.safeList(products, 'data', []);
586
588
  const productsById = this.indexBy(productsData, 'symbol');
587
589
  const cashData = this.safeList(cash, 'data', []);
@@ -3470,7 +3470,7 @@ class Exchange {
3470
3470
  if (currencyCode === undefined) {
3471
3471
  const currencies = Object.values(this.currencies);
3472
3472
  for (let i = 0; i < currencies.length; i++) {
3473
- const currency = [i];
3473
+ const currency = currencies[i];
3474
3474
  const networks = this.safeDict(currency, 'networks');
3475
3475
  const network = this.safeDict(networks, networkCode);
3476
3476
  networkId = this.safeString(network, 'id');
@@ -3615,13 +3615,13 @@ class Exchange {
3615
3615
  'nonce': undefined,
3616
3616
  };
3617
3617
  }
3618
- parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
3618
+ parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined, tail = false) {
3619
3619
  const results = [];
3620
3620
  for (let i = 0; i < ohlcvs.length; i++) {
3621
3621
  results.push(this.parseOHLCV(ohlcvs[i], market));
3622
3622
  }
3623
3623
  const sorted = this.sortBy(results, 0);
3624
- return this.filterBySinceLimit(sorted, since, limit, 0);
3624
+ return this.filterBySinceLimit(sorted, since, limit, 0, tail);
3625
3625
  }
3626
3626
  parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
3627
3627
  // marketIdKey should only be undefined when response is a dictionary
@@ -563,11 +563,11 @@ class bitfinex extends bitfinex$1 {
563
563
  * @param {object} [params] extra parameters specific to the exchange API endpoint
564
564
  * @returns {object[]} an array of objects representing market data
565
565
  */
566
- const ids = await this.publicGetSymbols();
566
+ const idsPromise = this.publicGetSymbols();
567
567
  //
568
568
  // [ "btcusd", "ltcusd", "ltcbtc" ]
569
569
  //
570
- const details = await this.publicGetSymbolsDetails();
570
+ const detailsPromise = this.publicGetSymbolsDetails();
571
571
  //
572
572
  // [
573
573
  // {
@@ -582,6 +582,7 @@ class bitfinex extends bitfinex$1 {
582
582
  // },
583
583
  // ]
584
584
  //
585
+ const [ids, details] = await Promise.all([idsPromise, detailsPromise]);
585
586
  const result = [];
586
587
  for (let i = 0; i < details.length; i++) {
587
588
  const market = details[i];
@@ -520,12 +520,13 @@ class bitfinex2 extends bitfinex2$1 {
520
520
  * @param {object} [params] extra parameters specific to the exchange API endpoint
521
521
  * @returns {object[]} an array of objects representing market data
522
522
  */
523
- let spotMarketsInfo = await this.publicGetConfPubInfoPair(params);
524
- let futuresMarketsInfo = await this.publicGetConfPubInfoPairFutures(params);
525
- spotMarketsInfo = this.safeValue(spotMarketsInfo, 0, []);
526
- futuresMarketsInfo = this.safeValue(futuresMarketsInfo, 0, []);
523
+ const spotMarketsInfoPromise = this.publicGetConfPubInfoPair(params);
524
+ const futuresMarketsInfoPromise = this.publicGetConfPubInfoPairFutures(params);
525
+ const marginIdsPromise = this.publicGetConfPubListPairMargin(params);
526
+ let [spotMarketsInfo, futuresMarketsInfo, marginIds] = await Promise.all([spotMarketsInfoPromise, futuresMarketsInfoPromise, marginIdsPromise]);
527
+ spotMarketsInfo = this.safeList(spotMarketsInfo, 0, []);
528
+ futuresMarketsInfo = this.safeList(futuresMarketsInfo, 0, []);
527
529
  const markets = this.arrayConcat(spotMarketsInfo, futuresMarketsInfo);
528
- let marginIds = await this.publicGetConfPubListPairMargin(params);
529
530
  marginIds = this.safeValue(marginIds, 0, []);
530
531
  //
531
532
  // [
@@ -640,7 +640,7 @@ class btcturk extends btcturk$1 {
640
640
  //
641
641
  return this.parseOHLCVs(response, market, timeframe, since, limit);
642
642
  }
643
- parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
643
+ parseOHLCVs(ohlcvs, market = undefined, timeframe = '1m', since = undefined, limit = undefined, tail = false) {
644
644
  const results = [];
645
645
  const timestamp = this.safeValue(ohlcvs, 't');
646
646
  const high = this.safeValue(ohlcvs, 'h');
@@ -660,7 +660,7 @@ class btcturk extends btcturk$1 {
660
660
  results.push(this.parseOHLCV(ohlcv, market));
661
661
  }
662
662
  const sorted = this.sortBy(results, 0);
663
- return this.filterBySinceLimit(sorted, since, limit, 0);
663
+ return this.filterBySinceLimit(sorted, since, limit, 0, tail);
664
664
  }
665
665
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
666
666
  /**
@@ -981,8 +981,9 @@ class gate extends gate$1 {
981
981
  return this.arrayConcat(markets, optionMarkets);
982
982
  }
983
983
  async fetchSpotMarkets(params = {}) {
984
- const marginResponse = await this.publicMarginGetCurrencyPairs(params);
985
- const spotMarketsResponse = await this.publicSpotGetCurrencyPairs(params);
984
+ const marginPromise = this.publicMarginGetCurrencyPairs(params);
985
+ const spotMarketsPromise = this.publicSpotGetCurrencyPairs(params);
986
+ const [marginResponse, spotMarketsResponse] = await Promise.all([marginPromise, spotMarketsPromise]);
986
987
  const marginMarkets = this.indexBy(marginResponse, 'id');
987
988
  //
988
989
  // Spot
@@ -842,8 +842,9 @@ class gemini extends gemini$1 {
842
842
  return this.parseTicker(response, market);
843
843
  }
844
844
  async fetchTickerV1AndV2(symbol, params = {}) {
845
- const tickerA = await this.fetchTickerV1(symbol, params);
846
- const tickerB = await this.fetchTickerV2(symbol, params);
845
+ const tickerPromiseA = this.fetchTickerV1(symbol, params);
846
+ const tickerPromiseB = this.fetchTickerV2(symbol, params);
847
+ const [tickerA, tickerB] = await Promise.all([tickerPromiseA, tickerPromiseB]);
847
848
  return this.deepExtend(tickerA, {
848
849
  'open': tickerB['open'],
849
850
  'high': tickerB['high'],
@@ -54,8 +54,9 @@ class hyperliquid extends hyperliquid$1 {
54
54
  'fetchBorrowInterest': false,
55
55
  'fetchBorrowRateHistories': false,
56
56
  'fetchBorrowRateHistory': false,
57
- 'fetchCanceledOrders': false,
57
+ 'fetchCanceledOrders': true,
58
58
  'fetchClosedOrders': true,
59
+ 'fetchCanceledAndClosedOrders': true,
59
60
  'fetchCrossBorrowRate': false,
60
61
  'fetchCrossBorrowRates': false,
61
62
  'fetchCurrencies': true,
@@ -87,7 +88,7 @@ class hyperliquid extends hyperliquid$1 {
87
88
  'fetchOpenOrders': true,
88
89
  'fetchOrder': true,
89
90
  'fetchOrderBook': true,
90
- 'fetchOrders': false,
91
+ 'fetchOrders': true,
91
92
  'fetchOrderTrades': false,
92
93
  'fetchPosition': true,
93
94
  'fetchPositionMode': false,
@@ -826,6 +827,7 @@ class hyperliquid extends hyperliquid$1 {
826
827
  await this.loadMarkets();
827
828
  const market = this.market(symbol);
828
829
  const until = this.safeInteger(params, 'until', this.milliseconds());
830
+ const useTail = (since === undefined);
829
831
  if (since === undefined) {
830
832
  since = 0;
831
833
  }
@@ -856,7 +858,7 @@ class hyperliquid extends hyperliquid$1 {
856
858
  // }
857
859
  // ]
858
860
  //
859
- return this.parseOHLCVs(response, market, timeframe, since, limit);
861
+ return this.parseOHLCVs(response, market, timeframe, since, limit, useTail);
860
862
  }
861
863
  parseOHLCV(ohlcv, market = undefined) {
862
864
  //
@@ -1731,7 +1733,16 @@ class hyperliquid extends hyperliquid$1 {
1731
1733
  // }
1732
1734
  // ]
1733
1735
  //
1734
- return this.parseOrders(response, market, since, limit);
1736
+ const orderWithStatus = [];
1737
+ for (let i = 0; i < response.length; i++) {
1738
+ const order = response[i];
1739
+ const extendOrder = {};
1740
+ if (this.safeString(order, 'status') === undefined) {
1741
+ extendOrder['ccxtStatus'] = 'open';
1742
+ }
1743
+ orderWithStatus.push(this.extend(order, extendOrder));
1744
+ }
1745
+ return this.parseOrders(orderWithStatus, market, since, limit);
1735
1746
  }
1736
1747
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1737
1748
  /**
@@ -1745,8 +1756,59 @@ class hyperliquid extends hyperliquid$1 {
1745
1756
  * @param {string} [params.user] user address, will default to this.walletAddress if not provided
1746
1757
  * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1747
1758
  */
1759
+ await this.loadMarkets();
1760
+ const orders = await this.fetchOrders(symbol, undefined, undefined, params); // don't filter here because we don't want to catch open orders
1761
+ const closedOrders = this.filterByArray(orders, 'status', ['closed'], false);
1762
+ return this.filterBySymbolSinceLimit(closedOrders, symbol, since, limit);
1763
+ }
1764
+ async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1765
+ /**
1766
+ * @method
1767
+ * @name hyperliquid#fetchCanceledOrders
1768
+ * @description fetch all canceled orders
1769
+ * @param {string} symbol unified market symbol
1770
+ * @param {int} [since] the earliest time in ms to fetch open orders for
1771
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
1772
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1773
+ * @param {string} [params.user] user address, will default to this.walletAddress if not provided
1774
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1775
+ */
1776
+ await this.loadMarkets();
1777
+ const orders = await this.fetchOrders(symbol, undefined, undefined, params); // don't filter here because we don't want to catch open orders
1778
+ const closedOrders = this.filterByArray(orders, 'status', ['canceled'], false);
1779
+ return this.filterBySymbolSinceLimit(closedOrders, symbol, since, limit);
1780
+ }
1781
+ async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1782
+ /**
1783
+ * @method
1784
+ * @name hyperliquid#fetchCanceledAndClosedOrders
1785
+ * @description fetch all closed and canceled orders
1786
+ * @param {string} symbol unified market symbol
1787
+ * @param {int} [since] the earliest time in ms to fetch open orders for
1788
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
1789
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1790
+ * @param {string} [params.user] user address, will default to this.walletAddress if not provided
1791
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1792
+ */
1793
+ await this.loadMarkets();
1794
+ const orders = await this.fetchOrders(symbol, undefined, undefined, params); // don't filter here because we don't want to catch open orders
1795
+ const closedOrders = this.filterByArray(orders, 'status', ['canceled', 'closed', 'rejected'], false);
1796
+ return this.filterBySymbolSinceLimit(closedOrders, symbol, since, limit);
1797
+ }
1798
+ async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1799
+ /**
1800
+ * @method
1801
+ * @name hyperliquid#fetchOrders
1802
+ * @description fetch all orders
1803
+ * @param {string} symbol unified market symbol
1804
+ * @param {int} [since] the earliest time in ms to fetch open orders for
1805
+ * @param {int} [limit] the maximum number of open orders structures to retrieve
1806
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1807
+ * @param {string} [params.user] user address, will default to this.walletAddress if not provided
1808
+ * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1809
+ */
1748
1810
  let userAddress = undefined;
1749
- [userAddress, params] = this.handlePublicAddress('fetchClosedOrders', params);
1811
+ [userAddress, params] = this.handlePublicAddress('fetchOrders', params);
1750
1812
  await this.loadMarkets();
1751
1813
  const market = this.safeMarket(symbol);
1752
1814
  const request = {
@@ -1935,11 +1997,14 @@ class hyperliquid extends hyperliquid$1 {
1935
1997
  }
1936
1998
  const symbol = market['symbol'];
1937
1999
  const timestamp = this.safeInteger2(order, 'timestamp', 'statusTimestamp');
1938
- const status = this.safeString(order, 'status');
2000
+ const status = this.safeString2(order, 'status', 'ccxtStatus');
2001
+ order = this.omit(order, ['ccxtStatus']);
1939
2002
  let side = this.safeString(entry, 'side');
1940
2003
  if (side !== undefined) {
1941
2004
  side = (side === 'A') ? 'sell' : 'buy';
1942
2005
  }
2006
+ const totalAmount = this.safeString2(entry, 'origSz', 'totalSz');
2007
+ const remaining = this.safeString(entry, 'sz');
1943
2008
  return this.safeOrder({
1944
2009
  'info': order,
1945
2010
  'id': this.safeString(entry, 'oid'),
@@ -1954,13 +2019,13 @@ class hyperliquid extends hyperliquid$1 {
1954
2019
  'postOnly': undefined,
1955
2020
  'reduceOnly': this.safeBool(entry, 'reduceOnly'),
1956
2021
  'side': side,
1957
- 'price': this.safeNumber(entry, 'limitPx'),
2022
+ 'price': this.safeString(entry, 'limitPx'),
1958
2023
  'triggerPrice': this.safeBool(entry, 'isTrigger') ? this.safeNumber(entry, 'triggerPx') : undefined,
1959
- 'amount': this.safeNumber2(entry, 'sz', 'totalSz'),
2024
+ 'amount': totalAmount,
1960
2025
  'cost': undefined,
1961
- 'average': this.safeNumber(entry, 'avgPx'),
1962
- 'filled': undefined,
1963
- 'remaining': undefined,
2026
+ 'average': this.safeString(entry, 'avgPx'),
2027
+ 'filled': Precise["default"].stringSub(totalAmount, remaining),
2028
+ 'remaining': remaining,
1964
2029
  'status': this.parseOrderStatus(status),
1965
2030
  'fee': undefined,
1966
2031
  'trades': undefined,
@@ -154,11 +154,12 @@ class independentreserve extends independentreserve$1 {
154
154
  * @param {object} [params] extra parameters specific to the exchange API endpoint
155
155
  * @returns {object[]} an array of objects representing market data
156
156
  */
157
- const baseCurrencies = await this.publicGetGetValidPrimaryCurrencyCodes(params);
157
+ const baseCurrenciesPromise = this.publicGetGetValidPrimaryCurrencyCodes(params);
158
158
  // ['Xbt', 'Eth', 'Usdt', ...]
159
- const quoteCurrencies = await this.publicGetGetValidSecondaryCurrencyCodes(params);
159
+ const quoteCurrenciesPromise = this.publicGetGetValidSecondaryCurrencyCodes(params);
160
160
  // ['Aud', 'Usd', 'Nzd', 'Sgd']
161
- const limits = await this.publicGetGetOrderMinimumVolumes(params);
161
+ const limitsPromise = this.publicGetGetOrderMinimumVolumes(params);
162
+ const [baseCurrencies, quoteCurrencies, limits] = await Promise.all([baseCurrenciesPromise, quoteCurrenciesPromise, limitsPromise]);
162
163
  //
163
164
  // {
164
165
  // "Xbt": 0.0001,
@@ -868,6 +868,9 @@ class indodax extends indodax$1 {
868
868
  else if (type === 'limit') {
869
869
  priceIsRequired = true;
870
870
  quantityIsRequired = true;
871
+ if (side === 'buy') {
872
+ request[market['quoteId']] = this.parseToNumeric(Precise["default"].stringMul(this.numberToString(amount), this.numberToString(price)));
873
+ }
871
874
  }
872
875
  if (priceIsRequired) {
873
876
  if (price === undefined) {
@@ -448,164 +448,82 @@ class mexc extends mexc$1 {
448
448
  'LTC': 'LTC',
449
449
  },
450
450
  'networks': {
451
- 'ABBC': 'ABBC',
451
+ 'TRC20': 'TRX',
452
+ 'TON': 'TONCOIN',
453
+ 'AVAXC': 'AVAX_CCHAIN',
454
+ 'ERC20': 'ETH',
452
455
  'ACA': 'ACALA',
453
- 'ADA': 'Cardano(ADA)',
454
- 'AE': 'AE',
455
- 'ALGO': 'Algorand(ALGO)',
456
- 'ALPH': 'Alephium(ALPH)',
457
- 'AME': 'AME',
458
- 'AOK': 'AOK',
459
- 'APT': 'APTOS(APT)',
460
- 'AR': 'AR',
461
- 'ARB': 'Arbitrum One(ARB)',
462
- 'ARBNOVA': 'ARBNOVA',
463
- 'ARBONE': 'ArbitrumOne(ARB)',
464
- 'ARK': 'ARK',
456
+ // 'ADA': 'Cardano(ADA)',
457
+ // 'AE': 'AE',
458
+ // 'ALGO': 'Algorand(ALGO)',
459
+ // 'ALPH': 'Alephium(ALPH)',
460
+ // 'ARB': 'Arbitrum One(ARB)',
461
+ // 'ARBONE': 'ArbitrumOne(ARB)',
465
462
  'ASTR': 'ASTAR',
466
- 'ATOM': 'Cosmos(ATOM)',
467
- 'AVAXC': 'Avalanche C Chain(AVAX CCHAIN)',
468
- 'AVAXX': 'Avalanche X Chain(AVAX XCHAIN)',
469
- 'AZERO': 'Aleph Zero(AZERO)',
470
- 'BCH': 'Bitcoin Cash(BCH)',
471
- 'BDX': 'BDX',
472
- 'BEAM': 'BEAM',
473
- 'BEP2': 'BNB Beacon Chain(BEP2)',
474
- 'BEP20': 'BNB Smart Chain(BEP20)',
475
- 'BITCI': 'BITCI',
476
- 'BNC': 'BNC',
477
- 'BNCDOT': 'BNCPOLKA',
478
- 'BOBA': 'BOBA',
479
- 'BSC': 'BEP20(BSC)',
480
- 'BSV': 'Bitcoin SV(BSV)',
481
- 'BTC': 'Bitcoin(BTC)',
463
+ // 'ATOM': 'Cosmos(ATOM)',
464
+ // 'AVAXC': 'Avalanche C Chain(AVAX CCHAIN)',
465
+ // 'AVAXX': 'Avalanche X Chain(AVAX XCHAIN)',
466
+ // 'AZERO': 'Aleph Zero(AZERO)',
467
+ // 'BCH': 'Bitcoin Cash(BCH)',
468
+ // 'BNCDOT': 'BNCPOLKA',
469
+ // 'BSV': 'Bitcoin SV(BSV)',
470
+ // 'BTC': 'Bitcoin(BTC)',
482
471
  'BTM': 'BTM2',
483
- 'CELO': 'CELO',
484
- 'CFX': 'CFX',
485
- 'CHZ': 'Chiliz Legacy Chain(CHZ)',
486
- 'CHZ2': 'Chiliz Chain(CHZ2)',
487
- 'CKB': 'CKB',
488
- 'CLORE': 'Clore.ai(CLORE)',
472
+ // 'CHZ': 'Chiliz Legacy Chain(CHZ)',
473
+ // 'CHZ2': 'Chiliz Chain(CHZ2)',
474
+ // 'CLORE': 'Clore.ai(CLORE)',
489
475
  'CRC20': 'CRONOS',
490
- 'CSPR': 'CSPR',
491
- 'DASH': 'DASH',
492
- 'DC': 'Dogechain(DC)',
493
- 'DCR': 'DCR',
494
- 'DNX': 'Dynex(DNX)',
495
- 'DOGE': 'Dogecoin(DOGE)',
496
- 'DOT': 'Polkadot(DOT)',
497
- 'DYM': 'Dymension(DYM)',
498
- 'EDG': 'EDG',
499
- 'EGLD': 'EGLD',
500
- 'EOS': 'EOS',
501
- 'ERC20': 'Ethereum(ERC20)',
502
- 'ETC': 'Ethereum Classic(ETC)',
476
+ // 'DC': 'Dogechain(DC)',
477
+ // 'DNX': 'Dynex(DNX)',
478
+ // 'DOGE': 'Dogecoin(DOGE)',
479
+ // 'DOT': 'Polkadot(DOT)',
480
+ // 'DYM': 'Dymension(DYM)',
503
481
  'ETHF': 'ETF',
504
- 'ETHW': 'ETHW',
505
- 'EVER': 'EVER',
506
- 'FET': 'FET',
507
- 'FIL': 'FIL',
508
- 'FIO': 'FIO',
509
- 'FLOW': 'FLOW',
510
- 'FSN': 'FSN',
511
- 'FTM': 'Fantom(FTM)',
512
- 'FUSE': 'FUSE',
513
- 'GLMR': 'GLMR',
514
- 'GRIN': 'GRIN',
515
- 'HBAR': 'Hedera(HBAR)',
516
- 'HIVE': 'HIVE',
517
482
  'HRC20': 'HECO',
518
- 'HYDRA': 'HYDRA',
519
- 'ICP': 'Internet Computer(ICP)',
520
- 'INDEX': 'Index Chain',
521
- 'IOST': 'IOST',
522
- 'IOTA': 'IOTA',
523
- 'IOTX': 'IOTX',
524
- 'IRIS': 'IRIS',
525
- 'KAR': 'KAR',
526
- 'KAS': 'Kaspa(KAS)',
527
- 'KAVA': 'KAVA',
528
- 'KDA': 'KDA',
529
- 'KILT': 'KILT',
530
- 'KLAY': 'Klaytn(KLAY)',
531
- 'KMA': 'KMA',
532
- 'KSM': 'KSM',
533
- 'LAT': 'LAT',
534
- 'LAVA': 'Elysium(LAVA)',
535
- 'LTC': 'Litecoin(LTC)',
536
- 'LUNA': 'Terra(LUNA)',
537
- 'MASS': 'MASS',
538
- 'MATIC': 'Polygon(MATIC)',
539
- 'MCOIN': 'Mcoin Network',
540
- 'METIS': 'METIS',
541
- 'MINA': 'MINA',
542
- 'MNT': 'Mantle(MNT)',
543
- 'MOVR': 'MOVR',
544
- 'MTRG': 'Meter(MTRG)',
545
- 'NAS': 'NAS',
546
- 'NEAR': 'NEAR Protocol(NEAR)',
547
- 'NEBL': 'NEBL',
548
- 'NEM': 'NEM',
549
- 'NEO': 'NEO',
550
- 'NEO3': 'NEO3',
551
- 'NEOXA': 'Neoxa Network',
552
- 'NULS': 'NULS',
483
+ // 'KLAY': 'Klaytn(KLAY)',
553
484
  'OASIS': 'ROSE',
554
- 'OASYS': 'OASYS',
555
485
  'OKC': 'OKT',
556
- 'OMN': 'Omega Network(OMN)',
557
- 'OMNI': 'OMNI',
558
- 'ONE': 'ONE',
559
- 'ONT': 'ONT',
560
- 'OPTIMISM': 'Optimism(OP)',
561
- 'OSMO': 'OSMO',
562
- 'PLCU': 'PLCU',
563
- 'POKT': 'POKT',
564
- 'QKC': 'QKC',
565
- 'QTUM': 'QTUM',
566
- 'RAP20': 'RAP20' + ' ' + '(Rangers Mainnet)',
567
- 'REI': 'REI',
568
486
  'RSK': 'RBTC',
569
- 'RVN': 'Ravencoin(RVN)',
570
- 'SATOX': 'Satoxcoin(SATOX)',
571
- 'SC': 'SC',
572
- 'SCRT': 'SCRT',
573
- 'SDN': 'SDN',
574
- 'SGB': 'SGB',
575
- 'SOL': 'Solana(SOL)',
576
- 'STAR': 'STAR',
577
- 'STARK': 'Starknet(STARK)',
578
- 'STEEM': 'STEEM',
579
- 'SYS': 'SYS',
580
- 'TAO': 'Bittensor(TAO)',
581
- 'TIA': 'Celestia(TIA)',
582
- 'TOMO': 'TOMO',
583
- 'TON': 'Toncoin(TON)',
584
- 'TRC10': 'TRC10',
585
- 'TRC20': 'Tron(TRC20)',
586
- 'UGAS': 'UGAS(Ultrain)',
587
- 'VET': 'VeChain(VET)',
588
- 'VEX': 'Vexanium(VEX)',
589
- 'VSYS': 'VSYS',
590
- 'WAVES': 'WAVES',
591
- 'WAX': 'WAX',
592
- 'WEMIX': 'WEMIX',
593
- 'XCH': 'Chia(XCH)',
594
- 'XDC': 'XDC',
595
- 'XEC': 'XEC',
596
- 'XLM': 'Stellar(XLM)',
597
- 'XMR': 'Monero(XMR)',
598
- 'XNA': 'Neurai(XNA)',
599
- 'XPR': 'XPR Network',
600
- 'XRD': 'XRD',
601
- 'XRP': 'Ripple(XRP)',
602
- 'XTZ': 'XTZ',
603
- 'XVG': 'XVG',
604
- 'XYM': 'XYM',
605
- 'ZEC': 'ZEC',
606
- 'ZEN': 'ZEN',
607
- 'ZIL': 'Zilliqa(ZIL)',
608
- 'ZTG': 'ZTG',
487
+ // 'RVN': 'Ravencoin(RVN)',
488
+ // 'SATOX': 'Satoxcoin(SATOX)',
489
+ // 'SC': 'SC',
490
+ // 'SCRT': 'SCRT',
491
+ // 'SDN': 'SDN',
492
+ // 'SGB': 'SGB',
493
+ // 'SOL': 'Solana(SOL)',
494
+ // 'STAR': 'STAR',
495
+ // 'STARK': 'Starknet(STARK)',
496
+ // 'STEEM': 'STEEM',
497
+ // 'SYS': 'SYS',
498
+ // 'TAO': 'Bittensor(TAO)',
499
+ // 'TIA': 'Celestia(TIA)',
500
+ // 'TOMO': 'TOMO',
501
+ // 'TON': 'Toncoin(TON)',
502
+ // 'TRC10': 'TRC10',
503
+ // 'TRC20': 'Tron(TRC20)',
504
+ // 'UGAS': 'UGAS(Ultrain)',
505
+ // 'VET': 'VeChain(VET)',
506
+ // 'VEX': 'Vexanium(VEX)',
507
+ // 'VSYS': 'VSYS',
508
+ // 'WAVES': 'WAVES',
509
+ // 'WAX': 'WAX',
510
+ // 'WEMIX': 'WEMIX',
511
+ // 'XCH': 'Chia(XCH)',
512
+ // 'XDC': 'XDC',
513
+ // 'XEC': 'XEC',
514
+ // 'XLM': 'Stellar(XLM)',
515
+ // 'XMR': 'Monero(XMR)',
516
+ // 'XNA': 'Neurai(XNA)',
517
+ // 'XPR': 'XPR Network',
518
+ // 'XRD': 'XRD',
519
+ // 'XRP': 'Ripple(XRP)',
520
+ // 'XTZ': 'XTZ',
521
+ // 'XVG': 'XVG',
522
+ // 'XYM': 'XYM',
523
+ // 'ZEC': 'ZEC',
524
+ // 'ZEN': 'ZEN',
525
+ // 'ZIL': 'Zilliqa(ZIL)',
526
+ // 'ZTG': 'ZTG',
609
527
  // todo: uncomment below after concensus
610
528
  // 'ALAYA': 'ATP',
611
529
  // 'ANDUSCHAIN': 'DEB',
@@ -1008,7 +926,7 @@ class mexc extends mexc$1 {
1008
926
  const chains = this.safeValue(currency, 'networkList', []);
1009
927
  for (let j = 0; j < chains.length; j++) {
1010
928
  const chain = chains[j];
1011
- const networkId = this.safeString2(chain, 'network', 'netWork');
929
+ const networkId = this.safeString2(chain, 'netWork', 'network');
1012
930
  const network = this.networkIdToCode(networkId);
1013
931
  const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
1014
932
  const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
@@ -4390,7 +4308,7 @@ class mexc extends mexc$1 {
4390
4308
  //
4391
4309
  const address = this.safeString(depositAddress, 'address');
4392
4310
  const currencyId = this.safeString(depositAddress, 'coin');
4393
- const networkId = this.safeString(depositAddress, 'network');
4311
+ const networkId = this.safeString(depositAddress, 'netWork');
4394
4312
  this.checkAddress(address);
4395
4313
  return {
4396
4314
  'currency': this.safeCurrencyCode(currencyId, currency),
@@ -5171,14 +5089,14 @@ class mexc extends mexc$1 {
5171
5089
  * @param {object} [params] extra parameters specific to the exchange API endpoint
5172
5090
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
5173
5091
  */
5092
+ await this.loadMarkets();
5093
+ const currency = this.currency(code);
5174
5094
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
5175
5095
  const networks = this.safeDict(this.options, 'networks', {});
5176
5096
  let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
5177
5097
  network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
5178
- network = this.networkIdToCode(network);
5098
+ network = this.networkCodeToId(network, currency['code']);
5179
5099
  this.checkAddress(address);
5180
- await this.loadMarkets();
5181
- const currency = this.currency(code);
5182
5100
  const request = {
5183
5101
  'coin': currency['id'],
5184
5102
  'address': address,