ccxt 4.4.99__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 +1 -1
- ccxt/abstract/bingx.py +1 -0
- ccxt/alpaca.py +1 -1
- ccxt/apex.py +1 -1
- ccxt/ascendex.py +1 -1
- ccxt/async_support/__init__.py +1 -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 +3 -2
- 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 +32 -14
- 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 +2 -2
- 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 +3 -3
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- 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 +17 -2
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hashkey.py +2 -2
- ccxt/async_support/hibachi.py +1 -1
- 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 +1 -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/exchange.py +11 -9
- ccxt/base/types.py +1 -0
- ccxt/bigone.py +1 -1
- ccxt/binance.py +3 -2
- ccxt/bingx.py +33 -4
- ccxt/bitbank.py +1 -1
- ccxt/bitfinex.py +4 -1
- ccxt/bitflyer.py +1 -1
- ccxt/bitget.py +32 -14
- 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 +2 -2
- ccxt/coinbase.py +1 -1
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/coincatch.py +2 -2
- ccxt/coinex.py +3 -3
- ccxt/coinmate.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/cryptocom.py +1 -1
- 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 +17 -2
- ccxt/gemini.py +1 -1
- ccxt/hashkey.py +2 -2
- ccxt/hibachi.py +1 -1
- 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 +1 -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/binance.py +2 -1
- ccxt/pro/bitvavo.py +1 -1
- ccxt/pro/bybit.py +1 -0
- ccxt/pro/coinex.py +1 -1
- ccxt/pro/hyperliquid.py +99 -12
- ccxt/pro/kucoin.py +1 -1
- ccxt/pro/kucoinfutures.py +1 -1
- ccxt/pro/mexc.py +328 -139
- ccxt/pro/okx.py +2 -1
- ccxt/pro/oxfun.py +1 -1
- 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/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.99.dist-info → ccxt-4.4.100.dist-info}/METADATA +5 -5
- {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/RECORD +197 -179
- {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/WHEEL +0 -0
- {ccxt-4.4.99.dist-info → ccxt-4.4.100.dist-info}/top_level.txt +0 -0
ccxt/pro/hyperliquid.py
CHANGED
@@ -8,7 +8,6 @@ from ccxt.async_support.base.ws.cache import ArrayCache, ArrayCacheBySymbolById,
|
|
8
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
|
@@ -825,17 +869,60 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
825
869
|
|
826
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/kucoin.py
CHANGED
@@ -1336,7 +1336,7 @@ 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
1340
|
return False
|
1341
1341
|
|
1342
1342
|
def handle_message(self, client: Client, message):
|
ccxt/pro/kucoinfutures.py
CHANGED
@@ -1181,7 +1181,7 @@ 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
1185
|
return True
|
1186
1186
|
|
1187
1187
|
def handle_subscription_status(self, client: Client, message):
|