ccxt 4.4.78__py2.py3-none-any.whl → 4.4.82__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 -1
  2. ccxt/abstract/bitmart.py +1 -0
  3. ccxt/apex.py +21 -31
  4. ccxt/ascendex.py +23 -6
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/apex.py +21 -31
  7. ccxt/async_support/ascendex.py +23 -6
  8. ccxt/async_support/base/exchange.py +5 -1
  9. ccxt/async_support/bigone.py +17 -14
  10. ccxt/async_support/binance.py +6 -0
  11. ccxt/async_support/bingx.py +16 -35
  12. ccxt/async_support/bitfinex.py +120 -82
  13. ccxt/async_support/bitget.py +58 -66
  14. ccxt/async_support/bitmart.py +7 -2
  15. ccxt/async_support/bitmex.py +8 -1
  16. ccxt/async_support/bitopro.py +5 -1
  17. ccxt/async_support/bitrue.py +2 -1
  18. ccxt/async_support/bitso.py +1 -1
  19. ccxt/async_support/bitteam.py +2 -0
  20. ccxt/async_support/bitvavo.py +25 -10
  21. ccxt/async_support/btcalpha.py +1 -1
  22. ccxt/async_support/btcmarkets.py +1 -1
  23. ccxt/async_support/btcturk.py +1 -1
  24. ccxt/async_support/bybit.py +29 -15
  25. ccxt/async_support/coinbase.py +3 -15
  26. ccxt/async_support/coinex.py +1 -0
  27. ccxt/async_support/coinlist.py +1 -0
  28. ccxt/async_support/coinone.py +1 -0
  29. ccxt/async_support/delta.py +3 -0
  30. ccxt/async_support/deribit.py +1 -0
  31. ccxt/async_support/hollaex.py +1 -0
  32. ccxt/async_support/htx.py +9 -5
  33. ccxt/async_support/huobijp.py +1 -0
  34. ccxt/async_support/hyperliquid.py +14 -0
  35. ccxt/async_support/kraken.py +2 -0
  36. ccxt/async_support/okx.py +2 -3
  37. ccxt/async_support/oxfun.py +21 -1
  38. ccxt/async_support/poloniex.py +1 -0
  39. ccxt/async_support/timex.py +2 -2
  40. ccxt/async_support/upbit.py +43 -21
  41. ccxt/async_support/whitebit.py +65 -12
  42. ccxt/base/exchange.py +20 -2
  43. ccxt/bigone.py +17 -14
  44. ccxt/binance.py +6 -0
  45. ccxt/bingx.py +16 -35
  46. ccxt/bitfinex.py +120 -82
  47. ccxt/bitget.py +58 -66
  48. ccxt/bitmart.py +7 -2
  49. ccxt/bitmex.py +8 -1
  50. ccxt/bitopro.py +5 -1
  51. ccxt/bitrue.py +2 -1
  52. ccxt/bitso.py +1 -1
  53. ccxt/bitteam.py +2 -0
  54. ccxt/bitvavo.py +25 -10
  55. ccxt/btcalpha.py +1 -1
  56. ccxt/btcmarkets.py +1 -1
  57. ccxt/btcturk.py +1 -1
  58. ccxt/bybit.py +29 -15
  59. ccxt/coinbase.py +3 -15
  60. ccxt/coinex.py +1 -0
  61. ccxt/coinlist.py +1 -0
  62. ccxt/coinone.py +1 -0
  63. ccxt/delta.py +3 -0
  64. ccxt/deribit.py +1 -0
  65. ccxt/hollaex.py +1 -0
  66. ccxt/htx.py +9 -5
  67. ccxt/huobijp.py +1 -0
  68. ccxt/hyperliquid.py +14 -0
  69. ccxt/kraken.py +2 -0
  70. ccxt/okx.py +2 -3
  71. ccxt/oxfun.py +21 -1
  72. ccxt/poloniex.py +1 -0
  73. ccxt/pro/__init__.py +1 -1
  74. ccxt/pro/binance.py +3 -3
  75. ccxt/pro/coinbase.py +41 -53
  76. ccxt/pro/hyperliquid.py +10 -2
  77. ccxt/pro/upbit.py +42 -0
  78. ccxt/test/tests_async.py +0 -1
  79. ccxt/test/tests_sync.py +0 -1
  80. ccxt/timex.py +2 -2
  81. ccxt/upbit.py +43 -21
  82. ccxt/whitebit.py +65 -12
  83. {ccxt-4.4.78.dist-info → ccxt-4.4.82.dist-info}/METADATA +9 -13
  84. {ccxt-4.4.78.dist-info → ccxt-4.4.82.dist-info}/RECORD +87 -87
  85. {ccxt-4.4.78.dist-info → ccxt-4.4.82.dist-info}/LICENSE.txt +0 -0
  86. {ccxt-4.4.78.dist-info → ccxt-4.4.82.dist-info}/WHEEL +0 -0
  87. {ccxt-4.4.78.dist-info → ccxt-4.4.82.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.4.78'
25
+ __version__ = '4.4.82'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/bitmart.py CHANGED
@@ -61,6 +61,7 @@ class ImplicitAPI:
61
61
  private_get_contract_private_order = privateGetContractPrivateOrder = Entry('contract/private/order', 'private', 'GET', {'cost': 1.2})
62
62
  private_get_contract_private_order_history = privateGetContractPrivateOrderHistory = Entry('contract/private/order-history', 'private', 'GET', {'cost': 10})
63
63
  private_get_contract_private_position = privateGetContractPrivatePosition = Entry('contract/private/position', 'private', 'GET', {'cost': 10})
64
+ private_get_contract_private_position_v2 = privateGetContractPrivatePositionV2 = Entry('contract/private/position-v2', 'private', 'GET', {'cost': 10})
64
65
  private_get_contract_private_get_open_orders = privateGetContractPrivateGetOpenOrders = Entry('contract/private/get-open-orders', 'private', 'GET', {'cost': 1.2})
65
66
  private_get_contract_private_current_plan_order = privateGetContractPrivateCurrentPlanOrder = Entry('contract/private/current-plan-order', 'private', 'GET', {'cost': 1.2})
66
67
  private_get_contract_private_trades = privateGetContractPrivateTrades = Entry('contract/private/trades', 'private', 'GET', {'cost': 10})
ccxt/apex.py CHANGED
@@ -498,11 +498,6 @@ class apex(Exchange, ImplicitAPI):
498
498
  code = self.safe_currency_code(currencyId)
499
499
  name = self.safe_string(currency, 'displayName')
500
500
  networks: dict = {}
501
- minPrecision = None
502
- minWithdrawFeeString = None
503
- minWithdrawString = None
504
- deposit = False
505
- withdraw = False
506
501
  for j in range(0, len(chains)):
507
502
  chain = chains[j]
508
503
  tokens = self.safe_list(chain, 'tokens', [])
@@ -512,53 +507,48 @@ class apex(Exchange, ImplicitAPI):
512
507
  if tokenName == currencyId:
513
508
  networkId = self.safe_string(chain, 'chainId')
514
509
  networkCode = self.network_id_to_code(networkId)
515
- precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
516
- minPrecision = precision if (minPrecision is None) else min(minPrecision, precision)
517
- depositAllowed = not self.safe_bool(chain, 'stopDeposit')
518
- deposit = depositAllowed if (depositAllowed) else deposit
519
- withdrawAllowed = self.safe_bool(token, 'withdrawEnable')
520
- withdraw = withdrawAllowed if (withdrawAllowed) else withdraw
521
- minWithdrawFeeString = self.safe_string(token, 'minFee')
522
- minWithdrawString = self.safe_string(token, 'minWithdraw')
523
- minNetworkDepositString = self.safe_string(chain, 'depositMin')
524
510
  networks[networkCode] = {
525
511
  'info': chain,
526
512
  'id': networkId,
527
513
  'network': networkCode,
528
- 'active': depositAllowed and withdrawAllowed,
529
- 'deposit': depositAllowed,
530
- 'withdraw': withdrawAllowed,
531
- 'fee': self.parse_number(minWithdrawFeeString),
532
- 'precision': precision,
514
+ 'active': None,
515
+ 'deposit': not self.safe_bool(chain, 'depositDisable'),
516
+ 'withdraw': self.safe_bool(token, 'withdrawEnable'),
517
+ 'fee': self.safe_number(token, 'minFee'),
518
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(token, 'decimals'))),
533
519
  'limits': {
534
520
  'withdraw': {
535
- 'min': self.parse_number(minWithdrawString),
521
+ 'min': self.safe_number(token, 'minWithdraw'),
536
522
  'max': None,
537
523
  },
538
524
  'deposit': {
539
- 'min': self.parse_number(minNetworkDepositString),
525
+ 'min': self.safe_number(chain, 'minDeposit'),
540
526
  'max': None,
541
527
  },
542
528
  },
