ccxt 4.3.33__py2.py3-none-any.whl → 4.3.35__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (204) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/ace.py +2 -2
  7. ccxt/alpaca.py +2 -2
  8. ccxt/ascendex.py +2 -2
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +2 -2
  11. ccxt/async_support/alpaca.py +2 -2
  12. ccxt/async_support/ascendex.py +2 -2
  13. ccxt/async_support/base/exchange.py +56 -40
  14. ccxt/async_support/bigone.py +2 -2
  15. ccxt/async_support/binance.py +6 -5
  16. ccxt/async_support/bingx.py +4 -3
  17. ccxt/async_support/bit2c.py +1 -1
  18. ccxt/async_support/bitbank.py +1 -1
  19. ccxt/async_support/bitbns.py +1 -1
  20. ccxt/async_support/bitfinex.py +2 -2
  21. ccxt/async_support/bitfinex2.py +1 -1
  22. ccxt/async_support/bitflyer.py +1 -1
  23. ccxt/async_support/bitget.py +4 -4
  24. ccxt/async_support/bithumb.py +1 -1
  25. ccxt/async_support/bitmart.py +4 -9
  26. ccxt/async_support/bitmex.py +3 -3
  27. ccxt/async_support/bitopro.py +3 -3
  28. ccxt/async_support/bitrue.py +2 -2
  29. ccxt/async_support/bitso.py +2 -2
  30. ccxt/async_support/bitstamp.py +2 -2
  31. ccxt/async_support/bitteam.py +3 -3
  32. ccxt/async_support/bitvavo.py +2 -2
  33. ccxt/async_support/blockchaincom.py +1 -1
  34. ccxt/async_support/blofin.py +3 -3
  35. ccxt/async_support/btcalpha.py +3 -3
  36. ccxt/async_support/btcbox.py +1 -1
  37. ccxt/async_support/btcmarkets.py +6 -4
  38. ccxt/async_support/btcturk.py +1 -1
  39. ccxt/async_support/bybit.py +3 -3
  40. ccxt/async_support/cex.py +1 -1
  41. ccxt/async_support/coinbase.py +156 -58
  42. ccxt/async_support/coinbaseexchange.py +1 -1
  43. ccxt/async_support/coinbaseinternational.py +3 -3
  44. ccxt/async_support/coincheck.py +2 -2
  45. ccxt/async_support/coinex.py +28 -21
  46. ccxt/async_support/coinlist.py +2 -2
  47. ccxt/async_support/coinmate.py +2 -2
  48. ccxt/async_support/coinmetro.py +2 -2
  49. ccxt/async_support/coinone.py +1 -1
  50. ccxt/async_support/coinsph.py +2 -2
  51. ccxt/async_support/cryptocom.py +1 -1
  52. ccxt/async_support/currencycom.py +2 -2
  53. ccxt/async_support/delta.py +1 -1
  54. ccxt/async_support/deribit.py +2 -2
  55. ccxt/async_support/digifinex.py +2 -2
  56. ccxt/async_support/exmo.py +2 -2
  57. ccxt/async_support/gate.py +2 -2
  58. ccxt/async_support/gemini.py +3 -3
  59. ccxt/async_support/hitbtc.py +2 -2
  60. ccxt/async_support/hollaex.py +1 -1
  61. ccxt/async_support/htx.py +2 -2
  62. ccxt/async_support/huobijp.py +2 -2
  63. ccxt/async_support/hyperliquid.py +2 -2
  64. ccxt/async_support/idex.py +2 -2
  65. ccxt/async_support/indodax.py +2 -2
  66. ccxt/async_support/kraken.py +5 -3
  67. ccxt/async_support/krakenfutures.py +1 -1
  68. ccxt/async_support/kucoin.py +2 -2
  69. ccxt/async_support/kuna.py +2 -2
  70. ccxt/async_support/latoken.py +2 -2
  71. ccxt/async_support/lbank.py +1 -1
  72. ccxt/async_support/luno.py +1 -1
  73. ccxt/async_support/lykke.py +1 -1
  74. ccxt/async_support/mercado.py +1 -1
  75. ccxt/async_support/mexc.py +1 -1
  76. ccxt/async_support/ndax.py +2 -2
  77. ccxt/async_support/novadax.py +3 -3
  78. ccxt/async_support/oceanex.py +2 -2
  79. ccxt/async_support/okcoin.py +3 -3
  80. ccxt/async_support/okx.py +3 -3
  81. ccxt/async_support/onetrading.py +2 -2
  82. ccxt/async_support/p2b.py +2 -2
  83. ccxt/async_support/paymium.py +1 -1
  84. ccxt/async_support/phemex.py +4 -4
  85. ccxt/async_support/poloniex.py +3 -3
  86. ccxt/async_support/poloniexfutures.py +2 -2
  87. ccxt/async_support/probit.py +3 -3
  88. ccxt/async_support/timex.py +2 -2
  89. ccxt/async_support/tokocrypto.py +1 -1
  90. ccxt/async_support/tradeogre.py +1 -1
  91. ccxt/async_support/upbit.py +3 -3
  92. ccxt/async_support/wavesexchange.py +1 -1
  93. ccxt/async_support/wazirx.py +3 -3
  94. ccxt/async_support/whitebit.py +3 -3
  95. ccxt/async_support/woo.py +3 -3
  96. ccxt/async_support/woofipro.py +3 -3
  97. ccxt/async_support/yobit.py +1 -1
  98. ccxt/async_support/zaif.py +2 -2
  99. ccxt/async_support/zonda.py +1 -1
  100. ccxt/base/exchange.py +107 -76
  101. ccxt/base/types.py +0 -1
  102. ccxt/bigone.py +2 -2
  103. ccxt/binance.py +6 -5
  104. ccxt/bingx.py +4 -3
  105. ccxt/bit2c.py +1 -1
  106. ccxt/bitbank.py +1 -1
  107. ccxt/bitbns.py +1 -1
  108. ccxt/bitfinex.py +2 -2
  109. ccxt/bitfinex2.py +1 -1
  110. ccxt/bitflyer.py +1 -1
  111. ccxt/bitget.py +4 -4
  112. ccxt/bithumb.py +1 -1
  113. ccxt/bitmart.py +4 -9
  114. ccxt/bitmex.py +3 -3
  115. ccxt/bitopro.py +3 -3
  116. ccxt/bitrue.py +2 -2
  117. ccxt/bitso.py +2 -2
  118. ccxt/bitstamp.py +2 -2
  119. ccxt/bitteam.py +3 -3
  120. ccxt/bitvavo.py +2 -2
  121. ccxt/blockchaincom.py +1 -1
  122. ccxt/blofin.py +3 -3
  123. ccxt/btcalpha.py +3 -3
  124. ccxt/btcbox.py +1 -1
  125. ccxt/btcmarkets.py +6 -4
  126. ccxt/btcturk.py +1 -1
  127. ccxt/bybit.py +3 -3
  128. ccxt/cex.py +1 -1
  129. ccxt/coinbase.py +156 -58
  130. ccxt/coinbaseexchange.py +1 -1
  131. ccxt/coinbaseinternational.py +3 -3
  132. ccxt/coincheck.py +2 -2
  133. ccxt/coinex.py +28 -21
  134. ccxt/coinlist.py +2 -2
  135. ccxt/coinmate.py +2 -2
  136. ccxt/coinmetro.py +2 -2
  137. ccxt/coinone.py +1 -1
  138. ccxt/coinsph.py +2 -2
  139. ccxt/cryptocom.py +1 -1
  140. ccxt/currencycom.py +2 -2
  141. ccxt/delta.py +1 -1
  142. ccxt/deribit.py +2 -2
  143. ccxt/digifinex.py +2 -2
  144. ccxt/exmo.py +2 -2
  145. ccxt/gate.py +2 -2
  146. ccxt/gemini.py +3 -3
  147. ccxt/hitbtc.py +2 -2
  148. ccxt/hollaex.py +1 -1
  149. ccxt/htx.py +2 -2
  150. ccxt/huobijp.py +2 -2
  151. ccxt/hyperliquid.py +2 -2
  152. ccxt/idex.py +2 -2
  153. ccxt/indodax.py +2 -2
  154. ccxt/kraken.py +5 -3
  155. ccxt/krakenfutures.py +1 -1
  156. ccxt/kucoin.py +2 -2
  157. ccxt/kuna.py +2 -2
  158. ccxt/latoken.py +2 -2
  159. ccxt/lbank.py +1 -1
  160. ccxt/luno.py +1 -1
  161. ccxt/lykke.py +1 -1
  162. ccxt/mercado.py +1 -1
  163. ccxt/mexc.py +1 -1
  164. ccxt/ndax.py +2 -2
  165. ccxt/novadax.py +3 -3
  166. ccxt/oceanex.py +2 -2
  167. ccxt/okcoin.py +3 -3
  168. ccxt/okx.py +3 -3
  169. ccxt/onetrading.py +2 -2
  170. ccxt/p2b.py +2 -2
  171. ccxt/paymium.py +1 -1
  172. ccxt/phemex.py +4 -4
  173. ccxt/poloniex.py +3 -3
  174. ccxt/poloniexfutures.py +2 -2
  175. ccxt/pro/__init__.py +1 -1
  176. ccxt/pro/binance.py +331 -2
  177. ccxt/pro/bitget.py +24 -1
  178. ccxt/pro/bitmart.py +1 -1
  179. ccxt/pro/bitmex.py +98 -1
  180. ccxt/pro/bybit.py +82 -1
  181. ccxt/pro/gate.py +173 -1
  182. ccxt/pro/kraken.py +1 -1
  183. ccxt/pro/kucoinfutures.py +4 -0
  184. ccxt/pro/okx.py +244 -1
  185. ccxt/probit.py +3 -3
  186. ccxt/test/base/__init__.py +1 -0
  187. ccxt/test/base/test_crypto.py +1 -1
  188. ccxt/test/base/test_liquidation.py +50 -0
  189. ccxt/timex.py +2 -2
  190. ccxt/tokocrypto.py +1 -1
  191. ccxt/tradeogre.py +1 -1
  192. ccxt/upbit.py +3 -3
  193. ccxt/wavesexchange.py +1 -1
  194. ccxt/wazirx.py +3 -3
  195. ccxt/whitebit.py +3 -3
  196. ccxt/woo.py +3 -3
  197. ccxt/woofipro.py +3 -3
  198. ccxt/yobit.py +1 -1
  199. ccxt/zaif.py +2 -2
  200. ccxt/zonda.py +1 -1
  201. {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/METADATA +4 -4
  202. {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/RECORD +204 -203
  203. {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/WHEEL +0 -0
  204. {ccxt-4.3.33.dist-info → ccxt-4.3.35.dist-info}/top_level.txt +0 -0
@@ -2606,7 +2606,7 @@ class digifinex(Exchange, ImplicitAPI):
2606
2606
  """
2607
2607
  return await self.fetch_transactions_by_type('withdrawal', code, since, limit, params)
2608
2608
 
2609
- def parse_transaction_status(self, status):
2609
+ def parse_transaction_status(self, status: Str):
2610
2610
  # deposit state includes: 1(in deposit), 2(to be confirmed), 3(successfully deposited), 4(stopped)
2611
2611
  # withdrawal state includes: 1(application in progress), 2(to be confirmed), 3(completed), 4(rejected)
2612
2612
  statuses: dict = {
@@ -3946,7 +3946,7 @@ class digifinex(Exchange, ImplicitAPI):
3946
3946
  url += '?' + urlencoded
3947
3947
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
3948
3948
 
3949
- def handle_errors(self, statusCode, statusText, url, method, responseHeaders, responseBody, response, requestHeaders, requestBody):
3949
+ def handle_errors(self, statusCode: int, statusText: str, url: str, method: str, responseHeaders: dict, responseBody, response, requestHeaders, requestBody):
3950
3950
  if not response:
3951
3951
  return None # fall back to default error handler
3952
3952
  code = self.safe_string(response, 'code')
@@ -2015,7 +2015,7 @@ class exmo(Exchange, ImplicitAPI):
2015
2015
  response = await self.privatePostWithdrawCrypt(self.extend(request, params))
2016
2016
  return self.parse_transaction(response, currency)
2017
2017
 
2018
- def parse_transaction_status(self, status):
2018
+ def parse_transaction_status(self, status: Str):
2019
2019
  statuses: dict = {
2020
2020
  'transferred': 'ok',
2021
2021
  'paid': 'ok',
@@ -2419,7 +2419,7 @@ class exmo(Exchange, ImplicitAPI):
2419
2419
  def nonce(self):
2420
2420
  return self.milliseconds()
2421
2421
 
2422
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
2422
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2423
2423
  if response is None:
2424
2424
  return None # fallback to default error handler
2425
2425
  if ('error' in response) and not ('result' in response):
@@ -3436,7 +3436,7 @@ class gate(Exchange, ImplicitAPI):
3436
3436
  #
3437
3437
  return self.parse_transaction(response, currency)
3438
3438
 
3439
- def parse_transaction_status(self, status):
3439
+ def parse_transaction_status(self, status: Str):
3440
3440
  statuses: dict = {
3441
3441
  'PEND': 'pending',
3442
3442
  'REQUEST': 'pending',
@@ -6958,7 +6958,7 @@ class gate(Exchange, ImplicitAPI):
6958
6958
  #
6959
6959
  return self.parse_positions(response, symbols, params)
6960
6960
 
6961
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
6961
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
6962
6962
  if response is None:
6963
6963
  return None
6964
6964
  #
@@ -832,7 +832,7 @@ class gemini(Exchange, ImplicitAPI):
832
832
  :see: https://docs.gemini.com/rest-api/#ticker-v2
833
833
  :param str symbol: unified symbol of the market to fetch the ticker for
834
834
  :param dict [params]: extra parameters specific to the exchange API endpoint
835
- :param dict [params.fetchTickerMethod]: 'fetchTickerV2', 'fetchTickerV1' or 'fetchTickerV1AndV2' - 'fetchTickerV1' for original ccxt.gemini.fetch_ticker- 'fetchTickerV1AndV2' for 2 api calls to get the result of both fetchTicker methods - default = 'fetchTickerV1'
835
+ :param dict [params.fetchTickerMethod]: 'fetchTickerV2', 'fetchTickerV1' or 'fetchTickerV1AndV2' - 'fetchTickerV1' for original ccxt.gemini.fetchTicker - 'fetchTickerV1AndV2' for 2 api calls to get the result of both fetchTicker methods - default = 'fetchTickerV1'
836
836
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
837
837
  """
838
838
  method = self.safe_value(self.options, 'fetchTickerMethod', 'fetchTickerV1')
@@ -1654,7 +1654,7 @@ class gemini(Exchange, ImplicitAPI):
1654
1654
  'fee': fee,
1655
1655
  }
1656
1656
 
1657
- def parse_transaction_status(self, status):
1657
+ def parse_transaction_status(self, status: Str):
1658
1658
  statuses: dict = {
1659
1659
  'Advanced': 'ok',
1660
1660
  'Complete': 'ok',
@@ -1749,7 +1749,7 @@ class gemini(Exchange, ImplicitAPI):
1749
1749
  body = self.json(query)
1750
1750
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1751
1751
 
1752
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
1752
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1753
1753
  if response is None:
1754
1754
  if isinstance(body, str):
1755
1755
  feedback = self.id + ' ' + body
@@ -1367,7 +1367,7 @@ class hitbtc(Exchange, ImplicitAPI):
1367
1367
  #
1368
1368
  return self.parse_transactions(response, currency, since, limit, params)
1369
1369
 
1370
- def parse_transaction_status(self, status):
1370
+ def parse_transaction_status(self, status: Str):
1371
1371
  statuses: dict = {
1372
1372
  'PENDING': 'pending',
1373
1373
  'FAILED': 'failed',
@@ -3362,7 +3362,7 @@ class hitbtc(Exchange, ImplicitAPI):
3362
3362
  marginMode = 'isolated'
3363
3363
  return [marginMode, params]
3364
3364
 
3365
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
3365
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
3366
3366
  #
3367
3367
  # {
3368
3368
  # "error": {
@@ -1792,7 +1792,7 @@ class hollaex(Exchange, ImplicitAPI):
1792
1792
  headers['api-signature'] = signature
1793
1793
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1794
1794
 
1795
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1795
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1796
1796
  if response is None:
1797
1797
  return None
1798
1798
  if (code >= 400) and (code <= 503):
ccxt/async_support/htx.py CHANGED
@@ -5955,7 +5955,7 @@ class htx(Exchange, ImplicitAPI):
5955
5955
  },
5956
5956
  }
5957
5957
 
5958
- def parse_transaction_status(self, status):
5958
+ def parse_transaction_status(self, status: Str):
5959
5959
  statuses: dict = {
5960
5960
  # deposit statuses
5961
5961
  'unknown': 'failed',
@@ -6640,7 +6640,7 @@ class htx(Exchange, ImplicitAPI):
6640
6640
  }) + url
6641
6641
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
6642
6642
 
6643
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
6643
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
6644
6644
  if response is None:
6645
6645
  return None # fallback to default error handler
6646
6646
  if 'status' in response:
@@ -1673,7 +1673,7 @@ class huobijp(Exchange, ImplicitAPI):
1673
1673
  },
