ccxt 4.3.30__py2.py3-none-any.whl → 4.3.32__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 (260) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +2 -0
  3. ccxt/abstract/binancecoinm.py +2 -0
  4. ccxt/abstract/binanceus.py +2 -0
  5. ccxt/abstract/binanceusdm.py +2 -0
  6. ccxt/ace.py +14 -14
  7. ccxt/alpaca.py +16 -16
  8. ccxt/ascendex.py +46 -46
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +14 -14
  11. ccxt/async_support/alpaca.py +16 -16
  12. ccxt/async_support/ascendex.py +46 -46
  13. ccxt/async_support/base/exchange.py +23 -23
  14. ccxt/async_support/bigone.py +32 -32
  15. ccxt/async_support/binance.py +105 -96
  16. ccxt/async_support/bingx.py +21 -21
  17. ccxt/async_support/bit2c.py +13 -13
  18. ccxt/async_support/bitbank.py +19 -19
  19. ccxt/async_support/bitbns.py +17 -17
  20. ccxt/async_support/bitfinex.py +24 -24
  21. ccxt/async_support/bitfinex2.py +142 -109
  22. ccxt/async_support/bitflyer.py +23 -23
  23. ccxt/async_support/bitget.py +76 -76
  24. ccxt/async_support/bithumb.py +20 -20
  25. ccxt/async_support/bitmart.py +55 -55
  26. ccxt/async_support/bitmex.py +41 -41
  27. ccxt/async_support/bitopro.py +30 -30
  28. ccxt/async_support/bitrue.py +37 -37
  29. ccxt/async_support/bitso.py +30 -30
  30. ccxt/async_support/bitstamp.py +31 -31
  31. ccxt/async_support/bitteam.py +26 -26
  32. ccxt/async_support/bitvavo.py +27 -27
  33. ccxt/async_support/bl3p.py +8 -8
  34. ccxt/async_support/blockchaincom.py +24 -24
  35. ccxt/async_support/blofin.py +37 -37
  36. ccxt/async_support/btcalpha.py +19 -19
  37. ccxt/async_support/btcbox.py +11 -11
  38. ccxt/async_support/btcmarkets.py +22 -22
  39. ccxt/async_support/btcturk.py +13 -13
  40. ccxt/async_support/bybit.py +96 -96
  41. ccxt/async_support/cex.py +21 -21
  42. ccxt/async_support/coinbase.py +53 -53
  43. ccxt/async_support/coinbaseexchange.py +29 -29
  44. ccxt/async_support/coinbaseinternational.py +32 -32
  45. ccxt/async_support/coincheck.py +14 -14
  46. ccxt/async_support/coinex.py +208 -175
  47. ccxt/async_support/coinlist.py +35 -35
  48. ccxt/async_support/coinmate.py +22 -22
  49. ccxt/async_support/coinmetro.py +22 -22
  50. ccxt/async_support/coinone.py +18 -18
  51. ccxt/async_support/coinsph.py +32 -32
  52. ccxt/async_support/coinspot.py +8 -8
  53. ccxt/async_support/cryptocom.py +43 -43
  54. ccxt/async_support/currencycom.py +33 -33
  55. ccxt/async_support/delta.py +35 -35
  56. ccxt/async_support/deribit.py +54 -54
  57. ccxt/async_support/digifinex.py +56 -56
  58. ccxt/async_support/exmo.py +34 -34
  59. ccxt/async_support/gate.py +60 -60
  60. ccxt/async_support/gemini.py +24 -24
  61. ccxt/async_support/hitbtc.py +51 -51
  62. ccxt/async_support/hollaex.py +29 -29
  63. ccxt/async_support/htx.py +73 -73
  64. ccxt/async_support/huobijp.py +30 -30
  65. ccxt/async_support/hyperliquid.py +58 -58
  66. ccxt/async_support/idex.py +33 -33
  67. ccxt/async_support/independentreserve.py +12 -12
  68. ccxt/async_support/indodax.py +21 -21
  69. ccxt/async_support/kraken.py +46 -51
  70. ccxt/async_support/krakenfutures.py +29 -29
  71. ccxt/async_support/kucoin.py +51 -51
  72. ccxt/async_support/kucoinfutures.py +33 -33
  73. ccxt/async_support/kuna.py +27 -27
  74. ccxt/async_support/latoken.py +27 -27
  75. ccxt/async_support/lbank.py +35 -35
  76. ccxt/async_support/luno.py +19 -19
  77. ccxt/async_support/lykke.py +20 -20
  78. ccxt/async_support/mercado.py +17 -17
  79. ccxt/async_support/mexc.py +64 -64
  80. ccxt/async_support/ndax.py +38 -38
  81. ccxt/async_support/novadax.py +26 -26
  82. ccxt/async_support/oceanex.py +21 -21
  83. ccxt/async_support/okcoin.py +35 -35
  84. ccxt/async_support/okx.py +85 -85
  85. ccxt/async_support/onetrading.py +32 -32
  86. ccxt/async_support/p2b.py +14 -14
  87. ccxt/async_support/paymium.py +12 -12
  88. ccxt/async_support/phemex.py +50 -50
  89. ccxt/async_support/poloniex.py +35 -35
  90. ccxt/async_support/poloniexfutures.py +25 -21
  91. ccxt/async_support/probit.py +30 -30
  92. ccxt/async_support/timex.py +22 -22
  93. ccxt/async_support/tokocrypto.py +26 -26
  94. ccxt/async_support/tradeogre.py +12 -12
  95. ccxt/async_support/upbit.py +28 -28
  96. ccxt/async_support/wavesexchange.py +33 -33
  97. ccxt/async_support/wazirx.py +21 -21
  98. ccxt/async_support/whitebit.py +37 -37
  99. ccxt/async_support/woo.py +51 -51
  100. ccxt/async_support/woofipro.py +46 -46
  101. ccxt/async_support/yobit.py +20 -20
  102. ccxt/async_support/zaif.py +12 -12
  103. ccxt/async_support/zonda.py +22 -22
  104. ccxt/base/exchange.py +48 -36
  105. ccxt/base/types.py +13 -0
  106. ccxt/bigone.py +32 -32
  107. ccxt/binance.py +105 -96
  108. ccxt/bingx.py +21 -21
  109. ccxt/bit2c.py +13 -13
  110. ccxt/bitbank.py +19 -19
  111. ccxt/bitbns.py +17 -17
  112. ccxt/bitfinex.py +24 -24
  113. ccxt/bitfinex2.py +142 -109
  114. ccxt/bitflyer.py +23 -23
  115. ccxt/bitget.py +76 -76
  116. ccxt/bithumb.py +20 -20
  117. ccxt/bitmart.py +55 -55
  118. ccxt/bitmex.py +41 -41
  119. ccxt/bitopro.py +30 -30
  120. ccxt/bitrue.py +37 -37
  121. ccxt/bitso.py +30 -30
  122. ccxt/bitstamp.py +31 -31
  123. ccxt/bitteam.py +26 -26
  124. ccxt/bitvavo.py +27 -27
  125. ccxt/bl3p.py +8 -8
  126. ccxt/blockchaincom.py +24 -24
  127. ccxt/blofin.py +37 -37
  128. ccxt/btcalpha.py +19 -19
  129. ccxt/btcbox.py +11 -11
  130. ccxt/btcmarkets.py +22 -22
  131. ccxt/btcturk.py +13 -13
  132. ccxt/bybit.py +96 -96
  133. ccxt/cex.py +21 -21
  134. ccxt/coinbase.py +53 -53
  135. ccxt/coinbaseexchange.py +29 -29
  136. ccxt/coinbaseinternational.py +32 -32
  137. ccxt/coincheck.py +14 -14
  138. ccxt/coinex.py +208 -175
  139. ccxt/coinlist.py +35 -35
  140. ccxt/coinmate.py +22 -22
  141. ccxt/coinmetro.py +22 -22
  142. ccxt/coinone.py +18 -18
  143. ccxt/coinsph.py +32 -32
  144. ccxt/coinspot.py +8 -8
  145. ccxt/cryptocom.py +43 -43
  146. ccxt/currencycom.py +33 -33
  147. ccxt/delta.py +35 -35
  148. ccxt/deribit.py +54 -54
  149. ccxt/digifinex.py +56 -56
  150. ccxt/exmo.py +34 -34
  151. ccxt/gate.py +60 -60
  152. ccxt/gemini.py +24 -24
  153. ccxt/hitbtc.py +51 -51
  154. ccxt/hollaex.py +29 -29
  155. ccxt/htx.py +73 -73
  156. ccxt/huobijp.py +30 -30
  157. ccxt/hyperliquid.py +58 -58
  158. ccxt/idex.py +33 -33
  159. ccxt/independentreserve.py +12 -12
  160. ccxt/indodax.py +21 -21
  161. ccxt/kraken.py +46 -51
  162. ccxt/krakenfutures.py +29 -29
  163. ccxt/kucoin.py +51 -51
  164. ccxt/kucoinfutures.py +33 -33
  165. ccxt/kuna.py +27 -27
  166. ccxt/latoken.py +27 -27
  167. ccxt/lbank.py +35 -35
  168. ccxt/luno.py +19 -19
  169. ccxt/lykke.py +20 -20
  170. ccxt/mercado.py +17 -17
  171. ccxt/mexc.py +64 -64
  172. ccxt/ndax.py +38 -38
  173. ccxt/novadax.py +26 -26
  174. ccxt/oceanex.py +21 -21
  175. ccxt/okcoin.py +35 -35
  176. ccxt/okx.py +85 -85
  177. ccxt/onetrading.py +32 -32
  178. ccxt/p2b.py +14 -14
  179. ccxt/paymium.py +12 -12
  180. ccxt/phemex.py +50 -50
  181. ccxt/poloniex.py +35 -35
  182. ccxt/poloniexfutures.py +25 -21
  183. ccxt/pro/__init__.py +1 -1
  184. ccxt/pro/alpaca.py +8 -8
  185. ccxt/pro/ascendex.py +4 -4
  186. ccxt/pro/binance.py +56 -56
  187. ccxt/pro/bingx.py +5 -5
  188. ccxt/pro/bitfinex.py +6 -6
  189. ccxt/pro/bitfinex2.py +10 -10
  190. ccxt/pro/bitget.py +17 -17
  191. ccxt/pro/bithumb.py +6 -6
  192. ccxt/pro/bitmart.py +8 -8
  193. ccxt/pro/bitmex.py +16 -16
  194. ccxt/pro/bitopro.py +4 -4
  195. ccxt/pro/bitrue.py +8 -8
  196. ccxt/pro/bitstamp.py +5 -5
  197. ccxt/pro/bitvavo.py +14 -14
  198. ccxt/pro/blockchaincom.py +7 -7
  199. ccxt/pro/bybit.py +12 -12
  200. ccxt/pro/cex.py +20 -20
  201. ccxt/pro/coinbase.py +32 -2
  202. ccxt/pro/coinbaseexchange.py +10 -10
  203. ccxt/pro/coinbaseinternational.py +4 -4
  204. ccxt/pro/coincheck.py +2 -2
  205. ccxt/pro/coinex.py +15 -15
  206. ccxt/pro/coinone.py +4 -4
  207. ccxt/pro/cryptocom.py +11 -11
  208. ccxt/pro/currencycom.py +4 -4
  209. ccxt/pro/deribit.py +9 -9
  210. ccxt/pro/exmo.py +9 -9
  211. ccxt/pro/gate.py +12 -12
  212. ccxt/pro/gemini.py +11 -11
  213. ccxt/pro/hitbtc.py +13 -13
  214. ccxt/pro/hollaex.py +6 -6
  215. ccxt/pro/htx.py +15 -15
  216. ccxt/pro/huobijp.py +16 -16
  217. ccxt/pro/hyperliquid.py +9 -9
  218. ccxt/pro/idex.py +12 -12
  219. ccxt/pro/independentreserve.py +2 -2
  220. ccxt/pro/kraken.py +14 -14
  221. ccxt/pro/krakenfutures.py +12 -12
  222. ccxt/pro/kucoin.py +12 -12
  223. ccxt/pro/kucoinfutures.py +16 -16
  224. ccxt/pro/lbank.py +12 -12
  225. ccxt/pro/luno.py +4 -4
  226. ccxt/pro/mexc.py +14 -14
  227. ccxt/pro/ndax.py +12 -12
  228. ccxt/pro/okcoin.py +6 -6
  229. ccxt/pro/okx.py +30 -30
  230. ccxt/pro/onetrading.py +13 -13
  231. ccxt/pro/p2b.py +2 -2
  232. ccxt/pro/phemex.py +9 -9
  233. ccxt/pro/poloniex.py +9 -9
  234. ccxt/pro/poloniexfutures.py +10 -10
  235. ccxt/pro/probit.py +8 -8
  236. ccxt/pro/upbit.py +1 -1
  237. ccxt/pro/wazirx.py +10 -10
  238. ccxt/pro/whitebit.py +8 -8
  239. ccxt/pro/woo.py +14 -14
  240. ccxt/pro/woofipro.py +14 -14
  241. ccxt/probit.py +30 -30
  242. ccxt/test/base/test_shared_methods.py +1 -0
  243. ccxt/test/test_async.py +1 -1
  244. ccxt/test/test_sync.py +1 -1
  245. ccxt/timex.py +22 -22
  246. ccxt/tokocrypto.py +26 -26
  247. ccxt/tradeogre.py +12 -12
  248. ccxt/upbit.py +28 -28
  249. ccxt/wavesexchange.py +33 -33
  250. ccxt/wazirx.py +21 -21
  251. ccxt/whitebit.py +37 -37
  252. ccxt/woo.py +51 -51
  253. ccxt/woofipro.py +46 -46
  254. ccxt/yobit.py +20 -20
  255. ccxt/zaif.py +12 -12
  256. ccxt/zonda.py +22 -22
  257. {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/METADATA +4 -4
  258. {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/RECORD +260 -260
  259. {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/WHEEL +0 -0
  260. {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/top_level.txt +0 -0
ccxt/blofin.py CHANGED
@@ -458,7 +458,7 @@ class blofin(Exchange, ImplicitAPI):
458
458
  """
459
459
  self.load_markets()
460
460
  market = self.market(symbol)
461
- request = {
461
+ request: dict = {
462
462
  'instId': market['id'],
463
463
  }
464
464
  limit = 50 if (limit is None) else limit
@@ -536,7 +536,7 @@ class blofin(Exchange, ImplicitAPI):
536
536
  """
537
537
  self.load_markets()
538
538
  market = self.market(symbol)
539
- request = {
539
+ request: dict = {
540
540
  'instId': market['id'],
541
541
  }
542
542
  response = self.publicGetMarketTickers(self.extend(request, params))
@@ -558,7 +558,7 @@ class blofin(Exchange, ImplicitAPI):
558
558
  tickers = self.safe_list(response, 'data', [])
559
559
  return self.parse_tickers(tickers, symbols)
560
560
 
561
- def parse_trade(self, trade, market: Market = None) -> Trade:
561
+ def parse_trade(self, trade: dict, market: Market = None) -> Trade:
562
562
  #
563
563
  # fetch trades
564
564
  # {
@@ -633,7 +633,7 @@ class blofin(Exchange, ImplicitAPI):
633
633
  if paginate:
634
634
  return self.fetch_paginated_call_cursor('fetchTrades', symbol, since, limit, params, 'tradeId', 'after', None, 100)
635
635
  market = self.market(symbol)
636
- request = {
636
+ request: dict = {
637
637
  'instId': market['id'],
638
638
  }
639
639
  response = None
@@ -690,7 +690,7 @@ class blofin(Exchange, ImplicitAPI):
690
690
  return self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 100)
691
691
  if limit is None:
692
692
  limit = 100 # default 100, max 100
693
- request = {
693
+ request: dict = {
694
694
  'instId': market['id'],
695
695
  'bar': self.safe_string(self.timeframes, timeframe, timeframe),
696
696
  'limit': limit,
@@ -723,7 +723,7 @@ class blofin(Exchange, ImplicitAPI):
723
723
  if paginate:
724
724
  return self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params)
725
725
  market = self.market(symbol)
726
- request = {
726
+ request: dict = {
727
727
  'instId': market['id'],
728
728
  }
729
729
  if since is not None:
@@ -797,7 +797,7 @@ class blofin(Exchange, ImplicitAPI):
797
797
  market = self.market(symbol)
798
798
  if not market['swap']:
799
799
  raise ExchangeError(self.id + ' fetchFundingRate() is only valid for swap markets')
800
- request = {
800
+ request: dict = {
801
801
  'instId': market['id'],
802
802
  }
803
803
  response = self.publicGetMarketFundingRate(self.extend(request, params))
@@ -855,7 +855,7 @@ class blofin(Exchange, ImplicitAPI):
855
855
  # }
856
856
  # }
857
857
  #
858
- result = {'info': response}
858
+ result: dict = {'info': response}
859
859
  data = self.safe_dict(response, 'data', {})
860
860
  timestamp = self.safe_integer(data, 'ts')
861
861
  details = self.safe_list(data, 'details', [])
@@ -894,7 +894,7 @@ class blofin(Exchange, ImplicitAPI):
894
894
  # ]
895
895
  # }
896
896
  #
897
- result = {'info': response}
897
+ result: dict = {'info': response}
898
898
  data = self.safe_list(response, 'data', [])
899
899
  for i in range(0, len(data)):
900
900
  balance = data[i]
@@ -908,7 +908,7 @@ class blofin(Exchange, ImplicitAPI):
908
908
  result[code] = account
909
909
  return self.safe_balance(result)
910
910
 
911
- def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
911
+ def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
912
912
  return {
913
913
  'info': fee,
914
914
  'symbol': self.safe_symbol(None, market),
@@ -931,7 +931,7 @@ class blofin(Exchange, ImplicitAPI):
931
931
  self.load_markets()
932
932
  accountType = self.safe_string_2(params, 'accountType', 'type')
933
933
  params = self.omit(params, ['accountType', 'type'])
934
- request = {
934
+ request: dict = {
935
935
  }
936
936
  response = None
937
937
  if accountType is not None:
@@ -945,7 +945,7 @@ class blofin(Exchange, ImplicitAPI):
945
945
 
946
946
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
947
947
  market = self.market(symbol)
948
- request = {
948
+ request: dict = {
949
949
  'instId': market['id'],
950
950
  'side': side,
951
951
  'orderType': type,
@@ -986,8 +986,8 @@ class blofin(Exchange, ImplicitAPI):
986
986
  request['tpOrderPrice'] = self.price_to_precision(symbol, tpPrice)
987
987
  return self.extend(request, params)
988
988
 
989
- def parse_order_status(self, status):
990
- statuses = {
989
+ def parse_order_status(self, status: Str):
990
+ statuses: dict = {
991
991
  'canceled': 'canceled',
992
992
  'order_failed': 'canceled',
993
993
  'live': 'open',
@@ -997,7 +997,7 @@ class blofin(Exchange, ImplicitAPI):
997
997
  }
998
998
  return self.safe_string(statuses, status, status)
999
999
 
1000
- def parse_order(self, order, market: Market = None) -> Order:
1000
+ def parse_order(self, order: dict, market: Market = None) -> Order:
1001
1001
  #
1002
1002
  # {
1003
1003
  # "orderId": "2075628533",
@@ -1161,7 +1161,7 @@ class blofin(Exchange, ImplicitAPI):
1161
1161
  def create_tpsl_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
1162
1162
  market = self.market(symbol)
1163
1163
  positionSide = self.safe_string(params, 'positionSide', 'net')
1164
- request = {
1164
+ request: dict = {
1165
1165
  'instId': market['id'],
1166
1166
  'side': side,
1167
1167
  'positionSide': positionSide,
@@ -1205,7 +1205,7 @@ class blofin(Exchange, ImplicitAPI):
1205
1205
  raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
1206
1206
  self.load_markets()
1207
1207
  market = self.market(symbol)
1208
- request = {
1208
+ request: dict = {
1209
1209
  'instId': market['id'],
1210
1210
  }
1211
1211
  isTrigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl'], False)
@@ -1269,7 +1269,7 @@ class blofin(Exchange, ImplicitAPI):
1269
1269
  paginate, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'paginate')
1270
1270
  if paginate:
1271
1271
  return self.fetch_paginated_call_dynamic('fetchOpenOrders', symbol, since, limit, params)
1272
- request = {
1272
+ request: dict = {
1273
1273
  }
1274
1274
  market = None
1275
1275
  if symbol is not None:
@@ -1306,7 +1306,7 @@ class blofin(Exchange, ImplicitAPI):
1306
1306
  paginate, params = self.handle_option_and_params(params, 'fetchMyTrades', 'paginate')
1307
1307
  if paginate:
1308
1308
  return self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params)
1309
- request = {
1309
+ request: dict = {
1310
1310
  }
1311
1311
  market = None
1312
1312
  if symbol is not None:
@@ -1336,7 +1336,7 @@ class blofin(Exchange, ImplicitAPI):
1336
1336
  paginate, params = self.handle_option_and_params(params, 'fetchDeposits', 'paginate')
1337
1337
  if paginate:
1338
1338
  return self.fetch_paginated_call_dynamic('fetchDeposits', code, since, limit, params)
1339
- request = {
1339
+ request: dict = {
1340
1340
  }
1341
1341
  currency = None
1342
1342
  if code is not None:
@@ -1368,7 +1368,7 @@ class blofin(Exchange, ImplicitAPI):
1368
1368
  paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
1369
1369
  if paginate:
1370
1370
  return self.fetch_paginated_call_dynamic('fetchWithdrawals', code, since, limit, params)
1371
- request = {
1371
+ request: dict = {
1372
1372
  }
1373
1373
  currency = None
1374
1374
  if code is not None:
@@ -1401,7 +1401,7 @@ class blofin(Exchange, ImplicitAPI):
1401
1401
  paginate, params = self.handle_option_and_params(params, 'fetchLedger', 'paginate')
1402
1402
  if paginate:
1403
1403
  return self.fetch_paginated_call_dynamic('fetchLedger', code, since, limit, params)
1404
- request = {
1404
+ request: dict = {
1405
1405
  }
1406
1406
  if limit is not None:
1407
1407
  request['limit'] = limit
@@ -1415,7 +1415,7 @@ class blofin(Exchange, ImplicitAPI):
1415
1415
  data = self.safe_list(response, 'data', [])
1416
1416
  return self.parse_ledger(data, currency, since, limit)
1417
1417
 
1418
- def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
1418
+ def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
1419
1419
  #
1420
1420
  #
1421
1421
  # fetchDeposits
@@ -1500,7 +1500,7 @@ class blofin(Exchange, ImplicitAPI):
1500
1500
  }
1501
1501
 
1502
1502
  def parse_transaction_status(self, status):
1503
- statuses = {
1503
+ statuses: dict = {
1504
1504
  '0': 'pending',
1505
1505
  '1': 'ok',
1506
1506
  '2': 'failed',
@@ -1509,7 +1509,7 @@ class blofin(Exchange, ImplicitAPI):
1509
1509
  return self.safe_string(statuses, status, status)
1510
1510
 
1511
1511
  def parse_ledger_entry_type(self, type):
1512
- types = {
1512
+ types: dict = {
1513
1513
  '1': 'transfer', # transfer
1514
1514
  '2': 'trade', # trade
1515
1515
  '3': 'trade', # delivery
@@ -1524,7 +1524,7 @@ class blofin(Exchange, ImplicitAPI):
1524
1524
  }
1525
1525
  return self.safe_string(types, type, type)
1526
1526
 
1527
- def parse_ledger_entry(self, item, currency: Currency = None):
1527
+ def parse_ledger_entry(self, item: dict, currency: Currency = None):
1528
1528
  id = self.safe_string(item, 'transferId')
1529
1529
  referenceId = self.safe_string(item, 'clientId')
1530
1530
  fromAccount = self.safe_string(item, 'fromAccount')
@@ -1633,7 +1633,7 @@ class blofin(Exchange, ImplicitAPI):
1633
1633
  accountsByType = self.safe_dict(self.options, 'accountsByType', {})
1634
1634
  fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
1635
1635
  toId = self.safe_string(accountsByType, toAccount, toAccount)
1636
- request = {
1636
+ request: dict = {
1637
1637
  'currency': currency['id'],
1638
1638
  'amount': self.currency_to_precision(code, amount),
1639
1639
  'fromAccount': fromId,
@@ -1668,7 +1668,7 @@ class blofin(Exchange, ImplicitAPI):
1668
1668
  """
1669
1669
  self.load_markets()
1670
1670
  market = self.market(symbol)
1671
- request = {
1671
+ request: dict = {
1672
1672
  'instId': market['id'],
1673
1673
  }
1674
1674
  response = self.privateGetAccountPositions(self.extend(request, params))
@@ -1678,7 +1678,7 @@ class blofin(Exchange, ImplicitAPI):
1678
1678
  return None
1679
1679
  return self.parse_position(position, market)
1680
1680
 
1681
- def fetch_positions(self, symbols: List[str] = None, params={}) -> List[Position]:
1681
+ def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
1682
1682
  """
1683
1683
  fetch data on a single open contract trade position
1684
1684
  :see: https://blofin.com/docs#get-positions
@@ -1694,7 +1694,7 @@ class blofin(Exchange, ImplicitAPI):
1694
1694
  result = self.parse_positions(data)
1695
1695
  return self.filter_by_array_positions(result, 'symbol', symbols, False)
1696
1696
 
1697
- def parse_position(self, position, market: Market = None):
1697
+ def parse_position(self, position: dict, market: Market = None):
1698
1698
  marketId = self.safe_string(position, 'instId')
1699
1699
  market = self.safe_market(marketId, market)
1700
1700
  symbol = market['symbol']
@@ -1775,7 +1775,7 @@ class blofin(Exchange, ImplicitAPI):
1775
1775
  'takeProfitPrice': None,
1776
1776
  })
1777
1777
 
1778
- def fetch_leverages(self, symbols: List[str] = None, params={}) -> Leverages:
1778
+ def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
1779
1779
  """
1780
1780
  fetch the set leverage for all contract markets
1781
1781
  :see: https://docs.blofin.com/index.html#get-multiple-leverage
@@ -1802,7 +1802,7 @@ class blofin(Exchange, ImplicitAPI):
1802
1802
  instIds = instIds + ',' + entryMarket['id']
1803
1803
  else:
1804
1804
  instIds = instIds + entryMarket['id']
1805
- request = {
1805
+ request: dict = {
1806
1806
  'instId': instIds,
1807
1807
  'marginMode': marginMode,
1808
1808
  }
@@ -1840,7 +1840,7 @@ class blofin(Exchange, ImplicitAPI):
1840
1840
  if (marginMode != 'cross') and (marginMode != 'isolated'):
1841
1841
  raise BadRequest(self.id + ' fetchLeverage() requires a marginMode parameter that must be either cross or isolated')
1842
1842
  market = self.market(symbol)
1843
- request = {
1843
+ request: dict = {
1844
1844
  'instId': market['id'],
1845
1845
  'marginMode': marginMode,
1846
1846
  }
@@ -1892,7 +1892,7 @@ class blofin(Exchange, ImplicitAPI):
1892
1892
  marginMode, params = self.handle_margin_mode_and_params('setLeverage', params, 'cross')
1893
1893
  if (marginMode != 'cross') and (marginMode != 'isolated'):
1894
1894
  raise BadRequest(self.id + ' setLeverage() requires a marginMode parameter that must be either cross or isolated')
1895
- request = {
1895
+ request: dict = {
1896
1896
  'leverage': leverage,
1897
1897
  'marginMode': marginMode,
1898
1898
  'instId': market['id'],
@@ -1921,7 +1921,7 @@ class blofin(Exchange, ImplicitAPI):
1921
1921
  clientOrderId = self.safe_string(params, 'clientOrderId')
1922
1922
  marginMode = None
1923
1923
  marginMode, params = self.handle_margin_mode_and_params('closePosition', params, 'cross')
1924
- request = {
1924
+ request: dict = {
1925
1925
  'instId': market['id'],
1926
1926
  'marginMode': marginMode,
1927
1927
  }
@@ -1948,7 +1948,7 @@ class blofin(Exchange, ImplicitAPI):
1948
1948
  paginate, params = self.handle_option_and_params(params, 'fetchClosedOrders', 'paginate')
1949
1949
  if paginate:
1950
1950
  return self.fetch_paginated_call_dynamic('fetchClosedOrders', symbol, since, limit, params)
1951
- request = {
1951
+ request: dict = {
1952
1952
  }
1953
1953
  market = None
1954
1954
  if symbol is not None:
@@ -1993,7 +1993,7 @@ class blofin(Exchange, ImplicitAPI):
1993
1993
  data = self.safe_dict(response, 'data', {})
1994
1994
  return self.parse_margin_mode(data, market)
1995
1995
 
1996
- def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
1996
+ def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
1997
1997
  return {
1998
1998
  'info': marginMode,
1999
1999
  'symbol': market['symbol'],
ccxt/btcalpha.py CHANGED
@@ -283,7 +283,7 @@ class btcalpha(Exchange, ImplicitAPI):
283
283
  """
284
284
  self.load_markets()
285
285
  market = self.market(symbol)
286
- request = {
286
+ request: dict = {
287
287
  'pair': market['id'],
288
288
  }
289
289
  response = self.publicGetTicker(self.extend(request, params))
@@ -355,7 +355,7 @@ class btcalpha(Exchange, ImplicitAPI):
355
355
  """
356
356
  self.load_markets()
357
357
  market = self.market(symbol)
358
- request = {
358
+ request: dict = {
359
359
  'pair_name': market['id'],
360
360
  }
361
361
  if limit:
@@ -372,7 +372,7 @@ class btcalpha(Exchange, ImplicitAPI):
372
372
  result.append(self.parse_bid_ask(bidask, priceKey, amountKey))
373
373
  return result
374
374
 
375
- def parse_trade(self, trade, market: Market = None) -> Trade:
375
+ def parse_trade(self, trade: dict, market: Market = None) -> Trade:
376
376
  #
377
377
  # fetchTrades(public)
378
378
  #
@@ -433,7 +433,7 @@ class btcalpha(Exchange, ImplicitAPI):
433
433
  """
434
434
  self.load_markets()
435
435
  market = None
436
- request = {}
436
+ request: dict = {}
437
437
  if symbol is not None:
438
438
  market = self.market(symbol)
439
439
  request['pair'] = market['id']
@@ -481,7 +481,7 @@ class btcalpha(Exchange, ImplicitAPI):
481
481
  """
482
482
  self.load_markets()
483
483
  currency = None
484
- request = {}
484
+ request: dict = {}
485
485
  if code is not None:
486
486
  currency = self.currency(code)
487
487
  request['currency_id'] = currency['id']
@@ -499,7 +499,7 @@ class btcalpha(Exchange, ImplicitAPI):
499
499
  #
500
500
  return self.parse_transactions(response, currency, since, limit, {'type': 'withdrawal'})
501
501
 
502
- def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
502
+ def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
503
503
  #
504
504
  # deposit
505
505
  # {
@@ -545,7 +545,7 @@ class btcalpha(Exchange, ImplicitAPI):
545
545
  }
546
546
 
547
547
  def parse_transaction_status(self, status):
548
- statuses = {
548
+ statuses: dict = {
549
549
  '10': 'pending', # New
550
550
  '20': 'pending', # Verified, waiting for approving
551
551
  '30': 'ok', # Approved by moderator
@@ -587,7 +587,7 @@ class btcalpha(Exchange, ImplicitAPI):
587
587
  """
588
588
  self.load_markets()
589
589
  market = self.market(symbol)
590
- request = {
590
+ request: dict = {
591
591
  'pair': market['id'],
592
592
  'type': self.safe_string(self.timeframes, timeframe, timeframe),
593
593
  }
@@ -606,7 +606,7 @@ class btcalpha(Exchange, ImplicitAPI):
606
606
  return self.parse_ohlcvs(response, market, timeframe, since, limit)
607
607
 
608
608
  def parse_balance(self, response) -> Balances:
609
- result = {'info': response}
609
+ result: dict = {'info': response}
610
610
  for i in range(0, len(response)):
611
611
  balance = response[i]
612
612
  currencyId = self.safe_string(balance, 'currency')
@@ -628,15 +628,15 @@ class btcalpha(Exchange, ImplicitAPI):
628
628
  response = self.privateGetWallets(params)
629
629
  return self.parse_balance(response)
630
630
 
631
- def parse_order_status(self, status):
632
- statuses = {
631
+ def parse_order_status(self, status: Str):
632
+ statuses: dict = {
633
633
  '1': 'open',
634
634
  '2': 'canceled',
635
635
  '3': 'closed',
636
636
  }
637
637
  return self.safe_string(statuses, status, status)
638
638
 
639
- def parse_order(self, order, market: Market = None) -> Order:
639
+ def parse_order(self, order: dict, market: Market = None) -> Order:
640
640
  #
641
641
  # fetchClosedOrders / fetchOrder
642
642
  # {
@@ -723,7 +723,7 @@ class btcalpha(Exchange, ImplicitAPI):
723
723
  raise InvalidOrder(self.id + ' only limits orders are supported')
724
724
  self.load_markets()
725
725
  market = self.market(symbol)
726
- request = {
726
+ request: dict = {
727
727
  'pair': market['id'],
728
728
  'type': side,
729
729
  'amount': amount,
@@ -747,7 +747,7 @@ class btcalpha(Exchange, ImplicitAPI):
747
747
  :param dict [params]: extra parameters specific to the exchange API endpoint
748
748
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
749
749
  """
750
- request = {
750
+ request: dict = {
751
751
  'order': id,
752
752
  }
753
753
  response = self.privatePostOrderCancel(self.extend(request, params))
@@ -762,7 +762,7 @@ class btcalpha(Exchange, ImplicitAPI):
762
762
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
763
763
  """
764
764
  self.load_markets()
765
- request = {
765
+ request: dict = {
766
766
  'id': id,
767
767
  }
768
768
  order = self.privateGetOrderId(self.extend(request, params))
@@ -779,7 +779,7 @@ class btcalpha(Exchange, ImplicitAPI):
779
779
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
780
780
  """
781
781
  self.load_markets()
782
- request = {}
782
+ request: dict = {}
783
783
  market = None
784
784
  if symbol is not None:
785
785
  market = self.market(symbol)
@@ -799,7 +799,7 @@ class btcalpha(Exchange, ImplicitAPI):
799
799
  :param dict [params]: extra parameters specific to the exchange API endpoint
800
800
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
801
801
  """
802
- request = {
802
+ request: dict = {
803
803
  'status': '1',
804
804
  }
805
805
  return self.fetch_orders(symbol, since, limit, self.extend(request, params))
@@ -814,7 +814,7 @@ class btcalpha(Exchange, ImplicitAPI):
814
814
  :param dict [params]: extra parameters specific to the exchange API endpoint
815
815
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
816
816
  """
817
- request = {
817
+ request: dict = {
818
818
  'status': '3',
819
819
  }
820
820
  return self.fetch_orders(symbol, since, limit, self.extend(request, params))
@@ -830,7 +830,7 @@ class btcalpha(Exchange, ImplicitAPI):
830
830
  :returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
831
831
  """
832
832
  self.load_markets()
833
- request = {}
833
+ request: dict = {}
834
834
  if symbol is not None:
835
835
  market = self.market(symbol)
836
836
  request['pair'] = market['id']
ccxt/btcbox.py CHANGED
@@ -137,7 +137,7 @@ class btcbox(Exchange, ImplicitAPI):
137
137
  })
138
138
 
139
139
  def parse_balance(self, response) -> Balances:
140
- result = {'info': response}
140
+ result: dict = {'info': response}
141
141
  codes = list(self.currencies.keys())
142
142
  for i in range(0, len(codes)):
143
143
  code = codes[i]
@@ -174,7 +174,7 @@ class btcbox(Exchange, ImplicitAPI):
174
174
  """
175
175
  self.load_markets()
176
176
  market = self.market(symbol)
177
- request = {}
177
+ request: dict = {}
178
178
  numSymbols = len(self.symbols)
179
179
  if numSymbols > 1:
180
180
  request['coin'] = market['baseId']
@@ -217,14 +217,14 @@ class btcbox(Exchange, ImplicitAPI):
217
217
  """
218
218
  self.load_markets()
219
219
  market = self.market(symbol)
220
- request = {}
220
+ request: dict = {}
221
221
  numSymbols = len(self.symbols)
222
222
  if numSymbols > 1:
223
223
  request['coin'] = market['baseId']
224
224
  response = self.publicGetTicker(self.extend(request, params))
225
225
  return self.parse_ticker(response, market)
226
226
 
227
- def parse_trade(self, trade, market: Market = None) -> Trade:
227
+ def parse_trade(self, trade: dict, market: Market = None) -> Trade:
228
228
  #
229
229
  # fetchTrades(public)
230
230
  #
@@ -271,7 +271,7 @@ class btcbox(Exchange, ImplicitAPI):
271
271
  """
272
272
  self.load_markets()
273
273
  market = self.market(symbol)
274
- request = {}
274
+ request: dict = {}
275
275
  numSymbols = len(self.symbols)
276
276
  if numSymbols > 1:
277
277
  request['coin'] = market['baseId']
@@ -303,7 +303,7 @@ class btcbox(Exchange, ImplicitAPI):
303
303
  """
304
304
  self.load_markets()
305
305
  market = self.market(symbol)
306
- request = {
306
+ request: dict = {
307
307
  'amount': amount,
308
308
  'price': price,
309
309
  'type': side,
@@ -332,7 +332,7 @@ class btcbox(Exchange, ImplicitAPI):
332
332
  if symbol is None:
333
333
  symbol = 'BTC/JPY'
334
334
  market = self.market(symbol)
335
- request = {
335
+ request: dict = {
336
336
  'id': id,
337
337
  'coin': market['baseId'],
338
338
  }
@@ -342,8 +342,8 @@ class btcbox(Exchange, ImplicitAPI):
342
342
  #
343
343
  return self.parse_order(response, market)
344
344
 
345
- def parse_order_status(self, status):
346
- statuses = {
345
+ def parse_order_status(self, status: Str):
346
+ statuses: dict = {
347
347
  # TODO: complete list
348
348
  'part': 'open', # partially or not at all executed
349
349
  'all': 'closed', # fully executed
@@ -353,7 +353,7 @@ class btcbox(Exchange, ImplicitAPI):
353
353
  }
354
354
  return self.safe_string(statuses, status, status)
355
355
 
356
- def parse_order(self, order, market: Market = None) -> Order:
356
+ def parse_order(self, order: dict, market: Market = None) -> Order:
357
357
  #
358
358
  # {
359
359
  # "id":11,
@@ -446,7 +446,7 @@ class btcbox(Exchange, ImplicitAPI):
446
446
  if symbol is None:
447
447
  symbol = 'BTC/JPY'
448
448
  market = self.market(symbol)
449
- request = {
449
+ request: dict = {
450
450
  'type': type, # 'open' or 'all'
451
451
  'coin': market['baseId'],
452
452
  }