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
ccxt/hollaex.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.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
- def fetch_open_order(self, id: str, symbol: String = None, params={}):
836
+ 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
- def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
875
+ 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 self.fetch_orders(symbol, since, limit, self.extend(request, params))
888
888
 
889
- def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
889
+ 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 self.fetch_orders(symbol, since, limit, self.extend(request, params))
902
902
 
903
- def fetch_order(self, id: str, symbol: String = None, params={}):
903
+ 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
- def fetch_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
942
+ 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
- def cancel_order(self, id: str, symbol: String = None, params={}):
1144
+ 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
- def cancel_all_orders(self, symbol: String = None, params={}):
1172
+ 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
- def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
1203
+ 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
- def fetch_deposits(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1338
+ 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
- def fetch_withdrawal(self, id: str, code: String = None, params={}):
1392
+ 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
- def fetch_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1436
+ 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/htx.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.htx import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Int, Order, OrderBook, OrderRequest, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import PermissionDenied
@@ -514,6 +514,7 @@ class htx(Exchange, ImplicitAPI):
514
514
  # Future Market Data interface
515
515
  'api/v1/contract_contract_info': 1,
516
516
  'api/v1/contract_index': 1,
517
+ 'api/v1/contract_query_elements': 1,
517
518
  'api/v1/contract_price_limit': 1,
518
519
  'api/v1/contract_open_interest': 1,
519
520
  'api/v1/contract_delivery_price': 1,
@@ -543,6 +544,7 @@ class htx(Exchange, ImplicitAPI):
543
544
  # Swap Market Data interface
544
545
  'swap-api/v1/swap_contract_info': 1,
545
546
  'swap-api/v1/swap_index': 1,
547
+ 'swap-api/v1/swap_query_elements': 1,
546
548
  'swap-api/v1/swap_price_limit': 1,
547
549
  'swap-api/v1/swap_open_interest': 1,
548
550
  'swap-ex/market/depth': 1,
@@ -575,6 +577,7 @@ class htx(Exchange, ImplicitAPI):
575
577
  # Swap Market Data interface
576
578
  'linear-swap-api/v1/swap_contract_info': 1,
577
579
  'linear-swap-api/v1/swap_index': 1,
580
+ 'linear-swap-api/v1/swap_query_elements': 1,
578
581
  'linear-swap-api/v1/swap_price_limit': 1,
579
582
  'linear-swap-api/v1/swap_open_interest': 1,
580
583
  'linear-swap-ex/market/depth': 1,
@@ -1462,7 +1465,7 @@ class htx(Exchange, ImplicitAPI):
1462
1465
  #
1463
1466
  return self.safe_integer_2(response, 'data', 'ts')
1464
1467
 
1465
- def parse_trading_fee(self, fee, market=None):
1468
+ def parse_trading_fee(self, fee, market: Market = None):
1466
1469
  #
1467
1470
  # {
1468
1471
  # "symbol":"btcusdt",
@@ -1548,7 +1551,7 @@ class htx(Exchange, ImplicitAPI):
1548
1551
  #
1549
1552
  return self.parse_trading_limits(self.safe_value(response, 'data', {}))
1550
1553
 
1551
- def parse_trading_limits(self, limits, symbol: String = None, params={}):
1554
+ def parse_trading_limits(self, limits, symbol: Str = None, params={}):
1552
1555
  #
1553
1556
  # { "symbol": "aidocbtc",
1554
1557
  # "buy-limit-must-less-than": 1.1,
@@ -1884,7 +1887,7 @@ class htx(Exchange, ImplicitAPI):
1884
1887
  })
1885
1888
  return result
1886
1889
 
1887
- def parse_ticker(self, ticker, market=None) -> Ticker:
1890
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
1888
1891
  #
1889
1892
  # fetchTicker
1890
1893
  #
@@ -2272,7 +2275,7 @@ class htx(Exchange, ImplicitAPI):
2272
2275
  return result
2273
2276
  raise ExchangeError(self.id + ' fetchOrderBook() returned unrecognized response: ' + self.json(response))
2274
2277
 
2275
- def parse_trade(self, trade, market=None) -> Trade:
2278
+ def parse_trade(self, trade, market: Market = None) -> Trade:
2276
2279
  #
