ccxt 4.1.54__py2.py3-none-any.whl → 4.1.56__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 (251) hide show
  1. ccxt/__init__.py +2 -2
  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/abstract/bitbank.py +1 -0
  7. ccxt/abstract/coinbase.py +2 -0
  8. ccxt/abstract/htx.py +3 -0
  9. ccxt/abstract/huobi.py +3 -0
  10. ccxt/abstract/huobipro.py +3 -0
  11. ccxt/abstract/okex.py +3 -1
  12. ccxt/abstract/okex5.py +3 -1
  13. ccxt/abstract/okx.py +3 -1
  14. ccxt/ace.py +23 -23
  15. ccxt/alpaca.py +8 -8
  16. ccxt/ascendex.py +26 -26
  17. ccxt/async_support/__init__.py +2 -2
  18. ccxt/async_support/ace.py +23 -23
  19. ccxt/async_support/alpaca.py +8 -8
  20. ccxt/async_support/ascendex.py +26 -26
  21. ccxt/async_support/base/exchange.py +4 -2216
  22. ccxt/async_support/bigone.py +21 -24
  23. ccxt/async_support/binance.py +61 -54
  24. ccxt/async_support/bingx.py +28 -28
  25. ccxt/async_support/bit2c.py +9 -9
  26. ccxt/async_support/bitbank.py +11 -10
  27. ccxt/async_support/bitbns.py +11 -11
  28. ccxt/async_support/bitfinex.py +15 -15
  29. ccxt/async_support/bitfinex2.py +22 -22
  30. ccxt/async_support/bitflyer.py +13 -13
  31. ccxt/async_support/bitforex.py +10 -10
  32. ccxt/async_support/bitget.py +44 -44
  33. ccxt/async_support/bithumb.py +9 -9
  34. ccxt/async_support/bitmart.py +85 -104
  35. ccxt/async_support/bitmex.py +27 -27
  36. ccxt/async_support/bitopro.py +18 -18
  37. ccxt/async_support/bitpanda.py +18 -18
  38. ccxt/async_support/bitrue.py +14 -14
  39. ccxt/async_support/bitso.py +17 -17
  40. ccxt/async_support/bitstamp.py +17 -17
  41. ccxt/async_support/bittrex.py +22 -24
  42. ccxt/async_support/bitvavo.py +15 -15
  43. ccxt/async_support/bl3p.py +4 -4
  44. ccxt/async_support/blockchaincom.py +17 -17
  45. ccxt/async_support/btcalpha.py +14 -14
  46. ccxt/async_support/btcbox.py +9 -9
  47. ccxt/async_support/btcmarkets.py +17 -17
  48. ccxt/async_support/btcturk.py +9 -9
  49. ccxt/async_support/bybit.py +46 -46
  50. ccxt/async_support/cex.py +10 -10
  51. ccxt/async_support/coinbase.py +69 -25
  52. ccxt/async_support/coinbasepro.py +19 -19
  53. ccxt/async_support/coincheck.py +10 -10
  54. ccxt/async_support/coinex.py +57 -66
  55. ccxt/async_support/coinlist.py +22 -22
  56. ccxt/async_support/coinmate.py +10 -10
  57. ccxt/async_support/coinone.py +10 -10
  58. ccxt/async_support/coinsph.py +17 -17
  59. ccxt/async_support/coinspot.py +5 -5
  60. ccxt/async_support/cryptocom.py +27 -27
  61. ccxt/async_support/currencycom.py +18 -18
  62. ccxt/async_support/delta.py +21 -21
  63. ccxt/async_support/deribit.py +24 -24
  64. ccxt/async_support/digifinex.py +35 -35
  65. ccxt/async_support/exmo.py +19 -19
  66. ccxt/async_support/gate.py +38 -38
  67. ccxt/async_support/gemini.py +11 -11
  68. ccxt/async_support/hitbtc.py +27 -27
  69. ccxt/async_support/hollaex.py +19 -19
  70. ccxt/async_support/htx.py +47 -44
  71. ccxt/async_support/huobijp.py +22 -22
  72. ccxt/async_support/idex.py +20 -20
  73. ccxt/async_support/independentreserve.py +9 -9
  74. ccxt/async_support/indodax.py +10 -10
  75. ccxt/async_support/kraken.py +25 -25
  76. ccxt/async_support/krakenfutures.py +17 -17
  77. ccxt/async_support/kucoin.py +27 -27
  78. ccxt/async_support/kucoinfutures.py +20 -20
  79. ccxt/async_support/kuna.py +19 -19
  80. ccxt/async_support/latoken.py +14 -14
  81. ccxt/async_support/lbank.py +18 -18
  82. ccxt/async_support/luno.py +14 -14
  83. ccxt/async_support/lykke.py +12 -12
  84. ccxt/async_support/mercado.py +11 -11
  85. ccxt/async_support/mexc.py +36 -36
  86. ccxt/async_support/ndax.py +18 -18
  87. ccxt/async_support/novadax.py +17 -17
  88. ccxt/async_support/oceanex.py +12 -12
  89. ccxt/async_support/okcoin.py +19 -19
  90. ccxt/async_support/okx.py +48 -45
  91. ccxt/async_support/p2b.py +6 -6
  92. ccxt/async_support/paymium.py +6 -6
  93. ccxt/async_support/phemex.py +57 -57
  94. ccxt/async_support/poloniex.py +31 -30
  95. ccxt/async_support/poloniexfutures.py +16 -16
  96. ccxt/async_support/probit.py +22 -22
  97. ccxt/async_support/tidex.py +15 -15
  98. ccxt/async_support/timex.py +20 -20
  99. ccxt/async_support/tokocrypto.py +16 -16
  100. ccxt/async_support/upbit.py +15 -15
  101. ccxt/async_support/wavesexchange.py +12 -12
  102. ccxt/async_support/wazirx.py +13 -13
  103. ccxt/async_support/whitebit.py +26 -26
  104. ccxt/async_support/woo.py +47 -47
  105. ccxt/async_support/yobit.py +8 -8
  106. ccxt/async_support/zaif.py +10 -10
  107. ccxt/async_support/zonda.py +16 -16
  108. ccxt/base/errors.py +17 -16
  109. ccxt/base/exchange.py +57 -97
  110. ccxt/base/types.py +138 -139
  111. ccxt/bigone.py +21 -24
  112. ccxt/binance.py +61 -54
  113. ccxt/bingx.py +28 -28
  114. ccxt/bit2c.py +9 -9
  115. ccxt/bitbank.py +11 -10
  116. ccxt/bitbns.py +11 -11
  117. ccxt/bitfinex.py +15 -15
  118. ccxt/bitfinex2.py +22 -22
  119. ccxt/bitflyer.py +13 -13
  120. ccxt/bitforex.py +10 -10
  121. ccxt/bitget.py +44 -44
  122. ccxt/bithumb.py +9 -9
  123. ccxt/bitmart.py +85 -104
  124. ccxt/bitmex.py +27 -27
  125. ccxt/bitopro.py +18 -18
  126. ccxt/bitpanda.py +18 -18
  127. ccxt/bitrue.py +14 -14
  128. ccxt/bitso.py +17 -17
  129. ccxt/bitstamp.py +17 -17
  130. ccxt/bittrex.py +22 -24
  131. ccxt/bitvavo.py +15 -15
  132. ccxt/bl3p.py +4 -4
  133. ccxt/blockchaincom.py +17 -17
  134. ccxt/btcalpha.py +14 -14
  135. ccxt/btcbox.py +9 -9
  136. ccxt/btcmarkets.py +17 -17
  137. ccxt/btcturk.py +9 -9
  138. ccxt/bybit.py +46 -46
  139. ccxt/cex.py +10 -10
  140. ccxt/coinbase.py +69 -25
  141. ccxt/coinbasepro.py +19 -19
  142. ccxt/coincheck.py +10 -10
  143. ccxt/coinex.py +57 -66
  144. ccxt/coinlist.py +22 -22
  145. ccxt/coinmate.py +10 -10
  146. ccxt/coinone.py +10 -10
  147. ccxt/coinsph.py +17 -17
  148. ccxt/coinspot.py +5 -5
  149. ccxt/cryptocom.py +27 -27
  150. ccxt/currencycom.py +18 -18
  151. ccxt/delta.py +21 -21
  152. ccxt/deribit.py +24 -24
  153. ccxt/digifinex.py +35 -35
  154. ccxt/exmo.py +19 -19
  155. ccxt/gate.py +38 -38
  156. ccxt/gemini.py +11 -11
  157. ccxt/hitbtc.py +27 -27
  158. ccxt/hollaex.py +19 -19
  159. ccxt/htx.py +47 -44
  160. ccxt/huobijp.py +22 -22
  161. ccxt/idex.py +20 -20
  162. ccxt/independentreserve.py +9 -9
  163. ccxt/indodax.py +10 -10
  164. ccxt/kraken.py +25 -25
  165. ccxt/krakenfutures.py +17 -17
  166. ccxt/kucoin.py +27 -27
  167. ccxt/kucoinfutures.py +20 -20
  168. ccxt/kuna.py +19 -19
  169. ccxt/latoken.py +14 -14
  170. ccxt/lbank.py +18 -18
  171. ccxt/luno.py +14 -14
  172. ccxt/lykke.py +12 -12
  173. ccxt/mercado.py +11 -11
  174. ccxt/mexc.py +36 -36
  175. ccxt/ndax.py +18 -18
  176. ccxt/novadax.py +17 -17
  177. ccxt/oceanex.py +12 -12
  178. ccxt/okcoin.py +19 -19
  179. ccxt/okx.py +48 -45
  180. ccxt/p2b.py +6 -6
  181. ccxt/paymium.py +6 -6
  182. ccxt/phemex.py +57 -57
  183. ccxt/poloniex.py +31 -30
  184. ccxt/poloniexfutures.py +16 -16
  185. ccxt/pro/__init__.py +1 -1
  186. ccxt/pro/alpaca.py +3 -3
  187. ccxt/pro/ascendex.py +2 -2
  188. ccxt/pro/binance.py +9 -9
  189. ccxt/pro/bingx.py +3 -3
  190. ccxt/pro/bitfinex.py +3 -3
  191. ccxt/pro/bitfinex2.py +3 -3
  192. ccxt/pro/bitget.py +3 -3
  193. ccxt/pro/bitmart.py +2 -2
  194. ccxt/pro/bitmex.py +3 -3
  195. ccxt/pro/bitpanda.py +3 -3
  196. ccxt/pro/bitrue.py +2 -2
  197. ccxt/pro/bitstamp.py +2 -2
  198. ccxt/pro/bittrex.py +3 -3
  199. ccxt/pro/bitvavo.py +3 -3
  200. ccxt/pro/blockchaincom.py +2 -2
  201. ccxt/pro/bybit.py +4 -4
  202. ccxt/pro/cex.py +3 -3
  203. ccxt/pro/coinbasepro.py +3 -3
  204. ccxt/pro/coinex.py +2 -2
  205. ccxt/pro/cryptocom.py +5 -5
  206. ccxt/pro/deribit.py +3 -3
  207. ccxt/pro/exmo.py +2 -2
  208. ccxt/pro/gate.py +3 -3
  209. ccxt/pro/gemini.py +2 -2
  210. ccxt/pro/hitbtc.py +4 -4
  211. ccxt/pro/hollaex.py +3 -3
  212. ccxt/pro/htx.py +3 -3
  213. ccxt/pro/idex.py +3 -3
  214. ccxt/pro/kraken.py +7 -7
  215. ccxt/pro/krakenfutures.py +4 -4
  216. ccxt/pro/kucoin.py +3 -3
  217. ccxt/pro/kucoinfutures.py +3 -3
  218. ccxt/pro/mexc.py +3 -3
  219. ccxt/pro/okcoin.py +2 -2
  220. ccxt/pro/okx.py +6 -6
  221. ccxt/pro/phemex.py +3 -3
  222. ccxt/pro/poloniex.py +3 -3
  223. ccxt/pro/poloniexfutures.py +3 -3
  224. ccxt/pro/probit.py +3 -3
  225. ccxt/pro/wazirx.py +3 -3
  226. ccxt/pro/whitebit.py +3 -3
  227. ccxt/pro/woo.py +2 -2
  228. ccxt/probit.py +22 -22
  229. ccxt/test/base/test_shared_methods.py +3 -3
  230. ccxt/test/test_async.py +543 -535
  231. ccxt/test/test_sync.py +542 -534
  232. ccxt/tidex.py +15 -15
  233. ccxt/timex.py +20 -20
  234. ccxt/tokocrypto.py +16 -16
  235. ccxt/upbit.py +15 -15
  236. ccxt/wavesexchange.py +12 -12
  237. ccxt/wazirx.py +13 -13
  238. ccxt/whitebit.py +26 -26
  239. ccxt/woo.py +47 -47
  240. ccxt/yobit.py +8 -8
  241. ccxt/zaif.py +10 -10
  242. ccxt/zonda.py +16 -16
  243. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
  244. ccxt-4.1.56.dist-info/RECORD +449 -0
  245. ccxt/async_support/bitstamp1.py +0 -402
  246. ccxt/async_support/lbank2.py +0 -2620
  247. ccxt/bitstamp1.py +0 -402
  248. ccxt/lbank2.py +0 -2619
  249. ccxt-4.1.54.dist-info/RECORD +0 -453
  250. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
  251. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.hollaex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Int, Order, OrderBook, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ArgumentsRequired
12
12
  from ccxt.base.errors import BadRequest
@@ -529,7 +529,7 @@ class hollaex(Exchange, ImplicitAPI):
529
529
  result[symbol] = self.extend(self.parse_ticker(ticker, market), params)
530
530
  return self.filter_by_array_tickers(result, 'symbol', symbols)
531
531
 
532
- def parse_ticker(self, ticker, market=None) -> Ticker:
532
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
533
533
  #
534
534
  # fetchTicker
535
535
  #
@@ -615,7 +615,7 @@ class hollaex(Exchange, ImplicitAPI):
615
615
  trades = self.safe_value(response, market['id'], [])
616
616
  return self.parse_trades(trades, market, since, limit)
617
617
 
618
- def parse_trade(self, trade, market=None) -> Trade:
618
+ def parse_trade(self, trade, market: Market = None) -> Trade:
619
619
  #
620
620
  # fetchTrades(public)
621
621
  #
@@ -773,7 +773,7 @@ class hollaex(Exchange, ImplicitAPI):
773
773
  #
774
774
  return self.parse_ohlcvs(response, market, timeframe, since, limit)
775
775
 
776
- def parse_ohlcv(self, ohlcv, market=None) -> list:
776
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
777
777
  #
778
778
  # {
779
779
  # "time":"2020-03-02T20:00:00.000Z",
@@ -833,7 +833,7 @@ class hollaex(Exchange, ImplicitAPI):
833
833
  #
834
834
  return self.parse_balance(response)
835
835
 
836
- async def fetch_open_order(self, id: str, symbol: String = None, params={}):
836
+ async def fetch_open_order(self, id: str, symbol: Str = None, params={}):
837
837
  """
838
838
  fetch an open order by it's id
839
839
  :param str id: order id
@@ -872,7 +872,7 @@ class hollaex(Exchange, ImplicitAPI):
872
872
  #
873
873
  return self.parse_order(response)
874
874
 
875
- async def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
875
+ async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
876
876
  """
877
877
  fetch all unfilled currently open orders
878
878
  :param str symbol: unified market symbol
@@ -886,7 +886,7 @@ class hollaex(Exchange, ImplicitAPI):
886
886
  }
887
887
  return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
888
888
 
889
- async def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
889
+ async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
890
890
  """
891
891
  fetches information on multiple closed orders made by the user
892
892
  :param str symbol: unified market symbol of the market orders were made in
@@ -900,7 +900,7 @@ class hollaex(Exchange, ImplicitAPI):
900
900
  }
901
901
  return await self.fetch_orders(symbol, since, limit, self.extend(request, params))
902
902
 
903
- async def fetch_order(self, id: str, symbol: String = None, params={}):
903
+ async def fetch_order(self, id: str, symbol: Str = None, params={}):
904
904
  """
905
905
  fetches information on an order made by the user
906
906
  :param str symbol: unified symbol of the market the order was made in
@@ -939,7 +939,7 @@ class hollaex(Exchange, ImplicitAPI):
939
939
  raise OrderNotFound(self.id + ' fetchOrder() could not find order id ' + id)
940
940
  return self.parse_order(order)
941
941
 
942
- async def fetch_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
942
+ async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
943
943
  """
944
944
  fetches information on multiple orders made by the user
945
945
  :param str symbol: unified market symbol of the market orders were made in
@@ -1011,7 +1011,7 @@ class hollaex(Exchange, ImplicitAPI):
1011
1011
  }
1012
1012
  return self.safe_string(statuses, status, status)
1013
1013
 
1014
- def parse_order(self, order, market=None) -> Order:
1014
+ def parse_order(self, order, market: Market = None) -> Order:
1015
1015
  #
1016
1016
  # createOrder, fetchOpenOrder, fetchOpenOrders
1017
1017
  #
@@ -1141,7 +1141,7 @@ class hollaex(Exchange, ImplicitAPI):
1141
1141
  #
1142
1142
  return self.parse_order(response, market)
1143
1143
 
1144
- async def cancel_order(self, id: str, symbol: String = None, params={}):
1144
+ async def cancel_order(self, id: str, symbol: Str = None, params={}):
1145
1145
  """
1146
1146
  cancels an open order
1147
1147
  :param str id: order id
@@ -1169,7 +1169,7 @@ class hollaex(Exchange, ImplicitAPI):
1169
1169
  #
1170
1170
  return self.parse_order(response)
1171
1171
 
1172
- async def cancel_all_orders(self, symbol: String = None, params={}):
1172
+ async def cancel_all_orders(self, symbol: Str = None, params={}):
1173
1173
  """
1174
1174
  cancel all open orders in a market
1175
1175
  :param str symbol: unified market symbol of the market to cancel orders in
@@ -1200,7 +1200,7 @@ class hollaex(Exchange, ImplicitAPI):
1200
1200
  #
1201
1201
  return self.parse_orders(response, market)
1202
1202
 
1203
- async def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
1203
+ async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1204
1204
  """
1205
1205
  fetch all trades made by the user
1206
1206
  :param str symbol: unified market symbol
@@ -1246,7 +1246,7 @@ class hollaex(Exchange, ImplicitAPI):
1246
1246
  data = self.safe_value(response, 'data', [])
1247
1247
  return self.parse_trades(data, market, since, limit)
1248
1248
 
1249
- def parse_deposit_address(self, depositAddress, currency=None):
1249
+ def parse_deposit_address(self, depositAddress, currency: Currency = None):
1250
1250
  #
1251
1251
  # {
1252
1252
  # "currency":"usdt",
@@ -1335,7 +1335,7 @@ class hollaex(Exchange, ImplicitAPI):
1335
1335
  addresses = wallet if (network is None) else self.filter_by(wallet, 'network', network)
1336
1336
  return self.parse_deposit_addresses(addresses, codes)
1337
1337
 
1338
- async def fetch_deposits(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1338
+ async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1339
1339
  """
1340
1340
  fetch all deposits made to an account
1341
1341
  :param str code: unified currency code
@@ -1389,7 +1389,7 @@ class hollaex(Exchange, ImplicitAPI):
1389
1389
  data = self.safe_value(response, 'data', [])
1390
1390
  return self.parse_transactions(data, currency, since, limit)
1391
1391
 
1392
- async def fetch_withdrawal(self, id: str, code: String = None, params={}):
1392
+ async def fetch_withdrawal(self, id: str, code: Str = None, params={}):
1393
1393
  """
1394
1394
  fetch data on a currency withdrawal via the withdrawal id
1395
1395
  :param str id: withdrawal id
@@ -1433,7 +1433,7 @@ class hollaex(Exchange, ImplicitAPI):
1433
1433
  transaction = self.safe_value(data, 0, {})
1434
1434
  return self.parse_transaction(transaction, currency)
1435
1435
 
1436
- async def fetch_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1436
+ async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1437
1437
  """
1438
1438
  fetch all withdrawals made from an account
1439
1439
  :param str code: unified currency code
@@ -1487,7 +1487,7 @@ class hollaex(Exchange, ImplicitAPI):
1487
1487
  data = self.safe_value(response, 'data', [])
1488
1488
  return self.parse_transactions(data, currency, since, limit)
1489
1489
 
1490
- def parse_transaction(self, transaction, currency=None) -> Transaction:
1490
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
1491
1491
  #
1492
1492
  # fetchWithdrawals, fetchDeposits
1493
1493
  #
@@ -1621,7 +1621,7 @@ class hollaex(Exchange, ImplicitAPI):
1621
1621
  #
1622
1622
  return self.parse_transaction(response, currency)
1623
1623
 
1624
- def parse_deposit_withdraw_fee(self, fee, currency=None):
1624
+ def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
1625
1625
  #
1626
1626
  # "bch":{
1627
1627
  # "id":4,
ccxt/async_support/htx.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.htx import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Int, Order, OrderBook, OrderRequest, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade, Transaction
10
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import PermissionDenied
@@ -515,6 +515,7 @@ class htx(Exchange, ImplicitAPI):
515
515
  # Future Market Data interface
516
516
  'api/v1/contract_contract_info': 1,
517
517
  'api/v1/contract_index': 1,
518
+ 'api/v1/contract_query_elements': 1,
518
519
  'api/v1/contract_price_limit': 1,
519
520
  'api/v1/contract_open_interest': 1,
520
521
  'api/v1/contract_delivery_price': 1,
@@ -544,6 +545,7 @@ class htx(Exchange, ImplicitAPI):
544
545
  # Swap Market Data interface
545
546
  'swap-api/v1/swap_contract_info': 1,
546
547
  'swap-api/v1/swap_index': 1,
548
+ 'swap-api/v1/swap_query_elements': 1,
547
549
  'swap-api/v1/swap_price_limit': 1,
548
550
  'swap-api/v1/swap_open_interest': 1,
549
551
  'swap-ex/market/depth': 1,
@@ -576,6 +578,7 @@ class htx(Exchange, ImplicitAPI):
576
578
  # Swap Market Data interface
577
579
  'linear-swap-api/v1/swap_contract_info': 1,
578
580
  'linear-swap-api/v1/swap_index': 1,
581
+ 'linear-swap-api/v1/swap_query_elements': 1,
579
582
  'linear-swap-api/v1/swap_price_limit': 1,
580
583
  'linear-swap-api/v1/swap_open_interest': 1,
581
584
  'linear-swap-ex/market/depth': 1,
@@ -1463,7 +1466,7 @@ class htx(Exchange, ImplicitAPI):
1463
1466
  #
1464
1467
  return self.safe_integer_2(response, 'data', 'ts')
1465
1468
 
1466
- def parse_trading_fee(self, fee, market=None):
1469
+ def parse_trading_fee(self, fee, market: Market = None):
1467
1470
  #
1468
1471
  # {
1469
1472
  # "symbol":"btcusdt",
@@ -1549,7 +1552,7 @@ class htx(Exchange, ImplicitAPI):
1549
1552
  #
1550
1553
  return self.parse_trading_limits(self.safe_value(response, 'data', {}))
1551
1554
 
1552
- def parse_trading_limits(self, limits, symbol: String = None, params={}):
1555
+ def parse_trading_limits(self, limits, symbol: Str = None, params={}):
1553
1556
  #
1554
1557
  # { "symbol": "aidocbtc",
1555
1558
  # "buy-limit-must-less-than": 1.1,
@@ -1885,7 +1888,7 @@ class htx(Exchange, ImplicitAPI):
1885
1888
  })
1886
1889
  return result
1887
1890
 
1888
- def parse_ticker(self, ticker, market=None) -> Ticker:
1891
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
1889
1892
  #
1890
1893
  # fetchTicker
1891
1894
  #
@@ -2273,7 +2276,7 @@ class htx(Exchange, ImplicitAPI):
2273
2276
  return result
2274
2277
  raise ExchangeError(self.id + ' fetchOrderBook() returned unrecognized response: ' + self.json(response))
2275
2278
 
2276
- def parse_trade(self, trade, market=None) -> Trade:
2279
+ def parse_trade(self, trade, market: Market = None) -> Trade:
2277
2280
  #
2278
2281
  # spot fetchTrades(public)
2279
2282
  #
@@ -2402,7 +2405,7 @@ class htx(Exchange, ImplicitAPI):
2402
2405
  'fee': fee,
2403
2406
  }, market)
2404
2407
 
2405
- async def fetch_order_trades(self, id: str, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2408
+ async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2406
2409
  """
2407
2410
  fetch all the trades made from a single order
2408
2411
  :param str id: order id
@@ -2421,7 +2424,7 @@ class htx(Exchange, ImplicitAPI):
2421
2424
  raise NotSupported(self.id + ' fetchOrderTrades() is only supported for spot markets')
2422
2425
  return await self.fetch_spot_order_trades(id, symbol, since, limit, params)
2423
2426
 
2424
- async def fetch_spot_order_trades(self, id: str, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2427
+ async def fetch_spot_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2425
2428
  await self.load_markets()
2426
2429
  request = {
2427
2430
  'order-id': id,
@@ -2429,7 +2432,7 @@ class htx(Exchange, ImplicitAPI):
2429
2432
  response = await self.spotPrivateGetV1OrderOrdersOrderIdMatchresults(self.extend(request, params))
2430
2433
  return self.parse_trades(response['data'], None, since, limit)
2431
2434
 
2432
- async def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2435
+ async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2433
2436
  """
2434
2437
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-match-results-via-multiple-fields-new
2435
2438
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-match-results-via-multiple-fields-new
@@ -2653,7 +2656,7 @@ class htx(Exchange, ImplicitAPI):
2653
2656
  result = self.sort_by(result, 'timestamp')
2654
2657
  return self.filter_by_symbol_since_limit(result, market['symbol'], since, limit)
2655
2658
 
2656
- def parse_ohlcv(self, ohlcv, market=None) -> list:
2659
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
2657
2660
  #
2658
2661
  # {
2659
2662
  # "amount":1.2082,
@@ -3308,7 +3311,7 @@ class htx(Exchange, ImplicitAPI):
3308
3311
  result = self.safe_balance(result)
3309
3312
  return result
3310
3313
 
3311
- async def fetch_order(self, id: str, symbol: String = None, params={}):
3314
+ async def fetch_order(self, id: str, symbol: Str = None, params={}):
3312
3315
  """
3313
3316
  fetches information on an order made by the user
3314
3317
  :param str symbol: unified symbol of the market the order was made in
@@ -3513,7 +3516,7 @@ class htx(Exchange, ImplicitAPI):
3513
3516
  account['used'] = self.safe_string(balance, 'balance')
3514
3517
  return account
3515
3518
 
3516
- async def fetch_spot_orders_by_states(self, states, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3519
+ async def fetch_spot_orders_by_states(self, states, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3517
3520
  method = self.safe_string(self.options, 'fetchOrdersByStatesMethod', 'spot_private_get_v1_order_orders') # spot_private_get_v1_order_history
3518
3521
  if method == 'spot_private_get_v1_order_orders':
3519
3522
  self.check_required_symbol('fetchOrders', symbol)
@@ -3575,13 +3578,13 @@ class htx(Exchange, ImplicitAPI):
3575
3578
  data = self.safe_value(response, 'data', [])
3576
3579
  return self.parse_orders(data, market, since, limit)
3577
3580
 
3578
- async def fetch_spot_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3581
+ async def fetch_spot_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3579
3582
  return await self.fetch_spot_orders_by_states('pre-submitted,submitted,partial-filled,filled,partial-canceled,canceled', symbol, since, limit, params)
3580
3583
 
3581
- async def fetch_closed_spot_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3584
+ async def fetch_closed_spot_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3582
3585
  return await self.fetch_spot_orders_by_states('filled,partial-canceled,canceled', symbol, since, limit, params)
3583
3586
 
3584
- async def fetch_contract_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3587
+ async def fetch_contract_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3585
3588
  self.check_required_symbol('fetchContractOrders', symbol)
3586
3589
  await self.load_markets()
3587
3590
  market = self.market(symbol)
@@ -3792,13 +3795,13 @@ class htx(Exchange, ImplicitAPI):
3792
3795
  orders = self.safe_value(orders, 'orders', [])
3793
3796
  return self.parse_orders(orders, market, since, limit)
3794
3797
 
3795
- async def fetch_closed_contract_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3798
+ async def fetch_closed_contract_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3796
3799
  request = {
3797
3800
  'status': '5,6,7', # comma separated, 0 all, 3 submitted orders, 4 partially matched, 5 partially cancelled, 6 fully matched and closed, 7 canceled
3798
3801
  }
3799
3802
  return await self.fetch_contract_orders(symbol, since, limit, self.extend(request, params))
3800
3803
 
3801
- async def fetch_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3804
+ async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3802
3805
  """
3803
3806
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
3804
3807
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
@@ -3830,7 +3833,7 @@ class htx(Exchange, ImplicitAPI):
3830
3833
  else:
3831
3834
  return await self.fetch_spot_orders(symbol, since, limit, params)
3832
3835
 
3833
- async def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3836
+ async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3834
3837
  """
3835
3838
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
3836
3839
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
@@ -3862,7 +3865,7 @@ class htx(Exchange, ImplicitAPI):
3862
3865
  else:
3863
3866
  return await self.fetch_closed_contract_orders(symbol, since, limit, params)
3864
3867
 
3865
- async def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3868
+ async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3866
3869
  """
3867
3870
  :see: https://huobiapi.github.io/docs/spot/v1/en/#get-all-open-orders
3868
3871
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-current-unfilled-order-acquisition
@@ -4116,7 +4119,7 @@ class htx(Exchange, ImplicitAPI):
4116
4119
  }
4117
4120
  return self.safe_string(statuses, status, status)
4118
4121
 
4119
- def parse_order(self, order, market=None) -> Order:
4122
+ def parse_order(self, order, market: Market = None) -> Order:
4120
4123
  #
4121
4124
  # spot
4122
4125
  #
@@ -4945,7 +4948,7 @@ class htx(Exchange, ImplicitAPI):
4945
4948
  result = self.array_concat(success, errors)
4946
4949
  return self.parse_orders(result, market)
4947
4950
 
4948
- async def cancel_order(self, id: str, symbol: String = None, params={}):
4951
+ async def cancel_order(self, id: str, symbol: Str = None, params={}):
4949
4952
  """
4950
4953
  cancels an open order
4951
4954
  :param str id: order id
@@ -5057,7 +5060,7 @@ class htx(Exchange, ImplicitAPI):
5057
5060
  'status': 'canceled',
5058
5061
  })
5059
5062
 
5060
- async def cancel_orders(self, ids, symbol: String = None, params={}):
5063
+ async def cancel_orders(self, ids, symbol: Str = None, params={}):
5061
5064
  """
5062
5065
  cancel multiple orders
5063
5066
  :param str[] ids: order ids
@@ -5203,7 +5206,7 @@ class htx(Exchange, ImplicitAPI):
5203
5206
  #
5204
5207
  return response
5205
5208
 
5206
- async def cancel_all_orders(self, symbol: String = None, params={}):
5209
+ async def cancel_all_orders(self, symbol: Str = None, params={}):
5207
5210
  """
5208
5211
  cancel all open orders
5209
5212
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
@@ -5305,7 +5308,7 @@ class htx(Exchange, ImplicitAPI):
5305
5308
  #
5306
5309
  return response
5307
5310
 
5308
- def parse_deposit_address(self, depositAddress, currency=None):
5311
+ def parse_deposit_address(self, depositAddress, currency: Currency = None):
5309
5312
  #
5310
5313
  # {
5311
5314
  # "currency": "usdt",
@@ -5407,7 +5410,7 @@ class htx(Exchange, ImplicitAPI):
5407
5410
  addresses.append(address)
5408
5411
  return addresses
5409
5412
 
5410
- async def fetch_deposits(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5413
+ async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5411
5414
  """
5412
5415
  fetch all deposits made to an account
5413
5416
  :param str code: unified currency code
@@ -5460,7 +5463,7 @@ class htx(Exchange, ImplicitAPI):
5460
5463
  #
5461
5464
  return self.parse_transactions(response['data'], currency, since, limit)
5462
5465
 
5463
- async def fetch_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5466
+ async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5464
5467
  """
5465
5468
  fetch all withdrawals made from an account
5466
5469
  :param str code: unified currency code
@@ -5511,7 +5514,7 @@ class htx(Exchange, ImplicitAPI):
5511
5514
  #
5512
5515
  return self.parse_transactions(response['data'], currency, since, limit)
5513
5516
 
5514
- def parse_transaction(self, transaction, currency=None) -> Transaction:
5517
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
5515
5518
  #
5516
5519
  # fetchDeposits
5517
5520
  #
@@ -5679,7 +5682,7 @@ class htx(Exchange, ImplicitAPI):
5679
5682
  #
5680
5683
  return self.parse_transaction(response, currency)
5681
5684
 
5682
- def parse_transfer(self, transfer, currency=None):
5685
+ def parse_transfer(self, transfer, currency: Currency = None):
5683
5686
  #
5684
5687
  # transfer
5685
5688
  #
@@ -5902,7 +5905,7 @@ class htx(Exchange, ImplicitAPI):
5902
5905
  }
5903
5906
  return rates
5904
5907
 
5905
- async def fetch_funding_rate_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
5908
+ async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5906
5909
  """
5907
5910
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-funding-rate
5908
5911
  :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-funding-rate
@@ -5973,7 +5976,7 @@ class htx(Exchange, ImplicitAPI):
5973
5976
  sorted = self.sort_by(rates, 'timestamp')
5974
5977
  return self.filter_by_symbol_since_limit(sorted, market['symbol'], since, limit)
5975
5978
 
5976
- def parse_funding_rate(self, contract, market=None):
5979
+ def parse_funding_rate(self, contract, market: Market = None):
5977
5980
  #
5978
5981
  # {
5979
5982
  # "status": "ok",
@@ -6096,7 +6099,7 @@ class htx(Exchange, ImplicitAPI):
6096
6099
  result = self.parse_funding_rates(data)
6097
6100
  return self.filter_by_array(result, 'symbol', symbols)
6098
6101
 
6099
- async def fetch_borrow_interest(self, code: String = None, symbol: String = None, since: Int = None, limit: Int = None, params={}):
6102
+ async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6100
6103
  """
6101
6104
  fetch the interest owed by the user for borrowing currency for margin trading
6102
6105
  :param str code: unified currency code
@@ -6154,7 +6157,7 @@ class htx(Exchange, ImplicitAPI):
6154
6157
  interest = self.parse_borrow_interests(data, market)
6155
6158
  return self.filter_by_currency_since_limit(interest, code, since, limit)
6156
6159
 
6157
- def parse_borrow_interest(self, info, market=None):
6160
+ def parse_borrow_interest(self, info, market: Market = None):
6158
6161
  # isolated
6159
6162
  # {
6160
6163
  # "interest-rate":"0.000040830000000000",
@@ -6345,7 +6348,7 @@ class htx(Exchange, ImplicitAPI):
6345
6348
  self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
6346
6349
  return None
6347
6350
 
6348
- async def fetch_funding_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
6351
+ async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6349
6352
  """
6350
6353
  fetch the history of funding payments paid and received on self account
6351
6354
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-account-financial-records-via-multiple-fields-new # linear swaps
@@ -6428,7 +6431,7 @@ class htx(Exchange, ImplicitAPI):
6428
6431
  data = self.safe_value(response, 'data', [])
6429
6432
  return self.parse_incomes(data, market, since, limit)
6430
6433
 
6431
- async def set_leverage(self, leverage, symbol: String = None, params={}):
6434
+ async def set_leverage(self, leverage, symbol: Str = None, params={}):
6432
6435
  """
6433
6436
  set the level of leverage for a market
6434
6437
  :param float leverage: the rate of leverage
@@ -6491,7 +6494,7 @@ class htx(Exchange, ImplicitAPI):
6491
6494
  response = await getattr(self, method)(self.extend(request, query))
6492
6495
  return response
6493
6496
 
6494
- def parse_income(self, income, market=None):
6497
+ def parse_income(self, income, market: Market = None):
6495
6498
  #
6496
6499
  # {
6497
6500
  # "id": "1667161118",
@@ -6519,7 +6522,7 @@ class htx(Exchange, ImplicitAPI):
6519
6522
  'amount': amount,
6520
6523
  }
6521
6524
 
6522
- def parse_position(self, position, market=None):
6525
+ def parse_position(self, position, market: Market = None):
6523
6526
  #
6524
6527
  # {
6525
6528
  # "symbol": "BTC",
@@ -6991,7 +6994,7 @@ class htx(Exchange, ImplicitAPI):
6991
6994
  }
6992
6995
  return self.safe_string(types, type, type)
6993
6996
 
6994
- def parse_ledger_entry(self, item, currency=None):
6997
+ def parse_ledger_entry(self, item, currency: Currency = None):
6995
6998
  #
6996
6999
  # {
6997
7000
  # "accountId": 10000001,
@@ -7033,7 +7036,7 @@ class htx(Exchange, ImplicitAPI):
7033
7036
  'info': item,
7034
7037
  }
7035
7038
 
7036
- async def fetch_ledger(self, code: String = None, since: Int = None, limit: Int = None, params={}):
7039
+ async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
7037
7040
  """
7038
7041
  :see: https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
7039
7042
  fetch the history of changes, actions done by the user or operations that altered balance of the user
@@ -7432,7 +7435,7 @@ class htx(Exchange, ImplicitAPI):
7432
7435
  openInterest['datetime'] = self.iso8601(timestamp)
7433
7436
  return openInterest
7434
7437
 
7435
- def parse_open_interest(self, interest, market=None):
7438
+ def parse_open_interest(self, interest, market: Market = None):
7436
7439
  #
7437
7440
  # fetchOpenInterestHistory
7438
7441
  #
@@ -7499,7 +7502,7 @@ class htx(Exchange, ImplicitAPI):
7499
7502
  'info': interest,
7500
7503
  }, market)
7501
7504
 
7502
- async def borrow_margin(self, code: str, amount, symbol: String = None, params={}):
7505
+ async def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
7503
7506
  """
7504
7507
  create a loan to borrow margin
7505
7508
  :see: https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
@@ -7548,7 +7551,7 @@ class htx(Exchange, ImplicitAPI):
7548
7551
  'symbol': symbol,
7549
7552
  })
7550
7553
 
7551
- async def repay_margin(self, code: str, amount, symbol: String = None, params={}):
7554
+ async def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
7552
7555
  """
7553
7556
  repay borrowed margin and interest
7554
7557
  :see: https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
@@ -7591,7 +7594,7 @@ class htx(Exchange, ImplicitAPI):
7591
7594
  'symbol': symbol,
7592
7595
  })
7593
7596
 
7594
- def parse_margin_loan(self, info, currency=None):
7597
+ def parse_margin_loan(self, info, currency: Currency = None):
7595
7598
  #
7596
7599
  # borrowMargin cross
7597
7600
  #
@@ -7624,7 +7627,7 @@ class htx(Exchange, ImplicitAPI):
7624
7627
  'info': info,
7625
7628
  }
7626
7629
 
7627
- async def fetch_settlement_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
7630
+ async def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
7628
7631
  """
7629
7632
  Fetches historical settlement records
7630
7633
  :param str symbol: unified symbol of the market to fetch the settlement history for
@@ -7764,7 +7767,7 @@ class htx(Exchange, ImplicitAPI):
7764
7767
  data = self.safe_value(response, 'data')
7765
7768
  return self.parse_deposit_withdraw_fees(data, codes, 'currency')
7766
7769
 
7767
- def parse_deposit_withdraw_fee(self, fee, currency=None):
7770
+ def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
7768
7771
  #
7769
7772
  # {
7770
7773
  # "currency": "sxp",
@@ -7977,7 +7980,7 @@ class htx(Exchange, ImplicitAPI):
7977
7980
  data = self.safe_value(response, 'data', [])
7978
7981
  return self.parse_liquidations(data, market, since, limit)
7979
7982
 
7980
- def parse_liquidation(self, liquidation, market=None):
7983
+ def parse_liquidation(self, liquidation, market: Market = None):
7981
7984
  #
7982
7985
  # {
7983
7986
  # "query_id": 452057,