1674
1674
  }
1675
1675
 
1676
- def parse_transaction_status(self, status):
1676
+ def parse_transaction_status(self, status: Str):
1677
1677
  statuses: dict = {
1678
1678
  # deposit statuses
1679
1679
  'unknown': 'failed',
@@ -1782,7 +1782,7 @@ class huobijp(Exchange, ImplicitAPI):
1782
1782
  }) + url
1783
1783
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1784
1784
 
1785
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
1785
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1786
1786
  if response is None:
1787
1787
  return None # fallback to default error handler
1788
1788
  if 'status' in response:
@@ -520,7 +520,7 @@ class hyperliquid(Exchange, ImplicitAPI):
520
520
  }))
521
521
  return markets
522
522
 
523
- def parse_market(self, market) -> Market:
523
+ def parse_market(self, market: dict) -> Market:
524
524
  #
525
525
  # {
526
526
  # "maxLeverage": "50",
@@ -2357,7 +2357,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2357
2357
  return coin # spot
2358
2358
  return coin + '/USDC:USDC'
2359
2359
 
2360
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2360
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2361
2361
  if not response:
2362
2362
  return None # fallback to default error handler
2363
2363
  # {"status":"err","response":"User or API Wallet 0xb8a6f8b26223de27c31938d56e470a5b832703a5 does not exist."}