2277
2280
  # spot fetchTrades(public)
2278
2281
  #
@@ -2401,7 +2404,7 @@ class htx(Exchange, ImplicitAPI):
2401
2404
  'fee': fee,
2402
2405
  }, market)
2403
2406
 
2404
- def fetch_order_trades(self, id: str, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2407
+ def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2405
2408
  """
2406
2409
  fetch all the trades made from a single order
2407
2410
  :param str id: order id
@@ -2420,7 +2423,7 @@ class htx(Exchange, ImplicitAPI):
2420
2423
  raise NotSupported(self.id + ' fetchOrderTrades() is only supported for spot markets')
2421
2424
  return self.fetch_spot_order_trades(id, symbol, since, limit, params)
2422
2425
 
2423
- def fetch_spot_order_trades(self, id: str, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2426
+ def fetch_spot_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2424
2427
  self.load_markets()
2425
2428
  request = {
2426
2429
  'order-id': id,
@@ -2428,7 +2431,7 @@ class htx(Exchange, ImplicitAPI):
2428
2431
  response = self.spotPrivateGetV1OrderOrdersOrderIdMatchresults(self.extend(request, params))
2429
2432
  return self.parse_trades(response['data'], None, since, limit)
2430
2433
 
2431
- def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2434
+ def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2432
2435
  """
2433
2436
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-match-results-via-multiple-fields-new
2434
2437
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-match-results-via-multiple-fields-new
@@ -2652,7 +2655,7 @@ class htx(Exchange, ImplicitAPI):
2652
2655
  result = self.sort_by(result, 'timestamp')
2653
2656
  return self.filter_by_symbol_since_limit(result, market['symbol'], since, limit)
2654
2657
 
2655
- def parse_ohlcv(self, ohlcv, market=None) -> list:
2658
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
2656
2659
  #
2657
2660
  # {
2658
2661
  # "amount":1.2082,
@@ -3307,7 +3310,7 @@ class htx(Exchange, ImplicitAPI):
3307
3310
  result = self.safe_balance(result)
3308
3311
  return result
3309
3312
 
3310
- def fetch_order(self, id: str, symbol: String = None, params={}):
3313
+ def fetch_order(self, id: str, symbol: Str = None, params={}):
3311
3314
  """
3312
3315
  fetches information on an order made by the user
3313
3316
  :param str symbol: unified symbol of the market the order was made in
@@ -3512,7 +3515,7 @@ class htx(Exchange, ImplicitAPI):
3512
3515
  account['used'] = self.safe_string(balance, 'balance')
3513
3516
  return account
3514
3517
 
3515
- def fetch_spot_orders_by_states(self, states, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3518
+ def fetch_spot_orders_by_states(self, states, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3516
3519
  method = self.safe_string(self.options, 'fetchOrdersByStatesMethod', 'spot_private_get_v1_order_orders') # spot_private_get_v1_order_history
3517
3520
  if method == 'spot_private_get_v1_order_orders':
3518
3521
  self.check_required_symbol('fetchOrders', symbol)
@@ -3574,13 +3577,13 @@ class htx(Exchange, ImplicitAPI):
3574
3577
  data = self.safe_value(response, 'data', [])
3575
3578
  return self.parse_orders(data, market, since, limit)
3576
3579
 
3577
- def fetch_spot_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3580
+ def fetch_spot_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3578
3581
  return self.fetch_spot_orders_by_states('pre-submitted,submitted,partial-filled,filled,partial-canceled,canceled', symbol, since, limit, params)
3579
3582
 
3580
- def fetch_closed_spot_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3583
+ def fetch_closed_spot_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3581
3584
  return self.fetch_spot_orders_by_states('filled,partial-canceled,canceled', symbol, since, limit, params)
3582
3585
 
3583
- def fetch_contract_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3586
+ def fetch_contract_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3584
3587
  self.check_required_symbol('fetchContractOrders', symbol)
3585
3588
  self.load_markets()
3586
3589
  market = self.market(symbol)
@@ -3791,13 +3794,13 @@ class htx(Exchange, ImplicitAPI):
3791
3794
  orders = self.safe_value(orders, 'orders', [])
3792
3795
  return self.parse_orders(orders, market, since, limit)
3793
3796
 
3794
- def fetch_closed_contract_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3797
+ def fetch_closed_contract_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3795
3798
  request = {
3796
3799
  'status': '5,6,7', # comma separated, 0 all, 3 submitted orders, 4 partially matched, 5 partially cancelled, 6 fully matched and closed, 7 canceled
3797
3800
  }
3798
3801
  return self.fetch_contract_orders(symbol, since, limit, self.extend(request, params))
3799
3802
 
3800
- def fetch_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3803
+ def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3801
3804
  """
3802
3805
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
3803
3806
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
@@ -3829,7 +3832,7 @@ class htx(Exchange, ImplicitAPI):
3829
3832
  else:
3830
3833
  return self.fetch_spot_orders(symbol, since, limit, params)
3831
3834
 
3832
- def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3835
+ def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3833
3836
  """
3834
3837
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
3835
3838
  :see: https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
@@ -3861,7 +3864,7 @@ class htx(Exchange, ImplicitAPI):
3861
3864
  else:
3862
3865
  return self.fetch_closed_contract_orders(symbol, since, limit, params)
3863
3866
 
3864
- def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3867
+ def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3865
3868
  """
3866
3869
  :see: https://huobiapi.github.io/docs/spot/v1/en/#get-all-open-orders
3867
3870
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-current-unfilled-order-acquisition
@@ -4115,7 +4118,7 @@ class htx(Exchange, ImplicitAPI):
4115
4118
  }
