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
ccxt/pro/coincatch.py CHANGED
@@ -1298,7 +1298,7 @@ class coincatch(ccxt.async_support.coincatch):
1298
1298
  'info': position,
1299
1299
  })
1300
1300
 
1301
- def handle_error_message(self, client: Client, message):
1301
+ def handle_error_message(self, client: Client, message) -> Bool:
1302
1302
  #
1303
1303
  # {event: "error", code: 30001, msg: "Channel does not exist"}
1304
1304
  #
ccxt/pro/coinex.py CHANGED
@@ -1257,7 +1257,7 @@ class coinex(ccxt.async_support.coinex):
1257
1257
  method = self.safe_string(message, 'method')
1258
1258
  error = self.safe_string(message, 'message')
1259
1259
  if error is not None:
1260
- self.handle_errors(None, None, client.url, method, None, self.json(error), message, None, None)
1260
+ self.handle_errors(1, '', client.url, method, {}, self.json(error), message, {}, {})
1261
1261
  handlers: dict = {
1262
1262
  'state.update': self.handle_ticker,
1263
1263
  'balance.update': self.handle_balance,
ccxt/pro/coinone.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache
8
- from ccxt.base.types import Any, Int, Market, OrderBook, Ticker, Trade
8
+ from ccxt.base.types import Any, Bool, Int, Market, OrderBook, Ticker, Trade
9
9
  from ccxt.async_support.base.ws.client import Client
10
10
  from typing import List
11
11
  from ccxt.base.errors import AuthenticationError
@@ -348,7 +348,7 @@ class coinone(ccxt.async_support.coinone):
348
348
  'fee': None,
349
349
  }, market)
350
350
 
351
- def handle_error_message(self, client: Client, message):
351
+ def handle_error_message(self, client: Client, message) -> Bool:
352
352
  #
353
353
  # {
354
354
  # "response_type": "ERROR",
ccxt/pro/cryptocom.py CHANGED
@@ -6,7 +6,7 @@
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
9
+ from ccxt.base.types import Any, Balances, Bool, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
10
10
  from ccxt.async_support.base.ws.client import Client
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1188,7 +1188,7 @@ class cryptocom(ccxt.async_support.cryptocom):
1188
1188
  message = self.extend(request, params)
1189
1189
  return await self.watch(url, messageHash, message, messageHash)
1190
1190
 
1191
- def handle_error_message(self, client: Client, message):
1191
+ def handle_error_message(self, client: Client, message) -> Bool:
1192
1192
  #
1193
1193
  # {
1194
1194
  # "id": 0,
ccxt/pro/derive.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
8
- from ccxt.base.types import Any, Int, Order, OrderBook, Str, Ticker, Trade
8
+ from ccxt.base.types import Any, Bool, Int, Order, OrderBook, Str, Ticker, Trade
9
9
  from ccxt.async_support.base.ws.client import Client
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
@@ -618,7 +618,7 @@ class derive(ccxt.async_support.derive):
618
618
  messageHash = topic + trade['symbol']
619
619
  client.resolve(myTrades, messageHash)
620
620
 
621
- def handle_error_message(self, client: Client, message):
621
+ def handle_error_message(self, client: Client, message) -> Bool:
622
622
  #
623
623
  # {
624
624
  # id: '690c6276-0fc6-4121-aafa-f28bf5adedcb',
ccxt/pro/gate.py CHANGED
@@ -6,7 +6,7 @@
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Int, Liquidation, Market, MarketType, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
9
+ from ccxt.base.types import Any, Balances, Bool, Int, Liquidation, Market, MarketType, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
10
10
  from ccxt.async_support.base.ws.client import Client
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1332,7 +1332,7 @@ class gate(ccxt.async_support.gate):
1332
1332
  """
1333
1333
  return self.watch_my_liquidations_for_symbols([symbol], since, limit, params)
1334
1334
 
1335
- async def watch_my_liquidations_for_symbols(self, symbols: List[str] = None, since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
1335
+ async def watch_my_liquidations_for_symbols(self, symbols: List[str], since: Int = None, limit: Int = None, params={}) -> List[Liquidation]:
1336
1336
  """
1337
1337
  watch the private liquidations of a trading pair
1338
1338
 
@@ -1486,7 +1486,7 @@ class gate(ccxt.async_support.gate):
1486
1486
  'datetime': self.iso8601(timestamp),
1487
1487
  })
1488
1488
 
1489
- def handle_error_message(self, client: Client, message):
1489
+ def handle_error_message(self, client: Client, message) -> Bool:
1490
1490
  #
1491
1491
  # {
1492
1492
  # "time": 1647274664,
ccxt/pro/hollaex.py CHANGED
@@ -6,7 +6,7 @@
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Str, Trade
9
+ from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Str, Trade
10
10
  from ccxt.async_support.base.ws.client import Client
11
11
  from typing import List
12
12
  from ccxt.base.errors import AuthenticationError
@@ -443,7 +443,7 @@ class hollaex(ccxt.async_support.hollaex):
443
443
  message = self.extend(request, params)
444
444
  return await self.watch(signedUrl, messageHash, message, messageHash)
445
445
 
446
- def handle_error_message(self, client: Client, message):
446
+ def handle_error_message(self, client: Client, message) -> Bool:
447
447
  #
448
448
  # {error: "Bearer or HMAC authentication required"}
449
449
  # {error: "Error: wrong input"}
ccxt/pro/htx.py CHANGED
@@ -6,7 +6,7 @@
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide, ArrayCacheByTimestamp
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Position, Str, Strings, Ticker, Trade
9
+ from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Position, Str, Strings, Ticker, Trade
10
10
  from ccxt.async_support.base.ws.client import Client
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -1811,7 +1811,7 @@ class htx(ccxt.async_support.htx):
1811
1811
  promise = client.futures['auth']
1812
1812
  promise.resolve(message)
1813
1813
 
1814
- def handle_error_message(self, client: Client, message):
1814
+ def handle_error_message(self, client: Client, message) -> Bool:
1815
1815
  #
1816
1816
  # {
1817
1817
  # "action": "sub",
@@ -1875,7 +1875,7 @@ class htx(ccxt.async_support.htx):
1875
1875
  return False
1876
1876
  else:
1877
1877
  client.reject(e)
1878
- return message
1878
+ return True
1879
1879
 
1880
1880
  def handle_message(self, client: Client, message):
1881
1881
  if self.handle_error_message(client, message):
ccxt/pro/hyperliquid.py CHANGED
@@ -5,10 +5,9 @@
5
5
 
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
8
- from ccxt.base.types import Any, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
8
+ from ccxt.base.types import Any, Bool, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
9
9
  from ccxt.async_support.base.ws.client import Client
10
10
  from typing import List
11
- from ccxt.base.errors import ExchangeError
12
11
 
13
12
 
14
13
  class hyperliquid(ccxt.async_support.hyperliquid):
@@ -17,6 +16,8 @@ class hyperliquid(ccxt.async_support.hyperliquid):
17
16
  return self.deep_extend(super(hyperliquid, self).describe(), {
18
17
  'has': {
19
18
  'ws': True,
19
+ 'cancelOrderWs': True,
20
+ 'cancelOrdersWs': True,
20
21
  'createOrderWs': True,
21
22
  'createOrdersWs': True,
22
23
  'editOrderWs': True,
@@ -104,9 +105,6 @@ class hyperliquid(ccxt.async_support.hyperliquid):
104
105
  order, globalParams = self.parseCreateEditOrderArgs(None, symbol, type, side, amount, price, params)
105
106
  orders = await self.create_orders_ws([order], globalParams)
106
107
  parsedOrder = orders[0]
107
- orderInfo = self.safe_dict(parsedOrder, 'info')
108
- # handle potential error here
109
- self.handle_errors(None, None, None, None, None, self.json(orderInfo), orderInfo, None, None)
110
108
  return parsedOrder
111
109
 
112
110
  async def edit_order_ws(self, id: str, symbol: str, type: str, side: str, amount: Num = None, price: Num = None, params={}):
@@ -145,11 +143,57 @@ class hyperliquid(ccxt.async_support.hyperliquid):
145
143
  statuses = self.safe_list(dataObject, 'statuses', [])
146
144
  first = self.safe_dict(statuses, 0, {})
147
145
  parsedOrder = self.parse_order(first, market)
148
- orderInfo = self.safe_dict(parsedOrder, 'info')
149
- # handle potential error here
150
- self.handle_errors(None, None, None, None, None, self.json(orderInfo), orderInfo, None, None)
151
146
  return parsedOrder
152
147
 
148
+ async def cancel_orders_ws(self, ids: List[str], symbol: Str = None, params={}):
149
+ """
150
+ cancel multiple orders using WebSocket post request
151
+
152
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/post-requests
153
+
154
+ :param str[] ids: list of order ids to cancel
155
+ :param str symbol: unified symbol of the market the orders were made in
156
+ :param dict [params]: extra parameters specific to the exchange API endpoint
157
+ :param str[] [params.clientOrderId]: list of client order ids to cancel instead of order ids
158
+ :param str [params.vaultAddress]: the vault address for order cancellation
159
+ :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
160
+ """
161
+ self.check_required_credentials()
162
+ await self.load_markets()
163
+ request = self.cancelOrdersRequest(ids, symbol, params)
164
+ url = self.urls['api']['ws']['public']
165
+ wrapped = self.wrap_as_post_action(request)
166
+ wsRequest = self.safe_dict(wrapped, 'request', {})
167
+ requestId = self.safe_string(wrapped, 'requestId')
168
+ response = await self.watch(url, requestId, wsRequest, requestId)
169
+ responseObj = self.safe_dict(response, 'response', {})
170
+ data = self.safe_dict(responseObj, 'data', {})
171
+ statuses = self.safe_list(data, 'statuses', [])
172
+ orders = []
173
+ for i in range(0, len(statuses)):
174
+ status = statuses[i]
175
+ orders.append(self.safe_order({
176
+ 'info': status,
177
+ 'status': status,
178
+ }))
179
+ return orders
180
+
181
+ async def cancel_order_ws(self, id: str, symbol: Str = None, params={}):
182
+ """
183
+ cancel a single order using WebSocket post request
184
+
185
+ https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/post-requests
186
+
187
+ :param str id: order id to cancel
188
+ :param str symbol: unified symbol of the market the order was made in
189
+ :param dict [params]: extra parameters specific to the exchange API endpoint
190
+ :param str [params.clientOrderId]: client order id to cancel instead of order id
191
+ :param str [params.vaultAddress]: the vault address for order cancellation
192
+ :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
193
+ """
194
+ orders = await self.cancel_orders_ws([id], symbol, params)
195
+ return self.safe_dict(orders, 0)
196
+
153
197
  async def watch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
154
198
  """
155
199
  watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
@@ -823,19 +867,62 @@ class hyperliquid(ccxt.async_support.hyperliquid):
823
867
  client.resolve(stored, innerMessageHash)
824
868
  client.resolve(stored, messageHash)
825
869
 
826
- def handle_error_message(self, client: Client, message):
870
+ def handle_error_message(self, client: Client, message) -> Bool:
827
871
  #
828
- # {
872
+ # {
873
+ # "channel": "post",
874
+ # "data": {
875
+ # "id": 1,
876
+ # "response": {
877
+ # "type": "action",
878
+ # "payload": {
879
+ # "status": "ok",
880
+ # "response": {
881
+ # "type": "order",
882
+ # "data": {
883
+ # "statuses": [
884
+ # {
885
+ # "error": "Order price cannot be more than 80% away from the reference price"
886
+ # }
887
+ # ]
888
+ # }
889
+ # }
890
+ # }
891
+ # }
892
+ # }
893
+ # }
894
+ #
895
+ # {
829
896
  # "channel": "error",
830
897
  # "data": "Error parsing JSON into valid websocket request: {\"type\": \"allMids\"}"
831
898
  # }
832
899
  #
833
900
  channel = self.safe_string(message, 'channel', '')
834
- ret_msg = self.safe_string(message, 'data', '')
835
901
  if channel == 'error':
836
- raise ExchangeError(self.id + ' ' + ret_msg)
837
- else:
838
- return False
902
+ ret_msg = self.safe_string(message, 'data', '')
903
+ errorMsg = self.id + ' ' + ret_msg
904
+ client.reject(errorMsg)
905
+ return True
906
+ data = self.safe_dict(message, 'data', {})
907
+ id = self.safe_string(message, 'id')
908
+ response = self.safe_dict(data, 'response', {})
909
+ payload = self.safe_dict(response, 'payload', {})
910
+ status = self.safe_string(payload, 'status')
911
+ if status is not None and status != 'ok':
912
+ errorMsg = self.id + ' ' + self.json(payload)
913
+ client.reject(errorMsg, id)
914
+ return True
915
+ type = self.safe_string(payload, 'type')
916
+ if type == 'error':
917
+ error = self.id + ' ' + self.json(payload)
918
+ client.reject(error, id)
919
+ return True
920
+ try:
921
+ self.handle_errors(0, '', '', '', {}, self.json(payload), payload, {}, {})
922
+ except Exception as e:
923
+ client.reject(e, id)
924
+ return True
925
+ return False
839
926
 
840
927
  def handle_order_book_unsubscription(self, client: Client, subscription: dict):
841
928
  #
ccxt/pro/kraken.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
8
- from ccxt.base.types import Any, Balances, Int, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
8
+ from ccxt.base.types import Any, Balances, Bool, Int, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
9
9
  from ccxt.async_support.base.ws.client import Client
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
@@ -1590,7 +1590,7 @@ class kraken(ccxt.async_support.kraken):
1590
1590
  # del client.futures[requestId]
1591
1591
  # }
1592
1592
 
1593
- def handle_error_message(self, client: Client, message):
1593
+ def handle_error_message(self, client: Client, message) -> Bool:
1594
1594
  #
1595
1595
  # {
1596
1596
  # "errorMessage": "Currency pair not in ISO 4217-A3 format foobar",
ccxt/pro/krakenfutures.py CHANGED
@@ -6,7 +6,7 @@
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById
8
8
  import hashlib
9
- from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
9
+ from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
10
10
  from ccxt.async_support.base.ws.client import Client
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
@@ -212,7 +212,7 @@ class krakenfutures(ccxt.async_support.krakenfutures):
212
212
  return result
213
213
  return self.filter_by_array(self.bidsasks, 'symbol', symbols)
214
214
 
215
- async def watch_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
215
+ async def watch_trades(self, symbol: Str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
216
216
  """
217
217
  get the list of most recent trades for a particular symbol
218
218
 
@@ -1443,7 +1443,7 @@ class krakenfutures(ccxt.async_support.krakenfutures):
1443
1443
  messageHash += '#' + subChannelName
1444
1444
  return messageHash
1445
1445
 
1446
- def handle_error_message(self, client: Client, message):
1446
+ def handle_error_message(self, client: Client, message) -> Bool:
1447
1447
  #
1448
1448
  # {
1449
1449
  # event: 'alert',
@@ -1455,6 +1455,7 @@ class krakenfutures(ccxt.async_support.krakenfutures):
1455
1455
  raise ExchangeError(self.id + ' ' + errMsg)
1456
1456
  except Exception as error:
1457
1457
  client.reject(error)
1458
+ return False
1458
1459
 
1459
1460
  def handle_message(self, client, message):
1460
1461
  event = self.safe_string(message, 'event')
ccxt/pro/kucoin.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
8
- from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Str, Strings, Ticker, Tickers, Trade
8
+ from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Str, Strings, Ticker, Tickers, Trade
9
9
  from ccxt.async_support.base.ws.client import Client
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
@@ -1321,7 +1321,7 @@ class kucoin(ccxt.async_support.kucoin):
1321
1321
  client.lastPong = self.milliseconds()
1322
1322
  # https://docs.kucoin.com/#ping
1323
1323
 
1324
- def handle_error_message(self, client: Client, message):
1324
+ def handle_error_message(self, client: Client, message) -> Bool:
1325
1325
  #
1326
1326
  # {
1327
1327
  # "id": "1",
@@ -1336,7 +1336,8 @@ class kucoin(ccxt.async_support.kucoin):
1336
1336
  if client.url.find('connectId=private') >= 0:
1337
1337
  type = 'private'
1338
1338
  self.options['urls'][type] = None
1339
- self.handle_errors(None, None, client.url, None, None, data, message, None, None)
1339
+ self.handle_errors(1, '', client.url, '', {}, data, message, {}, {})
1340
+ return False
1340
1341
 
1341
1342
  def handle_message(self, client: Client, message):
1342
1343
  type = self.safe_string(message, 'type')
ccxt/pro/kucoinfutures.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import ccxt.async_support
7
7
  from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById, ArrayCacheByTimestamp
8
- from ccxt.base.types import Any, Balances, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
8
+ from ccxt.base.types import Any, Balances, Bool, Int, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade
9
9
  from ccxt.async_support.base.ws.client import Client
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
@@ -1166,7 +1166,7 @@ class kucoinfutures(ccxt.async_support.kucoinfutures):
1166
1166
  client.lastPong = self.milliseconds()
1167
1167
  return message
1168
1168
 
1169
- def handle_error_message(self, client: Client, message):
1169
+ def handle_error_message(self, client: Client, message) -> Bool:
1170
1170
  #
1171
1171
  # {
1172
1172
  # "id": "64d8732c856851144bded10d",
@@ -1181,7 +1181,8 @@ class kucoinfutures(ccxt.async_support.kucoinfutures):
1181
1181
  if client.url.find('connectId=private') >= 0:
1182
1182
  type = 'private'
1183
1183
  self.options['urls'][type] = None
1184
- self.handle_errors(None, None, client.url, None, None, data, message, None, None)
1184
+ self.handle_errors(1, '', client.url, '', {}, data, message, {}, {})
1185
+ return True
1185
1186
 
1186
1187
  def handle_subscription_status(self, client: Client, message):
1187
1188
  #