@@ -1416,7 +1416,7 @@ class idex(Exchange, ImplicitAPI):
1416
1416
  canceledOrder = self.safe_dict(response, 0)
1417
1417
  return self.parse_order(canceledOrder, market)
1418
1418
 
1419
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1419
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1420
1420
  errorCode = self.safe_string(response, 'code')
1421
1421
  message = self.safe_string(response, 'message')
1422
1422
  if errorCode is not None:
@@ -1557,7 +1557,7 @@ class idex(Exchange, ImplicitAPI):
1557
1557
  raise NotSupported(self.id + ' fetchTransactionsHelper() not support self method')
1558
1558
  return self.parse_transactions(response, currency, since, limit)
1559
1559
 
1560
- def parse_transaction_status(self, status):
1560
+ def parse_transaction_status(self, status: Str):
1561
1561
  statuses: dict = {
1562
1562
  'mined': 'ok',
1563
1563
  }
@@ -1078,7 +1078,7 @@ class indodax(Exchange, ImplicitAPI):
1078
1078
  'info': transaction,
1079
1079
  }
1080
1080
 
1081
- def parse_transaction_status(self, status):
1081
+ def parse_transaction_status(self, status: Str):
1082
1082
  statuses: dict = {
1083
1083
  'success': 'ok',
1084
1084
  }
@@ -1183,7 +1183,7 @@ class indodax(Exchange, ImplicitAPI):
1183
1183
  }
1184
1184
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1185
1185
 
1186
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1186
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1187
1187
  if response is None:
1188
1188
  return None
1189
1189
  # {success: 0, error: "invalid order."}
@@ -970,7 +970,9 @@ class kraken(Exchange, ImplicitAPI):
970
970
  else:
971
971
  request['interval'] = timeframe
972
972
  if since is not None:
973
- request['since'] = self.number_to_string(self.parse_to_int(since / 1000)) # expected to be in seconds
973
+ scaledSince = self.parse_to_int(since / 1000)
974
+ timeFrameInSeconds = parsedTimeframe * 60
975
+ request['since'] = self.number_to_string(scaledSince - timeFrameInSeconds) # expected to be in seconds
974
976
  response = await self.publicGetOHLC(self.extend(request, params))
975
977
  #
976
978
  # {
@@ -2168,7 +2170,7 @@ class kraken(Exchange, ImplicitAPI):
2168
2170
  orders = self.safe_dict(result, 'closed', {})
2169
2171
  return self.parse_orders(orders, market, since, limit)
2170
2172
 
2171
- def parse_transaction_status(self, status):
2173
+ def parse_transaction_status(self, status: Str):
2172
2174
  # IFEX transaction states