4116
4119
  return self.safe_string(statuses, status, status)
4117
4120
 
4118
- def parse_order(self, order, market=None) -> Order:
4121
+ def parse_order(self, order, market: Market = None) -> Order:
4119
4122
  #
4120
4123
  # spot
4121
4124
  #
@@ -4944,7 +4947,7 @@ class htx(Exchange, ImplicitAPI):
4944
4947
  result = self.array_concat(success, errors)
4945
4948
  return self.parse_orders(result, market)
4946
4949
 
4947
- def cancel_order(self, id: str, symbol: String = None, params={}):
4950
+ def cancel_order(self, id: str, symbol: Str = None, params={}):
4948
4951
  """
4949
4952
  cancels an open order
4950
4953
  :param str id: order id
@@ -5056,7 +5059,7 @@ class htx(Exchange, ImplicitAPI):
5056
5059
  'status': 'canceled',
5057
5060
  })
5058
5061
 
5059
- def cancel_orders(self, ids, symbol: String = None, params={}):
5062
+ def cancel_orders(self, ids, symbol: Str = None, params={}):
5060
5063
  """
5061
5064
  cancel multiple orders
5062
5065
  :param str[] ids: order ids
@@ -5202,7 +5205,7 @@ class htx(Exchange, ImplicitAPI):
5202
5205
  #
5203
5206
  return response
5204
5207
 
5205
- def cancel_all_orders(self, symbol: String = None, params={}):
5208
+ def cancel_all_orders(self, symbol: Str = None, params={}):
5206
5209
  """
5207
5210
  cancel all open orders
5208
5211
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
@@ -5304,7 +5307,7 @@ class htx(Exchange, ImplicitAPI):
5304
5307
  #
5305
5308
  return response
5306
5309
 
5307
- def parse_deposit_address(self, depositAddress, currency=None):
5310
+ def parse_deposit_address(self, depositAddress, currency: Currency = None):
5308
5311
  #
5309
5312
  # {
5310
5313
  # "currency": "usdt",
@@ -5406,7 +5409,7 @@ class htx(Exchange, ImplicitAPI):
5406
5409
  addresses.append(address)
5407
5410
  return addresses
5408
5411
 
5409
- def fetch_deposits(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5412
+ def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5410
5413
  """
5411
5414
  fetch all deposits made to an account
5412
5415
  :param str code: unified currency code
@@ -5459,7 +5462,7 @@ class htx(Exchange, ImplicitAPI):
5459
5462
  #
5460
5463
  return self.parse_transactions(response['data'], currency, since, limit)
5461
5464
 
5462
- def fetch_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5465
+ def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5463
5466
  """
5464
5467
  fetch all withdrawals made from an account
5465
5468
  :param str code: unified currency code
@@ -5510,7 +5513,7 @@ class htx(Exchange, ImplicitAPI):
5510
5513
  #
5511
5514
  return self.parse_transactions(response['data'], currency, since, limit)
5512
5515
 
5513
- def parse_transaction(self, transaction, currency=None) -> Transaction:
5516
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
5514
5517
  #
5515
5518
  # fetchDeposits
5516
5519
  #
@@ -5678,7 +5681,7 @@ class htx(Exchange, ImplicitAPI):
5678
5681
  #
5679
5682
  return self.parse_transaction(response, currency)
5680
5683
 
5681
- def parse_transfer(self, transfer, currency=None):
5684
+ def parse_transfer(self, transfer, currency: Currency = None):
5682
5685
  #
5683
5686
  # transfer
5684
5687
  #
@@ -5901,7 +5904,7 @@ class htx(Exchange, ImplicitAPI):
5901
5904
  }
5902
5905
  return rates
5903
5906
 
5904
- def fetch_funding_rate_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
5907
+ def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5905
5908
  """
5906
5909
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-funding-rate
5907
5910
  :see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-funding-rate
@@ -5972,7 +5975,7 @@ class htx(Exchange, ImplicitAPI):
5972
5975
  sorted = self.sort_by(rates, 'timestamp')
5973
5976
  return self.filter_by_symbol_since_limit(sorted, market['symbol'], since, limit)
5974
5977
 
5975
- def parse_funding_rate(self, contract, market=None):
5978
+ def parse_funding_rate(self, contract, market: Market = None):
5976
5979
  #
5977
5980
  # {
5978
5981
  # "status": "ok",
@@ -6095,7 +6098,7 @@ class htx(Exchange, ImplicitAPI):
6095
6098
  result = self.parse_funding_rates(data)
6096
6099
  return self.filter_by_array(result, 'symbol', symbols)
6097
6100
 
6098
- def fetch_borrow_interest(self, code: String = None, symbol: String = None, since: Int = None, limit: Int = None, params={}):
6101
+ def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6099
6102
  """
6100
6103
  fetch the interest owed by the user for borrowing currency for margin trading
6101
6104
  :param str code: unified currency code
@@ -6153,7 +6156,7 @@ class htx(Exchange, ImplicitAPI):
6153
6156
  interest = self.parse_borrow_interests(data, market)
6154
6157
  return self.filter_by_currency_since_limit(interest, code, since, limit)
6155
6158
 
6156
- def parse_borrow_interest(self, info, market=None):
6159
+ def parse_borrow_interest(self, info, market: Market = None):
6157
6160
  # isolated
6158
6161
  # {
6159
6162
  # "interest-rate":"0.000040830000000000",
@@ -6344,7 +6347,7 @@ class htx(Exchange, ImplicitAPI):
6344
6347
  self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
6345
6348
  return None
6346
6349
 
6347
- def fetch_funding_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
6350
+ def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6348
6351
  """
6349
6352
  fetch the history of funding payments paid and received on self account
6350
6353
  :see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-account-financial-records-via-multiple-fields-new # linear swaps
@@ -6427,7 +6430,7 @@ class htx(Exchange, ImplicitAPI):
6427
6430
  data = self.safe_value(response, 'data', [])
6428
6431
  return self.parse_incomes(data, market, since, limit)
6429
6432
 
6430
- def set_leverage(self, leverage, symbol: String = None, params={}):
6433
+ def set_leverage(self, leverage, symbol: Str = None, params={}):
6431
6434
  """
6432
6435
  set the level of leverage for a market
6433
6436
  :param float leverage: the rate of leverage
@@ -6490,7 +6493,7 @@ class htx(Exchange, ImplicitAPI):
6490
6493
  response = getattr(self, method)(self.extend(request, query))
6491
6494
  return response
6492
6495
 
6493
- def parse_income(self, income, market=None):
6496
+ def parse_income(self, income, market: Market = None):
6494
6497
  #
6495
6498
  # {
6496
6499
  # "id": "1667161118",
@@ -6518,7 +6521,7 @@ class htx(Exchange, ImplicitAPI):
6518
6521
  'amount': amount,
6519
6522
  }
6520
6523
 
6521
- def parse_position(self, position, market=None):
6524
+ def parse_position(self, position, market: Market = None):
6522
6525
  #
6523
6526
  # {
6524
6527
  # "symbol": "BTC",
@@ -6990,7 +6993,7 @@ class htx(Exchange, ImplicitAPI):
6990
6993
  }
6991
6994
  return self.safe_string(types, type, type)
6992
6995
 
6993
- def parse_ledger_entry(self, item, currency=None):
6996
+ def parse_ledger_entry(self, item, currency: Currency = None):
6994
6997
  #
6995
6998
  # {
6996
6999
  # "accountId": 10000001,
@@ -7032,7 +7035,7 @@ class htx(Exchange, ImplicitAPI):
7032
7035
  'info': item,
7033
7036
  }
7034
7037
 
7035
- def fetch_ledger(self, code: String = None, since: Int = None, limit: Int = None, params={}):
7038
+ def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
7036
7039
  """
7037
7040
  :see: https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
7038
7041
  fetch the history of changes, actions done by the user or operations that altered balance of the user
@@ -7431,7 +7434,7 @@ class htx(Exchange, ImplicitAPI):
7431
7434
  openInterest['datetime'] = self.iso8601(timestamp)
7432
7435
  return openInterest
7433
7436
 
7434
- def parse_open_interest(self, interest, market=None):
7437
+ def parse_open_interest(self, interest, market: Market = None):
7435
7438
  #
7436
7439
  # fetchOpenInterestHistory
7437
7440
  #
@@ -7498,7 +7501,7 @@ class htx(Exchange, ImplicitAPI):
7498
7501
  'info': interest,
7499
7502
  }, market)
7500
7503
 
7501
- def borrow_margin(self, code: str, amount, symbol: String = None, params={}):
7504
+ def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
7502
7505
  """
7503
7506
  create a loan to borrow margin
7504
7507
  :see: https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
@@ -7547,7 +7550,7 @@ class htx(Exchange, ImplicitAPI):
7547
7550
  'symbol': symbol,
7548
7551
  })
7549
7552
 
7550
- def repay_margin(self, code: str, amount, symbol: String = None, params={}):
7553
+ def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
7551
7554
  """
7552
7555
  repay borrowed margin and interest
7553
7556
  :see: https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
@@ -7590,7 +7593,7 @@ class htx(Exchange, ImplicitAPI):
7590
7593
  'symbol': symbol,
7591
7594
  })
7592
7595
 
7593
- def parse_margin_loan(self, info, currency=None):
7596
+ def parse_margin_loan(self, info, currency: Currency = None):
7594
7597
  #
7595
7598
  # borrowMargin cross
7596
7599
  #
@@ -7623,7 +7626,7 @@ class htx(Exchange, ImplicitAPI):
7623
7626
  'info': info,
7624
7627
  }
7625
7628
 
7626
- def fetch_settlement_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
7629
+ def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
7627
7630
  """
7628
7631
  Fetches historical settlement records
7629
7632
  :param str symbol: unified symbol of the market to fetch the settlement history for
@@ -7763,7 +7766,7 @@ class htx(Exchange, ImplicitAPI):
7763
7766
  data = self.safe_value(response, 'data')
7764
7767
  return self.parse_deposit_withdraw_fees(data, codes, 'currency')
7765
7768
 
7766
- def parse_deposit_withdraw_fee(self, fee, currency=None):
7769
+ def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
7767
7770
  #
7768
7771
  # {
7769
7772
  # "currency": "sxp",
@@ -7976,7 +7979,7 @@ class htx(Exchange, ImplicitAPI):
7976
7979
  data = self.safe_value(response, 'data', [])
7977
7980
  return self.parse_liquidations(data, market, since, limit)
7978
7981
 
7979
- def parse_liquidation(self, liquidation, market=None):
7982
+ def parse_liquidation(self, liquidation, market: Market = None):
7980
7983
  #
7981
7984
  # {
7982
7985
  # "query_id": 452057,