ccxt 4.4.78__py2.py3-none-any.whl → 4.4.80__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 (83) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bitmart.py +1 -0
  3. ccxt/apex.py +2 -2
  4. ccxt/ascendex.py +22 -5
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/apex.py +2 -2
  7. ccxt/async_support/ascendex.py +22 -5
  8. ccxt/async_support/base/exchange.py +5 -1
  9. ccxt/async_support/binance.py +6 -0
  10. ccxt/async_support/bingx.py +3 -3
  11. ccxt/async_support/bitfinex.py +59 -34
  12. ccxt/async_support/bitget.py +52 -64
  13. ccxt/async_support/bitmart.py +7 -2
  14. ccxt/async_support/bitmex.py +8 -1
  15. ccxt/async_support/bitopro.py +5 -1
  16. ccxt/async_support/bitrue.py +2 -1
  17. ccxt/async_support/bitso.py +1 -1
  18. ccxt/async_support/bitteam.py +2 -0
  19. ccxt/async_support/bitvavo.py +25 -10
  20. ccxt/async_support/btcalpha.py +1 -1
  21. ccxt/async_support/btcmarkets.py +1 -1
  22. ccxt/async_support/btcturk.py +1 -1
  23. ccxt/async_support/bybit.py +27 -15
  24. ccxt/async_support/coinbase.py +3 -15
  25. ccxt/async_support/coinex.py +1 -0
  26. ccxt/async_support/coinlist.py +1 -0
  27. ccxt/async_support/coinone.py +1 -0
  28. ccxt/async_support/delta.py +3 -0
  29. ccxt/async_support/deribit.py +1 -0
  30. ccxt/async_support/hollaex.py +1 -0
  31. ccxt/async_support/htx.py +7 -3
  32. ccxt/async_support/huobijp.py +1 -0
  33. ccxt/async_support/hyperliquid.py +1 -0
  34. ccxt/async_support/kraken.py +2 -0
  35. ccxt/async_support/okx.py +1 -1
  36. ccxt/async_support/poloniex.py +1 -0
  37. ccxt/async_support/timex.py +2 -2
  38. ccxt/async_support/upbit.py +43 -21
  39. ccxt/async_support/whitebit.py +65 -12
  40. ccxt/base/errors.py +0 -6
  41. ccxt/base/exchange.py +1 -1
  42. ccxt/binance.py +6 -0
  43. ccxt/bingx.py +3 -3
  44. ccxt/bitfinex.py +59 -34
  45. ccxt/bitget.py +52 -64
  46. ccxt/bitmart.py +7 -2
  47. ccxt/bitmex.py +8 -1
  48. ccxt/bitopro.py +5 -1
  49. ccxt/bitrue.py +2 -1
  50. ccxt/bitso.py +1 -1
  51. ccxt/bitteam.py +2 -0
  52. ccxt/bitvavo.py +25 -10
  53. ccxt/btcalpha.py +1 -1
  54. ccxt/btcmarkets.py +1 -1
  55. ccxt/btcturk.py +1 -1
  56. ccxt/bybit.py +27 -15
  57. ccxt/coinbase.py +3 -15
  58. ccxt/coinex.py +1 -0
  59. ccxt/coinlist.py +1 -0
  60. ccxt/coinone.py +1 -0
  61. ccxt/delta.py +3 -0
  62. ccxt/deribit.py +1 -0
  63. ccxt/hollaex.py +1 -0
  64. ccxt/htx.py +7 -3
  65. ccxt/huobijp.py +1 -0
  66. ccxt/hyperliquid.py +1 -0
  67. ccxt/kraken.py +2 -0
  68. ccxt/okx.py +1 -1
  69. ccxt/poloniex.py +1 -0
  70. ccxt/pro/__init__.py +1 -1
  71. ccxt/pro/binance.py +3 -3
  72. ccxt/pro/coinbase.py +40 -52
  73. ccxt/pro/upbit.py +42 -0
  74. ccxt/test/tests_async.py +0 -1
  75. ccxt/test/tests_sync.py +0 -1
  76. ccxt/timex.py +2 -2
  77. ccxt/upbit.py +43 -21
  78. ccxt/whitebit.py +65 -12
  79. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/METADATA +9 -11
  80. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/RECORD +83 -83
  81. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/LICENSE.txt +0 -0
  82. {ccxt-4.4.78.dist-info → ccxt-4.4.80.dist-info}/WHEEL +0 -0
  83. {ccxt-4.4.78.dist-info → ccxt-4.4.80.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.80'
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
@@ -827,7 +827,7 @@ class apex(Exchange, ImplicitAPI):
827
827
 
828
828
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
829
829
  #
830
- # {
830
+ # {
831
831
  # "start": 1647511440000,
832
832
  # "symbol": "BTC-USD",
833
833
  # "interval": "1",
@@ -837,7 +837,7 @@ class apex(Exchange, ImplicitAPI):
837
837
  # "close": "40000",
838
838
  # "volume": "1.002",
839
839
  # "turnover": "3"
840
- # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
840
+ # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
841
841
  #
842
842
  return [
843
843
  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': {
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.78'
7
+ __version__ = '4.4.80'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -827,7 +827,7 @@ class apex(Exchange, ImplicitAPI):
827
827
 
828
828
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
829
829
  #
830
- # {
830
+ # {
831
831
  # "start": 1647511440000,
832
832
  # "symbol": "BTC-USD",
833
833
  # "interval": "1",
@@ -837,7 +837,7 @@ class apex(Exchange, ImplicitAPI):
837
837
  # "close": "40000",
838
838
  # "volume": "1.002",
839
839
  # "turnover": "3"
840
- # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
840
+ # } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
841
841
  #
842
842
  return [
843
843
  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': {
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.78'
5
+ __version__ = '4.4.80'
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
@@ -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",
@@ -805,7 +805,7 @@ class bingx(Exchange, ImplicitAPI):
805
805
  'limits': limits,
806
806
  }
807
807
  active = depositEnabled or withdrawEnabled
808
- result[code] = {
808
+ result[code] = self.safe_currency_structure({
809
809
  'info': entry,
810
810
  'code': code,
811
811
  'id': currencyId,
@@ -817,7 +817,7 @@ class bingx(Exchange, ImplicitAPI):
817
817
  'networks': networks,
818
818
  'fee': fee,
819
819
  'limits': defaultLimits,
820
- }
820
+ })
821
821
  return result
822
822
 
823
823
  async def fetch_spot_markets(self, params) -> List[Market]:
@@ -1151,9 +1151,8 @@ class bitfinex(Exchange, ImplicitAPI):
1151
1151
  #
1152
1152
  # on trading pairs(ex. tBTCUSD)
1153
1153
  #
1154
- # {
1155
- # 'result': [
1156
- # SYMBOL,
1154
+ # [
1155
+ # SYMBOL, # self index is not present in singular-ticker
1157
1156
  # BID,
1158
1157
  # BID_SIZE,
1159
1158
  # ASK,
@@ -1164,15 +1163,13 @@ class bitfinex(Exchange, ImplicitAPI):
1164
1163
  # VOLUME,
1165
1164
  # HIGH,
1166
1165
  # LOW
1167
- # ]
1168
- # }
1166
+ # ]
1169
1167
  #
1170
1168
  #
1171
1169
  # on funding currencies(ex. fUSD)
1172
1170
  #
1173
- # {
1174
- # 'result': [
1175
- # SYMBOL,
1171
+ # [
1172
+ # SYMBOL, # self index is not present in singular-ticker
1176
1173
  # FRR,
1177
1174
  # BID,
1178
1175
  # BID_PERIOD,
@@ -1189,35 +1186,71 @@ class bitfinex(Exchange, ImplicitAPI):
1189
1186
  # _PLACEHOLDER,
1190
1187
  # _PLACEHOLDER,
1191
1188
  # FRR_AMOUNT_AVAILABLE
1192
- # ]
1193
- # }
1189
+ # ]
1194
1190
  #
1195
- result = self.safe_list(ticker, 'result')
1191
+ length = len(ticker)
1192
+ isFetchTicker = (length == 10) or (length == 16)
1193
+ symbol: Str = None
1194
+ minusIndex = 0
1195
+ isFundingCurrency = False
1196
+ if isFetchTicker:
1197
+ minusIndex = 1
1198
+ isFundingCurrency = (length == 16)
1199
+ else:
1200
+ marketId = self.safe_string(ticker, 0)
1201
+ market = self.safe_market(marketId, market)
1202
+ isFundingCurrency = (length == 17)
1196
1203
  symbol = self.safe_symbol(None, market)
1197
- length = len(result)
1198
- last = self.safe_string(result, length - 4)
1199
- percentage = self.safe_string(result, length - 5)
1204
+ last: Str = None
1205
+ bid: Str = None
1206
+ ask: Str = None
1207
+ change: Str = None
1208
+ percentage: Str = None
1209
+ volume: Str = None
1210
+ high: Str = None
1211
+ low: Str = None
1212
+ if isFundingCurrency:
1213
+ # per api docs, they are different array type
1214
+ last = self.safe_string(ticker, 10 - minusIndex)
1215
+ bid = self.safe_string(ticker, 2 - minusIndex)
1216
+ ask = self.safe_string(ticker, 5 - minusIndex)
1217
+ change = self.safe_string(ticker, 8 - minusIndex)
1218
+ percentage = self.safe_string(ticker, 9 - minusIndex)
1219
+ volume = self.safe_string(ticker, 11 - minusIndex)
1220
+ high = self.safe_string(ticker, 12 - minusIndex)
1221
+ low = self.safe_string(ticker, 13 - minusIndex)
1222
+ else:
1223
+ # on trading pairs(ex. tBTCUSD or tHMSTR:USD)
1224
+ last = self.safe_string(ticker, 7 - minusIndex)
1225
+ bid = self.safe_string(ticker, 1 - minusIndex)
1226
+ ask = self.safe_string(ticker, 3 - minusIndex)
1227
+ change = self.safe_string(ticker, 5 - minusIndex)
1228
+ percentage = self.safe_string(ticker, 6 - minusIndex)
1229
+ percentage = Precise.string_mul(percentage, '100')
1230
+ volume = self.safe_string(ticker, 8 - minusIndex)
1231
+ high = self.safe_string(ticker, 9 - minusIndex)
1232
+ low = self.safe_string(ticker, 10 - minusIndex)
1200
1233
  return self.safe_ticker({
1201
1234
  'symbol': symbol,
1202
1235
  'timestamp': None,
1203
1236
  'datetime': None,
1204
- 'high': self.safe_string(result, length - 2),
1205
- 'low': self.safe_string(result, length - 1),
1206
- 'bid': self.safe_string(result, length - 10),
1207
- 'bidVolume': self.safe_string(result, length - 9),
1208
- 'ask': self.safe_string(result, length - 8),
1209
- 'askVolume': self.safe_string(result, length - 7),
1237
+ 'high': high,
1238
+ 'low': low,
1239
+ 'bid': bid,
1240
+ 'bidVolume': None,
1241
+ 'ask': ask,
1242
+ 'askVolume': None,
1210
1243
  'vwap': None,
1211
1244
  'open': None,
1212
1245
  'close': last,
1213
1246
  'last': last,
1214
1247
  'previousClose': None,
1215
- 'change': self.safe_string(result, length - 6),
1216
- 'percentage': Precise.string_mul(percentage, '100'),
1248
+ 'change': change,
1249
+ 'percentage': percentage,
1217
1250
  'average': None,
1218
- 'baseVolume': self.safe_string(result, length - 3),
1251
+ 'baseVolume': volume,
1219
1252
  'quoteVolume': None,
1220
- 'info': result,
1253
+ 'info': ticker,
1221
1254
  }, market)
1222
1255
 
1223
1256
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1278,14 +1311,7 @@ class bitfinex(Exchange, ImplicitAPI):
1278
1311
  # ...
1279
1312
  # ]
1280
1313
  #
1281
- result: dict = {}
1282
- for i in range(0, len(tickers)):
1283
- ticker = tickers[i]
1284
- marketId = self.safe_string(ticker, 0)
1285
- market = self.safe_market(marketId)
1286
- symbol = market['symbol']
1287
- result[symbol] = self.parse_ticker({'result': ticker}, market)
1288
- return self.filter_by_array_tickers(result, 'symbol', symbols)
1314
+ return self.parse_tickers(tickers, symbols)
1289
1315
 
1290
1316
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
1291
1317
  """
@@ -1303,8 +1329,7 @@ class bitfinex(Exchange, ImplicitAPI):
1303
1329
  'symbol': market['id'],
1304
1330
  }
1305
1331
  ticker = await self.publicGetTickerSymbol(self.extend(request, params))
1306
- result: dict = {'result': ticker}
1307
- return self.parse_ticker(result, market)
1332
+ return self.parse_ticker(ticker, market)
1308
1333
 
1309
1334
  def parse_trade(self, trade: dict, market: Market = None) -> Trade:
1310
1335
  #
@@ -1567,6 +1567,8 @@ class bitget(Exchange, ImplicitAPI):
1567
1567
  'method': 'privateMixGetV2MixPositionAllPosition', # or privateMixGetV2MixPositionHistoryPosition
1568
1568
  },
1569
1569
  'defaultTimeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
1570
+ # fiat currencies on deposit page
1571
+ 'fiatCurrencies': ['EUR', 'VND', 'PLN', 'CZK', 'HUF', 'DKK', 'AUD', 'CAD', 'NOK', 'SEK', 'CHF', 'MXN', 'COP', 'ARS', 'GBP', 'BRL', 'UAH', 'ZAR'],
1570
1572
  },
1571
1573
  'features': {
1572
1574
  'spot': {
@@ -2025,99 +2027,85 @@ class bitget(Exchange, ImplicitAPI):
2025
2027
  """
2026
2028
  response = await self.publicSpotGetV2SpotPublicCoins(params)
2027
2029
  #
2028
- # {
2029
- # "code": "00000",
2030
- # "data": [
2031
- # {
2032
- # "chains": [
2033
- # {
2034
- # "browserUrl": "https://blockchair.com/bitcoin/transaction/",
2035
- # "chain": "BTC",
2036
- # "depositConfirm": "1",
2037
- # "extraWithdrawFee": "0",
2038
- # "minDepositAmount": "0.0001",
2039
- # "minWithdrawAmount": "0.005",
2040
- # "needTag": "false",
2041
- # "rechargeable": "true",
2042
- # "withdrawConfirm": "1",
2043
- # "withdrawFee": "0.0004",
2044
- # "withdrawable": "true"
2045
- # },
2046
- # ],
2047
- # "coin": "BTC",
2048
- # "coinId": "1",
2049
- # "transfer": "true""
2050
- # }
2051
- # ],
2052
- # "msg": "success",
2053
- # "requestTime": "1700120731773"
2054
- # }
2030
+ # {
2031
+ # "code": "00000",
2032
+ # "msg": "success",
2033
+ # "requestTime": "1746195617812",
2034
+ # "data": [
2035
+ # {
2036
+ # "coinId": "1456",
2037
+ # "coin": "NEIROETH",
2038
+ # "transfer": "false",
2039
+ # "chains": [
2040
+ # {
2041
+ # "chain": "ERC20",
2042
+ # "needTag": "false",
2043
+ # "withdrawable": "true",
2044
+ # "rechargeable": "true",
2045
+ # "withdrawFee": "44.91017965",
2046
+ # "extraWithdrawFee": "0",
2047
+ # "depositConfirm": "12",
2048
+ # "withdrawConfirm": "64",
2049
+ # "minDepositAmount": "0.06",
2050
+ # "minWithdrawAmount": "60",
2051
+ # "browserUrl": "https://etherscan.io/tx/",
2052
+ # "contractAddress": "0xee2a03aa6dacf51c18679c516ad5283d8e7c2637",
2053
+ # "withdrawStep": "0",
2054
+ # "withdrawMinScale": "8",
2055
+ # "congestion": "normal"
2056
+ # }
2057
+ # ],
2058
+ # "areaCoin": "no"
2059
+ # },
2060
+ # ...
2055
2061
  #
2056
2062
  result: dict = {}
2057
2063
  data = self.safe_value(response, 'data', [])
2064
+ fiatCurrencies = self.safe_list(self.options, 'fiatCurrencies', [])
2058
2065
  for i in range(0, len(data)):
2059
2066
  entry = data[i]
2060
2067
  id = self.safe_string(entry, 'coin') # we don't use 'coinId' has no use. it is 'coin' field that needs to be used in currency related endpoints(deposit, withdraw, etc..)
2061
2068
  code = self.safe_currency_code(id)
2062
2069
  chains = self.safe_value(entry, 'chains', [])
2063
2070
  networks: dict = {}
2064
- deposit = False
2065
- withdraw = False
2066
- minWithdrawString = None
2067
- minDepositString = None
2068
- minWithdrawFeeString = None
2069
2071
  for j in range(0, len(chains)):
2070
2072
  chain = chains[j]
2071
2073
  networkId = self.safe_string(chain, 'chain')
2072
2074
  network = self.network_id_to_code(networkId, code)
2073
2075
  if network is not None:
2074
2076
  network = network.upper()
2075
- withdrawEnabled = self.safe_string(chain, 'withdrawable')
2076
- canWithdraw = withdrawEnabled == 'true'
2077
- withdraw = canWithdraw if (canWithdraw) else withdraw
2078
- depositEnabled = self.safe_string(chain, 'rechargeable')
2079
- canDeposit = depositEnabled == 'true'
2080
- deposit = canDeposit if (canDeposit) else deposit
2081
- networkWithdrawFeeString = self.safe_string(chain, 'withdrawFee')
2082
- if networkWithdrawFeeString is not None:
2083
- minWithdrawFeeString = networkWithdrawFeeString if (minWithdrawFeeString is None) else Precise.string_min(networkWithdrawFeeString, minWithdrawFeeString)
2084
- networkMinWithdrawString = self.safe_string(chain, 'minWithdrawAmount')
2085
- if networkMinWithdrawString is not None:
2086
- minWithdrawString = networkMinWithdrawString if (minWithdrawString is None) else Precise.string_min(networkMinWithdrawString, minWithdrawString)
2087
- networkMinDepositString = self.safe_string(chain, 'minDepositAmount')
2088
- if networkMinDepositString is not None:
2089
- minDepositString = networkMinDepositString if (minDepositString is None) else Precise.string_min(networkMinDepositString, minDepositString)
2090
2077
  networks[network] = {
2091
2078
  'info': chain,
2092
2079
  'id': networkId,
2093
2080
  'network': network,
2094
2081
  'limits': {
2095
2082
  'withdraw': {
2096
- 'min': self.parse_number(networkMinWithdrawString),
2083
+ 'min': self.safe_number(chain, 'minWithdrawAmount'),
2097
2084
  'max': None,
2098
2085
  },
2099
2086
  'deposit': {
2100
- 'min': self.parse_number(networkMinDepositString),
2087
+ 'min': self.safe_number(chain, 'minDepositAmount'),
2101
2088
  'max': None,
2102
2089
  },
2103
2090
  },
2104
- 'active': canWithdraw and canDeposit,
2105
- 'withdraw': canWithdraw,
2106
- 'deposit': canDeposit,
2107
- 'fee': self.parse_number(networkWithdrawFeeString),
2108
- 'precision': None,
2091
+ 'active': None,
2092
+ 'withdraw': self.safe_string(chain, 'withdrawable') == 'true',
2093
+ 'deposit': self.safe_string(chain, 'rechargeable') == 'true',
2094
+ 'fee': self.safe_number(chain, 'withdrawFee'),
2095
+ 'precision': self.parse_number(self.parse_precision(self.safe_string(chain, 'withdrawMinScale'))),
2109
2096
  }
2110
- result[code] = {
2097
+ isFiat = self.in_array(code, fiatCurrencies)
2098
+ result[code] = self.safe_currency_structure({
2111
2099
  'info': entry,
2112
2100
  'id': id,
2113
2101
  'code': code,
2114
2102
  'networks': networks,
2115
- 'type': None,
2103
+ 'type': 'fiat' if isFiat else 'crypto',
2116
2104
  'name': None,
2117
- 'active': deposit and withdraw,
2118
- 'deposit': deposit,
2119
- 'withdraw': withdraw,
2120
- 'fee': self.parse_number(minWithdrawFeeString),
2105
+ 'active': None,
2106
+ 'deposit': None,
2107
+ 'withdraw': None,
2108
+ 'fee': None,
2121
2109
  'precision': None,
2122
2110
  'limits': {
2123
2111
  'amount': {
@@ -2125,16 +2113,16 @@ class bitget(Exchange, ImplicitAPI):
2125
2113
  'max': None,
2126
2114
  },
2127
2115
  'withdraw': {
2128
- 'min': self.parse_number(minWithdrawString),
2116
+ 'min': None,
2129
2117
  'max': None,
2130
2118
  },
2131
2119
  'deposit': {
2132
- 'min': self.parse_number(minDepositString),
2120
+ 'min': None,
2133
2121
  'max': None,
2134
2122
  },
2135
2123
  },
2136
2124
  'created': None,
2137
- }
2125
+ })
2138
2126
  return result
2139
2127
 
2140
2128
  async def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
@@ -2753,7 +2741,7 @@ class bitget(Exchange, ImplicitAPI):
2753
2741
  close = self.safe_string(ticker, 'lastPr')
2754
2742
  timestamp = self.safe_integer_omit_zero(ticker, 'ts') # exchange bitget provided 0
2755
2743
  change = self.safe_string(ticker, 'change24h')
2756
- open24 = self.safe_string(ticker, 'open24')
2744
+ open24 = self.safe_string_2(ticker, 'open24', 'open24h')
2757
2745
  open = self.safe_string(ticker, 'open')
2758
2746
  symbol: str
2759
2747
  openValue: str