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/hitbtc.py
CHANGED
@@ -2648,7 +2648,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
2648
2648
|
'info': response,
|
2649
2649
|
}
|
2650
2650
|
|
2651
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2651
|
+
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
|
-
def set_leverage(self, leverage:
|
3420
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
3421
3421
|
"""
|
3422
3422
|
set the level of leverage for a market
|
3423
3423
|
|
ccxt/hollaex.py
CHANGED
@@ -1798,7 +1798,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
1798
1798
|
'fee': fee,
|
1799
1799
|
}
|
1800
1800
|
|
1801
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1801
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
1802
1802
|
"""
|
1803
1803
|
make a withdrawal
|
1804
1804
|
|
ccxt/htx.py
CHANGED
@@ -5016,7 +5016,7 @@ class htx(Exchange, ImplicitAPI):
|
|
5016
5016
|
params['createMarketBuyOrderRequiresPrice'] = False
|
5017
5017
|
return self.create_order(symbol, 'market', 'buy', cost, None, params)
|
5018
5018
|
|
5019
|
-
def create_trailing_percent_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, trailingPercent=None, trailingTriggerPrice=None, params={}) -> Order:
|
5019
|
+
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:
|
5020
5020
|
"""
|
5021
5021
|
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
|
5022
5022
|
:param str symbol: unified symbol of the market to create an order in
|
@@ -6308,7 +6308,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6308
6308
|
}
|
6309
6309
|
return self.safe_string(statuses, status, status)
|
6310
6310
|
|
6311
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
6311
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
6312
6312
|
"""
|
6313
6313
|
|
6314
6314
|
https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
|
@@ -7133,7 +7133,7 @@ class htx(Exchange, ImplicitAPI):
|
|
7133
7133
|
data = self.safe_list(response, 'data', [])
|
7134
7134
|
return self.parse_incomes(data, market, since, limit)
|
7135
7135
|
|
7136
|
-
def set_leverage(self, leverage:
|
7136
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
7137
7137
|
"""
|
7138
7138
|
set the level of leverage for a market
|
7139
7139
|
|
@@ -8852,6 +8852,7 @@ class htx(Exchange, ImplicitAPI):
|
|
8852
8852
|
'contracts': self.safe_number(liquidation, 'volume'),
|
8853
8853
|
'contractSize': self.safe_number(market, 'contractSize'),
|
8854
8854
|
'price': self.safe_number(liquidation, 'price'),
|
8855
|
+
'side': self.safe_string_lower(liquidation, 'direction'),
|
8855
8856
|
'baseValue': self.safe_number(liquidation, 'amount'),
|
8856
8857
|
'quoteValue': self.safe_number(liquidation, 'trade_turnover'),
|
8857
8858
|
'timestamp': timestamp,
|
ccxt/hyperliquid.py
CHANGED
@@ -1675,6 +1675,43 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1675
1675
|
if symbol is None:
|
1676
1676
|
raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
|
1677
1677
|
self.load_markets()
|
1678
|
+
request = self.cancel_orders_request(ids, symbol, params)
|
1679
|
+
response = self.privatePostExchange(request)
|
1680
|
+
#
|
1681
|
+
# {
|
1682
|
+
# "status":"ok",
|
1683
|
+
# "response":{
|
1684
|
+
# "type":"cancel",
|
1685
|
+
# "data":{
|
1686
|
+
# "statuses":[
|
1687
|
+
# "success"
|
1688
|
+
# ]
|
1689
|
+
# }
|
1690
|
+
# }
|
1691
|
+
# }
|
1692
|
+
#
|
1693
|
+
innerResponse = self.safe_dict(response, 'response')
|
1694
|
+
data = self.safe_dict(innerResponse, 'data')
|
1695
|
+
statuses = self.safe_list(data, 'statuses')
|
1696
|
+
orders = []
|
1697
|
+
for i in range(0, len(statuses)):
|
1698
|
+
status = statuses[i]
|
1699
|
+
orders.append(self.safe_order({
|
1700
|
+
'info': status,
|
1701
|
+
'status': status,
|
1702
|
+
}))
|
1703
|
+
return orders
|
1704
|
+
|
1705
|
+
def cancel_orders_request(self, ids: List[str], symbol: Str = None, params={}) -> dict:
|
1706
|
+
"""
|
1707
|
+
build the request payload for cancelling multiple orders
|
1708
|
+
https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
1709
|
+
https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
1710
|
+
:param str[] ids: order ids
|
1711
|
+
:param str symbol: unified market symbol
|
1712
|
+
:param dict [params]:
|
1713
|
+
:returns dict: the raw request object to be sent to the exchange
|
1714
|
+
"""
|
1678
1715
|
market = self.market(symbol)
|
1679
1716
|
clientOrderId = self.safe_value_2(params, 'clientOrderId', 'client_id')
|
1680
1717
|
params = self.omit(params, ['clientOrderId', 'client_id'])
|
@@ -1715,31 +1752,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1715
1752
|
if vaultAddress is not None:
|
1716
1753
|
params = self.omit(params, 'vaultAddress')
|
1717
1754
|
request['vaultAddress'] = vaultAddress
|
1718
|
-
|
1719
|
-
#
|
1720
|
-
# {
|
1721
|
-
# "status":"ok",
|
1722
|
-
# "response":{
|
1723
|
-
# "type":"cancel",
|
1724
|
-
# "data":{
|
1725
|
-
# "statuses":[
|
1726
|
-
# "success"
|
1727
|
-
# ]
|
1728
|
-
# }
|
1729
|
-
# }
|
1730
|
-
# }
|
1731
|
-
#
|
1732
|
-
innerResponse = self.safe_dict(response, 'response')
|
1733
|
-
data = self.safe_dict(innerResponse, 'data')
|
1734
|
-
statuses = self.safe_list(data, 'statuses')
|
1735
|
-
orders = []
|
1736
|
-
for i in range(0, len(statuses)):
|
1737
|
-
status = statuses[i]
|
1738
|
-
orders.append(self.safe_order({
|
1739
|
-
'info': status,
|
1740
|
-
'status': status,
|
1741
|
-
}))
|
1742
|
-
return orders
|
1755
|
+
return request
|
1743
1756
|
|
1744
1757
|
def cancel_orders_for_symbols(self, orders: List[CancellationRequest], params={}):
|
1745
1758
|
"""
|
@@ -2468,6 +2481,8 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2468
2481
|
}, market)
|
2469
2482
|
|
2470
2483
|
def parse_order_status(self, status: Str):
|
2484
|
+
if status is None:
|
2485
|
+
return None
|
2471
2486
|
statuses: dict = {
|
2472
2487
|
'triggered': 'open',
|
2473
2488
|
'filled': 'closed',
|
@@ -2476,6 +2491,10 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2476
2491
|
'rejected': 'rejected',
|
2477
2492
|
'marginCanceled': 'canceled',
|
2478
2493
|
}
|
2494
|
+
if status.endswith('Rejected'):
|
2495
|
+
return 'rejected'
|
2496
|
+
if status.endswith('Canceled'):
|
2497
|
+
return 'canceled'
|
2479
2498
|
return self.safe_string(statuses, status, status)
|
2480
2499
|
|
2481
2500
|
def parse_order_type(self, status):
|
@@ -2805,7 +2824,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2805
2824
|
#
|
2806
2825
|
return response
|
2807
2826
|
|
2808
|
-
def set_leverage(self, leverage:
|
2827
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
2809
2828
|
"""
|
2810
2829
|
set the level of leverage for a market
|
2811
2830
|
:param float leverage: the rate of leverage
|
@@ -3058,7 +3077,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
3058
3077
|
'status': 'ok',
|
3059
3078
|
}
|
3060
3079
|
|
3061
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
3080
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
3062
3081
|
"""
|
3063
3082
|
make a withdrawal(only support USDC)
|
3064
3083
|
|
@@ -3586,6 +3605,27 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
3586
3605
|
'rate': rate,
|
3587
3606
|
}
|
3588
3607
|
|
3608
|
+
def reserve_request_weight(self, weight: Num, params={}) -> dict:
|
3609
|
+
"""
|
3610
|
+
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.
|
3611
|
+
:param number weight: the weight to reserve, 1 weight = 1 action, 0.0005 USDC per action
|
3612
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3613
|
+
:returns dict: a response object
|
3614
|
+
"""
|
3615
|
+
nonce = self.milliseconds()
|
3616
|
+
request: dict = {
|
3617
|
+
'nonce': nonce,
|
3618
|
+
}
|
3619
|
+
action: dict = {
|
3620
|
+
'type': 'reserveRequestWeight',
|
3621
|
+
'weight': weight,
|
3622
|
+
}
|
3623
|
+
signature = self.sign_l1_action(action, nonce)
|
3624
|
+
request['action'] = action
|
3625
|
+
request['signature'] = signature
|
3626
|
+
response = self.privatePostExchange(self.extend(request, params))
|
3627
|
+
return response
|
3628
|
+
|
3589
3629
|
def extract_type_from_delta(self, data=[]):
|
3590
3630
|
records = []
|
3591
3631
|
for i in range(0, len(data)):
|
@@ -3639,8 +3679,10 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
3639
3679
|
responsePayload = self.safe_dict(response, 'response', {})
|
3640
3680
|
data = self.safe_dict(responsePayload, 'data', {})
|
3641
3681
|
statuses = self.safe_list(data, 'statuses', [])
|
3642
|
-
|
3643
|
-
|
3682
|
+
for i in range(0, len(statuses)):
|
3683
|
+
message = self.safe_string(statuses[i], 'error')
|
3684
|
+
if message is not None:
|
3685
|
+
break
|
3644
3686
|
feedback = self.id + ' ' + body
|
3645
3687
|
nonEmptyMessage = ((message is not None) and (message != ''))
|
3646
3688
|
if nonEmptyMessage:
|
ccxt/independentreserve.py
CHANGED
@@ -922,7 +922,7 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
922
922
|
'tag': self.safe_string(depositAddress, 'Tag'),
|
923
923
|
}
|
924
924
|
|
925
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
925
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
926
926
|
"""
|
927
927
|
make a withdrawal
|
928
928
|
|
ccxt/indodax.py
CHANGED
@@ -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
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1147
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
1148
1148
|
"""
|
1149
1149
|
make a withdrawal
|
1150
1150
|
|
ccxt/kraken.py
CHANGED
@@ -3037,7 +3037,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
3037
3037
|
'tag': tag,
|
3038
3038
|
}
|
3039
3039
|
|
3040
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
3040
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
3041
3041
|
"""
|
3042
3042
|
make a withdrawal
|
3043
3043
|
|
ccxt/krakenfutures.py
CHANGED
@@ -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
|
-
def set_leverage(self, leverage:
|
2610
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
2610
2611
|
"""
|
2611
2612
|
set the level of leverage for a market
|
2612
2613
|
|
ccxt/kucoin.py
CHANGED
@@ -3386,7 +3386,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3386
3386
|
'tierBased': True,
|
3387
3387
|
}
|
3388
3388
|
|
3389
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
3389
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
3390
3390
|
"""
|
3391
3391
|
make a withdrawal
|
3392
3392
|
|
@@ -4801,7 +4801,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4801
4801
|
data = self.safe_list(response, 'data', [])
|
4802
4802
|
return self.parse_deposit_withdraw_fees(data, codes, 'currency')
|
4803
4803
|
|
4804
|
-
def set_leverage(self, leverage:
|
4804
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
4805
4805
|
"""
|
4806
4806
|
set the level of leverage for a market
|
4807
4807
|
|
ccxt/kucoinfutures.py
CHANGED
@@ -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
|
self.load_markets()
|
@@ -3217,7 +3218,7 @@ class kucoinfutures(kucoin, ImplicitAPI):
|
|
3217
3218
|
'marginMode': marginMode,
|
3218
3219
|
})
|
3219
3220
|
|
3220
|
-
def set_leverage(self, leverage:
|
3221
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
3221
3222
|
"""
|
3222
3223
|
set the level of leverage for a market
|
3223
3224
|
|
ccxt/lbank.py
CHANGED
@@ -967,7 +967,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
967
967
|
timestamp = self.milliseconds()
|
968
968
|
if market['swap']:
|
969
969
|
return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks', 'price', 'volume')
|
970
|
-
return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks'
|
970
|
+
return self.parse_order_book(orderbook, market['symbol'], timestamp, 'bids', 'asks')
|
971
971
|
|
972
972
|
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
973
973
|
#
|
@@ -2234,7 +2234,7 @@ class lbank(Exchange, ImplicitAPI):
|
|
2234
2234
|
'tag': tag,
|
2235
2235
|
}
|
2236
2236
|
|
2237
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2237
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
2238
2238
|
"""
|
2239
2239
|
make a withdrawal
|
2240
2240
|
|
ccxt/mercado.py
CHANGED
@@ -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
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
707
|
+
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
|
ccxt/mexc.py
CHANGED
@@ -487,6 +487,12 @@ class mexc(Exchange, ImplicitAPI):
|
|
487
487
|
'ZKSYNC': 'ZKSYNCERA',
|
488
488
|
'TRC20': 'TRX',
|
489
489
|
'TON': 'TONCOIN',
|
490
|
+
'ARBITRUM': 'ARB',
|
491
|
+
'STX': 'STACKS',
|
492
|
+
'LUNC': 'LUNA',
|
493
|
+
'STARK': 'STARKNET',
|
494
|
+
'APT': 'APTOS',
|
495
|
+
'PEAQ': 'PEAQEVM',
|
490
496
|
'AVAXC': 'AVAX_CCHAIN',
|
491
497
|
'ERC20': 'ETH',
|
492
498
|
'ACA': 'ACALA',
|
@@ -516,6 +522,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
516
522
|
# 'DNX': 'Dynex(DNX)',
|
517
523
|
# 'DOGE': 'Dogecoin(DOGE)',
|
518
524
|
# 'DOT': 'Polkadot(DOT)',
|
525
|
+
'DOT': 'DOTASSETHUB',
|
519
526
|
# 'DYM': 'Dymension(DYM)',
|
520
527
|
'ETHF': 'ETF',
|
521
528
|
'HRC20': 'HECO',
|
@@ -4055,7 +4062,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4055
4062
|
"""
|
4056
4063
|
return self.modify_margin_helper(symbol, amount, 'ADD', params)
|
4057
4064
|
|
4058
|
-
def set_leverage(self, leverage:
|
4065
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
4059
4066
|
"""
|
4060
4067
|
set the level of leverage for a market
|
4061
4068
|
|
@@ -5241,7 +5248,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
5241
5248
|
}
|
5242
5249
|
return self.safe_string(statuses, status, status)
|
5243
5250
|
|
5244
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
5251
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
5245
5252
|
"""
|
5246
5253
|
make a withdrawal
|
5247
5254
|
|
ccxt/modetrade.py
CHANGED
@@ -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
|
+
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
|
+
self.load_markets()
|
1074
|
+
paginate = False
|
1075
|
+
paginate, params = self.handle_option_and_params(params, 'fetchFundingHistory', 'paginate')
|
1076
|
+
if paginate:
|
1077
|
+
return 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 = 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
|
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
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2424
|
+
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
|
-
def set_leverage(self, leverage:
|
2554
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
2464
2555
|
"""
|
2465
2556
|
set the level of leverage for a market
|
2466
2557
|
|
ccxt/ndax.py
CHANGED
@@ -2357,7 +2357,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
2357
2357
|
'network': None,
|
2358
2358
|
}
|
2359
2359
|
|
2360
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2360
|
+
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
|
ccxt/novadax.py
CHANGED
@@ -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
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
1304
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
1271
1305
|
"""
|
1272
1306
|
make a withdrawal
|
1273
1307
|
|
ccxt/okcoin.py
CHANGED
@@ -2416,7 +2416,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2416
2416
|
}
|
2417
2417
|
return self.safe_string(statuses, status, status)
|
2418
2418
|
|
2419
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
2419
|
+
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/okx.py
CHANGED
@@ -4954,7 +4954,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4954
4954
|
first = self.safe_string(keys, 0)
|
4955
4955
|
return self.safe_dict(response, first)
|
4956
4956
|
|
4957
|
-
def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|
4957
|
+
def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
|
4958
4958
|
"""
|
4959
4959
|
make a withdrawal
|
4960
4960
|
|
@@ -6351,7 +6351,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6351
6351
|
sorted = self.sort_by(result, 'timestamp')
|
6352
6352
|
return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
|
6353
6353
|
|
6354
|
-
def set_leverage(self, leverage:
|
6354
|
+
def set_leverage(self, leverage: int, symbol: Str = None, params={}):
|
6355
6355
|
"""
|
6356
6356
|
set the level of leverage for a market
|
6357
6357
|
|