2173
2175
  statuses: dict = {
2174
2176
  'Initial': 'pending',
@@ -2832,7 +2834,7 @@ class kraken(Exchange, ImplicitAPI):
2832
2834
  def nonce(self):
2833
2835
  return self.milliseconds()
2834
2836
 
2835
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2837
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2836
2838
  if code == 520:
2837
2839
  raise ExchangeNotAvailable(self.id + ' ' + str(code) + ' ' + reason)
2838
2840
  # todo: rewrite self for "broad" exceptions matching
@@ -2491,7 +2491,7 @@ class krakenfutures(Exchange, ImplicitAPI):
2491
2491
  'shortLeverage': leverageValue,
2492
2492
  }
2493
2493
 
2494
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2494
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2495
2495
  if response is None:
2496
2496
  return None
2497
2497
  if code == 429:
@@ -3101,7 +3101,7 @@ class kucoin(Exchange, ImplicitAPI):
3101
3101
  code = currency['code']
3102
3102
  self.currencies[code]['networks'][networkCode]['precision'] = precision
3103
3103
 
3104
- def parse_transaction_status(self, status):
3104
+ def parse_transaction_status(self, status: Str):
3105
3105
  statuses: dict = {
3106
3106
  'SUCCESS': 'ok',
3107
3107
  'PROCESSING': 'pending',
@@ -4498,7 +4498,7 @@ class kucoin(Exchange, ImplicitAPI):
4498
4498
  headers['KC-BROKER-NAME'] = brokerName
4499
4499
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
4500
4500
 
4501
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
4501
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
4502
4502
  if not response:
4503
4503
  self.throw_broadly_matched_exception(self.exceptions['broad'], body, body)
4504
4504
  return None
@@ -1555,7 +1555,7 @@ class kuna(Exchange, ImplicitAPI):
1555
1555
  'tag': None,
1556
1556
  }
1557
1557
 
1558
- def parse_transaction_status(self, status):
1558
+ def parse_transaction_status(self, status: Str):
1559
1559
  statuses: dict = {
1560
1560
  'Created': 'pending',
1561
1561
  'Canceled': 'canceled',
@@ -1814,7 +1814,7 @@ class kuna(Exchange, ImplicitAPI):
1814
1814
  body = json.dumps(body)
1815
1815
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1816
1816
 
1817
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1817
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1818
1818
  #
1819
1819
  # {
1820
1820
  # "errors": [
@@ -1457,7 +1457,7 @@ class latoken(Exchange, ImplicitAPI):
1457
1457
  'fee': fee,
1458
1458
  }
1459
1459
 
1460
- def parse_transaction_status(self, status):
1460
+ def parse_transaction_status(self, status: Str):
1461
1461
  statuses: dict = {
1462
1462
  'TRANSACTION_STATUS_CONFIRMED': 'ok',
1463
1463
  'TRANSACTION_STATUS_EXECUTED': 'ok',
@@ -1641,7 +1641,7 @@ class latoken(Exchange, ImplicitAPI):
1641
1641
  url = self.urls['api']['rest'] + requestString
1642
1642
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1643
1643
 
1644
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1644
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1645
1645
  if not response:
1646
1646
  return None
1647
1647
  #
@@ -2568,7 +2568,7 @@ class lbank(Exchange, ImplicitAPI):
2568
2568
  pem += self.secret[start:end] + "\n" # eslint-disable-line
2569
2569
  return pem + '-----END PRIVATE KEY-----'
2570
2570
 
2571
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
2571
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2572
2572
  if response is None:
2573
2573
  return None
2574
2574
  success = self.safe_value(response, 'result')
@@ -1050,7 +1050,7 @@ class luno(Exchange, ImplicitAPI):
1050
1050
  }
1051
1051
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1052
1052
 
1053
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
1053
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1054
1054
  if response is None:
1055
1055
  return None
1056
1056
  error = self.safe_value(response, 'error')
@@ -1248,7 +1248,7 @@ class lykke(Exchange, ImplicitAPI):
1248
1248
  headers['X-Request-ID'] = self.uuid()
1249
1249
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1250
1250
 
1251
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1251
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1252
1252
  if response is None:
1253
1253
  return None
1254
1254
  error = self.safe_value(response, 'error', {})
@@ -828,7 +828,7 @@ class mercado(Exchange, ImplicitAPI):
828
828
  }
829
829
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
830
830
 
831
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
831
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
832
832
  if response is None:
833
833
  return None
834
834
  #
@@ -5342,7 +5342,7 @@ class mexc(Exchange, ImplicitAPI):
5342
5342
  headers['Signature'] = signature
5343
5343
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
5344
5344
 
5345
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
5345
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
5346
5346
  if response is None:
5347
5347
  return None
5348
5348
  # spot
@@ -460,7 +460,7 @@ class ndax(Exchange, ImplicitAPI):
460
460
  #
461
461
  return self.parse_markets(response)
462
462
 
463
- def parse_market(self, market) -> Market:
463
+ def parse_market(self, market: dict) -> Market:
464
464
  id = self.safe_string(market, 'InstrumentId')
465
465
  # lowercaseId = self.safe_string_lower(market, 'symbol')
466
466
  baseId = self.safe_string(market, 'Product1')
@@ -2332,7 +2332,7 @@ class ndax(Exchange, ImplicitAPI):
2332
2332
  url += '?' + self.urlencode(query)
2333
2333
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
2334
2334
 
2335
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2335
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2336
2336
  if code == 404:
2337
2337
  raise AuthenticationError(self.id + ' ' + body)
2338
2338
  if response is None:
@@ -272,7 +272,7 @@ class novadax(Exchange, ImplicitAPI):
272
272
  data = self.safe_value(response, 'data', [])
273
273
  return self.parse_markets(data)
274
274
 
275
- def parse_market(self, market) -> Market:
275
+ def parse_market(self, market: dict) -> Market:
276
276
  baseId = self.safe_string(market, 'baseCurrency')
277
277
  quoteId = self.safe_string(market, 'quoteCurrency')
278
278
  id = self.safe_string(market, 'symbol')
@@ -1303,7 +1303,7 @@ class novadax(Exchange, ImplicitAPI):
1303
1303
  data = self.safe_list(response, 'data', [])
1304
1304
  return self.parse_transactions(data, currency, since, limit)
1305
1305
 
1306
- def parse_transaction_status(self, status):
1306
+ def parse_transaction_status(self, status: Str):
1307
1307
  # Pending the record is wait broadcast to chain
1308
1308
  # x/M confirming the comfirming state of tx, the M is total confirmings needed
1309
1309
  # SUCCESS the record is success full
@@ -1468,7 +1468,7 @@ class novadax(Exchange, ImplicitAPI):
1468
1468
  headers['X-Nova-Signature'] = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
1469
1469
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1470
1470
 
1471
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1471
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1472
1472
  if response is None:
1473
1473
  return None
1474
1474
  #
@@ -181,7 +181,7 @@ class oceanex(Exchange, ImplicitAPI):
181
181
  markets = self.safe_value(response, 'data', [])
182
182
  return self.parse_markets(markets)
183
183
 
184
- def parse_market(self, market) -> Market:
184
+ def parse_market(self, market: dict) -> Market:
185
185
  id = self.safe_value(market, 'id')
186
186
  name = self.safe_value(market, 'name')
187
187
  baseId, quoteId = name.split('/')
@@ -887,7 +887,7 @@ class oceanex(Exchange, ImplicitAPI):
887
887
  headers = {'Content-Type': 'application/json'}
888
888
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
889
889
 
890
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
890
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
891
891
  #
892
892
  # {"code":1011,"message":"This IP 'x.x.x.x' is not allowed","data":{}}
893
893
  #
@@ -643,7 +643,7 @@ class okcoin(Exchange, ImplicitAPI):
643
643
  markets = self.safe_value(response, 'data', [])
644
644
  return self.parse_markets(markets)
645
645
 
646
- def parse_market(self, market) -> Market:
646
+ def parse_market(self, market: dict) -> Market:
647
647
  #
648
648
  # spot markets
649
649
  #
@@ -2493,7 +2493,7 @@ class okcoin(Exchange, ImplicitAPI):
2493
2493
  data = self.safe_list(response, 'data', [])
2494
2494
  return self.parse_transactions(data, currency, since, limit, params)
2495
2495
 
2496
- def parse_transaction_status(self, status):
2496
+ def parse_transaction_status(self, status: Str):
2497
2497
  #
2498
2498
  # deposit statuses
2499
2499
  #
@@ -2898,7 +2898,7 @@ class okcoin(Exchange, ImplicitAPI):
2898
2898
  else:
2899
2899
  return self.parse_trading_balance(response)
2900
2900
 
2901
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
2901
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2902
2902
  if not response:
2903
2903
  return None # fallback to default error handler
2904
2904
  #
ccxt/async_support/okx.py CHANGED
@@ -1373,7 +1373,7 @@ class okx(Exchange, ImplicitAPI):
1373
1373
  result = self.array_concat(result, promises[i])
1374
1374
  return result
1375
1375
 
1376
- def parse_market(self, market) -> Market:
1376
+ def parse_market(self, market: dict) -> Market:
1377
1377
  #
1378
1378
  # {
1379
1379
  # "alias": "", # self_week, next_week, quarter, next_quarter
@@ -4806,7 +4806,7 @@ class okx(Exchange, ImplicitAPI):
4806
4806
  withdrawal = self.safe_dict(data, 0, {})
4807
4807
  return self.parse_transaction(withdrawal)
4808
4808
 
4809
- def parse_transaction_status(self, status):
4809
+ def parse_transaction_status(self, status: Str):
4810
4810
  #
4811
4811
  # deposit statuses
4812
4812
  #
@@ -7614,7 +7614,7 @@ class okx(Exchange, ImplicitAPI):
7614
7614
  }
7615
7615
  return result
7616
7616
 
7617
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
7617
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
7618
7618
  if not response:
7619
7619
  return None # fallback to default error handler
7620
7620
  #
@@ -387,7 +387,7 @@ class onetrading(Exchange, ImplicitAPI):
387
387
  #
388
388
  return self.parse_markets(response)
389
389
 
390
- def parse_market(self, market) -> Market:
390
+ def parse_market(self, market: dict) -> Market:
391
391
  baseAsset = self.safe_value(market, 'base', {})
392
392
  quoteAsset = self.safe_value(market, 'quote', {})
393
393
  baseId = self.safe_string(baseAsset, 'code')
@@ -1894,7 +1894,7 @@ class onetrading(Exchange, ImplicitAPI):
1894
1894
  url += '?' + self.urlencode(query)
1895
1895
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1896
1896
 
1897
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1897
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1898
1898
  if response is None:
1899
1899
  return None
1900
1900
  #
ccxt/async_support/p2b.py CHANGED
@@ -279,7 +279,7 @@ class p2b(Exchange, ImplicitAPI):
279
279
  markets = self.safe_value(response, 'result', [])
280
280
  return self.parse_markets(markets)
281
281
 
282
- def parse_market(self, market) -> Market:
282
+ def parse_market(self, market: dict) -> Market:
283
283
  marketId = self.safe_string(market, 'name')
284
284
  baseId = self.safe_string(market, 'stock')
285
285
  quoteId = self.safe_string(market, 'money')
@@ -1182,7 +1182,7 @@ class p2b(Exchange, ImplicitAPI):
1182
1182
  body = self.json(params)
1183
1183
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1184
1184
 
1185
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1185
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1186
1186
  if response is None:
1187
1187
  return None
1188
1188
  if code == 400:
@@ -552,7 +552,7 @@ class paymium(Exchange, ImplicitAPI):
552
552
  headers['Api-Signature'] = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
553
553
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
554
554
 
555
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
555
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
556
556
  if response is None:
557
557
  return None
558
558
  errors = self.safe_value(response, 'errors')
@@ -512,7 +512,7 @@ class phemex(Exchange, ImplicitAPI):
512
512
  parts = value.split(' ')
513
513
  return self.safe_number(parts, 0)
514
514
 
515
- def parse_swap_market(self, market):
515
+ def parse_swap_market(self, market: dict):
516
516
  #
517
517
  # {
518
518
  # "symbol":"BTCUSD",
@@ -647,7 +647,7 @@ class phemex(Exchange, ImplicitAPI):
647
647
  'info': market,
648
648
  })
649
649
 
650
- def parse_spot_market(self, market):
650
+ def parse_spot_market(self, market: dict):
651
651
  #
652
652
  # {
653
653
  # "symbol":"sBTCUSDT",
@@ -3225,7 +3225,7 @@ class phemex(Exchange, ImplicitAPI):
3225
3225
  data = self.safe_list(response, 'data', [])
3226
3226
  return self.parse_transactions(data, currency, since, limit)
3227
3227
 
3228
- def parse_transaction_status(self, status):
3228
+ def parse_transaction_status(self, status: Str):
3229
3229
  statuses: dict = {
3230
3230
  'Success': 'ok',
3231
3231
  'Succeed': 'ok',
@@ -4453,7 +4453,7 @@ class phemex(Exchange, ImplicitAPI):
4453
4453
  data = self.safe_dict(response, 'data', {})
4454
4454
  return self.parse_transaction(data, currency)
4455
4455
 
4456
- def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
4456
+ def handle_errors(self, httpCode: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
4457
4457
  if response is None:
4458
4458
  return None # fallback to default error handler
4459
4459
  #
@@ -514,7 +514,7 @@ class poloniex(Exchange, ImplicitAPI):
514
514
  #
515
515
  return self.parse_markets(markets)
516
516
 
517
- def parse_market(self, market) -> Market:
517
+ def parse_market(self, market: dict) -> Market:
518
518
  id = self.safe_string(market, 'symbol')
519
519
  baseId = self.safe_string(market, 'baseCurrencyName')
520
520
  quoteId = self.safe_string(market, 'quoteCurrencyName')
@@ -2084,7 +2084,7 @@ class poloniex(Exchange, ImplicitAPI):
2084
2084
  transactions = self.parse_transactions(deposits, currency, since, limit)
2085
2085
  return self.filter_by_currency_since_limit(transactions, code, since, limit)
2086
2086
 
2087
- def parse_transaction_status(self, status):
2087
+ def parse_transaction_status(self, status: Str):
2088
2088
  statuses: dict = {
2089
2089
  'COMPLETE': 'ok',
2090
2090
  'COMPLETED': 'ok',
@@ -2212,7 +2212,7 @@ class poloniex(Exchange, ImplicitAPI):
2212
2212
  }
2213
2213
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
2214
2214
 
2215
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
2215
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
2216
2216
  if response is None:
2217
2217
  return None
2218
2218
  #
@@ -288,7 +288,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
288
288
  data = self.safe_value(response, 'data', [])
289
289
  return self.parse_markets(data)
290
290
 
291
- def parse_market(self, market) -> Market:
291
+ def parse_market(self, market: dict) -> Market:
292
292
  id = self.safe_string(market, 'symbol')
293
293
  baseId = self.safe_string(market, 'baseCurrency')
294
294
  quoteId = self.safe_string(market, 'quoteCurrency')
@@ -1698,7 +1698,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
1698
1698
  headers['Content-Type'] = 'application/json'
1699
1699
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1700
1700
 
1701
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1701
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1702
1702
  if not response:
1703
1703
  self.throw_broadly_matched_exception(self.exceptions['broad'], body, body)
1704
1704
  return None
@@ -276,7 +276,7 @@ class probit(Exchange, ImplicitAPI):
276
276
  markets = self.safe_value(response, 'data', [])
277
277
  return self.parse_markets(markets)
278
278
 
279
- def parse_market(self, market) -> Market:
279
+ def parse_market(self, market: dict) -> Market:
280
280
  id = self.safe_string(market, 'id')
281
281
  baseId = self.safe_string(market, 'base_currency_id')
282
282
  quoteId = self.safe_string(market, 'quote_currency_id')
@@ -1511,7 +1511,7 @@ class probit(Exchange, ImplicitAPI):
1511
1511
  'info': transaction,
1512
1512
  }
1513
1513
 
1514
- def parse_transaction_status(self, status):
1514
+ def parse_transaction_status(self, status: Str):
1515
1515
  statuses: dict = {
1516
1516
  'requested': 'pending',
1517
1517
  'pending': 'pending',
@@ -1720,7 +1720,7 @@ class probit(Exchange, ImplicitAPI):
1720
1720
  self.options['expires'] = self.sum(self.milliseconds(), expiresIn * 1000)
1721
1721
  return response
1722
1722
 
1723
- def handle_errors(self, code, reason, url, method, headers, body, response, requestHeaders, requestBody):
1723
+ def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
1724
1724
  if response is None:
1725
1725
  return None # fallback to default error handler
1726
1726
  if 'errorCode' in response: