ccxt 4.4.82__py2.py3-none-any.whl → 4.4.86__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 (121) hide show
  1. ccxt/__init__.py +3 -9
  2. ccxt/abstract/blofin.py +8 -0
  3. ccxt/abstract/btcbox.py +1 -0
  4. ccxt/abstract/myokx.py +2 -0
  5. ccxt/abstract/okx.py +2 -0
  6. ccxt/apex.py +2 -1
  7. ccxt/ascendex.py +187 -151
  8. ccxt/async_support/__init__.py +3 -9
  9. ccxt/async_support/apex.py +2 -1
  10. ccxt/async_support/ascendex.py +187 -151
  11. ccxt/async_support/base/exchange.py +51 -24
  12. ccxt/async_support/base/ws/cache.py +6 -1
  13. ccxt/async_support/bequant.py +1 -1
  14. ccxt/async_support/bitget.py +5 -6
  15. ccxt/async_support/bitmart.py +1 -1
  16. ccxt/async_support/bitrue.py +14 -32
  17. ccxt/async_support/bitso.py +33 -0
  18. ccxt/async_support/bitstamp.py +33 -0
  19. ccxt/async_support/{huobijp.py → bittrade.py} +11 -11
  20. ccxt/async_support/blofin.py +145 -14
  21. ccxt/async_support/btcbox.py +25 -5
  22. ccxt/async_support/bybit.py +16 -37
  23. ccxt/async_support/cex.py +2 -4
  24. ccxt/async_support/coinbase.py +58 -47
  25. ccxt/async_support/coinbaseexchange.py +141 -32
  26. ccxt/async_support/coincatch.py +14 -67
  27. ccxt/async_support/coinex.py +28 -29
  28. ccxt/async_support/coinlist.py +17 -16
  29. ccxt/async_support/coinmetro.py +20 -11
  30. ccxt/async_support/coinone.py +8 -10
  31. ccxt/async_support/coinsph.py +124 -2
  32. ccxt/async_support/cryptocom.py +109 -2
  33. ccxt/async_support/cryptomus.py +42 -80
  34. ccxt/async_support/delta.py +75 -36
  35. ccxt/async_support/deribit.py +4 -5
  36. ccxt/async_support/derive.py +46 -10
  37. ccxt/async_support/ellipx.py +175 -77
  38. ccxt/async_support/gate.py +1 -1
  39. ccxt/async_support/gemini.py +3 -4
  40. ccxt/async_support/hitbtc.py +56 -65
  41. ccxt/async_support/hollaex.py +106 -49
  42. ccxt/async_support/htx.py +20 -43
  43. ccxt/async_support/hyperliquid.py +6 -6
  44. ccxt/async_support/kraken.py +27 -23
  45. ccxt/async_support/kucoinfutures.py +5 -0
  46. ccxt/async_support/lbank.py +1 -1
  47. ccxt/async_support/mexc.py +2 -2
  48. ccxt/async_support/ndax.py +25 -24
  49. ccxt/async_support/okcoin.py +12 -29
  50. ccxt/async_support/okx.py +9 -0
  51. ccxt/async_support/onetrading.py +10 -7
  52. ccxt/async_support/oxfun.py +40 -110
  53. ccxt/async_support/paradex.py +123 -4
  54. ccxt/base/exchange.py +21 -2
  55. ccxt/base/types.py +3 -0
  56. ccxt/bequant.py +1 -1
  57. ccxt/bitget.py +5 -6
  58. ccxt/bitmart.py +1 -1
  59. ccxt/bitrue.py +14 -32
  60. ccxt/bitso.py +33 -0
  61. ccxt/bitstamp.py +33 -0
  62. ccxt/{huobijp.py → bittrade.py} +11 -11
  63. ccxt/blofin.py +145 -14
  64. ccxt/btcbox.py +24 -5
  65. ccxt/bybit.py +16 -37
  66. ccxt/cex.py +2 -4
  67. ccxt/coinbase.py +58 -47
  68. ccxt/coinbaseexchange.py +141 -32
  69. ccxt/coincatch.py +14 -67
  70. ccxt/coinex.py +28 -29
  71. ccxt/coinlist.py +17 -16
  72. ccxt/coinmetro.py +20 -11
  73. ccxt/coinone.py +8 -10
  74. ccxt/coinsph.py +124 -2
  75. ccxt/cryptocom.py +109 -2
  76. ccxt/cryptomus.py +42 -80
  77. ccxt/delta.py +75 -36
  78. ccxt/deribit.py +4 -5
  79. ccxt/derive.py +46 -10
  80. ccxt/ellipx.py +175 -77
  81. ccxt/gate.py +1 -1
  82. ccxt/gemini.py +3 -4
  83. ccxt/hitbtc.py +56 -65
  84. ccxt/hollaex.py +106 -49
  85. ccxt/htx.py +20 -43
  86. ccxt/hyperliquid.py +6 -6
  87. ccxt/kraken.py +27 -23
  88. ccxt/kucoinfutures.py +5 -0
  89. ccxt/lbank.py +1 -1
  90. ccxt/mexc.py +2 -2
  91. ccxt/ndax.py +25 -24
  92. ccxt/okcoin.py +12 -29
  93. ccxt/okx.py +9 -0
  94. ccxt/onetrading.py +10 -7
  95. ccxt/oxfun.py +40 -110
  96. ccxt/paradex.py +123 -4
  97. ccxt/pro/__init__.py +109 -5
  98. ccxt/pro/binance.py +32 -33
  99. ccxt/pro/bithumb.py +5 -3
  100. ccxt/pro/{huobijp.py → bittrade.py} +3 -3
  101. ccxt/pro/kraken.py +249 -79
  102. ccxt/pro/luno.py +6 -5
  103. ccxt/pro/mexc.py +254 -7
  104. ccxt/pro/poloniex.py +6 -2
  105. {ccxt-4.4.82.dist-info → ccxt-4.4.86.dist-info}/METADATA +8 -11
  106. {ccxt-4.4.82.dist-info → ccxt-4.4.86.dist-info}/RECORD +110 -121
  107. ccxt/abstract/bl3p.py +0 -19
  108. ccxt/abstract/idex.py +0 -26
  109. ccxt/abstract/kuna.py +0 -182
  110. ccxt/async_support/base/ws/fast_client.py +0 -97
  111. ccxt/async_support/bl3p.py +0 -543
  112. ccxt/async_support/idex.py +0 -1889
  113. ccxt/async_support/kuna.py +0 -1935
  114. ccxt/bl3p.py +0 -543
  115. ccxt/idex.py +0 -1889
  116. ccxt/kuna.py +0 -1935
  117. ccxt/pro/idex.py +0 -687
  118. /ccxt/abstract/{huobijp.py → bittrade.py} +0 -0
  119. {ccxt-4.4.82.dist-info → ccxt-4.4.86.dist-info}/LICENSE.txt +0 -0
  120. {ccxt-4.4.82.dist-info → ccxt-4.4.86.dist-info}/WHEEL +0 -0
  121. {ccxt-4.4.82.dist-info → ccxt-4.4.86.dist-info}/top_level.txt +0 -0
ccxt/cryptomus.py CHANGED
@@ -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
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
ccxt/delta.py CHANGED
@@ -509,31 +509,49 @@ class delta(Exchange, ImplicitAPI):
509
509
  """
510
510
  response = 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
  def load_markets(self, reload=False, params={}):
ccxt/deribit.py CHANGED
@@ -640,18 +640,17 @@ class deribit(Exchange, ImplicitAPI):
640
640
  # "testnet": True
641
641
  # }
642
642
  #
643
- data = self.safe_value(response, 'result', {})
643
+ data = self.safe_list(response, 'result', [])
644
644
  result: dict = {}
645
645
  for i in range(0, len(data)):
646
646
  currency = data[i]
647
647
  currencyId = self.safe_string(currency, 'currency')
648
648
  code = self.safe_currency_code(currencyId)
649
- name = self.safe_string(currency, 'currency_long')
650
- result[code] = {
649
+ result[code] = self.safe_currency_structure({
651
650
  'info': currency,
652
651
  'code': code,
653
652
  'id': currencyId,
654
- 'name': name,
653
+ 'name': self.safe_string(currency, 'currency_long'),
655
654
  'active': None,
656
655
  'deposit': None,
657
656
  'withdraw': None,
@@ -673,7 +672,7 @@ class deribit(Exchange, ImplicitAPI):
673
672
  },
674
673
  },
675
674
  'networks': None,
676
- }
675
+ })
677
676
  return result
678
677
 
679
678
  def code_from_options(self, methodName, params={}):
ccxt/derive.py CHANGED
@@ -460,14 +460,50 @@ class derive(Exchange, ImplicitAPI):
460
460
  result: dict = {}
461
461
  tokenResponse = self.publicGetGetAllCurrencies(params)
462
462
  #
463
- # {
464
- # "result": [
465
- # {
466
- # "currency": "USDC",
467
- # "spot_price": "1.000066413299999872",
468
- # "spot_price_24h": "1.000327785299999872"
469
- # }
470
- # ],
463
+ # {
464
+ # "result": [
465
+ # {
466
+ # "currency": "SEI",
467
+ # "instrument_types": [
468
+ # "perp"
469
+ # ],
470
+ # "protocol_asset_addresses": {
471
+ # "perp": "0x7225889B75fd34C68eA3098dAE04D50553C09840",
472
+ # "option": null,
473
+ # "spot": null,
474
+ # "underlying_erc20": null
475
+ # },
476
+ # "managers": [
477
+ # {
478
+ # "address": "0x28c9ddF9A3B29c2E6a561c1BC520954e5A33de5D",
479
+ # "margin_type": "SM",
480
+ # "currency": null
481
+ # }
482
+ # ],
483
+ # "srm_im_discount": "0",
484
+ # "srm_mm_discount": "0",
485
+ # "pm2_collateral_discounts": [],
486
+ # "borrow_apy": "0",
487
+ # "supply_apy": "0",
488
+ # "total_borrow": "0",
489
+ # "total_supply": "0",
490
+ # "asset_cap_and_supply_per_manager": {
491
+ # "perp": {
492
+ # "SM": [
493
+ # {
494
+ # "current_open_interest": "0",
495
+ # "interest_cap": "2000000",
496
+ # "manager_currency": null
497
+ # }
498
+ # ]
499
+ # },
500
+ # "option": {},
501
+ # "erc20": {}
502
+ # },
503
+ # "market_type": "SRM_PERP_ONLY",
504
+ # "spot_price": "0.2193542905042081",
505
+ # "spot_price_24h": "0.238381655533635830"
506
+ # },
471
507
  # "id": "7e07fe1d-0ab4-4d2b-9e22-b65ce9e232dc"
472
508
  # }
473
509
  #
@@ -476,7 +512,7 @@ class derive(Exchange, ImplicitAPI):
476
512
  currency = currencies[i]
477
513
  currencyId = self.safe_string(currency, 'currency')
478
514
  code = self.safe_currency_code(currencyId)
479
- result[code] = {
515
+ result[code] = self.safe_currency_structure({
480
516
  'id': currencyId,
481
517
  'name': None,
482
518
  'code': code,
@@ -497,7 +533,7 @@ class derive(Exchange, ImplicitAPI):
497
533
  },
498
534
  },
499
535
  'info': currency,
500
- }
536
+ })
501
537
  return result
502
538
 
503
539
  def fetch_markets(self, params={}) -> List[Market]: