ccxt 4.4.77__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 (133) hide show
  1. ccxt/__init__.py +3 -3
  2. ccxt/abstract/apex.py +31 -0
  3. ccxt/abstract/bitmart.py +1 -0
  4. ccxt/apex.py +1884 -0
  5. ccxt/ascendex.py +23 -6
  6. ccxt/async_support/__init__.py +3 -3
  7. ccxt/async_support/apex.py +1884 -0
  8. ccxt/async_support/ascendex.py +23 -6
  9. ccxt/async_support/base/exchange.py +5 -1
  10. ccxt/async_support/binance.py +9 -3
  11. ccxt/async_support/bingx.py +4 -4
  12. ccxt/async_support/bitfinex.py +61 -36
  13. ccxt/async_support/bitflyer.py +2 -2
  14. ccxt/async_support/bitget.py +186 -128
  15. ccxt/async_support/bitmart.py +9 -4
  16. ccxt/async_support/bitmex.py +14 -7
  17. ccxt/async_support/bitopro.py +5 -1
  18. ccxt/async_support/bitrue.py +2 -1
  19. ccxt/async_support/bitso.py +1 -1
  20. ccxt/async_support/bitteam.py +2 -0
  21. ccxt/async_support/bitvavo.py +25 -10
  22. ccxt/async_support/btcalpha.py +1 -1
  23. ccxt/async_support/btcmarkets.py +1 -1
  24. ccxt/async_support/btcturk.py +1 -1
  25. ccxt/async_support/bybit.py +27 -15
  26. ccxt/async_support/cex.py +1 -1
  27. ccxt/async_support/coinbase.py +17 -4
  28. ccxt/async_support/coincatch.py +66 -0
  29. ccxt/async_support/coinex.py +2 -1
  30. ccxt/async_support/coinlist.py +1 -0
  31. ccxt/async_support/coinone.py +1 -0
  32. ccxt/async_support/cryptocom.py +2 -2
  33. ccxt/async_support/defx.py +1 -1
  34. ccxt/async_support/delta.py +4 -1
  35. ccxt/async_support/deribit.py +3 -2
  36. ccxt/async_support/derive.py +2 -2
  37. ccxt/async_support/digifinex.py +2 -2
  38. ccxt/async_support/gate.py +1 -1
  39. ccxt/async_support/hitbtc.py +5 -2
  40. ccxt/async_support/hollaex.py +1 -0
  41. ccxt/async_support/htx.py +9 -5
  42. ccxt/async_support/huobijp.py +1 -0
  43. ccxt/async_support/hyperliquid.py +14 -6
  44. ccxt/async_support/kraken.py +4 -2
  45. ccxt/async_support/krakenfutures.py +2 -2
  46. ccxt/async_support/kucoinfutures.py +2 -2
  47. ccxt/async_support/mexc.py +50 -52
  48. ccxt/async_support/okx.py +2 -2
  49. ccxt/async_support/oxfun.py +2 -2
  50. ccxt/async_support/paradex.py +2 -2
  51. ccxt/async_support/phemex.py +4 -3
  52. ccxt/async_support/poloniex.py +4 -3
  53. ccxt/async_support/probit.py +1 -0
  54. ccxt/async_support/timex.py +2 -2
  55. ccxt/async_support/tradeogre.py +2 -1
  56. ccxt/async_support/upbit.py +243 -63
  57. ccxt/async_support/vertex.py +2 -2
  58. ccxt/async_support/whitebit.py +66 -12
  59. ccxt/async_support/woo.py +5 -3
  60. ccxt/async_support/woofipro.py +2 -2
  61. ccxt/async_support/xt.py +9 -2
  62. ccxt/base/exchange.py +69 -2
  63. ccxt/binance.py +9 -3
  64. ccxt/bingx.py +4 -4
  65. ccxt/bitfinex.py +61 -36
  66. ccxt/bitflyer.py +2 -2
  67. ccxt/bitget.py +186 -128
  68. ccxt/bitmart.py +9 -4
  69. ccxt/bitmex.py +14 -7
  70. ccxt/bitopro.py +5 -1
  71. ccxt/bitrue.py +2 -1
  72. ccxt/bitso.py +1 -1
  73. ccxt/bitteam.py +2 -0
  74. ccxt/bitvavo.py +25 -10
  75. ccxt/btcalpha.py +1 -1
  76. ccxt/btcmarkets.py +1 -1
  77. ccxt/btcturk.py +1 -1
  78. ccxt/bybit.py +27 -15
  79. ccxt/cex.py +1 -1
  80. ccxt/coinbase.py +17 -4
  81. ccxt/coincatch.py +66 -0
  82. ccxt/coinex.py +2 -1
  83. ccxt/coinlist.py +1 -0
  84. ccxt/coinone.py +1 -0
  85. ccxt/cryptocom.py +2 -2
  86. ccxt/defx.py +1 -1
  87. ccxt/delta.py +4 -1
  88. ccxt/deribit.py +3 -2
  89. ccxt/derive.py +2 -2
  90. ccxt/digifinex.py +2 -2
  91. ccxt/gate.py +1 -1
  92. ccxt/hitbtc.py +5 -2
  93. ccxt/hollaex.py +1 -0
  94. ccxt/htx.py +9 -5
  95. ccxt/huobijp.py +1 -0
  96. ccxt/hyperliquid.py +14 -6
  97. ccxt/kraken.py +4 -2
  98. ccxt/krakenfutures.py +2 -2
  99. ccxt/kucoinfutures.py +2 -2
  100. ccxt/mexc.py +50 -52
  101. ccxt/okx.py +2 -2
  102. ccxt/oxfun.py +2 -2
  103. ccxt/paradex.py +2 -2
  104. ccxt/phemex.py +4 -3
  105. ccxt/poloniex.py +4 -3
  106. ccxt/pro/__init__.py +5 -1
  107. ccxt/pro/apex.py +984 -0
  108. ccxt/pro/binance.py +3 -3
  109. ccxt/pro/coinbase.py +43 -57
  110. ccxt/pro/gate.py +22 -2
  111. ccxt/pro/hollaex.py +2 -2
  112. ccxt/pro/p2b.py +2 -2
  113. ccxt/pro/tradeogre.py +272 -0
  114. ccxt/pro/upbit.py +42 -0
  115. ccxt/probit.py +1 -0
  116. ccxt/test/tests_async.py +4 -1
  117. ccxt/test/tests_sync.py +4 -1
  118. ccxt/timex.py +2 -2
  119. ccxt/tradeogre.py +2 -1
  120. ccxt/upbit.py +243 -63
  121. ccxt/vertex.py +2 -2
  122. ccxt/whitebit.py +66 -12
  123. ccxt/woo.py +5 -3
  124. ccxt/woofipro.py +2 -2
  125. ccxt/xt.py +9 -2
  126. {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/METADATA +9 -11
  127. {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/RECORD +130 -128
  128. ccxt/abstract/ace.py +0 -15
  129. ccxt/ace.py +0 -1152
  130. ccxt/async_support/ace.py +0 -1152
  131. {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/LICENSE.txt +0 -0
  132. {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/WHEEL +0 -0
  133. {ccxt-4.4.77.dist-info → ccxt-4.4.80.dist-info}/top_level.txt +0 -0
@@ -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, 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': {
@@ -2633,7 +2650,7 @@ class ascendex(Exchange, ImplicitAPI):
2633
2650
  'internal': False,
2634
2651
  }
2635
2652
 
2636
- async def fetch_positions(self, symbols: Strings = None, params={}):
2653
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2637
2654
  """
2638
2655
  fetch all open positions
2639
2656
  :param str[]|None symbols: list of unified market symbols
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.77'
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
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import json
11
- from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
11
+ from ccxt.base.types import Any, Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, LongShortRatio, MarginMode, MarginModes, MarginModification, Market, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, MarketInterface, TransferEntry
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
14
14
  from ccxt.base.errors import AuthenticationError
@@ -44,7 +44,7 @@ class binance(Exchange, ImplicitAPI):
44
44
  return self.deep_extend(super(binance, self).describe(), {
45
45
  'id': 'binance',
46
46
  'name': 'Binance',
47
- 'countries': ['JP', 'MT'], # Japan, Malta
47
+ 'countries': [], # Japan
48
48
  'rateLimit': 50,
49
49
  'certified': True,
50
50
  'pro': True,
@@ -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)):
@@ -10111,7 +10117,7 @@ class binance(Exchange, ImplicitAPI):
10111
10117
  'percentage': None,
10112
10118
  })
10113
10119
 
10114
- async def fetch_positions(self, symbols: Strings = None, params={}):
10120
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
10115
10121
  """
10116
10122
  fetch all open positions
10117
10123
 
@@ -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]:
@@ -2372,7 +2372,7 @@ class bingx(Exchange, ImplicitAPI):
2372
2372
  positions = self.parse_positions(records)
2373
2373
  return self.filter_by_symbol_since_limit(positions, symbol, since, limit)
2374
2374
 
2375
- async def fetch_positions(self, symbols: Strings = None, params={}):
2375
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2376
2376
  """
2377
2377
  fetch all open positions
2378
2378
 
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitfinex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Any, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, 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
@@ -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
  #
@@ -2676,7 +2701,7 @@ class bitfinex(Exchange, ImplicitAPI):
2676
2701
  self.throw_broadly_matched_exception(self.exceptions['broad'], text, text)
2677
2702
  return self.parse_transaction(response, currency)
2678
2703
 
2679
- async def fetch_positions(self, symbols: Strings = None, params={}):
2704
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
2680
2705
  """
2681
2706
  fetch all open positions
2682
2707
 
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitflyer import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface
9
+ from ccxt.base.types import Any, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -842,7 +842,7 @@ class bitflyer(Exchange, ImplicitAPI):
842
842
  #
843
843
  return self.parse_trades(response, market, since, limit)
844
844
 
845
- async def fetch_positions(self, symbols: Strings = None, params={}):
845
+ async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
846
846
  """
847
847
  fetch all open positions
848
848