543
529
  }
544
- result[code] = {
530
+ networkKeys = list(networks.keys())
531
+ networksLength = len(networkKeys)
532
+ emptyChains = networksLength == 0 # non-functional coins
533
+ valueForEmpty = False if emptyChains else None
534
+ result[code] = self.safe_currency_structure({
545
535
  'info': currency,
546
536
  'code': code,
547
537
  'id': currencyId,
548
538
  'type': 'crypto',
549
539
  'name': name,
550
- 'active': deposit and withdraw,
551
- 'deposit': deposit,
552
- 'withdraw': withdraw,
553
- 'fee': self.parse_number(minWithdrawFeeString),
554
- 'precision': minPrecision,
540
+ 'active': None,
541
+ 'deposit': valueForEmpty,
542
+ 'withdraw': valueForEmpty,
543
+ 'fee': None,
544
+ 'precision': None,
555
545
  'limits': {
556
546
  'amount': {
557
547
  'min': None,
558
548
  'max': None,
559
549
  },
560
550
  'withdraw': {
561
- 'min': self.parse_number(minWithdrawString),
551
+ 'min': None,
562
552
  'max': None,
563
553
  },
564
554
  'deposit': {
@@ -567,7 +557,7 @@ class apex(Exchange, ImplicitAPI):
567
557
  },
568
558
  },
569
559
  'networks': networks,
570
- }
560
+ })
571
561
  return result
572
562
 
573
563
  def fetch_markets(self, params={}) -> List[Market]:
@@ -827,7 +817,7 @@ class apex(Exchange, ImplicitAPI):
827
817
 
828
818
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
829
819
  #
830
- # {
820
+ # {
831
821
  # "start": 1647511440000,
832
822
  # "symbol": "BTC-USD",
833
823
  # "interval": "1",
@@ -837,7 +827,7 @@ class apex(Exchange, ImplicitAPI):
837
827
  # "close": "40000",
838
828
  # "volume": "1.002",
839
829
  # "turnover": "3"
840
- # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
830
+ # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
841
831
  #
842
832
  return [
843
833
  self.safe_integer_n(ohlcv, ['start', 't']),
ccxt/ascendex.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.ascendex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -521,6 +521,7 @@ class ascendex(Exchange, ImplicitAPI):
521
521
  # "data":[
522
522
  # {
523
523
  # "assetCode":"BTT",
524
+ # "displayName": "BTT",
524
525
  # "borrowAssetCode":"BTT-B",
525
526
  # "interestAssetCode":"BTT-I",
526
527
  # "nativeScale":0,
@@ -541,12 +542,13 @@ class ascendex(Exchange, ImplicitAPI):
541
542
  # "data":[
542
543
  # {
543
544
  # "assetCode":"LTCBULL",
545
+ # "displayName": "LTCBULL",
544
546
  # "nativeScale":4,
545
547
  # "numConfirmations":20,
546
548
  # "withdrawFee":"0.2",
547
549
  # "minWithdrawalAmt":"1.0",
548
550
  # "statusCode":"Normal",
549
- # "statusMessage":""
551
+ # "statusMessage":"" # hideFromWalletTx
550
552
  # }
551
553
  # ]
552
554
  # }
@@ -568,8 +570,23 @@ class ascendex(Exchange, ImplicitAPI):
568
570
  scale = self.safe_string_2(currency, 'precisionScale', 'nativeScale')
569
571
  precision = self.parse_number(self.parse_precision(scale))
570
572
  fee = self.safe_number_2(currency, 'withdrawFee', 'withdrawalFee')
571
- status = self.safe_string_2(currency, 'status', 'statusCode')
573
+ status = self.safe_string(currency, 'status')
574
+ statusCode = self.safe_string(currency, 'statusCode')
572
575
  active = (status == 'Normal')
576
+ depositEnabled: Bool = None
577
+ withdrawEnabled: Bool = None
578
+ if status == 'Delisted' or statusCode == 'hideFromWalletTx':
579
+ depositEnabled = False
580
+ withdrawEnabled = False
581
+ elif status == 'Normal':
582
+ depositEnabled = True
583
+ withdrawEnabled = True
584
+ elif status == 'NoTransaction' or statusCode == 'NoTransaction':
585
+ depositEnabled = True
586
+ withdrawEnabled = False
587
+ elif status == 'NoDeposit':
588
+ depositEnabled = False
589
+ withdrawEnabled = True
573
590
  marginInside = ('borrowAssetCode' in currency)
574
591
  result[code] = {
575
592
  'id': id,
@@ -579,8 +596,8 @@ class ascendex(Exchange, ImplicitAPI):
579
596
  'margin': marginInside,
580
597
  'name': self.safe_string(currency, 'assetName'),
581
598
  'active': active,
582
- 'deposit': None,
583
- 'withdraw': None,
599
+ 'deposit': depositEnabled,
600
+ 'withdraw': withdrawEnabled,
584
601
  'fee': fee,
585
602
  'precision': precision,
586
603
  'limits': {
@@ -593,7 +610,7 @@ class ascendex(Exchange, ImplicitAPI):
593
610
  'max': None,
594
611
  },
595
612
  },
596
- 'networks': {},
613
+ 'networks': {}, # todo
597
614
  }
598
615
  return result
599
616
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.78'
7
+ __version__ = '4.4.82'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -498,11 +498,6 @@ class apex(Exchange, ImplicitAPI):
498
498
  code = self.safe_currency_code(currencyId)
499
499
  name = self.safe_string(currency, 'displayName')
500
500
  networks: dict = {}
501
- minPrecision = None
502
- minWithdrawFeeString = None
503
- minWithdrawString = None
504
- deposit = False
505
- withdraw = False
506
501
  for j in range(0, len(chains)):
507
502
  chain = chains[j]
508
503
  tokens = self.safe_list(chain, 'tokens', [])
@@ -512,53 +507,48 @@ class apex(Exchange, ImplicitAPI):
512
507
  if tokenName == currencyId:
513
508
  networkId = self.safe_string(chain, 'chainId')
514
509
  networkCode = self.network_id_to_code(networkId)
515
- precision = self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals')))
516
- minPrecision = precision if (minPrecision is None) else min(minPrecision, precision)
517
- depositAllowed = not self.safe_bool(chain, 'stopDeposit')
518
- deposit = depositAllowed if (depositAllowed) else deposit
519
- withdrawAllowed = self.safe_bool(token, 'withdrawEnable')
520
- withdraw = withdrawAllowed if (withdrawAllowed) else withdraw
521
- minWithdrawFeeString = self.safe_string(token, 'minFee')
522
- minWithdrawString = self.safe_string(token, 'minWithdraw')
523
- minNetworkDepositString = self.safe_string(chain, 'depositMin')
524
510
  networks[networkCode] = {
525
511
  'info': chain,
526
512
  'id': networkId,
527
513
  'network': networkCode,
528
- 'active': depositAllowed and withdrawAllowed,
529
- 'deposit': depositAllowed,
530
- 'withdraw': withdrawAllowed,
531
- 'fee': self.parse_number(minWithdrawFeeString),
532
- 'precision': precision,
514
+ 'active': None,
515
+ 'deposit': not self.safe_bool(chain, 'depositDisable'),
516
+ 'withdraw': self.safe_bool(token, 'withdrawEnable'),
517
+ 'fee': self.safe_number(token, 'minFee'),
518
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(token, 'decimals'))),
533
519
  'limits': {
534
520
  'withdraw': {
535
- 'min': self.parse_number(minWithdrawString),
521
+ 'min': self.safe_number(token, 'minWithdraw'),
536
522
  'max': None,
537
523
  },
538
524
  'deposit': {
539
- 'min': self.parse_number(minNetworkDepositString),
525
+ 'min': self.safe_number(chain, 'minDeposit'),
540
526
  'max': None,
541
527
  },
542
528
  },
543
529
  }
544
- result[code] = {
530
+ networkKeys = list(networks.keys())
531
+ networksLength = len(networkKeys)
532
+ emptyChains = networksLength == 0 # non-functional coins
533
+ valueForEmpty = False if emptyChains else None
534
+ result[code] = self.safe_currency_structure({
545
535
  'info': currency,
546
536
  'code': code,
547
537
  'id': currencyId,
548
538
  'type': 'crypto',
549
539
  'name': name,
550
- 'active': deposit and withdraw,
551
- 'deposit': deposit,
552
- 'withdraw': withdraw,
553
- 'fee': self.parse_number(minWithdrawFeeString),
554
- 'precision': minPrecision,
540
+ 'active': None,
541
+ 'deposit': valueForEmpty,
542
+ 'withdraw': valueForEmpty,
543
+ 'fee': None,
544
+ 'precision': None,
555
545
  'limits': {
556
546
  'amount': {
557
547
  'min': None,
558
548
  'max': None,
559
549
  },
560
550
  'withdraw': {
561
- 'min': self.parse_number(minWithdrawString),
551
+ 'min': None,
562
552
  'max': None,
563
553
  },
564
554
  'deposit': {
@@ -567,7 +557,7 @@ class apex(Exchange, ImplicitAPI):
567
557
  },
568
558
  },
569
559
  'networks': networks,
570
- }
560
+ })
571
561
  return result
572
562
 
573
563
  async def fetch_markets(self, params={}) -> List[Market]:
@@ -827,7 +817,7 @@ class apex(Exchange, ImplicitAPI):
827
817
 
828
818
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
829
819
  #
830
- # {
820
+ # {
831
821
  # "start": 1647511440000,
832
822
  # "symbol": "BTC-USD",
833
823
  # "interval": "1",
@@ -837,7 +827,7 @@ class apex(Exchange, ImplicitAPI):
837
827
  # "close": "40000",
838
828
  # "volume": "1.002",
839
829
  # "turnover": "3"
840
- # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
830
+ # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
841
831
  #
842
832
  return [
843
833
  self.safe_integer_n(ohlcv, ['start', 't']),
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.ascendex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Any, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -522,6 +522,7 @@ class ascendex(Exchange, ImplicitAPI):
522
522
  # "data":[
523
523
  # {
524
524
  # "assetCode":"BTT",
525
+ # "displayName": "BTT",
525
526
  # "borrowAssetCode":"BTT-B",
526
527
  # "interestAssetCode":"BTT-I",
527
528
  # "nativeScale":0,
@@ -542,12 +543,13 @@ class ascendex(Exchange, ImplicitAPI):
542
543
  # "data":[
543
544
  # {
544
545
  # "assetCode":"LTCBULL",
546
+ # "displayName": "LTCBULL",
545
547
  # "nativeScale":4,
546
548
  # "numConfirmations":20,
547
549
  # "withdrawFee":"0.2",
548
550
  # "minWithdrawalAmt":"1.0",
549
551
  # "statusCode":"Normal",
550
- # "statusMessage":""
552
+ # "statusMessage":"" # hideFromWalletTx
551
553
  # }
552
554
  # ]
553
555
  # }
@@ -569,8 +571,23 @@ class ascendex(Exchange, ImplicitAPI):
569
571
  scale = self.safe_string_2(currency, 'precisionScale', 'nativeScale')
570
572
  precision = self.parse_number(self.parse_precision(scale))
571
573
  fee = self.safe_number_2(currency, 'withdrawFee', 'withdrawalFee')
572
- status = self.safe_string_2(currency, 'status', 'statusCode')
574
+ status = self.safe_string(currency, 'status')
575
+ statusCode = self.safe_string(currency, 'statusCode')
573
576
  active = (status == 'Normal')
577
+ depositEnabled: Bool = None
578
+ withdrawEnabled: Bool = None
579
+ if status == 'Delisted' or statusCode == 'hideFromWalletTx':
580
+ depositEnabled = False
581
+ withdrawEnabled = False
582
+ elif status == 'Normal':
583
+ depositEnabled = True
584
+ withdrawEnabled = True
585
+ elif status == 'NoTransaction' or statusCode == 'NoTransaction':
586
+ depositEnabled = True
587
+ withdrawEnabled = False
588
+ elif status == 'NoDeposit':
589
+ depositEnabled = False
590
+ withdrawEnabled = True
574
591
  marginInside = ('borrowAssetCode' in currency)
575
592
  result[code] = {
576
593
  'id': id,
@@ -580,8 +597,8 @@ class ascendex(Exchange, ImplicitAPI):
580
597
  'margin': marginInside,
581
598
  'name': self.safe_string(currency, 'assetName'),
582
599
  'active': active,
583
- 'deposit': None,
584
- 'withdraw': None,
600
+ 'deposit': depositEnabled,
601
+ 'withdraw': withdrawEnabled,
585
602
  'fee': fee,
586
603
  'precision': precision,
587
604
  'limits': {
@@ -594,7 +611,7 @@ class ascendex(Exchange, ImplicitAPI):
594
611
  'max': None,
595
612
  },
596
613
  },
597
- 'networks': {},
614
+ 'networks': {}, # todo
598
615
  }
