ccxt 4.4.98__py2.py3-none-any.whl → 4.4.100__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/bingx.py +1 -0
  3. ccxt/abstract/bitget.py +6 -0
  4. ccxt/abstract/hibachi.py +26 -0
  5. ccxt/alpaca.py +1 -1
  6. ccxt/apex.py +1 -1
  7. ccxt/ascendex.py +1 -1
  8. ccxt/async_support/__init__.py +3 -1
  9. ccxt/async_support/alpaca.py +1 -1
  10. ccxt/async_support/apex.py +1 -1
  11. ccxt/async_support/ascendex.py +1 -1
  12. ccxt/async_support/base/exchange.py +44 -9
  13. ccxt/async_support/base/ws/client.py +3 -1
  14. ccxt/async_support/bigone.py +1 -1
  15. ccxt/async_support/binance.py +10 -8
  16. ccxt/async_support/bingx.py +33 -4
  17. ccxt/async_support/bitbank.py +1 -1
  18. ccxt/async_support/bitfinex.py +4 -1
  19. ccxt/async_support/bitflyer.py +1 -1
  20. ccxt/async_support/bitget.py +2040 -561
  21. ccxt/async_support/bithumb.py +1 -1
  22. ccxt/async_support/bitmart.py +2 -2
  23. ccxt/async_support/bitmex.py +3 -2
  24. ccxt/async_support/bitopro.py +1 -1
  25. ccxt/async_support/bitrue.py +2 -2
  26. ccxt/async_support/bitso.py +1 -1
  27. ccxt/async_support/bitstamp.py +1 -1
  28. ccxt/async_support/bittrade.py +1 -1
  29. ccxt/async_support/bitvavo.py +1 -1
  30. ccxt/async_support/blockchaincom.py +1 -1
  31. ccxt/async_support/blofin.py +1 -1
  32. ccxt/async_support/btcmarkets.py +1 -1
  33. ccxt/async_support/bybit.py +7 -3
  34. ccxt/async_support/coinbase.py +1 -1
  35. ccxt/async_support/coinbaseexchange.py +1 -1
  36. ccxt/async_support/coinbaseinternational.py +1 -1
  37. ccxt/async_support/coincatch.py +2 -2
  38. ccxt/async_support/coinex.py +67 -6
  39. ccxt/async_support/coinmate.py +1 -1
  40. ccxt/async_support/coinsph.py +1 -1
  41. ccxt/async_support/cryptocom.py +2 -2
  42. ccxt/async_support/defx.py +2 -2
  43. ccxt/async_support/delta.py +1 -1
  44. ccxt/async_support/deribit.py +1 -1
  45. ccxt/async_support/digifinex.py +2 -2
  46. ccxt/async_support/ellipx.py +1 -1
  47. ccxt/async_support/exmo.py +1 -1
  48. ccxt/async_support/foxbit.py +3 -3
  49. ccxt/async_support/gate.py +18 -4
  50. ccxt/async_support/gemini.py +1 -1
  51. ccxt/async_support/hashkey.py +2 -2
  52. ccxt/async_support/hibachi.py +2080 -0
  53. ccxt/async_support/hitbtc.py +2 -2
  54. ccxt/async_support/hollaex.py +1 -1
  55. ccxt/async_support/htx.py +4 -3
  56. ccxt/async_support/hyperliquid.py +71 -29
  57. ccxt/async_support/independentreserve.py +1 -1
  58. ccxt/async_support/indodax.py +1 -1
  59. ccxt/async_support/kraken.py +1 -1
  60. ccxt/async_support/krakenfutures.py +2 -1
  61. ccxt/async_support/kucoin.py +2 -2
  62. ccxt/async_support/kucoinfutures.py +2 -1
  63. ccxt/async_support/lbank.py +2 -2
  64. ccxt/async_support/mercado.py +1 -1
  65. ccxt/async_support/mexc.py +9 -2
  66. ccxt/async_support/modetrade.py +93 -2
  67. ccxt/async_support/ndax.py +1 -1
  68. ccxt/async_support/novadax.py +35 -1
  69. ccxt/async_support/okcoin.py +1 -1
  70. ccxt/async_support/okx.py +2 -2
  71. ccxt/async_support/onetrading.py +33 -0
  72. ccxt/async_support/oxfun.py +1 -1
  73. ccxt/async_support/p2b.py +32 -0
  74. ccxt/async_support/paradex.py +2 -1
  75. ccxt/async_support/phemex.py +2 -2
  76. ccxt/async_support/poloniex.py +2 -2
  77. ccxt/async_support/probit.py +36 -1
  78. ccxt/async_support/tokocrypto.py +1 -1
  79. ccxt/async_support/upbit.py +1 -1
  80. ccxt/async_support/vertex.py +1 -1
  81. ccxt/async_support/wavesexchange.py +1 -1
  82. ccxt/async_support/whitebit.py +2 -2
  83. ccxt/async_support/woo.py +4 -4
  84. ccxt/async_support/woofipro.py +93 -2
  85. ccxt/async_support/xt.py +2 -2
  86. ccxt/async_support/yobit.py +1 -1
  87. ccxt/async_support/zaif.py +1 -1
  88. ccxt/async_support/zonda.py +1 -1
  89. ccxt/base/errors.py +0 -6
  90. ccxt/base/exchange.py +11 -9
  91. ccxt/base/types.py +1 -0
  92. ccxt/bigone.py +1 -1
  93. ccxt/binance.py +10 -8
  94. ccxt/bingx.py +33 -4
  95. ccxt/bitbank.py +1 -1
  96. ccxt/bitfinex.py +4 -1
  97. ccxt/bitflyer.py +1 -1
  98. ccxt/bitget.py +2040 -561
  99. ccxt/bithumb.py +1 -1
  100. ccxt/bitmart.py +2 -2
  101. ccxt/bitmex.py +3 -2
  102. ccxt/bitopro.py +1 -1
  103. ccxt/bitrue.py +2 -2
  104. ccxt/bitso.py +1 -1
  105. ccxt/bitstamp.py +1 -1
  106. ccxt/bittrade.py +1 -1
  107. ccxt/bitvavo.py +1 -1
  108. ccxt/blockchaincom.py +1 -1
  109. ccxt/blofin.py +1 -1
  110. ccxt/btcmarkets.py +1 -1
  111. ccxt/bybit.py +7 -3
  112. ccxt/coinbase.py +1 -1
  113. ccxt/coinbaseexchange.py +1 -1
  114. ccxt/coinbaseinternational.py +1 -1
  115. ccxt/coincatch.py +2 -2
  116. ccxt/coinex.py +67 -6
  117. ccxt/coinmate.py +1 -1
  118. ccxt/coinsph.py +1 -1
  119. ccxt/cryptocom.py +2 -2
  120. ccxt/defx.py +2 -2
  121. ccxt/delta.py +1 -1
  122. ccxt/deribit.py +1 -1
  123. ccxt/digifinex.py +2 -2
  124. ccxt/ellipx.py +1 -1
  125. ccxt/exmo.py +1 -1
  126. ccxt/foxbit.py +3 -3
  127. ccxt/gate.py +18 -4
  128. ccxt/gemini.py +1 -1
  129. ccxt/hashkey.py +2 -2
  130. ccxt/hibachi.py +2079 -0
  131. ccxt/hitbtc.py +2 -2
  132. ccxt/hollaex.py +1 -1
  133. ccxt/htx.py +4 -3
  134. ccxt/hyperliquid.py +71 -29
  135. ccxt/independentreserve.py +1 -1
  136. ccxt/indodax.py +1 -1
  137. ccxt/kraken.py +1 -1
  138. ccxt/krakenfutures.py +2 -1
  139. ccxt/kucoin.py +2 -2
  140. ccxt/kucoinfutures.py +2 -1
  141. ccxt/lbank.py +2 -2
  142. ccxt/mercado.py +1 -1
  143. ccxt/mexc.py +9 -2
  144. ccxt/modetrade.py +93 -2
  145. ccxt/ndax.py +1 -1
  146. ccxt/novadax.py +35 -1
  147. ccxt/okcoin.py +1 -1
  148. ccxt/okx.py +2 -2
  149. ccxt/onetrading.py +33 -0
  150. ccxt/oxfun.py +1 -1
  151. ccxt/p2b.py +32 -0
  152. ccxt/paradex.py +2 -1
  153. ccxt/phemex.py +2 -2
  154. ccxt/poloniex.py +2 -2
  155. ccxt/pro/__init__.py +1 -1
  156. ccxt/pro/alpaca.py +2 -2
  157. ccxt/pro/apex.py +2 -2
  158. ccxt/pro/ascendex.py +2 -2
  159. ccxt/pro/binance.py +4 -5
  160. ccxt/pro/bitget.py +3 -3
  161. ccxt/pro/bithumb.py +2 -2
  162. ccxt/pro/bitmart.py +2 -2
  163. ccxt/pro/bitmex.py +3 -3
  164. ccxt/pro/bitstamp.py +3 -3
  165. ccxt/pro/bittrade.py +2 -2
  166. ccxt/pro/bitvavo.py +5 -3
  167. ccxt/pro/bybit.py +5 -4
  168. ccxt/pro/cex.py +3 -2
  169. ccxt/pro/coinbaseexchange.py +4 -4
  170. ccxt/pro/coinbaseinternational.py +2 -2
  171. ccxt/pro/coincatch.py +1 -1
  172. ccxt/pro/coinex.py +1 -1
  173. ccxt/pro/coinone.py +2 -2
  174. ccxt/pro/cryptocom.py +2 -2
  175. ccxt/pro/derive.py +2 -2
  176. ccxt/pro/gate.py +3 -3
  177. ccxt/pro/hollaex.py +2 -2
  178. ccxt/pro/htx.py +3 -3
  179. ccxt/pro/hyperliquid.py +101 -14
  180. ccxt/pro/kraken.py +2 -2
  181. ccxt/pro/krakenfutures.py +4 -3
  182. ccxt/pro/kucoin.py +4 -3
  183. ccxt/pro/kucoinfutures.py +4 -3
  184. ccxt/pro/mexc.py +328 -139
  185. ccxt/pro/modetrade.py +2 -2
  186. ccxt/pro/okcoin.py +2 -2
  187. ccxt/pro/okx.py +7 -6
  188. ccxt/pro/onetrading.py +2 -2
  189. ccxt/pro/oxfun.py +1 -1
  190. ccxt/pro/p2b.py +2 -2
  191. ccxt/pro/paradex.py +2 -2
  192. ccxt/pro/poloniex.py +2 -2
  193. ccxt/pro/probit.py +2 -2
  194. ccxt/pro/vertex.py +2 -2
  195. ccxt/pro/whitebit.py +2 -2
  196. ccxt/pro/woo.py +2 -2
  197. ccxt/pro/woofipro.py +2 -2
  198. ccxt/probit.py +36 -1
  199. ccxt/protobuf/__init__.py +0 -0
  200. ccxt/protobuf/mexc/PrivateAccountV3Api_pb2.py +37 -0
  201. ccxt/protobuf/mexc/PrivateDealsV3Api_pb2.py +37 -0
  202. ccxt/protobuf/mexc/PrivateOrdersV3Api_pb2.py +37 -0
  203. ccxt/protobuf/mexc/PublicAggreBookTickerV3Api_pb2.py +37 -0
  204. ccxt/protobuf/mexc/PublicAggreDealsV3Api_pb2.py +39 -0
  205. ccxt/protobuf/mexc/PublicAggreDepthsV3Api_pb2.py +39 -0
  206. ccxt/protobuf/mexc/PublicBookTickerBatchV3Api_pb2.py +38 -0
  207. ccxt/protobuf/mexc/PublicBookTickerV3Api_pb2.py +37 -0
  208. ccxt/protobuf/mexc/PublicDealsV3Api_pb2.py +39 -0
  209. ccxt/protobuf/mexc/PublicIncreaseDepthsBatchV3Api_pb2.py +38 -0
  210. ccxt/protobuf/mexc/PublicIncreaseDepthsV3Api_pb2.py +39 -0
  211. ccxt/protobuf/mexc/PublicLimitDepthsV3Api_pb2.py +39 -0
  212. ccxt/protobuf/mexc/PublicMiniTickerV3Api_pb2.py +37 -0
  213. ccxt/protobuf/mexc/PublicMiniTickersV3Api_pb2.py +38 -0
  214. ccxt/protobuf/mexc/PublicSpotKlineV3Api_pb2.py +37 -0
  215. ccxt/protobuf/mexc/PushDataV3ApiWrapper_pb2.py +52 -0
  216. ccxt/protobuf/mexc/__init__.py +0 -0
  217. ccxt/test/tests_async.py +1 -1
  218. ccxt/test/tests_sync.py +1 -1
  219. ccxt/tokocrypto.py +1 -1
  220. ccxt/upbit.py +1 -1
  221. ccxt/vertex.py +1 -1
  222. ccxt/wavesexchange.py +1 -1
  223. ccxt/whitebit.py +2 -2
  224. ccxt/woo.py +4 -4
  225. ccxt/woofipro.py +93 -2
  226. ccxt/xt.py +2 -2
  227. ccxt/yobit.py +1 -1
  228. ccxt/zaif.py +1 -1
  229. ccxt/zonda.py +1 -1
  230. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/METADATA +8 -7
  231. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/RECORD +234 -213
  232. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/LICENSE.txt +0 -0
  233. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/WHEEL +0 -0
  234. {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/top_level.txt +0 -0
@@ -2648,7 +2648,7 @@ class hitbtc(Exchange, ImplicitAPI):
2648
2648
  'info': response,
2649
2649
  }
2650
2650
 
2651
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2651
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2652
2652
  """
2653
2653
  make a withdrawal
2654
2654
 
@@ -3417,7 +3417,7 @@ class hitbtc(Exchange, ImplicitAPI):
3417
3417
  'shortLeverage': leverageValue,
3418
3418
  }
3419
3419
 
3420
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
3420
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
3421
3421
  """
3422
3422
  set the level of leverage for a market
3423
3423
 
@@ -1798,7 +1798,7 @@ class hollaex(Exchange, ImplicitAPI):
1798
1798
  'fee': fee,
1799
1799
  }
1800
1800
 
1801
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1801
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1802
1802
  """
1803
1803
  make a withdrawal
1804
1804
 
ccxt/async_support/htx.py CHANGED
@@ -5017,7 +5017,7 @@ class htx(Exchange, ImplicitAPI):
5017
5017
  params['createMarketBuyOrderRequiresPrice'] = False
5018
5018
  return await self.create_order(symbol, 'market', 'buy', cost, None, params)
5019
5019
 
5020
- async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}) -> Order:
5020
+ async def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent: Num = None, trailingTriggerPrice: Num = None, params={}) -> Order:
5021
5021
  """
5022
5022
  create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
5023
5023
  :param str symbol: unified symbol of the market to create an order in
@@ -6309,7 +6309,7 @@ class htx(Exchange, ImplicitAPI):
6309
6309
  }
6310
6310
  return self.safe_string(statuses, status, status)
6311
6311
 
6312
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
6312
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
6313
6313
  """
6314
6314
 
6315
6315
  https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
@@ -7134,7 +7134,7 @@ class htx(Exchange, ImplicitAPI):
7134
7134
  data = self.safe_list(response, 'data', [])
7135
7135
  return self.parse_incomes(data, market, since, limit)
7136
7136
 
7137
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
7137
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
7138
7138
  """
7139
7139
  set the level of leverage for a market
7140
7140
 
@@ -8853,6 +8853,7 @@ class htx(Exchange, ImplicitAPI):
8853
8853
  'contracts': self.safe_number(liquidation, 'volume'),
8854
8854
  'contractSize': self.safe_number(market, 'contractSize'),
8855
8855
  'price': self.safe_number(liquidation, 'price'),
8856
+ 'side': self.safe_string_lower(liquidation, 'direction'),
8856
8857
  'baseValue': self.safe_number(liquidation, 'amount'),
8857
8858
  'quoteValue': self.safe_number(liquidation, 'trade_turnover'),
8858
8859
  'timestamp': timestamp,
@@ -1676,6 +1676,43 @@ class hyperliquid(Exchange, ImplicitAPI):
1676
1676
  if symbol is None:
1677
1677
  raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
1678
1678
  await self.load_markets()
1679
+ request = self.cancel_orders_request(ids, symbol, params)
1680
+ response = await self.privatePostExchange(request)
1681
+ #
1682
+ # {
1683
+ # "status":"ok",
1684
+ # "response":{
1685
+ # "type":"cancel",
1686
+ # "data":{
1687
+ # "statuses":[
1688
+ # "success"
1689
+ # ]
1690
+ # }
1691
+ # }
1692
+ # }
1693
+ #
1694
+ innerResponse = self.safe_dict(response, 'response')
1695
+ data = self.safe_dict(innerResponse, 'data')
1696
+ statuses = self.safe_list(data, 'statuses')
1697
+ orders = []
1698
+ for i in range(0, len(statuses)):
1699
+ status = statuses[i]
1700
+ orders.append(self.safe_order({
1701
+ 'info': status,
1702
+ 'status': status,
1703
+ }))
1704
+ return orders
1705
+
1706
+ def cancel_orders_request(self, ids: List[str], symbol: Str = None, params={}) -> dict:
1707
+ """
1708
+ build the request payload for cancelling multiple orders
1709
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
1710
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
1711
+ :param str[] ids: order ids
1712
+ :param str symbol: unified market symbol
1713
+ :param dict [params]:
1714
+ :returns dict: the raw request object to be sent to the exchange
1715
+ """
1679
1716
  market = self.market(symbol)
1680
1717
  clientOrderId = self.safe_value_2(params, 'clientOrderId', 'client_id')
1681
1718
  params = self.omit(params, ['clientOrderId', 'client_id'])
@@ -1716,31 +1753,7 @@ class hyperliquid(Exchange, ImplicitAPI):
1716
1753
  if vaultAddress is not None:
1717
1754
  params = self.omit(params, 'vaultAddress')
1718
1755
  request['vaultAddress'] = vaultAddress
1719
- response = await self.privatePostExchange(request)
1720
- #
1721
- # {
1722
- # "status":"ok",
1723
- # "response":{
1724
- # "type":"cancel",
1725
- # "data":{
1726
- # "statuses":[
1727
- # "success"
1728
- # ]
1729
- # }
1730
- # }
1731
- # }
1732
- #
1733
- innerResponse = self.safe_dict(response, 'response')
1734
- data = self.safe_dict(innerResponse, 'data')
1735
- statuses = self.safe_list(data, 'statuses')
1736
- orders = []
1737
- for i in range(0, len(statuses)):
1738
- status = statuses[i]
1739
- orders.append(self.safe_order({
1740
- 'info': status,
1741
- 'status': status,
1742
- }))
1743
- return orders
1756
+ return request
1744
1757
 
1745
1758
  async def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
1746
1759
  """
@@ -2469,6 +2482,8 @@ class hyperliquid(Exchange, ImplicitAPI):
2469
2482
  }, market)
2470
2483
 
2471
2484
  def parse_order_status(self, status: Str):
2485
+ if status is None:
2486
+ return None
2472
2487
  statuses: dict = {
2473
2488
  'triggered': 'open',
2474
2489
  'filled': 'closed',
@@ -2477,6 +2492,10 @@ class hyperliquid(Exchange, ImplicitAPI):
2477
2492
  'rejected': 'rejected',
2478
2493
  'marginCanceled': 'canceled',
2479
2494
  }
2495
+ if status.endswith('Rejected'):
2496
+ return 'rejected'
2497
+ if status.endswith('Canceled'):
2498
+ return 'canceled'
2480
2499
  return self.safe_string(statuses, status, status)
2481
2500
 
2482
2501
  def parse_order_type(self, status):
@@ -2806,7 +2825,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2806
2825
  #
2807
2826
  return response
2808
2827
 
2809
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2828
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2810
2829
  """
2811
2830
  set the level of leverage for a market
2812
2831
  :param float leverage: the rate of leverage
@@ -3059,7 +3078,7 @@ class hyperliquid(Exchange, ImplicitAPI):
3059
3078
  'status': 'ok',
3060
3079
  }
3061
3080
 
3062
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
3081
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
3063
3082
  """
3064
3083
  make a withdrawal(only support USDC)
3065
3084
 
@@ -3587,6 +3606,27 @@ class hyperliquid(Exchange, ImplicitAPI):
3587
3606
  'rate': rate,
3588
3607
  }
3589
3608
 
3609
+ async def reserve_request_weight(self, weight: Num, params={}) -> dict:
3610
+ """
3611
+ Instead of trading to increase the address based rate limits, self action allows reserving additional actions for 0.0005 USDC per request. The cost is paid from the Perps balance.
3612
+ :param number weight: the weight to reserve, 1 weight = 1 action, 0.0005 USDC per action
3613
+ :param dict [params]: extra parameters specific to the exchange API endpoint
3614
+ :returns dict: a response object
3615
+ """
3616
+ nonce = self.milliseconds()
3617
+ request: dict = {
3618
+ 'nonce': nonce,
3619
+ }
3620
+ action: dict = {
3621
+ 'type': 'reserveRequestWeight',
3622
+ 'weight': weight,
3623
+ }
3624
+ signature = self.sign_l1_action(action, nonce)
3625
+ request['action'] = action
3626
+ request['signature'] = signature
3627
+ response = await self.privatePostExchange(self.extend(request, params))
3628
+ return response
3629
+
3590
3630
  def extract_type_from_delta(self, data=[]):
3591
3631
  records = []
3592
3632
  for i in range(0, len(data)):
@@ -3640,8 +3680,10 @@ class hyperliquid(Exchange, ImplicitAPI):
3640
3680
  responsePayload = self.safe_dict(response, 'response', {})
3641
3681
  data = self.safe_dict(responsePayload, 'data', {})
3642
3682
  statuses = self.safe_list(data, 'statuses', [])
3643
- firstStatus = self.safe_dict(statuses, 0)
3644
- message = self.safe_string(firstStatus, 'error')
3683
+ for i in range(0, len(statuses)):
3684
+ message = self.safe_string(statuses[i], 'error')
3685
+ if message is not None:
3686
+ break
3645
3687
  feedback = self.id + ' ' + body
3646
3688
  nonEmptyMessage = ((message is not None) and (message != ''))
3647
3689
  if nonEmptyMessage:
@@ -923,7 +923,7 @@ class independentreserve(Exchange, ImplicitAPI):
923
923
  'tag': self.safe_string(depositAddress, 'Tag'),
924
924
  }
925
925
 
926
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
926
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
927
927
  """
928
928
  make a withdrawal
929
929
 
@@ -1144,7 +1144,7 @@ class indodax(Exchange, ImplicitAPI):
1144
1144
  transactions = self.array_concat(withdraws, deposits)
1145
1145
  return self.parse_transactions(transactions, currency, since, limit)
1146
1146
 
1147
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1147
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1148
1148
  """
1149
1149
  make a withdrawal
1150
1150
 
@@ -3038,7 +3038,7 @@ class kraken(Exchange, ImplicitAPI):
3038
3038
  'tag': tag,
3039
3039
  }
3040
3040
 
3041
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
3041
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
3042
3042
  """
3043
3043
  make a withdrawal
3044
3044
 
@@ -246,6 +246,7 @@ class krakenfutures(Exchange, ImplicitAPI):
246
246
  'executions': 'private',
247
247
  'triggers': 'private',
248
248
  'accountlogcsv': 'private',
249
+ 'account-log': 'private',
249
250
  },
250
251
  },
251
252
  },
@@ -2606,7 +2607,7 @@ class krakenfutures(Exchange, ImplicitAPI):
2606
2607
  'toAccount': toAccount,
2607
2608
  })
2608
2609
 
2609
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2610
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2610
2611
  """
2611
2612
  set the level of leverage for a market
2612
2613
 
@@ -3387,7 +3387,7 @@ class kucoin(Exchange, ImplicitAPI):
3387
3387
  'tierBased': True,
3388
3388
  }
3389
3389
 
3390
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
3390
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
3391
3391
  """
3392
3392
  make a withdrawal
3393
3393
 
