ccxt 4.3.30__py2.py3-none-any.whl → 4.3.31__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/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +21 -21
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +168 -139
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +37 -37
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +35 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +21 -21
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +168 -139
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +19 -19
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +37 -37
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/RECORD +258 -258
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
@@ -219,7 +219,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
219
219
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
220
220
|
:returns dict: an associative dictionary of currencies
|
221
221
|
"""
|
222
|
-
request = {
|
222
|
+
request: dict = {
|
223
223
|
'type': 'meta',
|
224
224
|
}
|
225
225
|
response = await self.publicPostInfo(self.extend(request, params))
|
@@ -238,7 +238,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
238
238
|
# ]
|
239
239
|
#
|
240
240
|
meta = self.safe_list(response, 'universe', [])
|
241
|
-
result = {}
|
241
|
+
result: dict = {}
|
242
242
|
for i in range(0, len(meta)):
|
243
243
|
data = self.safe_dict(meta, i, {})
|
244
244
|
id = i
|
@@ -283,7 +283,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
283
283
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
284
284
|
:returns dict[]: an array of objects representing market data
|
285
285
|
"""
|
286
|
-
request = {
|
286
|
+
request: dict = {
|
287
287
|
'type': 'metaAndAssetCtxs',
|
288
288
|
}
|
289
289
|
response = await self.publicPostInfo(self.extend(request, params))
|
@@ -338,7 +338,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
338
338
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
339
339
|
:returns dict[]: an array of objects representing market data
|
340
340
|
"""
|
341
|
-
request = {
|
341
|
+
request: dict = {
|
342
342
|
'type': 'spotMetaAndAssetCtxs',
|
343
343
|
}
|
344
344
|
response = await self.publicPostInfo(self.extend(request, params))
|
@@ -623,7 +623,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
623
623
|
type, params = self.handle_market_type_and_params('fetchBalance', None, params)
|
624
624
|
isSpot = (type == 'spot')
|
625
625
|
reqType = 'spotClearinghouseState' if (isSpot) else 'clearinghouseState'
|
626
|
-
request = {
|
626
|
+
request: dict = {
|
627
627
|
'type': reqType,
|
628
628
|
'user': userAddress,
|
629
629
|
}
|
@@ -665,7 +665,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
665
665
|
#
|
666
666
|
balances = self.safe_list(response, 'balances')
|
667
667
|
if balances is not None:
|
668
|
-
spotBalances = {'info': response}
|
668
|
+
spotBalances: dict = {'info': response}
|
669
669
|
for i in range(0, len(balances)):
|
670
670
|
balance = balances[i]
|
671
671
|
code = self.safe_currency_code(self.safe_string(balance, 'coin'))
|
@@ -677,7 +677,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
677
677
|
spotBalances[code] = account
|
678
678
|
return self.safe_balance(spotBalances)
|
679
679
|
data = self.safe_dict(response, 'marginSummary', {})
|
680
|
-
result = {
|
680
|
+
result: dict = {
|
681
681
|
'info': response,
|
682
682
|
'USDC': {
|
683
683
|
'total': self.safe_float(data, 'accountValue'),
|
@@ -700,7 +700,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
700
700
|
"""
|
701
701
|
await self.load_markets()
|
702
702
|
market = self.market(symbol)
|
703
|
-
request = {
|
703
|
+
request: dict = {
|
704
704
|
'type': 'l2Book',
|
705
705
|
'coin': market['base'] if market['swap'] else market['id'],
|
706
706
|
}
|
@@ -728,7 +728,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
728
728
|
# }
|
729
729
|
#
|
730
730
|
data = self.safe_list(response, 'levels', [])
|
731
|
-
result = {
|
731
|
+
result: dict = {
|
732
732
|
'bids': self.safe_list(data, 0, []),
|
733
733
|
'asks': self.safe_list(data, 1, []),
|
734
734
|
}
|
@@ -755,7 +755,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
755
755
|
if limit is None:
|
756
756
|
limit = 500
|
757
757
|
params = self.omit(params, ['until'])
|
758
|
-
request = {
|
758
|
+
request: dict = {
|
759
759
|
'type': 'candleSnapshot',
|
760
760
|
'req': {
|
761
761
|
'coin': market['base'] if market['swap'] else market['id'],
|
@@ -825,7 +825,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
825
825
|
userAddress, params = self.handle_public_address('fetchTrades', params)
|
826
826
|
await self.load_markets()
|
827
827
|
market = self.safe_market(symbol)
|
828
|
-
request = {
|
828
|
+
request: dict = {
|
829
829
|
'user': userAddress,
|
830
830
|
}
|
831
831
|
if since is not None:
|
@@ -909,7 +909,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
909
909
|
hash = self.action_hash(action, vaultAdress, nonce)
|
910
910
|
isTestnet = self.safe_bool(self.options, 'sandboxMode', False)
|
911
911
|
phantomAgent = self.construct_phantom_agent(hash, isTestnet)
|
912
|
-
# data = {
|
912
|
+
# data: Dict = {
|
913
913
|
# 'domain': {
|
914
914
|
# 'chainId': 1337,
|
915
915
|
# 'name': 'Exchange',
|
@@ -933,13 +933,13 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
933
933
|
# }
|
934
934
|
zeroAddress = self.safe_string(self.options, 'zeroAddress')
|
935
935
|
chainId = 1337 # check self out
|
936
|
-
domain = {
|
936
|
+
domain: dict = {
|
937
937
|
'chainId': chainId,
|
938
938
|
'name': 'Exchange',
|
939
939
|
'verifyingContract': zeroAddress,
|
940
940
|
'version': '1',
|
941
941
|
}
|
942
|
-
messageTypes = {
|
942
|
+
messageTypes: dict = {
|
943
943
|
'Agent': [
|
944
944
|
{'name': 'source', 'type': 'string'},
|
945
945
|
{'name': 'connectionId', 'type': 'bytes32'},
|
@@ -951,7 +951,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
951
951
|
|
952
952
|
def build_sig(self, chainId, messageTypes, message):
|
953
953
|
zeroAddress = self.safe_string(self.options, 'zeroAddress')
|
954
|
-
domain = {
|
954
|
+
domain: dict = {
|
955
955
|
'chainId': chainId,
|
956
956
|
'name': 'Exchange',
|
957
957
|
'verifyingContract': zeroAddress,
|
@@ -964,7 +964,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
964
964
|
def build_transfer_sig(self, message):
|
965
965
|
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
966
966
|
chainId = 421614 if (isSandboxMode) else 42161
|
967
|
-
messageTypes = {
|
967
|
+
messageTypes: dict = {
|
968
968
|
'UsdTransferSignPayload': [
|
969
969
|
{'name': 'destination', 'type': 'string'},
|
970
970
|
{'name': 'amount', 'type': 'string'},
|
@@ -976,7 +976,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
976
976
|
def build_withdraw_sig(self, message):
|
977
977
|
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
978
978
|
chainId = 421614 if (isSandboxMode) else 42161
|
979
|
-
messageTypes = {
|
979
|
+
messageTypes: dict = {
|
980
980
|
'WithdrawFromBridge2SignPayload': [
|
981
981
|
{'name': 'destination', 'type': 'string'},
|
982
982
|
{'name': 'usd', 'type': 'string'},
|
@@ -1017,7 +1017,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1017
1017
|
'price': price,
|
1018
1018
|
'params': params,
|
1019
1019
|
}
|
1020
|
-
globalParams = {}
|
1020
|
+
globalParams: dict = {}
|
1021
1021
|
if vaultAddress is not None:
|
1022
1022
|
globalParams['vaultAddress'] = vaultAddress
|
1023
1023
|
response = await self.create_orders([order], globalParams)
|
@@ -1086,7 +1086,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1086
1086
|
px = self.price_to_precision(symbol, price)
|
1087
1087
|
sz = self.amount_to_precision(symbol, amount)
|
1088
1088
|
reduceOnly = self.safe_bool(orderParams, 'reduceOnly', False)
|
1089
|
-
orderType = {}
|
1089
|
+
orderType: dict = {}
|
1090
1090
|
if isTrigger:
|
1091
1091
|
isTp = False
|
1092
1092
|
if takeProfitPrice is not None:
|
@@ -1104,7 +1104,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1104
1104
|
'tif': timeInForce,
|
1105
1105
|
}
|
1106
1106
|
orderParams = self.omit(orderParams, ['clientOrderId', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce', 'client_id', 'reduceOnly', 'postOnly'])
|
1107
|
-
orderObj = {
|
1107
|
+
orderObj: dict = {
|
1108
1108
|
'a': self.parse_to_int(market['baseId']),
|
1109
1109
|
'b': isBuy,
|
1110
1110
|
'p': px,
|
@@ -1117,7 +1117,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1117
1117
|
orderObj['c'] = clientOrderId
|
1118
1118
|
orderReq.append(self.extend(orderObj, orderParams))
|
1119
1119
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
1120
|
-
orderAction = {
|
1120
|
+
orderAction: dict = {
|
1121
1121
|
'type': 'order',
|
1122
1122
|
'orders': orderReq,
|
1123
1123
|
'grouping': 'na',
|
@@ -1126,7 +1126,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1126
1126
|
if vaultAddress is None:
|
1127
1127
|
orderAction['brokerCode'] = 1
|
1128
1128
|
signature = self.sign_l1_action(orderAction, nonce, vaultAddress)
|
1129
|
-
request = {
|
1129
|
+
request: dict = {
|
1130
1130
|
'action': orderAction,
|
1131
1131
|
'nonce': nonce,
|
1132
1132
|
'signature': signature,
|
@@ -1192,12 +1192,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1192
1192
|
clientOrderId = self.safe_value_2(params, 'clientOrderId', 'client_id')
|
1193
1193
|
params = self.omit(params, ['clientOrderId', 'client_id'])
|
1194
1194
|
nonce = self.milliseconds()
|
1195
|
-
request = {
|
1195
|
+
request: dict = {
|
1196
1196
|
'nonce': nonce,
|
1197
1197
|
# 'vaultAddress': vaultAddress,
|
1198
1198
|
}
|
1199
1199
|
cancelReq = []
|
1200
|
-
cancelAction = {
|
1200
|
+
cancelAction: dict = {
|
1201
1201
|
'type': '',
|
1202
1202
|
'cancels': [],
|
1203
1203
|
}
|
@@ -1255,12 +1255,12 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1255
1255
|
self.check_required_credentials()
|
1256
1256
|
await self.load_markets()
|
1257
1257
|
nonce = self.milliseconds()
|
1258
|
-
request = {
|
1258
|
+
request: dict = {
|
1259
1259
|
'nonce': nonce,
|
1260
1260
|
# 'vaultAddress': vaultAddress,
|
1261
1261
|
}
|
1262
1262
|
cancelReq = []
|
1263
|
-
cancelAction = {
|
1263
|
+
cancelAction: dict = {
|
1264
1264
|
'type': '',
|
1265
1265
|
'cancels': [],
|
1266
1266
|
}
|
@@ -1279,7 +1279,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1279
1279
|
assetKey = 'asset' if cancelByCloid else 'a'
|
1280
1280
|
idKey = 'cloid' if cancelByCloid else 'o'
|
1281
1281
|
market = self.market(symbol)
|
1282
|
-
cancelObj = {}
|
1282
|
+
cancelObj: dict = {}
|
1283
1283
|
cancelObj[assetKey] = self.parse_to_numeric(market['baseId'])
|
1284
1284
|
cancelObj[idKey] = clientOrderId if cancelByCloid else self.parse_to_numeric(id)
|
1285
1285
|
cancelReq.append(cancelObj)
|
@@ -1320,11 +1320,11 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1320
1320
|
await self.load_markets()
|
1321
1321
|
params = self.omit(params, ['clientOrderId', 'client_id'])
|
1322
1322
|
nonce = self.milliseconds()
|
1323
|
-
request = {
|
1323
|
+
request: dict = {
|
1324
1324
|
'nonce': nonce,
|
1325
1325
|
# 'vaultAddress': vaultAddress,
|
1326
1326
|
}
|
1327
|
-
cancelAction = {
|
1327
|
+
cancelAction: dict = {
|
1328
1328
|
'type': 'scheduleCancel',
|
1329
1329
|
'time': nonce + timeout,
|
1330
1330
|
}
|
@@ -1394,7 +1394,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1394
1394
|
px = self.price_to_precision(symbol, str(price))
|
1395
1395
|
sz = self.amount_to_precision(symbol, amount)
|
1396
1396
|
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
1397
|
-
orderType = {}
|
1397
|
+
orderType: dict = {}
|
1398
1398
|
if isTrigger:
|
1399
1399
|
isTp = False
|
1400
1400
|
if takeProfitPrice is not None:
|
@@ -1414,7 +1414,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1414
1414
|
if triggerPrice is None:
|
1415
1415
|
triggerPrice = '0'
|
1416
1416
|
nonce = self.milliseconds()
|
1417
|
-
orderReq = {
|
1417
|
+
orderReq: dict = {
|
1418
1418
|
'a': self.parse_to_int(market['baseId']),
|
1419
1419
|
'b': isBuy,
|
1420
1420
|
'p': px,
|
@@ -1425,17 +1425,17 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1425
1425
|
}
|
1426
1426
|
if clientOrderId is not None:
|
1427
1427
|
orderReq['c'] = clientOrderId
|
1428
|
-
modifyReq = {
|
1428
|
+
modifyReq: dict = {
|
1429
1429
|
'oid': self.parse_to_int(id),
|
1430
1430
|
'order': orderReq,
|
1431
1431
|
}
|
1432
|
-
modifyAction = {
|
1432
|
+
modifyAction: dict = {
|
1433
1433
|
'type': 'batchModify',
|
1434
1434
|
'modifies': [modifyReq],
|
1435
1435
|
}
|
1436
1436
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
1437
1437
|
signature = self.sign_l1_action(modifyAction, nonce, vaultAddress)
|
1438
|
-
request = {
|
1438
|
+
request: dict = {
|
1439
1439
|
'action': modifyAction,
|
1440
1440
|
'nonce': nonce,
|
1441
1441
|
'signature': signature,
|
@@ -1499,7 +1499,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1499
1499
|
"""
|
1500
1500
|
await self.load_markets()
|
1501
1501
|
market = self.market(symbol)
|
1502
|
-
request = {
|
1502
|
+
request: dict = {
|
1503
1503
|
'type': 'fundingHistory',
|
1504
1504
|
'coin': market['base'],
|
1505
1505
|
}
|
@@ -1554,7 +1554,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1554
1554
|
method, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'method', 'frontendOpenOrders')
|
1555
1555
|
await self.load_markets()
|
1556
1556
|
market = self.safe_market(symbol)
|
1557
|
-
request = {
|
1557
|
+
request: dict = {
|
1558
1558
|
'type': method,
|
1559
1559
|
'user': userAddress,
|
1560
1560
|
}
|
@@ -1588,7 +1588,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1588
1588
|
userAddress, params = self.handle_public_address('fetchClosedOrders', params)
|
1589
1589
|
await self.load_markets()
|
1590
1590
|
market = self.safe_market(symbol)
|
1591
|
-
request = {
|
1591
|
+
request: dict = {
|
1592
1592
|
'type': 'historicalOrders',
|
1593
1593
|
'user': userAddress,
|
1594
1594
|
}
|
@@ -1621,7 +1621,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1621
1621
|
userAddress, params = self.handle_public_address('fetchOrder', params)
|
1622
1622
|
await self.load_markets()
|
1623
1623
|
market = self.safe_market(symbol)
|
1624
|
-
request = {
|
1624
|
+
request: dict = {
|
1625
1625
|
'type': 'orderStatus',
|
1626
1626
|
'oid': self.parse_to_numeric(id),
|
1627
1627
|
'user': userAddress,
|
@@ -1657,7 +1657,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1657
1657
|
data = self.safe_dict(response, 'order')
|
1658
1658
|
return self.parse_order(data, market)
|
1659
1659
|
|
1660
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1660
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1661
1661
|
#
|
1662
1662
|
# fetchOpenOrders
|
1663
1663
|
#
|
@@ -1795,15 +1795,15 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1795
1795
|
'trades': None,
|
1796
1796
|
}, market)
|
1797
1797
|
|
1798
|
-
def parse_order_status(self, status):
|
1799
|
-
statuses = {
|
1798
|
+
def parse_order_status(self, status: Str):
|
1799
|
+
statuses: dict = {
|
1800
1800
|
'triggered': 'open',
|
1801
1801
|
'filled': 'closed',
|
1802
1802
|
}
|
1803
1803
|
return self.safe_string(statuses, status, status)
|
1804
1804
|
|
1805
1805
|
def parse_order_type(self, status):
|
1806
|
-
statuses = {
|
1806
|
+
statuses: dict = {
|
1807
1807
|
'stop limit': 'limit',
|
1808
1808
|
'stop market': 'market',
|
1809
1809
|
}
|
@@ -1825,7 +1825,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1825
1825
|
userAddress, params = self.handle_public_address('fetchMyTrades', params)
|
1826
1826
|
await self.load_markets()
|
1827
1827
|
market = self.safe_market(symbol)
|
1828
|
-
request = {
|
1828
|
+
request: dict = {
|
1829
1829
|
'user': userAddress,
|
1830
1830
|
}
|
1831
1831
|
if since is not None:
|
@@ -1860,7 +1860,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1860
1860
|
#
|
1861
1861
|
return self.parse_trades(response, market, since, limit)
|
1862
1862
|
|
1863
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1863
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1864
1864
|
#
|
1865
1865
|
# {
|
1866
1866
|
# "closedPnl": "0.19343",
|
@@ -1932,7 +1932,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1932
1932
|
userAddress = None
|
1933
1933
|
userAddress, params = self.handle_public_address('fetchPositions', params)
|
1934
1934
|
symbols = self.market_symbols(symbols)
|
1935
|
-
request = {
|
1935
|
+
request: dict = {
|
1936
1936
|
'type': 'clearinghouseState',
|
1937
1937
|
'user': userAddress,
|
1938
1938
|
}
|
@@ -1988,7 +1988,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1988
1988
|
result.append(self.parse_position(data[i], None))
|
1989
1989
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
1990
1990
|
|
1991
|
-
def parse_position(self, position, market: Market = None):
|
1991
|
+
def parse_position(self, position: dict, market: Market = None):
|
1992
1992
|
#
|
1993
1993
|
# {
|
1994
1994
|
# "position": {
|
@@ -2075,7 +2075,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2075
2075
|
isCross = (marginMode == 'cross')
|
2076
2076
|
nonce = self.milliseconds()
|
2077
2077
|
params = self.omit(params, ['leverage'])
|
2078
|
-
updateAction = {
|
2078
|
+
updateAction: dict = {
|
2079
2079
|
'type': 'updateLeverage',
|
2080
2080
|
'asset': asset,
|
2081
2081
|
'isCross': isCross,
|
@@ -2088,7 +2088,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2088
2088
|
vaultAddress = vaultAddress.replace('0x', '')
|
2089
2089
|
extendedAction = self.extend(updateAction, params)
|
2090
2090
|
signature = self.sign_l1_action(extendedAction, nonce, vaultAddress)
|
2091
|
-
request = {
|
2091
|
+
request: dict = {
|
2092
2092
|
'action': extendedAction,
|
2093
2093
|
'nonce': nonce,
|
2094
2094
|
'signature': signature,
|
@@ -2125,7 +2125,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2125
2125
|
asset = self.parse_to_int(market['baseId'])
|
2126
2126
|
nonce = self.milliseconds()
|
2127
2127
|
params = self.omit(params, 'marginMode')
|
2128
|
-
updateAction = {
|
2128
|
+
updateAction: dict = {
|
2129
2129
|
'type': 'updateLeverage',
|
2130
2130
|
'asset': asset,
|
2131
2131
|
'isCross': isCross,
|
@@ -2133,7 +2133,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2133
2133
|
}
|
2134
2134
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
2135
2135
|
signature = self.sign_l1_action(updateAction, nonce, vaultAddress)
|
2136
|
-
request = {
|
2136
|
+
request: dict = {
|
2137
2137
|
'action': updateAction,
|
2138
2138
|
'nonce': nonce,
|
2139
2139
|
'signature': signature,
|
@@ -2183,7 +2183,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2183
2183
|
if type == 'reduce':
|
2184
2184
|
sz = -sz
|
2185
2185
|
nonce = self.milliseconds()
|
2186
|
-
updateAction = {
|
2186
|
+
updateAction: dict = {
|
2187
2187
|
'type': 'updateIsolatedMargin',
|
2188
2188
|
'asset': asset,
|
2189
2189
|
'isBuy': True,
|
@@ -2191,7 +2191,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2191
2191
|
}
|
2192
2192
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
2193
2193
|
signature = self.sign_l1_action(updateAction, nonce, vaultAddress)
|
2194
|
-
request = {
|
2194
|
+
request: dict = {
|
2195
2195
|
'action': updateAction,
|
2196
2196
|
'nonce': nonce,
|
2197
2197
|
'signature': signature,
|
@@ -2255,7 +2255,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2255
2255
|
vaultAddress = self.format_vault_address(self.safe_string(params, 'vaultAddress'))
|
2256
2256
|
params = self.omit(params, 'vaultAddress')
|
2257
2257
|
toPerp = (toAccount == 'perp') or (toAccount == 'swap')
|
2258
|
-
action = {
|
2258
|
+
action: dict = {
|
2259
2259
|
'type': 'spotUser',
|
2260
2260
|
'classTransfer': {
|
2261
2261
|
'usdc': amount,
|
@@ -2263,7 +2263,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2263
2263
|
},
|
2264
2264
|
}
|
2265
2265
|
signature = self.sign_l1_action(action, nonce, vaultAddress)
|
2266
|
-
innerRequest = {
|
2266
|
+
innerRequest: dict = {
|
2267
2267
|
'action': self.extend(action, params),
|
2268
2268
|
'nonce': nonce,
|
2269
2269
|
'signature': signature,
|
@@ -2278,13 +2278,13 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2278
2278
|
code = code.upper()
|
2279
2279
|
if code != 'USDC':
|
2280
2280
|
raise NotSupported(self.id + 'withdraw() only support USDC')
|
2281
|
-
payload = {
|
2281
|
+
payload: dict = {
|
2282
2282
|
'destination': toAccount,
|
2283
2283
|
'amount': self.number_to_string(amount),
|
2284
2284
|
'time': nonce,
|
2285
2285
|
}
|
2286
2286
|
sig = self.build_transfer_sig(payload)
|
2287
|
-
request = {
|
2287
|
+
request: dict = {
|
2288
2288
|
'action': {
|
2289
2289
|
'chain': 'ArbitrumTestnet' if (isSandboxMode) else 'Arbitrum',
|
2290
2290
|
'payload': payload,
|
@@ -2316,13 +2316,13 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
2316
2316
|
raise NotSupported(self.id + 'withdraw() only support USDC')
|
2317
2317
|
isSandboxMode = self.safe_bool(self.options, 'sandboxMode')
|
2318
2318
|
nonce = self.milliseconds()
|
2319
|
-
payload = {
|
2319
|
+
payload: dict = {
|
2320
2320
|
'destination': address,
|
2321
2321
|
'usd': str(amount),
|
2322
2322
|
'time': nonce,
|
2323
2323
|
}
|
2324
2324
|
sig = self.build_withdraw_sig(payload)
|
2325
|
-
request = {
|
2325
|
+
request: dict = {
|
2326
2326
|
'action': {
|
2327
2327
|
'chain': 'ArbitrumTestnet' if (isSandboxMode) else 'Arbitrum',
|
2328
2328
|
'payload': payload,
|