599
616
  return result
600
617
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.78'
5
+ __version__ = '4.4.82'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -114,6 +114,10 @@ class Exchange(BaseExchange):
114
114
  if self.ssl_context is None:
115
115
  # Create our SSL context object with our CA cert file
116
116
  self.ssl_context = ssl.create_default_context(cafile=self.cafile) if self.verify else self.verify
117
+ if (self.ssl_context and self.safe_bool(self.options, 'include_OS_certificates', False)):
118
+ os_default_paths = ssl.get_default_verify_paths()
119
+ if os_default_paths.cafile and os_default_paths.cafile != self.cafile:
120
+ self.ssl_context.load_verify_locations(cafile=os_default_paths.cafile)
117
121
 
118
122
  if self.own_session and self.session is None:
119
123
  # Pass this SSL context to aiohttp and create a TCPConnector
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bigone import ImplicitAPI
8
8
  import asyncio
9
- from ccxt.base.types import Any, Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
+ from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -510,19 +510,15 @@ class bigone(Exchange, ImplicitAPI):
510
510
  id = self.safe_string(currency, 'symbol')
511
511
  code = self.safe_currency_code(id)
512
512
  name = self.safe_string(currency, 'name')
513
- type = 'fiat' if self.safe_bool(currency, 'is_fiat') else 'crypto'
514
513
  networks: dict = {}
515
514
  chains = self.safe_list(currency, 'binding_gateways', [])
516
515
  currencyMaxPrecision = self.parse_precision(self.safe_string_2(currency, 'withdrawal_scale', 'scale'))
517
- currencyDepositEnabled: Bool = None
518
- currencyWithdrawEnabled: Bool = None
519
516
  for j in range(0, len(chains)):
520
517
  chain = chains[j]
521
518
  networkId = self.safe_string(chain, 'gateway_name')
522
519
  networkCode = self.network_id_to_code(networkId)
523
520
  deposit = self.safe_bool(chain, 'is_deposit_enabled')
524
521
  withdraw = self.safe_bool(chain, 'is_withdrawal_enabled')
525
- isActive = (deposit and withdraw)
526
522
  minDepositAmount = self.safe_string(chain, 'min_deposit_amount')
527
523
  minWithdrawalAmount = self.safe_string(chain, 'min_withdrawal_amount')
528
524
  withdrawalFee = self.safe_string(chain, 'withdrawal_fee')
@@ -533,7 +529,7 @@ class bigone(Exchange, ImplicitAPI):
533
529
  'margin': None,
534
530
  'deposit': deposit,
535
531
  'withdraw': withdraw,
536
- 'active': isActive,
532
+ 'active': None,
537
533
  'fee': self.parse_number(withdrawalFee),
538
534
  'precision': self.parse_number(precision),
539
535
  'limits': {
@@ -548,19 +544,26 @@ class bigone(Exchange, ImplicitAPI):
548
544
  },
549
545
  'info': chain,
550
546
  }
551
- # fill global values
552
- currencyDepositEnabled = (currencyDepositEnabled is None) or deposit if deposit else currencyDepositEnabled
553
- currencyWithdrawEnabled = (currencyWithdrawEnabled is None) or withdraw if withdraw else currencyWithdrawEnabled
554
- currencyMaxPrecision = (currencyMaxPrecision is None) or precision if Precise.string_gt(currencyMaxPrecision, precision) else currencyMaxPrecision
555
- result[code] = {
547
+ chainLength = len(chains)
548
+ type: Str = None
549
+ if self.safe_bool(currency, 'is_fiat'):
550
+ type = 'fiat'
551
+ elif chainLength == 0:
552
+ if self.is_leveraged_currency(id):
553
+ type = 'leveraged'
554
+ else:
555
+ type = 'other'
556
+ else:
557
+ type = 'crypto'
558
+ result[code] = self.safe_currency_structure({
556
559
  'id': id,
557
560
  'code': code,
558
561
  'info': currency,
559
562
  'name': name,
560
563
  'type': type,
561
564
  'active': None,
562
- 'deposit': currencyDepositEnabled,
563
- 'withdraw': currencyWithdrawEnabled,
565
+ 'deposit': None,
566
+ 'withdraw': None,
564
567
  'fee': None,
565
568
  'precision': self.parse_number(currencyMaxPrecision),
566
569
  'limits': {
@@ -574,7 +577,7 @@ class bigone(Exchange, ImplicitAPI):
574
577
  },
575
578
  },
576
579
  'networks': networks,
577
- }
580
+ })
578
581
  return result
579
582
 
580
583
  async def fetch_markets(self, params={}) -> List[Market]:
@@ -1294,6 +1294,7 @@ class binance(Exchange, ImplicitAPI):
1294
1294
  'inverse', # allows CORS in browsers
1295
1295
  # 'option', # does not allow CORS, enable outside of the browser only
1296
1296
  ],
1297
+ 'loadAllOptions': False,
1297
1298
  'fetchCurrencies': True, # self is a private call and it requires API keys
1298
1299
  # 'fetchTradesMethod': 'publicGetAggTrades', # publicGetTrades, publicGetHistoricalTrades, eapiPublicGetTrades
1299
1300
  # 'repayCrossMarginMethod': 'papiPostRepayLoan', # papiPostMarginRepayDebt
@@ -3021,6 +3022,11 @@ class binance(Exchange, ImplicitAPI):
3021
3022
  """
3022
3023
  promisesRaw = []
3023
3024
  rawFetchMarkets = self.safe_list(self.options, 'fetchMarkets', ['spot', 'linear', 'inverse'])
3025
+ # handle loadAllOptions option
3026
+ loadAllOptions = self.safe_bool(self.options, 'loadAllOptions', False)
3027
+ if loadAllOptions:
3028
+ if not self.in_array('option', rawFetchMarkets):
3029
+ rawFetchMarkets.append('option')
3024
3030
  sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
3025
3031
  fetchMarkets = []
3026
3032
  for i in range(0, len(rawFetchMarkets)):
@@ -723,7 +723,7 @@ class bingx(Exchange, ImplicitAPI):
723
723
  #
724
724
  # {
725
725
  # "code": 0,
726
- # "timestamp": 1702623271477,
726
+ # "timestamp": 1702623271476,
727
727
  # "data": [
728
728
  # {
729
729
  # "coin": "BTC",
@@ -767,57 +767,42 @@ class bingx(Exchange, ImplicitAPI):
767
767
  name = self.safe_string(entry, 'name')
768
768
  networkList = self.safe_list(entry, 'networkList')
769
769
  networks: dict = {}
770
- fee = None
771
- depositEnabled = False
772
- withdrawEnabled = False
773
- defaultLimits: dict = {}
774
770
  for j in range(0, len(networkList)):
775
771
  rawNetwork = networkList[j]
776
772
  network = self.safe_string(rawNetwork, 'network')
777
773
  networkCode = self.network_id_to_code(network)
778
- isDefault = self.safe_bool(rawNetwork, 'isDefault')
779
- networkDepositEnabled = self.safe_bool(rawNetwork, 'depositEnable')
780
- if networkDepositEnabled:
781
- depositEnabled = True
782
- networkWithdrawEnabled = self.safe_bool(rawNetwork, 'withdrawEnable')
783
- if networkWithdrawEnabled:
784
- withdrawEnabled = True
785
774
  limits: dict = {
786
775
  'withdraw': {
787
776
  'min': self.safe_number(rawNetwork, 'withdrawMin'),
788
777
  'max': self.safe_number(rawNetwork, 'withdrawMax'),
789
778
  },
790
779
  }
791
- fee = self.safe_number(rawNetwork, 'withdrawFee')
792
- if isDefault:
793
- defaultLimits = limits
794
- precision = self.safe_number(rawNetwork, 'withdrawPrecision')
795
- networkActive = networkDepositEnabled or networkWithdrawEnabled
780
+ precision = self.parse_number(self.parse_precision(self.safe_string(rawNetwork, 'withdrawPrecision')))
796
781
  networks[networkCode] = {
797
782
  'info': rawNetwork,
798
783
  'id': network,
799
784
  'network': networkCode,
800
- 'fee': fee,
801
- 'active': networkActive,
802
- 'deposit': networkDepositEnabled,
803
- 'withdraw': networkWithdrawEnabled,
785
+ 'fee': self.safe_number(rawNetwork, 'withdrawFee'),
786
+ 'active': None,
787
+ 'deposit': self.safe_bool(rawNetwork, 'depositEnable'),
788
+ 'withdraw': self.safe_bool(rawNetwork, 'withdrawEnable'),
804
789
  'precision': precision,
805
790
  'limits': limits,
806
791
  }
807
- active = depositEnabled or withdrawEnabled
808
- result[code] = {
792
+ result[code] = self.safe_currency_structure({
809
793
  'info': entry,
810
794
  'code': code,
811
795
  'id': currencyId,
812
796
  'precision': None,
813
797
  'name': name,
814
- 'active': active,
815
- 'deposit': depositEnabled,
816
- 'withdraw': withdrawEnabled,
798
+ 'active': None,
799
+ 'deposit': None,
800
+ 'withdraw': None,
817
801
  'networks': networks,
818
- 'fee': fee,
819
- 'limits': defaultLimits,
820
- }
802
+ 'fee': None,
803
+ 'limits': None,
804
+ 'type': 'crypto', # only cryptos now
805
+ })
821
806
  return result
822
807
 
823
808
  async def fetch_spot_markets(self, params) -> List[Market]:
@@ -5536,18 +5521,14 @@ class bingx(Exchange, ImplicitAPI):
5536
5521
  :param str address: the address to withdraw to
5537
5522
  :param str [tag]:
5538
5523
  :param dict [params]: extra parameters specific to the exchange API endpoint
5539
- :param int [params.walletType]: 1 fund account, 2 standard account, 3 perpetual account
5524
+ :param int [params.walletType]: 1 fund account, 2 standard account, 3 perpetual account, 15 spot account
5540
5525
  :returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
5541
5526
  """
5542
5527
  tag, params = self.handle_withdraw_tag_and_params(tag, params)
5543
5528
  self.check_address(address)
5544
5529
  await self.load_markets()
5545
5530
  currency = self.currency(code)
5546
- walletType = self.safe_integer(params, 'walletType')
5547
- if walletType is None:
5548
- walletType = 1
5549
- if not self.in_array(walletType, [1, 2, 3]):
5550
- raise BadRequest(self.id + ' withdraw() requires either 1 fund account, 2 standard futures account, 3 perpetual account for walletType')
5531
+ walletType = self.safe_integer(params, 'walletType', 1)
5551
5532
  request: dict = {
5552
5533
  'coin': currency['id'],
5553
5534
  'address': address,