ccxt 4.4.82__py2.py3-none-any.whl → 4.4.85__py2.py3-none-any.whl

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 (87) hide show
  1. ccxt/__init__.py +1 -5
  2. ccxt/abstract/blofin.py +8 -0
  3. ccxt/abstract/btcbox.py +1 -0
  4. ccxt/apex.py +2 -1
  5. ccxt/async_support/__init__.py +1 -5
  6. ccxt/async_support/apex.py +2 -1
  7. ccxt/async_support/base/exchange.py +26 -3
  8. ccxt/async_support/base/ws/cache.py +6 -1
  9. ccxt/async_support/bitget.py +1 -2
  10. ccxt/async_support/bitrue.py +14 -32
  11. ccxt/async_support/bitso.py +33 -0
  12. ccxt/async_support/bitstamp.py +33 -0
  13. ccxt/async_support/blofin.py +145 -14
  14. ccxt/async_support/btcbox.py +25 -5
  15. ccxt/async_support/bybit.py +16 -37
  16. ccxt/async_support/cex.py +2 -4
  17. ccxt/async_support/coinbase.py +56 -42
  18. ccxt/async_support/coinbaseexchange.py +141 -32
  19. ccxt/async_support/coincatch.py +14 -67
  20. ccxt/async_support/coinex.py +28 -29
  21. ccxt/async_support/coinlist.py +17 -16
  22. ccxt/async_support/coinmetro.py +20 -11
  23. ccxt/async_support/coinone.py +8 -10
  24. ccxt/async_support/coinsph.py +124 -2
  25. ccxt/async_support/cryptocom.py +109 -2
  26. ccxt/async_support/cryptomus.py +42 -80
  27. ccxt/async_support/delta.py +75 -36
  28. ccxt/async_support/derive.py +46 -10
  29. ccxt/async_support/ellipx.py +175 -77
  30. ccxt/async_support/gate.py +1 -1
  31. ccxt/async_support/gemini.py +3 -4
  32. ccxt/async_support/hitbtc.py +56 -65
  33. ccxt/async_support/hyperliquid.py +2 -2
  34. ccxt/async_support/kraken.py +27 -23
  35. ccxt/async_support/kucoinfutures.py +5 -0
  36. ccxt/async_support/lbank.py +1 -1
  37. ccxt/async_support/paradex.py +120 -4
  38. ccxt/base/exchange.py +21 -2
  39. ccxt/base/types.py +3 -0
  40. ccxt/bitget.py +1 -2
  41. ccxt/bitrue.py +14 -32
  42. ccxt/bitso.py +33 -0
  43. ccxt/bitstamp.py +33 -0
  44. ccxt/blofin.py +145 -14
  45. ccxt/btcbox.py +24 -5
  46. ccxt/bybit.py +16 -37
  47. ccxt/cex.py +2 -4
  48. ccxt/coinbase.py +56 -42
  49. ccxt/coinbaseexchange.py +141 -32
  50. ccxt/coincatch.py +14 -67
  51. ccxt/coinex.py +28 -29
  52. ccxt/coinlist.py +17 -16
  53. ccxt/coinmetro.py +20 -11
  54. ccxt/coinone.py +8 -10
  55. ccxt/coinsph.py +124 -2
  56. ccxt/cryptocom.py +109 -2
  57. ccxt/cryptomus.py +42 -80
  58. ccxt/delta.py +75 -36
  59. ccxt/derive.py +46 -10
  60. ccxt/ellipx.py +175 -77
  61. ccxt/gate.py +1 -1
  62. ccxt/gemini.py +3 -4
  63. ccxt/hitbtc.py +56 -65
  64. ccxt/hyperliquid.py +2 -2
  65. ccxt/kraken.py +27 -23
  66. ccxt/kucoinfutures.py +5 -0
  67. ccxt/lbank.py +1 -1
  68. ccxt/paradex.py +120 -4
  69. ccxt/pro/__init__.py +69 -3
  70. ccxt/pro/binance.py +31 -33
  71. ccxt/pro/bithumb.py +5 -3
  72. ccxt/pro/kraken.py +249 -79
  73. ccxt/pro/mexc.py +252 -7
  74. ccxt/pro/poloniex.py +6 -2
  75. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/METADATA +7 -9
  76. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/RECORD +79 -87
  77. ccxt/abstract/bl3p.py +0 -19
  78. ccxt/abstract/idex.py +0 -26
  79. ccxt/async_support/base/ws/fast_client.py +0 -97
  80. ccxt/async_support/bl3p.py +0 -543
  81. ccxt/async_support/idex.py +0 -1889
  82. ccxt/bl3p.py +0 -543
  83. ccxt/idex.py +0 -1889
  84. ccxt/pro/idex.py +0 -687
  85. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/LICENSE.txt +0 -0
  86. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/WHEEL +0 -0
  87. {ccxt-4.4.82.dist-info → ccxt-4.4.85.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinsph import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
9
+ from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -75,7 +75,7 @@ class coinsph(Exchange, ImplicitAPI):
75
75
  'fetchClosedOrders': True,
76
76
  'fetchCrossBorrowRate': False,
77
77
  'fetchCrossBorrowRates': False,
78
- 'fetchCurrencies': False,
78
+ 'fetchCurrencies': True,
79
79
  'fetchDeposit': None,
80
80
  'fetchDepositAddress': True,
81
81
  'fetchDepositAddresses': False,
@@ -501,6 +501,128 @@ class coinsph(Exchange, ImplicitAPI):
501
501
  },
502
502
  })
503
503
 
504
+ async def fetch_currencies(self, params={}) -> Currencies:
505
+ """
506
+ fetches all available currencies on an exchange
507
+
508
+ https://docs.coins.ph/rest-api/#all-coins-information-user_data
509
+
510
+ :param dict [params]: extra parameters specific to the exchange API endpoint
511
+ :returns dict: an associative dictionary of currencies
512
+ """
513
+ if not self.check_required_credentials(False):
514
+ return None
515
+ response = await self.privateGetOpenapiWalletV1ConfigGetall(params)
516
+ #
517
+ # [
518
+ # {
519
+ # "coin": "PHP",
520
+ # "name": "PHP",
521
+ # "depositAllEnable": False,
522
+ # "withdrawAllEnable": False,
523
+ # "free": "0",
524
+ # "locked": "0",
525
+ # "transferPrecision": "2",
526
+ # "transferMinQuantity": "0",
527
+ # "networkList": [],
528
+ # "legalMoney": True
529
+ # },
530
+ # {
531
+ # "coin": "USDT",
532
+ # "name": "USDT",
533
+ # "depositAllEnable": True,
534
+ # "withdrawAllEnable": True,
535
+ # "free": "0",
536
+ # "locked": "0",
537
+ # "transferPrecision": "8",
538
+ # "transferMinQuantity": "0",
539
+ # "networkList": [
540
+ # {
541
+ # "addressRegex": "^0x[0-9a-fA-F]{40}$",
542
+ # "memoRegex": " ",
543
+ # "network": "ETH",
544
+ # "name": "Ethereum(ERC20)",
545
+ # "depositEnable": True,
546
+ # "minConfirm": "12",
547
+ # "unLockConfirm": "-1",
548
+ # "withdrawDesc": "",
549
+ # "withdrawEnable": True,
550
+ # "withdrawFee": "6",
551
+ # "withdrawIntegerMultiple": "0.000001",
552
+ # "withdrawMax": "500000",
553
+ # "withdrawMin": "10",
554
+ # "sameAddress": False
555
+ # },
556
+ # {
557
+ # "addressRegex": "^T[0-9a-zA-Z]{33}$",
558
+ # "memoRegex": "",
559
+ # "network": "TRX",
560
+ # "name": "TRON",
561
+ # "depositEnable": True,
562
+ # "minConfirm": "19",
563
+ # "unLockConfirm": "-1",
564
+ # "withdrawDesc": "",
565
+ # "withdrawEnable": True,
566
+ # "withdrawFee": "3",
567
+ # "withdrawIntegerMultiple": "0.000001",
568
+ # "withdrawMax": "1000000",
569
+ # "withdrawMin": "20",
570
+ # "sameAddress": False
571
+ # }
572
+ # ],
573
+ # "legalMoney": False
574
+ # }
575
+ # ]
576
+ #
577
+ result: dict = {}
578
+ for i in range(0, len(response)):
579
+ entry = response[i]
580
+ id = self.safe_string(entry, 'coin')
581
+ code = self.safe_currency_code(id)
582
+ isFiat = self.safe_bool(entry, 'isLegalMoney')
583
+ networkList = self.safe_list(entry, 'networkList', [])
584
+ networks: dict = {}
585
+ for j in range(0, len(networkList)):
586
+ networkItem = networkList[j]
587
+ network = self.safe_string(networkItem, 'network')
588
+ networkCode = self.network_id_to_code(network)
589
+ networks[networkCode] = {
590
+ 'info': networkItem,
591
+ 'id': network,
592
+ 'network': networkCode,
593
+ 'active': None,
594
+ 'deposit': self.safe_bool(networkItem, 'depositEnable'),
595
+ 'withdraw': self.safe_bool(networkItem, 'withdrawEnable'),
596
+ 'fee': self.safe_number(networkItem, 'withdrawFee'),
597
+ 'precision': self.safe_number(networkItem, 'withdrawIntegerMultiple'),
598
+ 'limits': {
599
+ 'withdraw': {
600
+ 'min': self.safe_number(networkItem, 'withdrawMin'),
601
+ 'max': self.safe_number(networkItem, 'withdrawMax'),
602
+ },
603
+ 'deposit': {
604
+ 'min': None,
605
+ 'max': None,
606
+ },
607
+ },
608
+ }
609
+ result[code] = self.safe_currency_structure({
610
+ 'id': id,
611
+ 'name': self.safe_string(entry, 'name'),
612
+ 'code': code,
613
+ 'type': 'fiat' if isFiat else 'crypto',
614
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(entry, 'transferPrecision'))),
615
+ 'info': entry,
616
+ 'active': None,
617
+ 'deposit': self.safe_bool(entry, 'depositAllEnable'),
618
+ 'withdraw': self.safe_bool(entry, 'withdrawAllEnable'),
619
+ 'networks': networks,
620
+ 'fee': None,
621
+ 'fees': None,
622
+ 'limits': {},
623
+ })
624
+ return result
625
+
504
626
  def calculate_rate_limiter_cost(self, api, method, path, params, config={}):
505
627
  if ('noSymbol' in config) and not ('symbol' in params):
506
628
  return config['noSymbol']
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.cryptocom import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Any, Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
9
+ from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -69,7 +69,7 @@ class cryptocom(Exchange, ImplicitAPI):
69
69
  'fetchClosedOrders': 'emulated',
70
70
  'fetchCrossBorrowRate': False,
71
71
  'fetchCrossBorrowRates': False,
72
- 'fetchCurrencies': False,
72
+ 'fetchCurrencies': True,
73
73
  'fetchDepositAddress': True,
74
74
  'fetchDepositAddresses': False,
75
75
  'fetchDepositAddressesByNetwork': True,
@@ -526,6 +526,113 @@ class cryptocom(Exchange, ImplicitAPI):
526
526
  },
527
527
  })
528
528
 
529
+ async def fetch_currencies(self, params={}) -> Currencies:
530
+ """
531
+ fetches all available currencies on an exchange
532
+
533
+ https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-currency-networks
534
+
535
+ :param dict [params]: extra parameters specific to the exchange API endpoint
536
+ :returns dict: an associative dictionary of currencies
537
+ """
538
+ # self endpoint requires authentication
539
+ if not self.check_required_credentials(False):
540
+ return None
541
+ response = await self.v1PrivatePostPrivateGetCurrencyNetworks(params)
542
+ #
543
+ # {
544
+ # "id": "1747502328559",
545
+ # "method": "private/get-currency-networks",
546
+ # "code": "0",
547
+ # "result": {
548
+ # "update_time": "1747502281000",
549
+ # "currency_map": {
550
+ # "USDT": {
551
+ # "full_name": "Tether USD",
552
+ # "default_network": "ETH",
553
+ # "network_list": [
554
+ # {
555
+ # "network_id": "ETH",
556
+ # "withdrawal_fee": "10.00000000",
557
+ # "withdraw_enabled": True,
558
+ # "min_withdrawal_amount": "20.0",
559
+ # "deposit_enabled": True,
560
+ # "confirmation_required": "32"
561
+ # },
562
+ # {
563
+ # "network_id": "CRONOS",
564
+ # "withdrawal_fee": "0.18000000",
565
+ # "withdraw_enabled": True,
566
+ # "min_withdrawal_amount": "0.36",
567
+ # "deposit_enabled": True,
568
+ # "confirmation_required": "15"
569
+ # },
570
+ # {
571
+ # "network_id": "SOL",
572
+ # "withdrawal_fee": "5.31000000",
573
+ # "withdraw_enabled": True,
574
+ # "min_withdrawal_amount": "10.62",
575
+ # "deposit_enabled": True,
576
+ # "confirmation_required": "1"
577
+ # }
578
+ # ]
579
+ # }
580
+ # }
581
+ # }
582
+ # }
583
+ #
584
+ resultData = self.safe_dict(response, 'result', {})
585
+ currencyMap = self.safe_dict(resultData, 'currency_map', {})
586
+ keys = list(currencyMap.keys())
587
+ result: dict = {}
588
+ for i in range(0, len(keys)):
589
+ key = keys[i]
590
+ currency = currencyMap[key]
591
+ id = key
592
+ code = self.safe_currency_code(id)
593
+ networks: dict = {}
594
+ chains = self.safe_list(currency, 'network_list', [])
595
+ for j in range(0, len(chains)):
596
+ chain = chains[j]
597
+ networkId = self.safe_string(chain, 'network_id')
598
+ network = self.network_id_to_code(networkId)
599
+ networks[network] = {
600
+ 'info': chain,
601
+ 'id': networkId,
602
+ 'network': network,
603
+ 'active': None,
604
+ 'deposit': self.safe_bool(chain, 'deposit_enabled', False),
605
+ 'withdraw': self.safe_bool(chain, 'withdraw_enabled', False),
606
+ 'fee': self.safe_number(chain, 'withdrawal_fee'),
607
+ 'precision': None,
608
+ 'limits': {
609
+ 'withdraw': {
610
+ 'min': self.safe_number(chain, 'min_withdrawal_amount'),
611
+ 'max': None,
612
+ },
613
+ },
614
+ }
615
+ result[code] = self.safe_currency_structure({
616
+ 'info': currency,
617
+ 'id': id,
618
+ 'code': code,
619
+ 'name': self.safe_string(currency, 'full_name'),
620
+ 'active': None,
621
+ 'deposit': None,
622
+ 'withdraw': None,
623
+ 'fee': None,
624
+ 'precision': None,
625
+ 'limits': {
626
+ 'amount': {
627
+ 'min': None,
628
+ 'max': None,
629
+ },
630
+ },
631
+ 'type': 'crypto', # only crypto now
632
+ 'networks': networks,
633
+ })
634
+ return result
635
+
529
636
  async def fetch_markets(self, params={}) -> List[Market]:
530
637
  """
531
638
 
@@ -369,41 +369,9 @@ class cryptomus(Exchange, ImplicitAPI):
369
369
  coins = self.safe_list(response, 'result')
370
370
  result: dict = {}
371
371
  for i in range(0, len(coins)):
372
- currency = coins[i]
373
- currencyId = self.safe_string(currency, 'currency_code')
372
+ networkEntry = coins[i]
373
+ currencyId = self.safe_string(networkEntry, 'currency_code')
374
374
  code = self.safe_currency_code(currencyId)
375
- allowWithdraw = self.safe_bool(currency, 'can_withdraw')
376
- allowDeposit = self.safe_bool(currency, 'can_deposit')
377
- isActive = allowWithdraw and allowDeposit
378
- networkId = self.safe_string(currency, 'network_code')
379
- networksById = self.safe_dict(self.options, 'networksById')
380
- networkName = self.safe_string(networksById, networkId, networkId)
381
- minWithdraw = self.safe_number(currency, 'min_withdraw')
382
- maxWithdraw = self.safe_number(currency, 'max_withdraw')
383
- minDeposit = self.safe_number(currency, 'min_deposit')
384
- maxDeposit = self.safe_number(currency, 'max_deposit')
385
- network = {
386
- 'id': networkId,
387
- 'network': networkName,
388
- 'limits': {
389
- 'withdraw': {
390
- 'min': minWithdraw,
391
- 'max': maxWithdraw,
392
- },
393
- 'deposit': {
394
- 'min': minDeposit,
395
- 'max': maxDeposit,
396
- },
397
- },
398
- 'active': isActive,
399
- 'deposit': allowDeposit,
400
- 'withdraw': allowWithdraw,
401
- 'fee': None,
402
- 'precision': None,
403
- 'info': currency,
404
- }
405
- networks = {}
406
- networks[networkName] = network
407
375
  if not (code in result):
408
376
  result[code] = {
409
377
  'id': currencyId,
@@ -411,60 +379,54 @@ class cryptomus(Exchange, ImplicitAPI):
411
379
  'precision': None,
412
380
  'type': None,
413
381
  'name': None,
414
- 'active': isActive,
415
- 'deposit': allowDeposit,
416
- 'withdraw': allowWithdraw,
382
+ 'active': None,
383
+ 'deposit': None,
384
+ 'withdraw': None,
417
385
  'fee': None,
418
386
  'limits': {
419
387
  'withdraw': {
420
- 'min': minWithdraw,
421
- 'max': maxWithdraw,
388
+ 'min': None,
389
+ 'max': None,
422
390
  },
423
391
  'deposit': {
424
- 'min': minDeposit,
425
- 'max': maxDeposit,
392
+ 'min': None,
393
+ 'max': None,
426
394
  },
427
395
  },
428
- 'networks': networks,
429
- 'info': currency,
430
- }
431
- else:
432
- parsed = result[code]
433
- parsedNetworks = self.safe_dict(parsed, 'networks')
434
- parsed['networks'] = self.extend(parsedNetworks, networks)
435
- if isActive:
436
- parsed['active'] = True
437
- parsed['deposit'] = True
438
- parsed['withdraw'] = True
439
- else:
440
- if allowWithdraw:
441
- parsed['withdraw'] = True
442
- if allowDeposit:
443
- parsed['deposit'] = True
444
- parsedLimits = self.safe_dict(parsed, 'limits')
445
- withdrawLimits = {
446
- 'min': None,
447
- 'max': None,
396
+ 'networks': {},
397
+ 'info': {},
448
398
  }
449
- parsedWithdrawLimits = self.safe_dict(parsedLimits, 'withdraw', withdrawLimits)
450
- depositLimits = {
451
- 'min': None,
452
- 'max': None,
453
- }
454
- parsedDepositLimits = self.safe_dict(parsedLimits, 'deposit', depositLimits)
455
- if minWithdraw:
456
- withdrawLimits['min'] = min(parsedWithdrawLimits['min'], minWithdraw) if parsedWithdrawLimits['min'] else minWithdraw
457
- if maxWithdraw:
458
- withdrawLimits['max'] = max(parsedWithdrawLimits['max'], maxWithdraw) if parsedWithdrawLimits['max'] else maxWithdraw
459
- if minDeposit:
460
- depositLimits['min'] = min(parsedDepositLimits['min'], minDeposit) if parsedDepositLimits['min'] else minDeposit
461
- if maxDeposit:
462
- depositLimits['max'] = max(parsedDepositLimits['max'], maxDeposit) if parsedDepositLimits['max'] else maxDeposit
463
- limits = {
464
- 'withdraw': withdrawLimits,
465
- 'deposit': depositLimits,
466
- }
467
- parsed['limits'] = limits
399
+ networkId = self.safe_string(networkEntry, 'network_code')
400
+ networkCode = self.network_id_to_code(networkId)
401
+ result[code]['networks'][networkCode] = {
402
+ 'id': networkId,
403
+ 'network': networkCode,
404
+ 'limits': {
405
+ 'withdraw': {
406
+ 'min': self.safe_number(networkEntry, 'min_withdraw'),
407
+ 'max': self.safe_number(networkEntry, 'max_withdraw'),
408
+ },
409
+ 'deposit': {
410
+ 'min': self.safe_number(networkEntry, 'min_deposit'),
411
+ 'max': self.safe_number(networkEntry, 'max_deposit'),
412
+ },
413
+ },
414
+ 'active': None,
415
+ 'deposit': self.safe_bool(networkEntry, 'can_withdraw'),
416
+ 'withdraw': self.safe_bool(networkEntry, 'can_deposit'),
417
+ 'fee': None,
418
+ 'precision': None,
419
+ 'info': networkEntry,
420
+ }
421
+ # add entry in info
422
+ info = self.safe_list(result[code], 'info', [])
423
+ info.append(networkEntry)
424
+ result[code]['info'] = info
425
+ # only after all entries are formed in currencies, restructure each entry
426
+ allKeys = list(result.keys())
427
+ for i in range(0, len(allKeys)):
428
+ code = allKeys[i]
429
+ result[code] = self.safe_currency_structure(result[code]) # self is needed after adding network entry
468
430
  return result
469
431
 
470
432
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -509,31 +509,49 @@ class delta(Exchange, ImplicitAPI):
509
509
  """
510
510
  response = await self.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,41 @@ class delta(Exchange, ImplicitAPI):
545
563
  id = self.safe_string(currency, 'symbol')
546
564
  numericId = self.safe_integer(currency, 'id')
547
565
  code = self.safe_currency_code(id)
548
- depositStatus = self.safe_string(currency, 'deposit_status')
549
- withdrawalStatus = self.safe_string(currency, 'withdrawal_status')
550
- depositsEnabled = (depositStatus == 'enabled')
551
- withdrawalsEnabled = (withdrawalStatus == 'enabled')
552
- active = depositsEnabled and withdrawalsEnabled
553
- result[code] = {
566
+ chains = self.safe_list(currency, 'networks', [])
567
+ networks = {}
568
+ for j in range(0, len(chains)):
569
+ chain = chains[j]
570
+ networkId = self.safe_string(chain, 'network')
571
+ networkCode = self.network_id_to_code(networkId)
572
+ networks[networkCode] = {
573
+ 'id': networkId,
574
+ 'network': networkCode,
575
+ 'name': self.safe_string(chain, 'name'),
576
+ 'info': chain,
577
+ 'active': self.safe_string(chain, 'status') == 'enabled',
578
+ 'deposit': self.safe_string(chain, 'deposit_status') == 'enabled',
579
+ 'withdraw': self.safe_string(chain, 'withdrawal_status') == 'enabled',
580
+ 'fee': self.safe_number(chain, 'base_withdrawal_fee'),
581
+ 'limits': {
582
+ 'deposit': {
583
+ 'min': self.safe_number(chain, 'min_deposit_amount'),
584
+ 'max': None,
585
+ },
586
+ 'withdraw': {
587
+ 'min': self.safe_number(chain, 'min_withdrawal_amount'),
588
+ 'max': None,
589
+ },
590
+ },
591
+ }
592
+ result[code] = self.safe_currency_structure({
554
593
  'id': id,
555
594
  'numericId': numericId,
556
595
  'code': code,
557
596
  'name': self.safe_string(currency, 'name'),
558
597
  'info': currency, # the original payload
559
- 'active': active,
560
- 'deposit': depositsEnabled,
561
- 'withdraw': withdrawalsEnabled,
598
+ 'active': None,
599
+ 'deposit': self.safe_string(currency, 'deposit_status') == 'enabled',
600
+ 'withdraw': self.safe_string(currency, 'withdrawal_status') == 'enabled',
562
601
  'fee': self.safe_number(currency, 'base_withdrawal_fee'),
563
602
  'precision': self.parse_number(self.parse_precision(self.safe_string(currency, 'precision'))),
564
603
  'limits': {
@@ -568,9 +607,9 @@ class delta(Exchange, ImplicitAPI):
568
607
  'max': None,
569
608
  },
570
609
  },
571
- 'networks': {},
610
+ 'networks': networks,
572
611
  'type': 'crypto',
573
- }
612
+ })
574
613
  return result
575
614
 
576
615
  async def load_markets(self, reload=False, params={}):
@@ -461,14 +461,50 @@ class derive(Exchange, ImplicitAPI):
461
461
  result: dict = {}
462
462
  tokenResponse = await self.publicGetGetAllCurrencies(params)
463
463
  #
464
- # {
465
- # "result": [
466
- # {
467
- # "currency": "USDC",
468
- # "spot_price": "1.000066413299999872",
469
- # "spot_price_24h": "1.000327785299999872"
470
- # }
471
- # ],
464
+ # {
465
+ # "result": [
466
+ # {
467
+ # "currency": "SEI",
468
+ # "instrument_types": [
469
+ # "perp"
470
+ # ],
471
+ # "protocol_asset_addresses": {
472
+ # "perp": "0x7225889B75fd34C68eA3098dAE04D50553C09840",
473
+ # "option": null,
474
+ # "spot": null,
475
+ # "underlying_erc20": null
476
+ # },
477
+ # "managers": [
478
+ # {
479
+ # "address": "0x28c9ddF9A3B29c2E6a561c1BC520954e5A33de5D",
480
+ # "margin_type": "SM",
481
+ # "currency": null
482
+ # }
483
+ # ],
484
+ # "srm_im_discount": "0",
485
+ # "srm_mm_discount": "0",
486
+ # "pm2_collateral_discounts": [],
487
+ # "borrow_apy": "0",
488
+ # "supply_apy": "0",
489
+ # "total_borrow": "0",
490
+ # "total_supply": "0",
491
+ # "asset_cap_and_supply_per_manager": {
492
+ # "perp": {
493
+ # "SM": [
494
+ # {
495
+ # "current_open_interest": "0",
496
+ # "interest_cap": "2000000",
497
+ # "manager_currency": null
498
+ # }
499
+ # ]
500
+ # },
501
+ # "option": {},
502
+ # "erc20": {}
503
+ # },
504
+ # "market_type": "SRM_PERP_ONLY",
505
+ # "spot_price": "0.2193542905042081",
506
+ # "spot_price_24h": "0.238381655533635830"
507
+ # },
472
508
  # "id": "7e07fe1d-0ab4-4d2b-9e22-b65ce9e232dc"
473
509
  # }
474
510
  #
@@ -477,7 +513,7 @@ class derive(Exchange, ImplicitAPI):
477
513
  currency = currencies[i]
478
514
  currencyId = self.safe_string(currency, 'currency')
479
515
  code = self.safe_currency_code(currencyId)
480
- result[code] = {
516
+ result[code] = self.safe_currency_structure({
481
517
  'id': currencyId,
482
518
  'name': None,
483
519
  'code': code,
@@ -498,7 +534,7 @@ class derive(Exchange, ImplicitAPI):
498
534
  },
499
535
  },
500
536
  'info': currency,
501
- }
537
+ })
502
538
  return result
503
539
 
504
540
  async def fetch_markets(self, params={}) -> List[Market]: