ccxt 4.4.82 → 4.4.85

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 (103) hide show
  1. package/README.md +5 -7
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +1 -9
  4. package/dist/cjs/src/apex.js +2 -1
  5. package/dist/cjs/src/base/Exchange.js +15 -2
  6. package/dist/cjs/src/bitget.js +1 -3
  7. package/dist/cjs/src/bitrue.js +14 -35
  8. package/dist/cjs/src/bitso.js +33 -0
  9. package/dist/cjs/src/bitstamp.js +33 -0
  10. package/dist/cjs/src/blofin.js +154 -13
  11. package/dist/cjs/src/btcbox.js +25 -5
  12. package/dist/cjs/src/bybit.js +16 -40
  13. package/dist/cjs/src/cex.js +2 -4
  14. package/dist/cjs/src/coinbase.js +56 -40
  15. package/dist/cjs/src/coinbaseexchange.js +142 -32
  16. package/dist/cjs/src/coincatch.js +14 -67
  17. package/dist/cjs/src/coinex.js +29 -32
  18. package/dist/cjs/src/coinlist.js +16 -15
  19. package/dist/cjs/src/coinmetro.js +22 -11
  20. package/dist/cjs/src/coinone.js +8 -10
  21. package/dist/cjs/src/coinsph.js +126 -1
  22. package/dist/cjs/src/cryptocom.js +111 -1
  23. package/dist/cjs/src/cryptomus.js +43 -89
  24. package/dist/cjs/src/delta.js +76 -36
  25. package/dist/cjs/src/derive.js +46 -10
  26. package/dist/cjs/src/ellipx.js +175 -79
  27. package/dist/cjs/src/gate.js +1 -1
  28. package/dist/cjs/src/gemini.js +3 -5
  29. package/dist/cjs/src/hitbtc.js +56 -69
  30. package/dist/cjs/src/hyperliquid.js +2 -2
  31. package/dist/cjs/src/kraken.js +29 -24
  32. package/dist/cjs/src/kucoinfutures.js +6 -0
  33. package/dist/cjs/src/lbank.js +1 -1
  34. package/dist/cjs/src/paradex.js +119 -3
  35. package/dist/cjs/src/pro/binance.js +31 -33
  36. package/dist/cjs/src/pro/bithumb.js +5 -3
  37. package/dist/cjs/src/pro/kraken.js +289 -79
  38. package/dist/cjs/src/pro/mexc.js +302 -8
  39. package/dist/cjs/src/pro/poloniex.js +6 -2
  40. package/examples/js/cli.js +127 -13
  41. package/js/ccxt.d.ts +2 -11
  42. package/js/ccxt.js +2 -8
  43. package/js/src/abstract/blofin.d.ts +8 -0
  44. package/js/src/abstract/btcbox.d.ts +1 -0
  45. package/js/src/apex.js +2 -1
  46. package/js/src/base/Exchange.d.ts +15 -1
  47. package/js/src/base/Exchange.js +15 -2
  48. package/js/src/base/types.d.ts +3 -0
  49. package/js/src/bitget.js +1 -3
  50. package/js/src/bitrue.js +14 -35
  51. package/js/src/bitso.js +33 -0
  52. package/js/src/bitstamp.js +33 -0
  53. package/js/src/blofin.d.ts +42 -2
  54. package/js/src/blofin.js +154 -13
  55. package/js/src/btcbox.js +25 -5
  56. package/js/src/bybit.js +16 -40
  57. package/js/src/cex.js +2 -4
  58. package/js/src/coinbase.js +56 -40
  59. package/js/src/coinbaseexchange.js +142 -32
  60. package/js/src/coincatch.js +14 -67
  61. package/js/src/coinex.js +28 -29
  62. package/js/src/coinlist.js +16 -15
  63. package/js/src/coinmetro.js +22 -11
  64. package/js/src/coinone.js +8 -10
  65. package/js/src/coinsph.d.ts +10 -1
  66. package/js/src/coinsph.js +126 -1
  67. package/js/src/cryptocom.d.ts +10 -1
  68. package/js/src/cryptocom.js +111 -1
  69. package/js/src/cryptomus.js +43 -89
  70. package/js/src/delta.js +76 -36
  71. package/js/src/derive.js +46 -10
  72. package/js/src/ellipx.d.ts +2 -3
  73. package/js/src/ellipx.js +175 -80
  74. package/js/src/gate.js +1 -1
  75. package/js/src/gemini.js +3 -5
  76. package/js/src/hitbtc.js +56 -69
  77. package/js/src/hyperliquid.js +2 -2
  78. package/js/src/kraken.js +29 -24
  79. package/js/src/kucoinfutures.d.ts +1 -0
  80. package/js/src/kucoinfutures.js +6 -0
  81. package/js/src/lbank.js +1 -1
  82. package/js/src/paradex.d.ts +12 -1
  83. package/js/src/paradex.js +119 -3
  84. package/js/src/pro/binance.d.ts +26 -26
  85. package/js/src/pro/binance.js +31 -33
  86. package/js/src/pro/bithumb.js +5 -3
  87. package/js/src/pro/kraken.d.ts +7 -6
  88. package/js/src/pro/kraken.js +290 -80
  89. package/js/src/pro/mexc.d.ts +58 -0
  90. package/js/src/pro/mexc.js +302 -8
  91. package/js/src/pro/poloniex.d.ts +1 -1
  92. package/js/src/pro/poloniex.js +6 -2
  93. package/package.json +1 -1
  94. package/js/src/abstract/bl3p.d.ts +0 -22
  95. package/js/src/abstract/bl3p.js +0 -11
  96. package/js/src/abstract/idex.d.ts +0 -29
  97. package/js/src/abstract/idex.js +0 -11
  98. package/js/src/bl3p.d.ts +0 -116
  99. package/js/src/bl3p.js +0 -552
  100. package/js/src/idex.d.ts +0 -312
  101. package/js/src/idex.js +0 -1961
  102. package/js/src/pro/idex.d.ts +0 -81
  103. package/js/src/pro/idex.js +0 -720
package/js/src/coinsph.js CHANGED
@@ -59,7 +59,7 @@ export default class coinsph extends Exchange {
59
59
  'fetchClosedOrders': true,
60
60
  'fetchCrossBorrowRate': false,
61
61
  'fetchCrossBorrowRates': false,
62
- 'fetchCurrencies': false,
62
+ 'fetchCurrencies': true,
63
63
  'fetchDeposit': undefined,
64
64
  'fetchDepositAddress': true,
65
65
  'fetchDepositAddresses': false,
@@ -485,6 +485,131 @@ export default class coinsph extends Exchange {
485
485
  },
486
486
  });
487
487
  }
488
+ /**
489
+ * @method
490
+ * @name coinsph#fetchCurrencies
491
+ * @description fetches all available currencies on an exchange
492
+ * @see https://docs.coins.ph/rest-api/#all-coins-information-user_data
493
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
494
+ * @returns {object} an associative dictionary of currencies
495
+ */
496
+ async fetchCurrencies(params = {}) {
497
+ if (!this.checkRequiredCredentials(false)) {
498
+ return undefined;
499
+ }
500
+ const response = await this.privateGetOpenapiWalletV1ConfigGetall(params);
501
+ //
502
+ // [
503
+ // {
504
+ // "coin": "PHP",
505
+ // "name": "PHP",
506
+ // "depositAllEnable": false,
507
+ // "withdrawAllEnable": false,
508
+ // "free": "0",
509
+ // "locked": "0",
510
+ // "transferPrecision": "2",
511
+ // "transferMinQuantity": "0",
512
+ // "networkList": [],
513
+ // "legalMoney": true
514
+ // },
515
+ // {
516
+ // "coin": "USDT",
517
+ // "name": "USDT",
518
+ // "depositAllEnable": true,
519
+ // "withdrawAllEnable": true,
520
+ // "free": "0",
521
+ // "locked": "0",
522
+ // "transferPrecision": "8",
523
+ // "transferMinQuantity": "0",
524
+ // "networkList": [
525
+ // {
526
+ // "addressRegex": "^0x[0-9a-fA-F]{40}$",
527
+ // "memoRegex": " ",
528
+ // "network": "ETH",
529
+ // "name": "Ethereum (ERC20)",
530
+ // "depositEnable": true,
531
+ // "minConfirm": "12",
532
+ // "unLockConfirm": "-1",
533
+ // "withdrawDesc": "",
534
+ // "withdrawEnable": true,
535
+ // "withdrawFee": "6",
536
+ // "withdrawIntegerMultiple": "0.000001",
537
+ // "withdrawMax": "500000",
538
+ // "withdrawMin": "10",
539
+ // "sameAddress": false
540
+ // },
541
+ // {
542
+ // "addressRegex": "^T[0-9a-zA-Z]{33}$",
543
+ // "memoRegex": "",
544
+ // "network": "TRX",
545
+ // "name": "TRON",
546
+ // "depositEnable": true,
547
+ // "minConfirm": "19",
548
+ // "unLockConfirm": "-1",
549
+ // "withdrawDesc": "",
550
+ // "withdrawEnable": true,
551
+ // "withdrawFee": "3",
552
+ // "withdrawIntegerMultiple": "0.000001",
553
+ // "withdrawMax": "1000000",
554
+ // "withdrawMin": "20",
555
+ // "sameAddress": false
556
+ // }
557
+ // ],
558
+ // "legalMoney": false
559
+ // }
560
+ // ]
561
+ //
562
+ const result = {};
563
+ for (let i = 0; i < response.length; i++) {
564
+ const entry = response[i];
565
+ const id = this.safeString(entry, 'coin');
566
+ const code = this.safeCurrencyCode(id);
567
+ const isFiat = this.safeBool(entry, 'isLegalMoney');
568
+ const networkList = this.safeList(entry, 'networkList', []);
569
+ const networks = {};
570
+ for (let j = 0; j < networkList.length; j++) {
571
+ const networkItem = networkList[j];
572
+ const network = this.safeString(networkItem, 'network');
573
+ const networkCode = this.networkIdToCode(network);
574
+ networks[networkCode] = {
575
+ 'info': networkItem,
576
+ 'id': network,
577
+ 'network': networkCode,
578
+ 'active': undefined,
579
+ 'deposit': this.safeBool(networkItem, 'depositEnable'),
580
+ 'withdraw': this.safeBool(networkItem, 'withdrawEnable'),
581
+ 'fee': this.safeNumber(networkItem, 'withdrawFee'),
582
+ 'precision': this.safeNumber(networkItem, 'withdrawIntegerMultiple'),
583
+ 'limits': {
584
+ 'withdraw': {
585
+ 'min': this.safeNumber(networkItem, 'withdrawMin'),
586
+ 'max': this.safeNumber(networkItem, 'withdrawMax'),
587
+ },
588
+ 'deposit': {
589
+ 'min': undefined,
590
+ 'max': undefined,
591
+ },
592
+ },
593
+ };
594
+ }
595
+ result[code] = this.safeCurrencyStructure({
596
+ 'id': id,
597
+ 'name': this.safeString(entry, 'name'),
598
+ 'code': code,
599
+ 'type': isFiat ? 'fiat' : 'crypto',
600
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(entry, 'transferPrecision'))),
601
+ 'info': entry,
602
+ 'active': undefined,
603
+ 'deposit': this.safeBool(entry, 'depositAllEnable'),
604
+ 'withdraw': this.safeBool(entry, 'withdrawAllEnable'),
605
+ 'networks': networks,
606
+ 'fee': undefined,
607
+ 'fees': undefined,
608
+ 'limits': {},
609
+ });
610
+ }
611
+ return result;
612
+ }
488
613
  calculateRateLimiterCost(api, method, path, params, config = {}) {
489
614
  if (('noSymbol' in config) && !('symbol' in params)) {
490
615
  return config['noSymbol'];
@@ -1,11 +1,20 @@
1
1
  import Exchange from './abstract/cryptocom.js';
2
- import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress, Position } from './base/types.js';
2
+ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, Str, Ticker, OrderRequest, Balances, Transaction, OrderBook, Tickers, Strings, Currency, Currencies, Market, Num, Account, CancellationRequest, Dict, int, TradingFeeInterface, TradingFees, LedgerEntry, DepositAddress, Position } from './base/types.js';
3
3
  /**
4
4
  * @class cryptocom
5
5
  * @augments Exchange
6
6
  */
7
7
  export default class cryptocom extends Exchange {
8
8
  describe(): any;
9
+ /**
10
+ * @method
11
+ * @name cryptocom#fetchCurrencies
12
+ * @description fetches all available currencies on an exchange
13
+ * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
14
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
15
+ * @returns {object} an associative dictionary of currencies
16
+ */
17
+ fetchCurrencies(params?: {}): Promise<Currencies>;
9
18
  /**
10
19
  * @method
11
20
  * @name cryptocom#fetchMarkets
@@ -54,7 +54,7 @@ export default class cryptocom extends Exchange {
54
54
  'fetchClosedOrders': 'emulated',
55
55
  'fetchCrossBorrowRate': false,
56
56
  'fetchCrossBorrowRates': false,
57
- 'fetchCurrencies': false,
57
+ 'fetchCurrencies': true,
58
58
  'fetchDepositAddress': true,
59
59
  'fetchDepositAddresses': false,
60
60
  'fetchDepositAddressesByNetwork': true,
@@ -511,6 +511,116 @@ export default class cryptocom extends Exchange {
511
511
  },
512
512
  });
513
513
  }
514
+ /**
515
+ * @method
516
+ * @name cryptocom#fetchCurrencies
517
+ * @description fetches all available currencies on an exchange
518
+ * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
519
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
520
+ * @returns {object} an associative dictionary of currencies
521
+ */
522
+ async fetchCurrencies(params = {}) {
523
+ // this endpoint requires authentication
524
+ if (!this.checkRequiredCredentials(false)) {
525
+ return undefined;
526
+ }
527
+ const response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
528
+ //
529
+ // {
530
+ // "id": "1747502328559",
531
+ // "method": "private/get-currency-networks",
532
+ // "code": "0",
533
+ // "result": {
534
+ // "update_time": "1747502281000",
535
+ // "currency_map": {
536
+ // "USDT": {
537
+ // "full_name": "Tether USD",
538
+ // "default_network": "ETH",
539
+ // "network_list": [
540
+ // {
541
+ // "network_id": "ETH",
542
+ // "withdrawal_fee": "10.00000000",
543
+ // "withdraw_enabled": true,
544
+ // "min_withdrawal_amount": "20.0",
545
+ // "deposit_enabled": true,
546
+ // "confirmation_required": "32"
547
+ // },
548
+ // {
549
+ // "network_id": "CRONOS",
550
+ // "withdrawal_fee": "0.18000000",
551
+ // "withdraw_enabled": true,
552
+ // "min_withdrawal_amount": "0.36",
553
+ // "deposit_enabled": true,
554
+ // "confirmation_required": "15"
555
+ // },
556
+ // {
557
+ // "network_id": "SOL",
558
+ // "withdrawal_fee": "5.31000000",
559
+ // "withdraw_enabled": true,
560
+ // "min_withdrawal_amount": "10.62",
561
+ // "deposit_enabled": true,
562
+ // "confirmation_required": "1"
563
+ // }
564
+ // ]
565
+ // }
566
+ // }
567
+ // }
568
+ // }
569
+ //
570
+ const resultData = this.safeDict(response, 'result', {});
571
+ const currencyMap = this.safeDict(resultData, 'currency_map', {});
572
+ const keys = Object.keys(currencyMap);
573
+ const result = {};
574
+ for (let i = 0; i < keys.length; i++) {
575
+ const key = keys[i];
576
+ const currency = currencyMap[key];
577
+ const id = key;
578
+ const code = this.safeCurrencyCode(id);
579
+ const networks = {};
580
+ const chains = this.safeList(currency, 'network_list', []);
581
+ for (let j = 0; j < chains.length; j++) {
582
+ const chain = chains[j];
583
+ const networkId = this.safeString(chain, 'network_id');
584
+ const network = this.networkIdToCode(networkId);
585
+ networks[network] = {
586
+ 'info': chain,
587
+ 'id': networkId,
588
+ 'network': network,
589
+ 'active': undefined,
590
+ 'deposit': this.safeBool(chain, 'deposit_enabled', false),
591
+ 'withdraw': this.safeBool(chain, 'withdraw_enabled', false),
592
+ 'fee': this.safeNumber(chain, 'withdrawal_fee'),
593
+ 'precision': undefined,
594
+ 'limits': {
595
+ 'withdraw': {
596
+ 'min': this.safeNumber(chain, 'min_withdrawal_amount'),
597
+ 'max': undefined,
598
+ },
599
+ },
600
+ };
601
+ }
602
+ result[code] = this.safeCurrencyStructure({
603
+ 'info': currency,
604
+ 'id': id,
605
+ 'code': code,
606
+ 'name': this.safeString(currency, 'full_name'),
607
+ 'active': undefined,
608
+ 'deposit': undefined,
609
+ 'withdraw': undefined,
610
+ 'fee': undefined,
611
+ 'precision': undefined,
612
+ 'limits': {
613
+ 'amount': {
614
+ 'min': undefined,
615
+ 'max': undefined,
616
+ },
617
+ },
618
+ 'type': 'crypto',
619
+ 'networks': networks,
620
+ });
621
+ }
622
+ return result;
623
+ }
514
624
  /**
515
625
  * @method
516
626
  * @name cryptocom#fetchMarkets
@@ -368,41 +368,9 @@ export default class cryptomus extends Exchange {
368
368
  const coins = this.safeList(response, 'result');
369
369
  const result = {};
370
370
  for (let i = 0; i < coins.length; i++) {
371
- const currency = coins[i];
372
- const currencyId = this.safeString(currency, 'currency_code');
371
+ const networkEntry = coins[i];
372
+ const currencyId = this.safeString(networkEntry, 'currency_code');
373
373
  const code = this.safeCurrencyCode(currencyId);
374
- const allowWithdraw = this.safeBool(currency, 'can_withdraw');
375
- const allowDeposit = this.safeBool(currency, 'can_deposit');
376
- const isActive = allowWithdraw && allowDeposit;
377
- const networkId = this.safeString(currency, 'network_code');
378
- const networksById = this.safeDict(this.options, 'networksById');
379
- const networkName = this.safeString(networksById, networkId, networkId);
380
- const minWithdraw = this.safeNumber(currency, 'min_withdraw');
381
- const maxWithdraw = this.safeNumber(currency, 'max_withdraw');
382
- const minDeposit = this.safeNumber(currency, 'min_deposit');
383
- const maxDeposit = this.safeNumber(currency, 'max_deposit');
384
- const network = {
385
- 'id': networkId,
386
- 'network': networkName,
387
- 'limits': {
388
- 'withdraw': {
389
- 'min': minWithdraw,
390
- 'max': maxWithdraw,
391
- },
392
- 'deposit': {
393
- 'min': minDeposit,
394
- 'max': maxDeposit,
395
- },
396
- },
397
- 'active': isActive,
398
- 'deposit': allowDeposit,
399
- 'withdraw': allowWithdraw,
400
- 'fee': undefined,
401
- 'precision': undefined,
402
- 'info': currency,
403
- };
404
- const networks = {};
405
- networks[networkName] = network;
406
374
  if (!(code in result)) {
407
375
  result[code] = {
408
376
  'id': currencyId,
@@ -410,70 +378,56 @@ export default class cryptomus extends Exchange {
410
378
  'precision': undefined,
411
379
  'type': undefined,
412
380
  'name': undefined,
413
- 'active': isActive,
414
- 'deposit': allowDeposit,
415
- 'withdraw': allowWithdraw,
381
+ 'active': undefined,
382
+ 'deposit': undefined,
383
+ 'withdraw': undefined,
416
384
  'fee': undefined,
417
385
  'limits': {
418
386
  'withdraw': {
419
- 'min': minWithdraw,
420
- 'max': maxWithdraw,
387
+ 'min': undefined,
388
+ 'max': undefined,
421
389
  },
422
390
  'deposit': {
423
- 'min': minDeposit,
424
- 'max': maxDeposit,
391
+ 'min': undefined,
392
+ 'max': undefined,
425
393
  },
426
394
  },
427
- 'networks': networks,
428
- 'info': currency,
395
+ 'networks': {},
396
+ 'info': {},
429
397
  };
430
398
  }
431
- else {
432
- const parsed = result[code];
433
- const parsedNetworks = this.safeDict(parsed, 'networks');
434
- parsed['networks'] = this.extend(parsedNetworks, networks);
435
- if (isActive) {
436
- parsed['active'] = true;
437
- parsed['deposit'] = true;
438
- parsed['withdraw'] = true;
439
- }
440
- else {
441
- if (allowWithdraw) {
442
- parsed['withdraw'] = true;
443
- }
444
- if (allowDeposit) {
445
- parsed['deposit'] = true;
446
- }
447
- }
448
- const parsedLimits = this.safeDict(parsed, 'limits');
449
- const withdrawLimits = {
450
- 'min': undefined,
451
- 'max': undefined,
452
- };
453
- const parsedWithdrawLimits = this.safeDict(parsedLimits, 'withdraw', withdrawLimits);
454
- const depositLimits = {
455
- 'min': undefined,
456
- 'max': undefined,
457
- };
458
- const parsedDepositLimits = this.safeDict(parsedLimits, 'deposit', depositLimits);
459
- if (minWithdraw) {
460
- withdrawLimits['min'] = parsedWithdrawLimits['min'] ? Math.min(parsedWithdrawLimits['min'], minWithdraw) : minWithdraw;
461
- }
462
- if (maxWithdraw) {
463
- withdrawLimits['max'] = parsedWithdrawLimits['max'] ? Math.max(parsedWithdrawLimits['max'], maxWithdraw) : maxWithdraw;
464
- }
465
- if (minDeposit) {
466
- depositLimits['min'] = parsedDepositLimits['min'] ? Math.min(parsedDepositLimits['min'], minDeposit) : minDeposit;
467
- }
468
- if (maxDeposit) {
469
- depositLimits['max'] = parsedDepositLimits['max'] ? Math.max(parsedDepositLimits['max'], maxDeposit) : maxDeposit;
470
- }
471
- const limits = {
472
- 'withdraw': withdrawLimits,
473
- 'deposit': depositLimits,
474
- };
475
- parsed['limits'] = limits;
476
- }
399
+ const networkId = this.safeString(networkEntry, 'network_code');
400
+ const networkCode = this.networkIdToCode(networkId);
401
+ result[code]['networks'][networkCode] = {
402
+ 'id': networkId,
403
+ 'network': networkCode,
404
+ 'limits': {
405
+ 'withdraw': {
406
+ 'min': this.safeNumber(networkEntry, 'min_withdraw'),
407
+ 'max': this.safeNumber(networkEntry, 'max_withdraw'),
408
+ },
409
+ 'deposit': {
410
+ 'min': this.safeNumber(networkEntry, 'min_deposit'),
411
+ 'max': this.safeNumber(networkEntry, 'max_deposit'),
412
+ },
413
+ },
414
+ 'active': undefined,
415
+ 'deposit': this.safeBool(networkEntry, 'can_withdraw'),
416
+ 'withdraw': this.safeBool(networkEntry, 'can_deposit'),
417
+ 'fee': undefined,
418
+ 'precision': undefined,
419
+ 'info': networkEntry,
420
+ };
421
+ // add entry in info
422
+ const info = this.safeList(result[code], 'info', []);
423
+ info.push(networkEntry);
424
+ result[code]['info'] = info;
425
+ }
426
+ // only after all entries are formed in currencies, restructure each entry
427
+ const allKeys = Object.keys(result);
428
+ for (let i = 0; i < allKeys.length; i++) {
429
+ const code = allKeys[i];
430
+ result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
477
431
  }
478
432
  return result;
479
433
  }
package/js/src/delta.js CHANGED
@@ -509,31 +509,49 @@ export default class delta extends Exchange {
509
509
  async fetchCurrencies(params = {}) {
510
510
  const response = await this.publicGetAssets(params);
511
511
  //
512
- // {
513
- // "result":[
514
- // {
515
- // "base_withdrawal_fee":"0.0005",
516
- // "deposit_status":"enabled",
517
- // "id":2,
518
- // "interest_credit":true,
519
- // "interest_slabs":[
520
- // {"limit":"0.1","rate":"0"},
521
- // {"limit":"1","rate":"0.05"},
522
- // {"limit":"5","rate":"0.075"},
523
- // {"limit":"10","rate":"0.1"},
524
- // {"limit":"9999999999999999","rate":"0"}
525
- // ],
526
- // "kyc_deposit_limit":"10",
527
- // "kyc_withdrawal_limit":"2",
528
- // "min_withdrawal_amount":"0.001",
529
- // "minimum_precision":4,
530
- // "name":"Bitcoin",
531
- // "precision":8,
532
- // "sort_priority":1,
533
- // "symbol":"BTC",
534
- // "variable_withdrawal_fee":"0",
535
- // "withdrawal_status":"enabled"
536
- // },
512
+ // {
513
+ // "result": [
514
+ // {
515
+ // "base_withdrawal_fee": "0.005000000000000000",
516
+ // "id": "1",
517
+ // "interest_credit": false,
518
+ // "interest_slabs": null,
519
+ // "kyc_deposit_limit": "0.000000000000000000",
520
+ // "kyc_withdrawal_limit": "0.000000000000000000",
521
+ // "min_withdrawal_amount": "0.010000000000000000",
522
+ // "minimum_precision": "4",
523
+ // "name": "Ethereum",
524
+ // "networks": [
525
+ // {
526
+ // "allowed_deposit_groups": null,
527
+ // "base_withdrawal_fee": "0.0025",
528
+ // "deposit_status": "enabled",
529
+ // "memo_required": false,
530
+ // "min_deposit_amount": "0.000050000000000000",
531
+ // "min_withdrawal_amount": "0.010000000000000000",
532
+ // "minimum_deposit_confirmations": "12",
533
+ // "network": "ERC20",
534
+ // "variable_withdrawal_fee": "0",
535
+ // "withdrawal_status": "enabled"
536
+ // },
537
+ // {
538
+ // "allowed_deposit_groups": null,
539
+ // "base_withdrawal_fee": "0.0001",
540
+ // "deposit_status": "enabled",
541
+ // "memo_required": false,
542
+ // "min_deposit_amount": "0.000050000000000000",
543
+ // "min_withdrawal_amount": "0.000300000000000000",
544
+ // "minimum_deposit_confirmations": "15",
545
+ // "network": "BEP20(BSC)",
546
+ // "variable_withdrawal_fee": "0",
547
+ // "withdrawal_status": "enabled"
548
+ // }
549
+ // ],
550
+ // "precision": "18",
551
+ // "sort_priority": "3",
552
+ // "symbol": "ETH",
553
+ // "variable_withdrawal_fee": "0.000000000000000000"
554
+ // },
537
555
  // ],
538
556
  // "success":true
539
557
  // }
@@ -545,20 +563,42 @@ export default class delta extends Exchange {
545
563
  const id = this.safeString(currency, 'symbol');
546
564
  const numericId = this.safeInteger(currency, 'id');
547
565
  const code = this.safeCurrencyCode(id);
548
- const depositStatus = this.safeString(currency, 'deposit_status');
549
- const withdrawalStatus = this.safeString(currency, 'withdrawal_status');
550
- const depositsEnabled = (depositStatus === 'enabled');
551
- const withdrawalsEnabled = (withdrawalStatus === 'enabled');
552
- const active = depositsEnabled && withdrawalsEnabled;
553
- result[code] = {
566
+ const chains = this.safeList(currency, 'networks', []);
567
+ const networks = {};
568
+ for (let j = 0; j < chains.length; j++) {
569
+ const chain = chains[j];
570
+ const networkId = this.safeString(chain, 'network');
571
+ const networkCode = this.networkIdToCode(networkId);
572
+ networks[networkCode] = {
573
+ 'id': networkId,
574
+ 'network': networkCode,
575
+ 'name': this.safeString(chain, 'name'),
576
+ 'info': chain,
577
+ 'active': this.safeString(chain, 'status') === 'enabled',
578
+ 'deposit': this.safeString(chain, 'deposit_status') === 'enabled',
579
+ 'withdraw': this.safeString(chain, 'withdrawal_status') === 'enabled',
580
+ 'fee': this.safeNumber(chain, 'base_withdrawal_fee'),
581
+ 'limits': {
582
+ 'deposit': {
583
+ 'min': this.safeNumber(chain, 'min_deposit_amount'),
584
+ 'max': undefined,
585
+ },
586
+ 'withdraw': {
587
+ 'min': this.safeNumber(chain, 'min_withdrawal_amount'),
588
+ 'max': undefined,
589
+ },
590
+ },
591
+ };
592
+ }
593
+ result[code] = this.safeCurrencyStructure({
554
594
  'id': id,
555
595
  'numericId': numericId,
556
596
  'code': code,
557
597
  'name': this.safeString(currency, 'name'),
558
598
  'info': currency,
559
- 'active': active,
560
- 'deposit': depositsEnabled,
561
- 'withdraw': withdrawalsEnabled,
599
+ 'active': undefined,
600
+ 'deposit': this.safeString(currency, 'deposit_status') === 'enabled',
601
+ 'withdraw': this.safeString(currency, 'withdrawal_status') === 'enabled',
562
602
  'fee': this.safeNumber(currency, 'base_withdrawal_fee'),
563
603
  'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision'))),
564
604
  'limits': {
@@ -568,9 +608,9 @@ export default class delta extends Exchange {
568
608
  'max': undefined,
569
609
  },
570
610
  },
571
- 'networks': {},
611
+ 'networks': networks,
572
612
  'type': 'crypto',
573
- };
613
+ });
574
614
  }
575
615
  return result;
576
616
  }