@@ -4802,7 +4802,7 @@ class kucoin(Exchange, ImplicitAPI):
4802
4802
  data = self.safe_list(response, 'data', [])
4803
4803
  return self.parse_deposit_withdraw_fees(data, codes, 'currency')
4804
4804
 
4805
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
4805
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
4806
4806
  """
4807
4807
  set the level of leverage for a market
4808
4808
 
@@ -2416,6 +2416,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
2416
2416
  https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-futures
2417
2417
 
2418
2418
  :param dict [params]: extra parameters specific to the exchange API endpoint
2419
+ :param dict [params.code]: the unified currency code to fetch the balance for, if not provided, the default .options['fetchBalance']['code'] will be used
2419
2420
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
2420
2421
  """
2421
2422
  await self.load_markets()
@@ -3217,7 +3218,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
3217
3218
  'marginMode': marginMode,
3218
3219
  })
3219
3220
 
3220
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
3221
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
3221
3222
  """
3222
3223
  set the level of leverage for a market
3223
3224
 
@@ -968,7 +968,7 @@ class lbank(Exchange, ImplicitAPI):
968
968
  timestamp = self.milliseconds()
969
969
  if market['swap']:
970
970
  return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'price', 'volume')
971
- return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 1, 0)
971
+ return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks')
972
972
 
973
973
  def parse_trade(self, trade: dict, market: Market = None) -> Trade:
974
974
  #
@@ -2235,7 +2235,7 @@ class lbank(Exchange, ImplicitAPI):
2235
2235
  'tag': tag,
2236
2236
  }
2237
2237
 
2238
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2238
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2239
2239
  """
2240
2240
  make a withdrawal
2241
2241
 
@@ -704,7 +704,7 @@ class mercado(Exchange, ImplicitAPI):
704
704
  order = self.safe_dict(responseData, 'order')
705
705
  return self.parse_order(order, market)
706
706
 
707
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
707
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
708
708
  """
709
709
  make a withdrawal
710
710
  :param str code: unified currency code
@@ -488,6 +488,12 @@ class mexc(Exchange, ImplicitAPI):
488
488
  'ZKSYNC': 'ZKSYNCERA',
489
489
  'TRC20': 'TRX',
490
490
  'TON': 'TONCOIN',
491
+ 'ARBITRUM': 'ARB',
492
+ 'STX': 'STACKS',
493
+ 'LUNC': 'LUNA',
494
+ 'STARK': 'STARKNET',
495
+ 'APT': 'APTOS',
496
+ 'PEAQ': 'PEAQEVM',
491
497
  'AVAXC': 'AVAX_CCHAIN',
492
498
  'ERC20': 'ETH',
493
499
  'ACA': 'ACALA',
@@ -517,6 +523,7 @@ class mexc(Exchange, ImplicitAPI):
517
523
  # 'DNX': 'Dynex(DNX)',
518
524
  # 'DOGE': 'Dogecoin(DOGE)',
519
525
  # 'DOT': 'Polkadot(DOT)',
526
+ 'DOT': 'DOTASSETHUB',
520
527
  # 'DYM': 'Dymension(DYM)',
521
528
  'ETHF': 'ETF',
522
529
  'HRC20': 'HECO',
@@ -4056,7 +4063,7 @@ class mexc(Exchange, ImplicitAPI):
4056
4063
  """
4057
4064
  return await self.modify_margin_helper(symbol, amount, 'ADD', params)
4058
4065
 
4059
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
4066
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
4060
4067
  """
4061
4068
  set the level of leverage for a market
4062
4069
 
@@ -5242,7 +5249,7 @@ class mexc(Exchange, ImplicitAPI):
5242
5249
  }
5243
5250
  return self.safe_string(statuses, status, status)
5244
5251
 
5245
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
5252
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
5246
5253
  """
5247
5254
  make a withdrawal
5248
5255
 
@@ -1025,6 +1025,97 @@ class modetrade(Exchange, ImplicitAPI):
1025
1025
  sorted = self.sort_by(rates, 'timestamp')
1026
1026
  return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
1027
1027
 
1028
+ def parse_income(self, income, market: Market = None):
1029
+ #
1030
+ # {
1031
+ # "symbol": "PERP_ETH_USDC",
1032
+ # "funding_rate": 0.00046875,
1033
+ # "mark_price": 2100,
1034
+ # "funding_fee": 0.000016,
1035
+ # "payment_type": "Pay",
1036
+ # "status": "Accrued",
1037
+ # "created_time": 1682235722003,
1038
+ # "updated_time": 1682235722003
1039
+ # }
1040
+ #
1041
+ marketId = self.safe_string(income, 'symbol')
1042
+ symbol = self.safe_symbol(marketId, market)
1043
+ amount = self.safe_string(income, 'funding_fee')
1044
+ code = self.safe_currency_code('USDC')
1045
+ timestamp = self.safe_integer(income, 'updated_time')
1046
+ rate = self.safe_number(income, 'funding_rate')
1047
+ paymentType = self.safe_string(income, 'payment_type')
1048
+ amount = Precise.string_neg(amount) if (paymentType == 'Pay') else amount
1049
+ return {
1050
+ 'info': income,
1051
+ 'symbol': symbol,
1052
+ 'code': code,
1053
+ 'timestamp': timestamp,
1054
+ 'datetime': self.iso8601(timestamp),
1055
+ 'id': None,
1056
+ 'amount': self.parse_number(amount),
1057
+ 'rate': rate,
1058
+ }
1059
+
1060
+ async def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1061
+ """
1062
+ fetch the history of funding payments paid and received on self account
1063
+
1064
+ https://orderly.network/docs/build-on-omnichain/evm-api/restful-api/private/get-funding-fee-history
1065
+
1066
+ :param str [symbol]: unified market symbol
1067
+ :param int [since]: the earliest time in ms to fetch funding history for
1068
+ :param int [limit]: the maximum number of funding history structures to retrieve
1069
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1070
+ :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
1071
+ :returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
1072
+ """
1073
+ await self.load_markets()
1074
+ paginate = False
1075
+ paginate, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'paginate')
1076
+ if paginate:
1077
+ return await self.fetch_paginated_call_incremental('fetchFundingHistory', symbol, since, limit, params, 'page', 500)
1078
+ request: dict = {}
1079
+ market: Market = None
1080
+ if symbol is not None:
1081
+ market = self.market(symbol)
1082
+ request['symbol'] = market['id']
1083
+ if since is not None:
1084
+ request['start_t'] = since
1085
+ until = self.safe_integer(params, 'until') # unified in milliseconds
1086
+ params = self.omit(params, ['until'])
1087
+ if until is not None:
1088
+ request['end_t'] = until
1089
+ if limit is not None:
1090
+ request['size'] = min(limit, 500)
1091
+ response = await self.v1PrivateGetFundingFeeHistory(self.extend(request, params))
1092
+ #
1093
+ # {
1094
+ # "success": True,
1095
+ # "timestamp": 1702989203989,
1096
+ # "data": {
1097
+ # "meta": {
1098
+ # "total": 9,
1099
+ # "records_per_page": 25,
1100
+ # "current_page": 1
1101
+ # },
1102
+ # "rows": [{
1103
+ # "symbol": "PERP_ETH_USDC",
1104
+ # "funding_rate": 0.00046875,
1105
+ # "mark_price": 2100,
1106
+ # "funding_fee": 0.000016,
1107
+ # "payment_type": "Pay",
1108
+ # "status": "Accrued",
1109
+ # "created_time": 1682235722003,
1110
+ # "updated_time": 1682235722003
1111
+ # }]
1112
+ # }
1113
+ # }
1114
+ #
1115
+ data = self.safe_dict(response, 'data', {})
1116
+ rows = self.safe_list(data, 'rows', [])
1117
+ return self.parse_incomes(rows, market, since, limit)
1118
+
1028
1119
  async def fetch_trading_fees(self, params={}) -> TradingFees:
1029
1120
  """
1030
1121
  fetch the trading fees for multiple markets
@@ -2330,7 +2421,7 @@ class modetrade(Exchange, ImplicitAPI):
2330
2421
  def sign_message(self, message, privateKey):
2331
2422
  return self.sign_hash(self.hash_message(message), privateKey[-64:])
2332
2423
 
2333
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2424
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2334
2425
  """
2335
2426
  make a withdrawal
2336
2427
 
@@ -2460,7 +2551,7 @@ class modetrade(Exchange, ImplicitAPI):
2460
2551
  data = self.safe_dict(response, 'data', {})
2461
2552
  return self.parse_leverage(data, market)
2462
2553
 
2463
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
2554
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
2464
2555
  """
2465
2556
  set the level of leverage for a market
2466
2557
 
@@ -2357,7 +2357,7 @@ class ndax(Exchange, ImplicitAPI):
2357
2357
  'network': None,
2358
2358
  }
2359
2359
 
2360
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2360
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2361
2361
  """
2362
2362
  make a withdrawal
2363
2363
  :param str code: unified currency code
@@ -46,6 +46,9 @@ class novadax(Exchange, ImplicitAPI):
46
46
  'future': False,
47
47
  'option': False,
48
48
  'addMargin': False,
49
+ 'borrowCrossMargin': False,
50
+ 'borrowIsolatedMargin': False,
51
+ 'borrowMargin': False,
49
52
  'cancelOrder': True,
50
53
  'closeAllPositions': False,
51
54
  'closePosition': False,
@@ -58,9 +61,14 @@ class novadax(Exchange, ImplicitAPI):
58
61
  'createStopMarketOrder': True,
59
62
  'createStopOrder': True,
60
63
  'fetchAccounts': True,
64
+ 'fetchAllGreeks': False,
61
65
  'fetchBalance': True,
66
+ 'fetchBorrowInterest': False,
67
+ 'fetchBorrowRate': False,
62
68
  'fetchBorrowRateHistories': False,
63
69
  'fetchBorrowRateHistory': False,
70
+ 'fetchBorrowRates': False,
71
+ 'fetchBorrowRatesPerSymbol': False,
64
72
  'fetchClosedOrders': True,
65
73
  'fetchCrossBorrowRate': False,
66
74
  'fetchCrossBorrowRates': False,
@@ -70,20 +78,40 @@ class novadax(Exchange, ImplicitAPI):
70
78
  'fetchDeposits': True,
71
79
  'fetchDepositsWithdrawals': True,
72
80
  'fetchFundingHistory': False,
81
+ 'fetchFundingInterval': False,
82
+ 'fetchFundingIntervals': False,
73
83
  'fetchFundingRate': False,
74
84
  'fetchFundingRateHistory': False,
75
85
  'fetchFundingRates': False,
86
+ 'fetchGreeks': False,
76
87
  'fetchIndexOHLCV': False,
77
88
  'fetchIsolatedBorrowRate': False,
78
89
  'fetchIsolatedBorrowRates': False,
90
+ 'fetchIsolatedPositions': False,
79
91
  'fetchLeverage': False,
92
+ 'fetchLeverages': False,
80
93
  'fetchLeverageTiers': False,
94
+ 'fetchLiquidations': False,
95
+ 'fetchLongShortRatio': False,
96
+ 'fetchLongShortRatioHistory': False,
97
+ 'fetchMarginAdjustmentHistory': False,
98
+ 'fetchMarginMode': False,
99
+ 'fetchMarginModes': False,
100
+ 'fetchMarketLeverageTiers': False,
81
101
  'fetchMarkets': True,
82
102
  'fetchMarkOHLCV': False,
103
+ 'fetchMarkPrice': False,
104
+ 'fetchMarkPrices': False,
105
+ 'fetchMyLiquidations': False,
106
+ 'fetchMySettlementHistory': False,
83
107
  'fetchMyTrades': True,
84
108
  'fetchOHLCV': True,
109
+ 'fetchOpenInterest': False,
85
110
  'fetchOpenInterestHistory': False,
111
+ 'fetchOpenInterests': False,
86
112
  'fetchOpenOrders': True,
113
+ 'fetchOption': False,
114
+ 'fetchOptionChain': False,
87
115
  'fetchOrder': True,
88
116
  'fetchOrderBook': True,
89
117
  'fetchOrders': True,
@@ -96,6 +124,7 @@ class novadax(Exchange, ImplicitAPI):
96
124
  'fetchPositionsHistory': False,
97
125
  'fetchPositionsRisk': False,
98
126
  'fetchPremiumIndexOHLCV': False,
127
+ 'fetchSettlementHistory': False,
99
128
  'fetchTicker': True,
100
129
  'fetchTickers': True,
101
130
  'fetchTime': True,
@@ -103,9 +132,14 @@ class novadax(Exchange, ImplicitAPI):
103
132
  'fetchTradingFee': False,
104
133
  'fetchTradingFees': False,
105
134
  'fetchTransactions': 'emulated',
135
+ 'fetchUnderlyingAssets': False,
136
+ 'fetchVolatilityHistory': False,
106
137
  'fetchWithdrawals': True,
107
138
  'reduceMargin': False,
139
+ 'repayCrossMargin': False,
140
+ 'repayIsolatedMargin': False,
108
141
  'setLeverage': False,
142
+ 'setMargin': False,
109
143
  'setMarginMode': False,
110
144
  'setPositionMode': False,
111
145
  'transfer': True,
@@ -1267,7 +1301,7 @@ class novadax(Exchange, ImplicitAPI):
1267
1301
  }
1268
1302
  return self.safe_string(statuses, status, 'failed')
1269
1303
 
1270
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1304
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1271
1305
  """
1272
1306
  make a withdrawal
1273
1307
 
@@ -2416,7 +2416,7 @@ class okcoin(Exchange, ImplicitAPI):
2416
2416
  }
2417
2417
  return self.safe_string(statuses, status, status)
2418
2418
 
2419
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2419
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2420
2420
  """
2421
2421
 
2422
2422
  https://www.okcoin.com/docs-v5/en/#rest-api-funding-withdrawal
ccxt/async_support/okx.py CHANGED
@@ -4955,7 +4955,7 @@ class okx(Exchange, ImplicitAPI):
4955
4955
  first = self.safe_string(keys, 0)
4956
4956
  return self.safe_dict(response, first)
4957
4957
 
4958
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
4958
+ async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
4959
4959
  """
4960
4960
  make a withdrawal
4961
4961
 
@@ -6352,7 +6352,7 @@ class okx(Exchange, ImplicitAPI):
6352
6352
  sorted = self.sort_by(result, 'timestamp')
6353
6353
  return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
6354
6354
 
6355
- async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
6355
+ async def set_leverage(self, leverage: int, symbol: Str = None, params={}):
6356
6356
  """
6357
6357
  set the level of leverage for a market
6358
6358