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.
- ccxt/__init__.py +3 -1
- ccxt/abstract/bingx.py +1 -0
- ccxt/abstract/bitget.py +6 -0
- ccxt/abstract/hibachi.py +26 -0
- ccxt/alpaca.py +1 -1
- ccxt/apex.py +1 -1
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/apex.py +1 -1
- ccxt/async_support/ascendex.py +1 -1
- ccxt/async_support/base/exchange.py +44 -9
- ccxt/async_support/base/ws/client.py +3 -1
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +10 -8
- ccxt/async_support/bingx.py +33 -4
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitfinex.py +4 -1
- ccxt/async_support/bitflyer.py +1 -1
- ccxt/async_support/bitget.py +2040 -561
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +2 -2
- ccxt/async_support/bitmex.py +3 -2
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +1 -1
- ccxt/async_support/bittrade.py +1 -1
- ccxt/async_support/bitvavo.py +1 -1
- ccxt/async_support/blockchaincom.py +1 -1
- ccxt/async_support/blofin.py +1 -1
- ccxt/async_support/btcmarkets.py +1 -1
- ccxt/async_support/bybit.py +7 -3
- ccxt/async_support/coinbase.py +1 -1
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/coincatch.py +2 -2
- ccxt/async_support/coinex.py +67 -6
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/cryptocom.py +2 -2
- ccxt/async_support/defx.py +2 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/deribit.py +1 -1
- ccxt/async_support/digifinex.py +2 -2
- ccxt/async_support/ellipx.py +1 -1
- ccxt/async_support/exmo.py +1 -1
- ccxt/async_support/foxbit.py +3 -3
- ccxt/async_support/gate.py +18 -4
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hashkey.py +2 -2
- ccxt/async_support/hibachi.py +2080 -0
- ccxt/async_support/hitbtc.py +2 -2
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +4 -3
- ccxt/async_support/hyperliquid.py +71 -29
- ccxt/async_support/independentreserve.py +1 -1
- ccxt/async_support/indodax.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/krakenfutures.py +2 -1
- ccxt/async_support/kucoin.py +2 -2
- ccxt/async_support/kucoinfutures.py +2 -1
- ccxt/async_support/lbank.py +2 -2
- ccxt/async_support/mercado.py +1 -1
- ccxt/async_support/mexc.py +9 -2
- ccxt/async_support/modetrade.py +93 -2
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +35 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +2 -2
- ccxt/async_support/onetrading.py +33 -0
- ccxt/async_support/oxfun.py +1 -1
- ccxt/async_support/p2b.py +32 -0
- ccxt/async_support/paradex.py +2 -1
- ccxt/async_support/phemex.py +2 -2
- ccxt/async_support/poloniex.py +2 -2
- ccxt/async_support/probit.py +36 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/vertex.py +1 -1
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/whitebit.py +2 -2
- ccxt/async_support/woo.py +4 -4
- ccxt/async_support/woofipro.py +93 -2
- ccxt/async_support/xt.py +2 -2
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/errors.py +0 -6
- ccxt/base/exchange.py +11 -9
- ccxt/base/types.py +1 -0
- ccxt/bigone.py +1 -1
- ccxt/binance.py +10 -8
- ccxt/bingx.py +33 -4
- ccxt/bitbank.py +1 -1
- ccxt/bitfinex.py +4 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +2040 -561
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +2 -2
- ccxt/bitmex.py +3 -2
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +1 -1
- ccxt/bittrade.py +1 -1
- ccxt/bitvavo.py +1 -1
- ccxt/blockchaincom.py +1 -1
- ccxt/blofin.py +1 -1
- ccxt/btcmarkets.py +1 -1
- ccxt/bybit.py +7 -3
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/coincatch.py +2 -2
- ccxt/coinex.py +67 -6
- ccxt/coinmate.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/cryptocom.py +2 -2
- ccxt/defx.py +2 -2
- ccxt/delta.py +1 -1
- ccxt/deribit.py +1 -1
- ccxt/digifinex.py +2 -2
- ccxt/ellipx.py +1 -1
- ccxt/exmo.py +1 -1
- ccxt/foxbit.py +3 -3
- ccxt/gate.py +18 -4
- ccxt/gemini.py +1 -1
- ccxt/hashkey.py +2 -2
- ccxt/hibachi.py +2079 -0
- ccxt/hitbtc.py +2 -2
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +4 -3
- ccxt/hyperliquid.py +71 -29
- ccxt/independentreserve.py +1 -1
- ccxt/indodax.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/krakenfutures.py +2 -1
- ccxt/kucoin.py +2 -2
- ccxt/kucoinfutures.py +2 -1
- ccxt/lbank.py +2 -2
- ccxt/mercado.py +1 -1
- ccxt/mexc.py +9 -2
- ccxt/modetrade.py +93 -2
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +35 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +2 -2
- ccxt/onetrading.py +33 -0
- ccxt/oxfun.py +1 -1
- ccxt/p2b.py +32 -0
- ccxt/paradex.py +2 -1
- ccxt/phemex.py +2 -2
- ccxt/poloniex.py +2 -2
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +2 -2
- ccxt/pro/apex.py +2 -2
- ccxt/pro/ascendex.py +2 -2
- ccxt/pro/binance.py +4 -5
- ccxt/pro/bitget.py +3 -3
- ccxt/pro/bithumb.py +2 -2
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitmex.py +3 -3
- ccxt/pro/bitstamp.py +3 -3
- ccxt/pro/bittrade.py +2 -2
- ccxt/pro/bitvavo.py +5 -3
- ccxt/pro/bybit.py +5 -4
- ccxt/pro/cex.py +3 -2
- ccxt/pro/coinbaseexchange.py +4 -4
- ccxt/pro/coinbaseinternational.py +2 -2
- ccxt/pro/coincatch.py +1 -1
- ccxt/pro/coinex.py +1 -1
- ccxt/pro/coinone.py +2 -2
- ccxt/pro/cryptocom.py +2 -2
- ccxt/pro/derive.py +2 -2
- ccxt/pro/gate.py +3 -3
- ccxt/pro/hollaex.py +2 -2
- ccxt/pro/htx.py +3 -3
- ccxt/pro/hyperliquid.py +101 -14
- ccxt/pro/kraken.py +2 -2
- ccxt/pro/krakenfutures.py +4 -3
- ccxt/pro/kucoin.py +4 -3
- ccxt/pro/kucoinfutures.py +4 -3
- ccxt/pro/mexc.py +328 -139
- ccxt/pro/modetrade.py +2 -2
- ccxt/pro/okcoin.py +2 -2
- ccxt/pro/okx.py +7 -6
- ccxt/pro/onetrading.py +2 -2
- ccxt/pro/oxfun.py +1 -1
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/paradex.py +2 -2
- ccxt/pro/poloniex.py +2 -2
- ccxt/pro/probit.py +2 -2
- ccxt/pro/vertex.py +2 -2
- ccxt/pro/whitebit.py +2 -2
- ccxt/pro/woo.py +2 -2
- ccxt/pro/woofipro.py +2 -2
- ccxt/probit.py +36 -1
- ccxt/protobuf/__init__.py +0 -0
- ccxt/protobuf/mexc/PrivateAccountV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PrivateDealsV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PrivateOrdersV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicAggreBookTickerV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicAggreDealsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicAggreDepthsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicBookTickerBatchV3Api_pb2.py +38 -0
- ccxt/protobuf/mexc/PublicBookTickerV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicDealsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicIncreaseDepthsBatchV3Api_pb2.py +38 -0
- ccxt/protobuf/mexc/PublicIncreaseDepthsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicLimitDepthsV3Api_pb2.py +39 -0
- ccxt/protobuf/mexc/PublicMiniTickerV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PublicMiniTickersV3Api_pb2.py +38 -0
- ccxt/protobuf/mexc/PublicSpotKlineV3Api_pb2.py +37 -0
- ccxt/protobuf/mexc/PushDataV3ApiWrapper_pb2.py +52 -0
- ccxt/protobuf/mexc/__init__.py +0 -0
- ccxt/test/tests_async.py +1 -1
- ccxt/test/tests_sync.py +1 -1
- ccxt/tokocrypto.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/vertex.py +1 -1
- ccxt/wavesexchange.py +1 -1
- ccxt/whitebit.py +2 -2
- ccxt/woo.py +4 -4
- ccxt/woofipro.py +93 -2
- ccxt/xt.py +2 -2
- ccxt/yobit.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/METADATA +8 -7
- {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/RECORD +234 -213
- {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.98.dist-info → ccxt-4.4.100.dist-info}/WHEEL +0 -0
- {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(
|
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]
|
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
|
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
|
-
|
837
|
-
|
838
|
-
|
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
|
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(
|
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(
|
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
|
#
|