ccxt 4.4.91 → 4.4.93

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 (64) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ascendex.js +9 -8
  5. package/dist/cjs/src/base/Exchange.js +81 -33
  6. package/dist/cjs/src/binance.js +44 -1
  7. package/dist/cjs/src/bitmart.js +7 -0
  8. package/dist/cjs/src/bitmex.js +4 -4
  9. package/dist/cjs/src/bitvavo.js +10 -1
  10. package/dist/cjs/src/bybit.js +83 -8
  11. package/dist/cjs/src/coinbaseexchange.js +53 -0
  12. package/dist/cjs/src/coincheck.js +47 -4
  13. package/dist/cjs/src/coinex.js +19 -14
  14. package/dist/cjs/src/cryptomus.js +30 -53
  15. package/dist/cjs/src/deribit.js +6 -6
  16. package/dist/cjs/src/exmo.js +72 -59
  17. package/dist/cjs/src/htx.js +1 -1
  18. package/dist/cjs/src/hyperliquid.js +3 -2
  19. package/dist/cjs/src/krakenfutures.js +1 -1
  20. package/dist/cjs/src/kucoin.js +13 -15
  21. package/dist/cjs/src/latoken.js +19 -74
  22. package/dist/cjs/src/lbank.js +118 -34
  23. package/dist/cjs/src/okx.js +158 -2
  24. package/dist/cjs/src/paradex.js +54 -0
  25. package/dist/cjs/src/phemex.js +3 -3
  26. package/dist/cjs/src/pro/bitstamp.js +55 -16
  27. package/dist/cjs/src/pro/bybit.js +6 -7
  28. package/js/ccxt.d.ts +1 -1
  29. package/js/ccxt.js +1 -1
  30. package/js/src/abstract/lbank.d.ts +1 -0
  31. package/js/src/ascendex.js +9 -8
  32. package/js/src/base/Exchange.d.ts +5 -1
  33. package/js/src/base/Exchange.js +81 -33
  34. package/js/src/binance.d.ts +10 -0
  35. package/js/src/binance.js +44 -1
  36. package/js/src/bitmart.d.ts +7 -0
  37. package/js/src/bitmart.js +7 -0
  38. package/js/src/bitmex.d.ts +1 -1
  39. package/js/src/bitmex.js +4 -4
  40. package/js/src/bitvavo.js +10 -1
  41. package/js/src/bybit.d.ts +12 -1
  42. package/js/src/bybit.js +83 -8
  43. package/js/src/coinbaseexchange.js +53 -0
  44. package/js/src/coincheck.js +48 -5
  45. package/js/src/coinex.js +16 -13
  46. package/js/src/cryptomus.js +30 -53
  47. package/js/src/deribit.js +6 -6
  48. package/js/src/exmo.js +72 -59
  49. package/js/src/htx.js +1 -1
  50. package/js/src/hyperliquid.js +3 -2
  51. package/js/src/krakenfutures.js +1 -1
  52. package/js/src/kucoin.js +13 -15
  53. package/js/src/latoken.d.ts +0 -1
  54. package/js/src/latoken.js +19 -74
  55. package/js/src/lbank.d.ts +9 -1
  56. package/js/src/lbank.js +118 -34
  57. package/js/src/okx.d.ts +13 -1
  58. package/js/src/okx.js +158 -2
  59. package/js/src/paradex.d.ts +10 -0
  60. package/js/src/paradex.js +54 -0
  61. package/js/src/phemex.js +3 -3
  62. package/js/src/pro/bitstamp.js +55 -16
  63. package/js/src/pro/bybit.js +7 -8
  64. package/package.json +1 -1
@@ -1386,36 +1386,32 @@ class kucoin extends kucoin$1 {
1386
1386
  // }
1387
1387
  //
1388
1388
  const currenciesData = this.safeList(response, 'data', []);
1389
+ const brokenCurrencies = this.safeList(this.options, 'brokenCurrencies', ['00', 'OPEN_ERROR', 'HUF', 'BDT']);
1390
+ const otherFiats = this.safeList(this.options, 'fiats', ['KWD', 'IRR', 'PKR']);
1389
1391
  const result = {};
1390
1392
  for (let i = 0; i < currenciesData.length; i++) {
1391
1393
  const entry = currenciesData[i];
1392
1394
  const id = this.safeString(entry, 'currency');
1393
- const name = this.safeString(entry, 'fullName');
1395
+ if (this.inArray(id, brokenCurrencies)) {
1396
+ continue; // skip buggy entries: https://t.me/KuCoin_API/217798
1397
+ }
1394
1398
  const code = this.safeCurrencyCode(id);
1395
1399
  const networks = {};
1396
1400
  const chains = this.safeList(entry, 'chains', []);
1397
- const rawPrecision = this.safeString(entry, 'precision');
1398
- const precision = this.parseNumber(this.parsePrecision(rawPrecision));
1399
1401
  const chainsLength = chains.length;
1400
- if (!chainsLength) {
1401
- // one buggy coin, which doesn't contain info https://t.me/KuCoin_API/173118
1402
- continue;
1403
- }
1404
1402
  for (let j = 0; j < chainsLength; j++) {
1405
1403
  const chain = chains[j];
1406
1404
  const chainId = this.safeString(chain, 'chainId');
1407
1405
  const networkCode = this.networkIdToCode(chainId, code);
1408
- const chainWithdrawEnabled = this.safeBool(chain, 'isWithdrawEnabled', false);
1409
- const chainDepositEnabled = this.safeBool(chain, 'isDepositEnabled', false);
1410
1406
  networks[networkCode] = {
1411
1407
  'info': chain,
1412
1408
  'id': chainId,
1413
1409
  'name': this.safeString(chain, 'chainName'),
1414
1410
  'code': networkCode,
1415
- 'active': chainWithdrawEnabled && chainDepositEnabled,
1411
+ 'active': undefined,
1416
1412
  'fee': this.safeNumber(chain, 'withdrawalMinFee'),
1417
- 'deposit': chainDepositEnabled,
1418
- 'withdraw': chainWithdrawEnabled,
1413
+ 'deposit': this.safeBool(chain, 'isDepositEnabled'),
1414
+ 'withdraw': this.safeBool(chain, 'isWithdrawEnabled'),
1419
1415
  'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'withdrawPrecision'))),
1420
1416
  'limits': {
1421
1417
  'withdraw': {
@@ -1430,10 +1426,12 @@ class kucoin extends kucoin$1 {
1430
1426
  };
1431
1427
  }
1432
1428
  // kucoin has determined 'fiat' currencies with below logic
1433
- const isFiat = (rawPrecision === '2') && (chainsLength === 0);
1429
+ const rawPrecision = this.safeString(entry, 'precision');
1430
+ const precision = this.parseNumber(this.parsePrecision(rawPrecision));
1431
+ const isFiat = this.inArray(id, otherFiats) || ((rawPrecision === '2') && (chainsLength === 0));
1434
1432
  result[code] = this.safeCurrencyStructure({
1435
1433
  'id': id,
1436
- 'name': name,
1434
+ 'name': this.safeString(entry, 'fullName'),
1437
1435
  'code': code,
1438
1436
  'type': isFiat ? 'fiat' : 'crypto',
1439
1437
  'precision': precision,
@@ -2694,7 +2692,7 @@ class kucoin extends kucoin$1 {
2694
2692
  async cancelAllOrders(symbol = undefined, params = {}) {
2695
2693
  await this.loadMarkets();
2696
2694
  const request = {};
2697
- const trigger = this.safeBool(params, 'stop', false);
2695
+ const trigger = this.safeBool2(params, 'trigger', 'stop', false);
2698
2696
  let hf = undefined;
2699
2697
  [hf, params] = this.handleHfAndParams(params);
2700
2698
  params = this.omit(params, 'stop');
@@ -233,6 +233,8 @@ class latoken extends latoken$1 {
233
233
  'fetchTradingFee': {
234
234
  'method': 'fetchPrivateTradingFee', // or 'fetchPublicTradingFee'
235
235
  },
236
+ 'timeDifference': 0,
237
+ 'adjustForTimeDifference': true, // controls the adjustment logic upon instantiation
236
238
  },
237
239
  'features': {
238
240
  'spot': {
@@ -333,39 +335,6 @@ class latoken extends latoken$1 {
333
335
  * @returns {object[]} an array of objects representing market data
334
336
  */
335
337
  async fetchMarkets(params = {}) {
336
- const currencies = await this.fetchCurrenciesFromCache(params);
337
- //
338
- // [
339
- // {
340
- // "id":"1a075819-9e0b-48fc-8784-4dab1d186d6d",
341
- // "status":"CURRENCY_STATUS_ACTIVE",
342
- // "type":"CURRENCY_TYPE_ALTERNATIVE", // CURRENCY_TYPE_CRYPTO, CURRENCY_TYPE_IEO
343
- // "name":"MyCryptoBank",
344
- // "tag":"MCB",
345
- // "description":"",
346
- // "logo":"",
347
- // "decimals":18,
348
- // "created":1572912000000,
349
- // "tier":1,
350
- // "assetClass":"ASSET_CLASS_UNKNOWN",
351
- // "minTransferAmount":0
352
- // },
353
- // {
354
- // "id":"db02758e-2507-46a5-a805-7bc60355b3eb",
355
- // "status":"CURRENCY_STATUS_ACTIVE",
356
- // "type":"CURRENCY_TYPE_FUTURES_CONTRACT",
357
- // "name":"BTC USDT Futures Contract",
358
- // "tag":"BTCUSDT",
359
- // "description":"",
360
- // "logo":"",
361
- // "decimals":8,
362
- // "created":1589459984395,
363
- // "tier":1,
364
- // "assetClass":"ASSET_CLASS_UNKNOWN",
365
- // "minTransferAmount":0
366
- // },
367
- // ]
368
- //
369
338
  const response = await this.publicGetPair(params);
370
339
  //
371
340
  // [
@@ -387,9 +356,10 @@ class latoken extends latoken$1 {
387
356
  // }
388
357
  // ]
389
358
  //
390
- if (this.safeValue(this.options, 'adjustForTimeDifference', true)) {
359
+ if (this.safeBool(this.options, 'adjustForTimeDifference', false)) {
391
360
  await this.loadTimeDifference();
392
361
  }
362
+ const currencies = this.safeDict(this.options, 'cachedCurrencies', {});
393
363
  const currenciesById = this.indexBy(currencies, 'id');
394
364
  const result = [];
395
365
  for (let i = 0; i < response.length; i++) {
@@ -398,11 +368,13 @@ class latoken extends latoken$1 {
398
368
  // the exchange shows them inverted
399
369
  const baseId = this.safeString(market, 'baseCurrency');
400
370
  const quoteId = this.safeString(market, 'quoteCurrency');
401
- const baseCurrency = this.safeValue(currenciesById, baseId);
402
- const quoteCurrency = this.safeValue(currenciesById, quoteId);
403
- if (baseCurrency !== undefined && quoteCurrency !== undefined) {
404
- const base = this.safeCurrencyCode(this.safeString(baseCurrency, 'tag'));
405
- const quote = this.safeCurrencyCode(this.safeString(quoteCurrency, 'tag'));
371
+ const baseCurrency = this.safeDict(currenciesById, baseId);
372
+ const quoteCurrency = this.safeDict(currenciesById, quoteId);
373
+ const baseCurrencyInfo = this.safeDict(baseCurrency, 'info');
374
+ const quoteCurrencyInfo = this.safeDict(quoteCurrency, 'info');
375
+ if (baseCurrencyInfo !== undefined && quoteCurrencyInfo !== undefined) {
376
+ const base = this.safeCurrencyCode(this.safeString(baseCurrencyInfo, 'tag'));
377
+ const quote = this.safeCurrencyCode(this.safeString(quoteCurrencyInfo, 'tag'));
406
378
  const lowercaseQuote = quote.toLowerCase();
407
379
  const capitalizedQuote = this.capitalize(lowercaseQuote);
408
380
  const status = this.safeString(market, 'status');
@@ -459,22 +431,6 @@ class latoken extends latoken$1 {
459
431
  }
460
432
  return result;
461
433
  }
462
- async fetchCurrenciesFromCache(params = {}) {
463
- // this method is now redundant
464
- // currencies are now fetched before markets
465
- const options = this.safeValue(this.options, 'fetchCurrencies', {});
466
- const timestamp = this.safeInteger(options, 'timestamp');
467
- const expires = this.safeInteger(options, 'expires', 1000);
468
- const now = this.milliseconds();
469
- if ((timestamp === undefined) || ((now - timestamp) > expires)) {
470
- const response = await this.publicGetCurrency(params);
471
- this.options['fetchCurrencies'] = this.extend(options, {
472
- 'response': response,
473
- 'timestamp': now,
474
- });
475
- }
476
- return this.safeValue(this.options['fetchCurrencies'], 'response');
477
- }
478
434
  /**
479
435
  * @method
480
436
  * @name latoken#fetchCurrencies
@@ -483,7 +439,7 @@ class latoken extends latoken$1 {
483
439
  * @returns {object} an associative dictionary of currencies
484
440
  */
485
441
  async fetchCurrencies(params = {}) {
486
- const response = await this.fetchCurrenciesFromCache(params);
442
+ const response = await this.publicGetCurrency(params);
487
443
  //
488
444
  // [
489
445
  // {
@@ -522,29 +478,18 @@ class latoken extends latoken$1 {
522
478
  const id = this.safeString(currency, 'id');
523
479
  const tag = this.safeString(currency, 'tag');
524
480
  const code = this.safeCurrencyCode(tag);
525
- const fee = this.safeNumber(currency, 'fee');
526
481
  const currencyType = this.safeString(currency, 'type');
527
- let type = undefined;
528
- if (currencyType === 'CURRENCY_TYPE_ALTERNATIVE') {
529
- type = 'other';
530
- }
531
- else {
532
- // CURRENCY_TYPE_CRYPTO and CURRENCY_TYPE_IEO are all cryptos
533
- type = 'crypto';
534
- }
535
- const status = this.safeString(currency, 'status');
536
- const active = (status === 'CURRENCY_STATUS_ACTIVE');
537
- const name = this.safeString(currency, 'name');
538
- result[code] = {
482
+ const isCrypto = (currencyType === 'CURRENCY_TYPE_CRYPTO' || currencyType === 'CURRENCY_TYPE_IEO');
483
+ result[code] = this.safeCurrencyStructure({
539
484
  'id': id,
540
485
  'code': code,
541
486
  'info': currency,
542
- 'name': name,
543
- 'type': type,
544
- 'active': active,
487
+ 'name': this.safeString(currency, 'name'),
488
+ 'type': isCrypto ? 'crypto' : 'other',
489
+ 'active': this.safeString(currency, 'status') === 'CURRENCY_STATUS_ACTIVE',
545
490
  'deposit': undefined,
546
491
  'withdraw': undefined,
547
- 'fee': fee,
492
+ 'fee': this.safeNumber(currency, 'fee'),
548
493
  'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
549
494
  'limits': {
550
495
  'amount': {
@@ -557,7 +502,7 @@ class latoken extends latoken$1 {
557
502
  },
558
503
  },
559
504
  'networks': {},
560
- };
505
+ });
561
506
  }
562
507
  return result;
563
508
  }
@@ -49,6 +49,7 @@ class lbank extends lbank$1 {
49
49
  'fetchClosedOrders': false,
50
50
  'fetchCrossBorrowRate': false,
51
51
  'fetchCrossBorrowRates': false,
52
+ 'fetchCurrencies': true,
52
53
  'fetchDepositAddress': true,
53
54
  'fetchDepositAddresses': false,
54
55
  'fetchDepositAddressesByNetwork': false,
@@ -123,7 +124,8 @@ class lbank extends lbank$1 {
123
124
  'currencyPairs': 2.5,
124
125
  'accuracy': 2.5,
125
126
  'usdToCny': 2.5,
126
- 'withdrawConfigs': 2.5,
127
+ 'assetConfigs': 2.5,
128
+ 'withdrawConfigs': 2.5 * 1.5,
127
129
  'timestamp': 2.5,
128
130
  'ticker/24hr': 2.5,
129
131
  'ticker': 2.5,
@@ -209,6 +211,7 @@ class lbank extends lbank$1 {
209
211
  },
210
212
  },
211
213
  'commonCurrencies': {
214
+ 'XBT': 'XBT',
212
215
  'HIT': 'Hiver',
213
216
  'VET_ERC20': 'VEN',
214
217
  'PNT': 'Penta',
@@ -276,21 +279,12 @@ class lbank extends lbank$1 {
276
279
  // ptx: 1
277
280
  // }
278
281
  },
279
- 'inverse-networks': {
282
+ 'networksById': {
280
283
  'erc20': 'ERC20',
281
284
  'trc20': 'TRC20',
282
- 'omni': 'OMNI',
283
- 'asa': 'ASA',
284
- 'bep20(bsc)': 'BSC',
285
- 'bep20': 'BSC',
286
- 'heco': 'HT',
287
- 'bep2': 'BNB',
288
- 'btc': 'BTC',
289
- 'dogecoin': 'DOGE',
290
- 'matic': 'MATIC',
291
- 'oec': 'OEC',
292
- 'btctron': 'BTCTRON',
293
- 'xrp': 'XRP',
285
+ 'TRX': 'TRC20',
286
+ 'bep20(bsc)': 'BEP20',
287
+ 'bep20': 'BEP20',
294
288
  },
295
289
  'defaultNetworks': {
296
290
  'USDT': 'TRC20',
@@ -413,6 +407,108 @@ class lbank extends lbank$1 {
413
407
  //
414
408
  return this.safeInteger(response, 'data');
415
409
  }
410
+ /**
411
+ * @method
412
+ * @name lbank#fetchCurrencies
413
+ * @description fetches all available currencies on an exchange
414
+ * @param {dict} [params] extra parameters specific to the exchange API endpoint
415
+ * @returns {dict} an associative dictionary of currencies
416
+ */
417
+ async fetchCurrencies(params = {}) {
418
+ const response = await this.spotPublicGetWithdrawConfigs(params);
419
+ //
420
+ // {
421
+ // "msg": "Success",
422
+ // "result": "true",
423
+ // "data": [
424
+ // {
425
+ // "amountScale": "4",
426
+ // "chain": "bep20(bsc)",
427
+ // "assetCode": "usdt",
428
+ // "min": "10",
429
+ // "transferAmtScale": "4",
430
+ // "canWithDraw": true,
431
+ // "fee": "0.0000",
432
+ // "minTransfer": "0.0001",
433
+ // "type": "1"
434
+ // },
435
+ // {
436
+ // "amountScale": "4",
437
+ // "chain": "trc20",
438
+ // "assetCode": "usdt",
439
+ // "min": "1",
440
+ // "transferAmtScale": "4",
441
+ // "canWithDraw": true,
442
+ // "fee": "1.0000",
443
+ // "minTransfer": "0.0001",
444
+ // "type": "1"
445
+ // },
446
+ // ...
447
+ // ],
448
+ // "error_code": "0",
449
+ // "ts": "1747973911431"
450
+ // }
451
+ //
452
+ const currenciesData = this.safeList(response, 'data', []);
453
+ const grouped = this.groupBy(currenciesData, 'assetCode');
454
+ const groupedKeys = Object.keys(grouped);
455
+ const result = {};
456
+ for (let i = 0; i < groupedKeys.length; i++) {
457
+ const id = (groupedKeys[i]).toString(); // some currencies are numeric
458
+ const code = this.safeCurrencyCode(id);
459
+ const networksRaw = grouped[id];
460
+ const networks = {};
461
+ for (let j = 0; j < networksRaw.length; j++) {
462
+ const networkEntry = networksRaw[j];
463
+ const networkId = this.safeString(networkEntry, 'chain');
464
+ const networkCode = this.networkIdToCode(networkId);
465
+ networks[networkCode] = {
466
+ 'id': networkId,
467
+ 'network': networkCode,
468
+ 'limits': {
469
+ 'withdraw': {
470
+ 'min': this.safeNumber(networkEntry, 'min'),
471
+ 'max': undefined,
472
+ },
473
+ 'deposit': {
474
+ 'min': this.safeNumber(networkEntry, 'minTransfer'),
475
+ 'max': undefined,
476
+ },
477
+ },
478
+ 'active': undefined,
479
+ 'deposit': undefined,
480
+ 'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
481
+ 'fee': this.safeNumber(networkEntry, 'fee'),
482
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
483
+ 'info': networkEntry,
484
+ };
485
+ }
486
+ result[code] = this.safeCurrencyStructure({
487
+ 'id': id,
488
+ 'code': code,
489
+ 'precision': undefined,
490
+ 'type': undefined,
491
+ 'name': undefined,
492
+ 'active': undefined,
493
+ 'deposit': undefined,
494
+ 'withdraw': undefined,
495
+ 'fee': undefined,
496
+ 'limits': {
497
+ 'withdraw': {
498
+ 'min': undefined,
499
+ 'max': undefined,
500
+ },
501
+ 'deposit': {
502
+ 'min': undefined,
503
+ 'max': undefined,
504
+ },
505
+ },
506
+ 'networks': networks,
507
+ 'info': networksRaw,
508
+ });
509
+ }
510
+ return result;
511
+ }
416
512
  /**
417
513
  * @method
418
514
  * @name lbank#fetchMarkets
@@ -573,7 +669,7 @@ class lbank extends lbank$1 {
573
669
  'active': true,
574
670
  'contract': true,
575
671
  'linear': true,
576
- 'inverse': undefined,
672
+ 'inverse': false,
577
673
  'contractSize': this.safeNumber(market, 'volumeMultiple'),
578
674
  'expiry': undefined,
579
675
  'expiryDatetime': undefined,
@@ -2168,13 +2264,10 @@ class lbank extends lbank$1 {
2168
2264
  const result = this.safeValue(response, 'data');
2169
2265
  const address = this.safeString(result, 'address');
2170
2266
  const tag = this.safeString(result, 'memo');
2171
- const networkId = this.safeString(result, 'netWork');
2172
- const inverseNetworks = this.safeValue(this.options, 'inverse-networks', {});
2173
- const networkCode = this.safeStringUpper(inverseNetworks, networkId, networkId);
2174
2267
  return {
2175
2268
  'info': response,
2176
2269
  'currency': code,
2177
- 'network': networkCode,
2270
+ 'network': this.networkIdToCode(this.safeString(result, 'netWork')),
2178
2271
  'address': address,
2179
2272
  'tag': tag,
2180
2273
  };
@@ -2209,12 +2302,10 @@ class lbank extends lbank$1 {
2209
2302
  const result = this.safeValue(response, 'data');
2210
2303
  const address = this.safeString(result, 'address');
2211
2304
  const tag = this.safeString(result, 'memo');
2212
- const inverseNetworks = this.safeValue(this.options, 'inverse-networks', {});
2213
- const networkCode = this.safeStringUpper(inverseNetworks, network, network);
2214
2305
  return {
2215
2306
  'info': response,
2216
2307
  'currency': code,
2217
- 'network': networkCode,
2308
+ 'network': undefined,
2218
2309
  'address': address,
2219
2310
  'tag': tag,
2220
2311
  };
@@ -2338,9 +2429,6 @@ class lbank extends lbank$1 {
2338
2429
  }
2339
2430
  const txid = this.safeString(transaction, 'txId');
2340
2431
  const timestamp = this.safeInteger2(transaction, 'insertTime', 'applyTime');
2341
- const networks = this.safeValue(this.options, 'inverse-networks', {});
2342
- const networkId = this.safeString(transaction, 'networkName');
2343
- const network = this.safeString(networks, networkId, networkId);
2344
2432
  const address = this.safeString(transaction, 'address');
2345
2433
  let addressFrom = undefined;
2346
2434
  let addressTo = undefined;
@@ -2368,7 +2456,7 @@ class lbank extends lbank$1 {
2368
2456
  'txid': txid,
2369
2457
  'timestamp': timestamp,
2370
2458
  'datetime': this.iso8601(timestamp),
2371
- 'network': network,
2459
+ 'network': this.networkIdToCode(this.safeString(transaction, 'networkName')),
2372
2460
  'address': address,
2373
2461
  'addressTo': addressTo,
2374
2462
  'addressFrom': addressFrom,
@@ -2571,10 +2659,9 @@ class lbank extends lbank$1 {
2571
2659
  withdrawFees[code] = {};
2572
2660
  for (let j = 0; j < networkList.length; j++) {
2573
2661
  const networkEntry = networkList[j];
2574
- const networkId = this.safeString(networkEntry, 'name');
2575
- const networkCode = this.safeString(this.options['inverse-networks'], networkId, networkId);
2576
2662
  const fee = this.safeNumber(networkEntry, 'withdrawFee');
2577
2663
  if (fee !== undefined) {
2664
+ const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
2578
2665
  withdrawFees[code][networkCode] = fee;
2579
2666
  }
2580
2667
  }
@@ -2626,8 +2713,7 @@ class lbank extends lbank$1 {
2626
2713
  if (canWithdraw === 'true') {
2627
2714
  const currencyId = this.safeString(item, 'assetCode');
2628
2715
  const codeInner = this.safeCurrencyCode(currencyId);
2629
- const chain = this.safeString(item, 'chain');
2630
- let network = this.safeString(this.options['inverse-networks'], chain, chain);
2716
+ let network = this.networkIdToCode(this.safeString(item, 'chain'));
2631
2717
  if (network === undefined) {
2632
2718
  network = codeInner;
2633
2719
  }
@@ -2778,8 +2864,7 @@ class lbank extends lbank$1 {
2778
2864
  const resultCodeInfo = result[code]['info'];
2779
2865
  resultCodeInfo.push(fee);
2780
2866
  }
2781
- const chain = this.safeString(fee, 'chain');
2782
- const networkCode = this.safeString(this.options['inverse-networks'], chain, chain);
2867
+ const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'));
2783
2868
  if (networkCode !== undefined) {
2784
2869
  result[code]['networks'][networkCode] = {
2785
2870
  'withdraw': {
@@ -2835,8 +2920,7 @@ class lbank extends lbank$1 {
2835
2920
  const networkList = this.safeValue(fee, 'networkList', []);
2836
2921
  for (let j = 0; j < networkList.length; j++) {
2837
2922
  const networkEntry = networkList[j];
2838
- const networkId = this.safeString(networkEntry, 'name');
2839
- const networkCode = this.safeStringUpper(this.options['inverse-networks'], networkId, networkId);
2923
+ const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
2840
2924
  const withdrawFee = this.safeNumber(networkEntry, 'withdrawFee');
2841
2925
  const isDefault = this.safeValue(networkEntry, 'isDefault');
2842
2926
  if (withdrawFee !== undefined) {