ccxt 4.4.85 → 4.4.87

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 (115) hide show
  1. package/README.md +18 -7
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +16 -9
  4. package/dist/cjs/src/abstract/bittrade.js +9 -0
  5. package/dist/cjs/src/abstract/modetrade.js +9 -0
  6. package/dist/cjs/src/ascendex.js +189 -155
  7. package/dist/cjs/src/base/Exchange.js +10 -8
  8. package/dist/cjs/src/bequant.js +1 -1
  9. package/dist/cjs/src/binance.js +1 -1
  10. package/dist/cjs/src/bitget.js +5 -4
  11. package/dist/cjs/src/bitmart.js +1 -1
  12. package/dist/cjs/src/bitteam.js +31 -0
  13. package/dist/cjs/src/bittrade.js +2049 -0
  14. package/dist/cjs/src/coinbase.js +2 -6
  15. package/dist/cjs/src/coinmetro.js +5 -1
  16. package/dist/cjs/src/deribit.js +4 -5
  17. package/dist/cjs/src/derive.js +4 -5
  18. package/dist/cjs/src/ellipx.js +2 -3
  19. package/dist/cjs/src/gate.js +92 -76
  20. package/dist/cjs/src/hollaex.js +107 -49
  21. package/dist/cjs/src/htx.js +30 -52
  22. package/dist/cjs/src/hyperliquid.js +36 -20
  23. package/dist/cjs/src/kraken.js +5 -8
  24. package/dist/cjs/src/mexc.js +2 -2
  25. package/dist/cjs/src/modetrade.js +2839 -0
  26. package/dist/cjs/src/ndax.js +25 -24
  27. package/dist/cjs/src/okcoin.js +12 -31
  28. package/dist/cjs/src/okx.js +104 -2
  29. package/dist/cjs/src/okxus.js +53 -0
  30. package/dist/cjs/src/onetrading.js +9 -6
  31. package/dist/cjs/src/oxfun.js +42 -114
  32. package/dist/cjs/src/paradex.js +10 -1
  33. package/dist/cjs/src/phemex.js +4 -6
  34. package/dist/cjs/src/poloniex.js +181 -170
  35. package/dist/cjs/src/pro/binance.js +1 -0
  36. package/dist/cjs/src/pro/bittrade.js +605 -0
  37. package/dist/cjs/src/pro/luno.js +6 -5
  38. package/dist/cjs/src/pro/mexc.js +3 -0
  39. package/dist/cjs/src/pro/modetrade.js +1334 -0
  40. package/dist/cjs/src/pro/okxus.js +38 -0
  41. package/dist/cjs/src/probit.js +18 -51
  42. package/dist/cjs/src/timex.js +5 -10
  43. package/dist/cjs/src/vertex.js +3 -4
  44. package/dist/cjs/src/whitebit.js +41 -11
  45. package/dist/cjs/src/woo.js +101 -77
  46. package/dist/cjs/src/woofipro.js +24 -21
  47. package/dist/cjs/src/xt.js +36 -44
  48. package/js/ccxt.d.ts +20 -11
  49. package/js/ccxt.js +14 -8
  50. package/js/src/abstract/modetrade.d.ts +122 -0
  51. package/js/src/abstract/myokx.d.ts +2 -0
  52. package/js/src/abstract/okx.d.ts +2 -0
  53. package/js/src/abstract/okxus.d.ts +352 -0
  54. package/js/src/abstract/okxus.js +11 -0
  55. package/js/src/ascendex.d.ts +2 -0
  56. package/js/src/ascendex.js +189 -155
  57. package/js/src/base/Exchange.js +10 -8
  58. package/js/src/bequant.js +1 -1
  59. package/js/src/binance.js +1 -1
  60. package/js/src/bitget.js +5 -4
  61. package/js/src/bitmart.js +1 -1
  62. package/js/src/bitteam.js +31 -0
  63. package/js/src/{huobijp.d.ts → bittrade.d.ts} +29 -29
  64. package/js/src/{huobijp.js → bittrade.js} +35 -35
  65. package/js/src/coinbase.js +2 -6
  66. package/js/src/coinmetro.js +5 -1
  67. package/js/src/deribit.js +4 -5
  68. package/js/src/derive.js +4 -3
  69. package/js/src/ellipx.d.ts +1 -1
  70. package/js/src/ellipx.js +3 -5
  71. package/js/src/gate.js +92 -76
  72. package/js/src/hollaex.js +107 -49
  73. package/js/src/htx.js +30 -52
  74. package/js/src/hyperliquid.js +36 -20
  75. package/js/src/kraken.js +5 -8
  76. package/js/src/mexc.js +2 -2
  77. package/js/src/modetrade.d.ts +475 -0
  78. package/js/src/modetrade.js +2840 -0
  79. package/js/src/ndax.js +25 -24
  80. package/js/src/okcoin.js +12 -31
  81. package/js/src/okx.d.ts +24 -1
  82. package/js/src/okx.js +104 -2
  83. package/js/src/okxus.d.ts +4 -0
  84. package/js/src/okxus.js +54 -0
  85. package/js/src/onetrading.js +9 -6
  86. package/js/src/oxfun.js +42 -114
  87. package/js/src/paradex.js +10 -1
  88. package/js/src/phemex.js +4 -6
  89. package/js/src/poloniex.d.ts +2 -0
  90. package/js/src/poloniex.js +181 -170
  91. package/js/src/pro/binance.js +1 -0
  92. package/js/src/pro/{huobijp.d.ts → bittrade.d.ts} +6 -6
  93. package/js/src/pro/{huobijp.js → bittrade.js} +7 -7
  94. package/js/src/pro/luno.js +6 -5
  95. package/js/src/pro/mexc.js +3 -0
  96. package/js/src/pro/modetrade.d.ts +155 -0
  97. package/js/src/pro/modetrade.js +1335 -0
  98. package/js/src/pro/okxus.d.ts +4 -0
  99. package/js/src/pro/okxus.js +39 -0
  100. package/js/src/probit.js +18 -51
  101. package/js/src/timex.js +5 -10
  102. package/js/src/vertex.js +3 -4
  103. package/js/src/whitebit.js +42 -11
  104. package/js/src/woo.d.ts +2 -0
  105. package/js/src/woo.js +101 -77
  106. package/js/src/woofipro.d.ts +2 -1
  107. package/js/src/woofipro.js +24 -21
  108. package/js/src/xt.js +36 -44
  109. package/package.json +1 -1
  110. package/js/src/abstract/kuna.d.ts +0 -185
  111. package/js/src/kuna.d.ts +0 -335
  112. package/js/src/kuna.js +0 -2006
  113. /package/js/src/abstract/{huobijp.d.ts → bittrade.d.ts} +0 -0
  114. /package/js/src/abstract/{huobijp.js → bittrade.js} +0 -0
  115. /package/js/src/abstract/{kuna.js → modetrade.js} +0 -0
@@ -1452,10 +1452,6 @@ class coinbase extends coinbase$1 {
1452
1452
  this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE' })),
1453
1453
  this.v3PublicGetBrokerageMarketProducts(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' })),
1454
1454
  ];
1455
- if (this.checkRequiredCredentials(false)) {
1456
- unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE' }));
1457
- unresolvedContractPromises.push(this.extend(params, { 'product_type': 'FUTURE', 'contract_expiry_type': 'PERPETUAL' }));
1458
- }
1459
1455
  }
1460
1456
  catch (e) {
1461
1457
  unresolvedContractPromises = []; // the sync version of ccxt won't have the promise.all line so the request is made here. Some users can't access perpetual products
@@ -1472,8 +1468,8 @@ class coinbase extends coinbase$1 {
1472
1468
  const fees = this.safeDict(promises, 1, {});
1473
1469
  const expiringFutures = this.safeDict(contractPromises, 0, {});
1474
1470
  const perpetualFutures = this.safeDict(contractPromises, 1, {});
1475
- const expiringFees = this.safeDict(contractPromises, 2, {});
1476
- const perpetualFees = this.safeDict(contractPromises, 3, {});
1471
+ const expiringFees = this.safeDict(contractPromises, 0, {});
1472
+ const perpetualFees = this.safeDict(contractPromises, 1, {});
1477
1473
  //
1478
1474
  // {
1479
1475
  // "total_volume": 0,
@@ -385,7 +385,11 @@ class coinmetro extends coinmetro$1 {
385
385
  else if (typeRaw === 'fiat') {
386
386
  type = 'fiat';
387
387
  }
388
- const precisionDigits = this.safeString2(currency, 'digits', 'notabeneDecimals');
388
+ let precisionDigits = this.safeString2(currency, 'digits', 'notabeneDecimals');
389
+ if (code === 'RENDER') {
390
+ // RENDER is an exception (with broken info)
391
+ precisionDigits = '4';
392
+ }
389
393
  result[code] = this.safeCurrencyStructure({
390
394
  'id': id,
391
395
  'code': code,
@@ -634,18 +634,17 @@ class deribit extends deribit$1 {
634
634
  // "testnet": true
635
635
  // }
636
636
  //
637
- const data = this.safeValue(response, 'result', {});
637
+ const data = this.safeList(response, 'result', []);
638
638
  const result = {};
639
639
  for (let i = 0; i < data.length; i++) {
640
640
  const currency = data[i];
641
641
  const currencyId = this.safeString(currency, 'currency');
642
642
  const code = this.safeCurrencyCode(currencyId);
643
- const name = this.safeString(currency, 'currency_long');
644
- result[code] = {
643
+ result[code] = this.safeCurrencyStructure({
645
644
  'info': currency,
646
645
  'code': code,
647
646
  'id': currencyId,
648
- 'name': name,
647
+ 'name': this.safeString(currency, 'currency_long'),
649
648
  'active': undefined,
650
649
  'deposit': undefined,
651
650
  'withdraw': undefined,
@@ -667,7 +666,7 @@ class deribit extends deribit$1 {
667
666
  },
668
667
  },
669
668
  'networks': undefined,
670
- };
669
+ });
671
670
  }
672
671
  return result;
673
672
  }
@@ -1,13 +1,12 @@
1
1
  'use strict';
2
2
 
3
- require('../ccxt.js');
4
3
  var derive$1 = require('./abstract/derive.js');
5
- var number = require('./base/functions/number.js');
4
+ var Precise = require('./base/Precise.js');
5
+ var errors = require('./base/errors.js');
6
+ var crypto = require('./base/functions/crypto.js');
6
7
  var sha3 = require('./static_dependencies/noble-hashes/sha3.js');
7
8
  var secp256k1 = require('./static_dependencies/noble-curves/secp256k1.js');
8
- var crypto = require('./base/functions/crypto.js');
9
- var errors = require('./base/errors.js');
10
- var Precise = require('./base/Precise.js');
9
+ var number = require('./base/functions/number.js');
11
10
 
12
11
  // ----------------------------------------------------------------------------
13
12
  // ---------------------------------------------------------------------------
@@ -2,12 +2,11 @@
2
2
 
3
3
  var ellipx$1 = require('./abstract/ellipx.js');
4
4
  var errors = require('./base/errors.js');
5
- var number = require('./base/functions/number.js');
6
- require('../ccxt.js');
7
- var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
8
5
  var ed25519 = require('./static_dependencies/noble-curves/ed25519.js');
9
6
  var crypto = require('./base/functions/crypto.js');
10
7
  var Precise = require('./base/Precise.js');
8
+ var sha256 = require('./static_dependencies/noble-hashes/sha256.js');
9
+ var number = require('./base/functions/number.js');
11
10
 
12
11
  // ----------------------------------------------------------------------------
13
12
  // ---------------------------------------------------------------------------
@@ -108,7 +108,7 @@ class gate extends gate$1 {
108
108
  'fetchCurrencies': true,
109
109
  'fetchDepositAddress': true,
110
110
  'fetchDepositAddresses': false,
111
- 'fetchDepositAddressesByNetwork': false,
111
+ 'fetchDepositAddressesByNetwork': true,
112
112
  'fetchDeposits': true,
113
113
  'fetchDepositWithdrawFee': 'emulated',
114
114
  'fetchDepositWithdrawFees': true,
@@ -717,6 +717,16 @@ class gate extends gate$1 {
717
717
  },
718
718
  'networksById': {
719
719
  'OPETH': 'OP',
720
+ 'ETH': 'ERC20',
721
+ 'ERC20': 'ERC20',
722
+ 'TRX': 'TRC20',
723
+ 'TRC20': 'TRC20',
724
+ 'HT': 'HRC20',
725
+ 'HECO': 'HRC20',
726
+ 'BSC': 'BEP20',
727
+ 'BEP20': 'BEP20',
728
+ 'POLYGON': 'MATIC',
729
+ 'POL': 'MATIC',
720
730
  },
721
731
  'timeInForce': {
722
732
  'GTC': 'gtc',
@@ -1213,6 +1223,9 @@ class gate extends gate$1 {
1213
1223
  if (this.options['adjustForTimeDifference']) {
1214
1224
  await this.loadTimeDifference();
1215
1225
  }
1226
+ if (this.checkRequiredCredentials(false)) {
1227
+ await this.loadUnifiedStatus();
1228
+ }
1216
1229
  const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
1217
1230
  let rawPromises = [
1218
1231
  this.fetchContractMarkets(params),
@@ -1826,88 +1839,93 @@ class gate extends gate$1 {
1826
1839
  if (apiBackup !== undefined) {
1827
1840
  return undefined;
1828
1841
  }
1829
- if (this.checkRequiredCredentials(false)) {
1830
- await this.loadUnifiedStatus();
1831
- }
1832
1842
  const response = await this.publicSpotGetCurrencies(params);
1833
1843
  //
1834
- // [
1835
- // {
1836
- // "currency": "USDT_ETH",
1837
- // "name": "Tether",
1838
- // "delisted": false,
1839
- // "withdraw_disabled": false,
1840
- // "withdraw_delayed": false,
1841
- // "deposit_disabled": false,
1842
- // "trade_disabled": true,
1843
- // "chain": "ETH"
1844
- // },
1845
- // ]
1844
+ // [
1845
+ // {
1846
+ // "currency": "USDT",
1847
+ // "name": "Tether",
1848
+ // "delisted": false,
1849
+ // "withdraw_disabled": false,
1850
+ // "withdraw_delayed": false,
1851
+ // "deposit_disabled": false,
1852
+ // "trade_disabled": false,
1853
+ // "fixed_rate": "",
1854
+ // "chain": "ETH",
1855
+ // "chains": [
1856
+ // {
1857
+ // "name": "ETH",
1858
+ // "addr": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1859
+ // "withdraw_disabled": false,
1860
+ // "withdraw_delayed": false,
1861
+ // "deposit_disabled": false
1862
+ // },
1863
+ // {
1864
+ // "name": "ARBEVM",
1865
+ // "addr": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
1866
+ // "withdraw_disabled": false,
1867
+ // "withdraw_delayed": false,
1868
+ // "deposit_disabled": false
1869
+ // },
1870
+ // {
1871
+ // "name": "BSC",
1872
+ // "addr": "0x55d398326f99059fF775485246999027B3197955",
1873
+ // "withdraw_disabled": false,
1874
+ // "withdraw_delayed": false,
1875
+ // "deposit_disabled": false
1876
+ // },
1877
+ // ]
1878
+ // },
1879
+ // ]
1846
1880
  //
1847
1881
  const indexedCurrencies = this.indexBy(response, 'currency');
1848
1882
  const result = {};
1849
1883
  for (let i = 0; i < response.length; i++) {
1850
1884
  const entry = response[i];
1851
1885
  const currencyId = this.safeString(entry, 'currency');
1852
- const parts = currencyId.split('_');
1853
- const partFirst = this.safeString(parts, 0);
1854
- // if there's an underscore then the second part is always the chain name (except the _OLD suffix)
1855
- const currencyName = currencyId.endsWith('_OLD') ? currencyId : partFirst;
1856
- const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
1857
- const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
1858
- const tradeDisabled = this.safeBool(entry, 'trade_disabled', false);
1859
- const precision = this.parseNumber('0.0001'); // temporary safe default, because no value provided from API
1860
- const code = this.safeCurrencyCode(currencyName);
1886
+ const code = this.safeCurrencyCode(currencyId);
1861
1887
  // check leveraged tokens (e.g. BTC3S, ETH5L)
1862
- let isLeveragedToken = false;
1863
- if (currencyId.endsWith('3S') || currencyId.endsWith('3L') || currencyId.endsWith('5S') || currencyId.endsWith('5L')) {
1864
- const realCurrencyId = currencyId.slice(0, -2);
1865
- if (realCurrencyId in indexedCurrencies) {
1866
- isLeveragedToken = true;
1867
- }
1868
- }
1869
- const type = isLeveragedToken ? 'leveraged' : 'crypto';
1870
- // some networks are null, they are mostly obsolete & unsupported dead tokens, so we can default their networkId to their tokenname
1871
- const networkId = this.safeString(entry, 'chain', currencyId);
1872
- const networkCode = this.networkIdToCode(networkId, code);
1873
- const networkEntry = {
1874
- 'info': entry,
1875
- 'id': networkId,
1876
- 'network': networkCode,
1877
- 'limits': {
1878
- 'deposit': {
1879
- 'min': undefined,
1880
- 'max': undefined,
1881
- },
1882
- 'withdraw': {
1883
- 'min': undefined,
1884
- 'max': undefined,
1888
+ const type = this.isLeveragedCurrency(currencyId, true, indexedCurrencies) ? 'leveraged' : 'crypto';
1889
+ const chains = this.safeList(entry, 'chains', []);
1890
+ const networks = {};
1891
+ for (let j = 0; j < chains.length; j++) {
1892
+ const chain = chains[j];
1893
+ const networkId = this.safeString(chain, 'name');
1894
+ const networkCode = this.networkIdToCode(networkId);
1895
+ networks[networkCode] = {
1896
+ 'info': chain,
1897
+ 'id': networkId,
1898
+ 'network': networkCode,
1899
+ 'active': undefined,
1900
+ 'deposit': !this.safeBool(chain, 'deposit_disabled'),
1901
+ 'withdraw': !this.safeBool(chain, 'withdraw_disabled'),
1902
+ 'fee': undefined,
1903
+ 'precision': this.parseNumber('0.0001'),
1904
+ 'limits': {
1905
+ 'deposit': {
1906
+ 'min': undefined,
1907
+ 'max': undefined,
1908
+ },
1909
+ 'withdraw': {
1910
+ 'min': undefined,
1911
+ 'max': undefined,
1912
+ },
1885
1913
  },
1886
- },
1887
- 'active': !tradeDisabled,
1888
- 'deposit': !depositDisabled,
1889
- 'withdraw': !withdrawDisabled,
1890
- 'fee': undefined,
1891
- 'precision': precision,
1892
- };
1893
- // check if first entry for the specific currency
1894
- if (!(code in result)) {
1895
- result[code] = {
1896
- 'id': currencyName,
1897
- 'lowerCaseId': currencyName.toLowerCase(),
1898
- 'code': code,
1899
- 'type': type,
1900
- 'precision': precision,
1901
- 'limits': undefined,
1902
- 'networks': {},
1903
- 'info': [], // will be filled below
1904
1914
  };
1905
1915
  }
1906
- result[code]['networks'][networkCode] = networkEntry;
1907
- const info = this.safeList(result[code], 'info', []);
1908
- info.push(entry);
1909
- result[code]['info'] = info;
1910
- result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
1916
+ result[code] = this.safeCurrencyStructure({
1917
+ 'id': currencyId,
1918
+ 'code': code,
1919
+ 'name': this.safeString(entry, 'name'),
1920
+ 'type': type,
1921
+ 'active': !this.safeBool(entry, 'delisted'),
1922
+ 'deposit': !this.safeBool(entry, 'deposit_disabled'),
1923
+ 'withdraw': !this.safeBool(entry, 'withdraw_disabled'),
1924
+ 'fee': undefined,
1925
+ 'networks': networks,
1926
+ 'precision': this.parseNumber('0.0001'),
1927
+ 'info': entry,
1928
+ });
1911
1929
  }
1912
1930
  return result;
1913
1931
  }
@@ -2179,9 +2197,7 @@ class gate extends gate$1 {
2179
2197
  const chains = this.safeValue(response, 'multichain_addresses', []);
2180
2198
  const currencyId = this.safeString(response, 'currency');
2181
2199
  currency = this.safeCurrency(currencyId, currency);
2182
- const parsed = this.parseDepositAddresses(chains, [currency['code']], false, {
2183
- 'currency': currency['id'],
2184
- });
2200
+ const parsed = this.parseDepositAddresses(chains, undefined, false);
2185
2201
  return this.indexBy(parsed, 'network');
2186
2202
  }
2187
2203
  /**
@@ -2199,8 +2215,8 @@ class gate extends gate$1 {
2199
2215
  let networkCode = undefined;
2200
2216
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
2201
2217
  const chainsIndexedById = await this.fetchDepositAddressesByNetwork(code, params);
2202
- const selectedNetworkId = this.selectNetworkCodeFromUnifiedNetworks(code, networkCode, chainsIndexedById);
2203
- return chainsIndexedById[selectedNetworkId];
2218
+ const selectedNetworkIdOrCode = this.selectNetworkCodeFromUnifiedNetworks(code, networkCode, chainsIndexedById);
2219
+ return chainsIndexedById[selectedNetworkIdOrCode];
2204
2220
  }
2205
2221
  parseDepositAddress(depositAddress, currency = undefined) {
2206
2222
  //
@@ -284,6 +284,14 @@ class hollaex extends hollaex$1 {
284
284
  'BNB': 'bnb',
285
285
  'MATIC': 'matic',
286
286
  },
287
+ 'networksById': {
288
+ 'eth': 'ERC20',
289
+ 'ETH': 'ERC20',
290
+ 'ERC20': 'ERC20',
291
+ 'trx': 'TRC20',
292
+ 'TRX': 'TRC20',
293
+ 'TRC20': 'TRC20',
294
+ },
287
295
  },
288
296
  });
289
297
  }
@@ -414,66 +422,116 @@ class hollaex extends hollaex$1 {
414
422
  async fetchCurrencies(params = {}) {
415
423
  const response = await this.publicGetConstants(params);
416
424
  //
417
- // {
418
- // "coins":{
419
- // "bch":{
420
- // "id":4,
421
- // "fullname":"Bitcoin Cash",
422
- // "symbol":"bch",
423
- // "active":true,
424
- // "verified":true,
425
- // "allow_deposit":true,
426
- // "allow_withdrawal":true,
427
- // "withdrawal_fee":0.0002,
428
- // "min":0.001,
429
- // "max":100000,
430
- // "increment_unit":0.001,
431
- // "logo":"https://bitholla.s3.ap-northeast-2.amazonaws.com/icon/BCH-hollaex-asset-01.svg",
432
- // "code":"bch",
433
- // "is_public":true,
434
- // "meta":{},
435
- // "estimated_price":null,
436
- // "description":null,
437
- // "type":"blockchain",
438
- // "network":null,
439
- // "standard":null,
440
- // "issuer":"HollaEx",
441
- // "withdrawal_fees":null,
442
- // "created_at":"2019-08-09T10:45:43.367Z",
443
- // "updated_at":"2021-12-13T03:08:32.372Z",
444
- // "created_by":1,
445
- // "owner_id":1
446
- // },
425
+ // {
426
+ // "coins": {
427
+ // "usdt": {
428
+ // "id": "6",
429
+ // "fullname": "USD Tether",
430
+ // "symbol": "usdt",
431
+ // "active": true,
432
+ // "verified": true,
433
+ // "allow_deposit": true,
434
+ // "allow_withdrawal": true,
435
+ // "withdrawal_fee": "20",
436
+ // "min": "1",
437
+ // "max": "10000000",
438
+ // "increment_unit": "0.0001",
439
+ // "logo": "https://hollaex-resources.s3.ap-southeast-1.amazonaws.com/icons/usdt.svg",
440
+ // "code": "usdt",
441
+ // "is_public": true,
442
+ // "meta": {
443
+ // "color": "#27a17a",
444
+ // "website": "https://tether.to",
445
+ // "explorer": "https://blockchair.com/tether",
446
+ // "decimal_points": "6"
447
+ // },
448
+ // "estimated_price": "1",
449
+ // "description": "<p>Tether (USDT) is a stablecoin pegged 1:1 to the US dollar. It is a digital currency that aims to maintain its value while allowing for fast and secure transfer of funds. It was the first stablecoin, and is the most widely used due stablecoin due to its stability and low volatility compared to other cryptocurrencies. It was launched in 2014 by Tether Limited.</p>",
450
+ // "type": "blockchain",
451
+ // "network": "eth,trx,bnb,matic",
452
+ // "standard": "",
453
+ // "issuer": "HollaEx",
454
+ // "withdrawal_fees": {
455
+ // "bnb": {
456
+ // "value": "0.8",
457
+ // "active": true,
458
+ // "symbol": "usdt"
459
+ // },
460
+ // "eth": {
461
+ // "value": "1.5",
462
+ // "active": true,
463
+ // "symbol": "usdt"
464
+ // },
465
+ // "trx": {
466
+ // "value": "4",
467
+ // "active": true,
468
+ // "symbol": "usdt"
469
+ // },
470
+ // "matic": {
471
+ // "value": "0.3",
472
+ // "active": true,
473
+ // "symbol": "usdt"
474
+ // }
475
+ // },
476
+ // "display_name": null,
477
+ // "deposit_fees": null,
478
+ // "is_risky": false,
479
+ // "market_cap": "144568098696.29",
480
+ // "category": "stable",
481
+ // "created_at": "2019-08-09T10:45:43.367Z",
482
+ // "updated_at": "2025-03-25T17:12:37.970Z",
483
+ // "created_by": "168",
484
+ // "owner_id": "1"
485
+ // },
447
486
  // },
448
487
  // "network":"https://api.hollaex.network"
449
488
  // }
450
489
  //
451
- const coins = this.safeValue(response, 'coins', {});
490
+ const coins = this.safeDict(response, 'coins', {});
452
491
  const keys = Object.keys(coins);
453
492
  const result = {};
454
493
  for (let i = 0; i < keys.length; i++) {
455
494
  const key = keys[i];
456
495
  const currency = coins[key];
457
496
  const id = this.safeString(currency, 'symbol');
458
- const numericId = this.safeInteger(currency, 'id');
459
497
  const code = this.safeCurrencyCode(id);
460
- const name = this.safeString(currency, 'fullname');
461
- const depositEnabled = this.safeValue(currency, 'allow_deposit');
462
- const withdrawEnabled = this.safeValue(currency, 'allow_withdrawal');
463
- const isActive = this.safeValue(currency, 'active');
464
- const active = isActive && depositEnabled && withdrawEnabled;
465
- const fee = this.safeNumber(currency, 'withdrawal_fee');
466
- const withdrawalLimits = this.safeValue(currency, 'withdrawal_limits', []);
467
- result[code] = {
498
+ const withdrawalLimits = this.safeList(currency, 'withdrawal_limits', []);
499
+ const rawType = this.safeString(currency, 'type');
500
+ const type = (rawType === 'blockchain') ? 'crypto' : 'other';
501
+ const rawNetworks = this.safeDict(currency, 'withdrawal_fees', {});
502
+ const networks = {};
503
+ const networkIds = Object.keys(rawNetworks);
504
+ for (let j = 0; j < networkIds.length; j++) {
505
+ const networkId = networkIds[j];
506
+ const networkEntry = this.safeDict(rawNetworks, networkId);
507
+ const networkCode = this.networkIdToCode(networkId);
508
+ networks[networkCode] = {
509
+ 'id': networkId,
510
+ 'network': networkCode,
511
+ 'active': this.safeBool(networkEntry, 'active'),
512
+ 'deposit': undefined,
513
+ 'withdraw': undefined,
514
+ 'fee': this.safeNumber(networkEntry, 'value'),
515
+ 'precision': undefined,
516
+ 'limits': {
517
+ 'withdraw': {
518
+ 'min': undefined,
519
+ 'max': undefined,
520
+ },
521
+ },
522
+ 'info': networkEntry,
523
+ };
524
+ }
525
+ result[code] = this.safeCurrencyStructure({
468
526
  'id': id,
469
- 'numericId': numericId,
527
+ 'numericId': this.safeInteger(currency, 'id'),
470
528
  'code': code,
471
529
  'info': currency,
472
- 'name': name,
473
- 'active': active,
474
- 'deposit': depositEnabled,
475
- 'withdraw': withdrawEnabled,
476
- 'fee': fee,
530
+ 'name': this.safeString(currency, 'fullname'),
531
+ 'active': this.safeBool(currency, 'active'),
532
+ 'deposit': this.safeBool(currency, 'allow_deposit'),
533
+ 'withdraw': this.safeBool(currency, 'allow_withdrawal'),
534
+ 'fee': this.safeNumber(currency, 'withdrawal_fee'),
477
535
  'precision': this.safeNumber(currency, 'increment_unit'),
478
536
  'limits': {
479
537
  'amount': {
@@ -485,9 +543,9 @@ class hollaex extends hollaex$1 {
485
543
  'max': this.safeValue(withdrawalLimits, 0),
486
544
  },
487
545
  },
488
- 'networks': {},
489
- 'type': 'crypto',
490
- };
546
+ 'networks': networks,
547
+ 'type': type,
548
+ });
491
549
  }
492
550
  return result;
493
551
  }