async-hyperliquid 0.4.7__tar.gz → 0.4.8__tar.gz
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.
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/PKG-INFO +1 -1
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/pyproject.toml +1 -1
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/_async_hyperliquid/actions.py +22 -12
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/_async_hyperliquid/orders.py +3 -1
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/LICENSE +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/README.md +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/__init__.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/_async_hyperliquid/__init__.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/_async_hyperliquid/core.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/_async_hyperliquid/info.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/async_api.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/async_hyperliquid.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/exchange.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/info.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/__init__.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/constants.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/decorators.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/miscs.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/signing.py +0 -0
- {async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/types.py +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import math
|
|
2
1
|
import re
|
|
2
|
+
import math
|
|
3
3
|
import warnings
|
|
4
4
|
|
|
5
|
-
from async_hyperliquid.utils.constants import HYPE_FACTOR, MAINNET_API_URL, USD_FACTOR
|
|
6
|
-
from async_hyperliquid.utils.decorators import private_key_required
|
|
7
5
|
from async_hyperliquid.utils.miscs import round_token_amount
|
|
6
|
+
from async_hyperliquid.utils.types import AgentAbstraction, UserSetAbstraction
|
|
8
7
|
from async_hyperliquid.utils.signing import (
|
|
9
|
-
|
|
10
|
-
sign_approve_builder_fee_action,
|
|
11
|
-
sign_convert_to_multi_sig_user_action,
|
|
8
|
+
sign_withdraw_action,
|
|
12
9
|
sign_send_asset_action,
|
|
10
|
+
sign_usd_transfer_action,
|
|
11
|
+
sign_approve_agent_action,
|
|
13
12
|
sign_spot_transfer_action,
|
|
13
|
+
sign_token_delegate_action,
|
|
14
14
|
sign_staking_deposit_action,
|
|
15
15
|
sign_staking_withdraw_action,
|
|
16
|
-
sign_token_delegate_action,
|
|
17
16
|
sign_usd_class_transfer_action,
|
|
18
|
-
|
|
17
|
+
sign_approve_builder_fee_action,
|
|
19
18
|
sign_user_dex_abstraction_action,
|
|
20
19
|
sign_user_set_abstraction_action,
|
|
21
|
-
|
|
20
|
+
sign_convert_to_multi_sig_user_action,
|
|
22
21
|
)
|
|
23
|
-
from async_hyperliquid.utils.
|
|
22
|
+
from async_hyperliquid.utils.constants import USD_FACTOR, HYPE_FACTOR, MAINNET_API_URL
|
|
23
|
+
from async_hyperliquid.utils.decorators import private_key_required
|
|
24
24
|
|
|
25
25
|
from .orders import AsyncHyperliquidOrdersClient
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ from .orders import AsyncHyperliquidOrdersClient
|
|
|
28
28
|
class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
29
29
|
async def set_referrer_code(self, code: str):
|
|
30
30
|
action = {"type": "setReferrer", "code": code}
|
|
31
|
-
return await self.exchange.post_action(action)
|
|
31
|
+
return await self.exchange.post_action(action, expires=self.expires)
|
|
32
32
|
|
|
33
33
|
@private_key_required
|
|
34
34
|
async def create_sub_account(self, name: str):
|
|
@@ -164,6 +164,7 @@ class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
|
164
164
|
}
|
|
165
165
|
return await self.exchange.post_action(action)
|
|
166
166
|
|
|
167
|
+
@private_key_required
|
|
167
168
|
async def approve_agent(self, agent: str, name: str | None = None):
|
|
168
169
|
nonce = self.next_nonce()
|
|
169
170
|
action = {
|
|
@@ -178,6 +179,7 @@ class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
|
178
179
|
|
|
179
180
|
return await self.exchange.post_action_with_sig(action, sig, nonce)
|
|
180
181
|
|
|
182
|
+
@private_key_required
|
|
181
183
|
async def approve_builder_fee(self, max_fee_rate: float, builder: str):
|
|
182
184
|
nonce = self.next_nonce()
|
|
183
185
|
action = {
|
|
@@ -189,6 +191,7 @@ class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
|
189
191
|
sig = sign_approve_builder_fee_action(self.account, action, self.is_mainnet)
|
|
190
192
|
return await self.exchange.post_action_with_sig(action, sig, nonce)
|
|
191
193
|
|
|
194
|
+
@private_key_required
|
|
192
195
|
async def convert_to_multi_sig_user(self, users: list[str], threshold: int):
|
|
193
196
|
nonce = self.next_nonce()
|
|
194
197
|
signers = {"authorizedUsers": sorted(users), "threshold": threshold}
|
|
@@ -200,12 +203,16 @@ class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
|
200
203
|
|
|
201
204
|
async def reserve_request_weight(self, weight: int):
|
|
202
205
|
action = {"type": "reserveRequestWeight", "weight": weight}
|
|
203
|
-
return await self.exchange.post_action(
|
|
206
|
+
return await self.exchange.post_action(
|
|
207
|
+
action, vault=self.vault, expires=self.expires
|
|
208
|
+
)
|
|
204
209
|
|
|
210
|
+
@private_key_required
|
|
205
211
|
async def use_big_block(self, enable: bool):
|
|
206
212
|
action = {"type": "evmUserModify", "usingBigBlocks": enable}
|
|
207
213
|
return await self.exchange.post_action(action)
|
|
208
214
|
|
|
215
|
+
@private_key_required
|
|
209
216
|
async def user_dex_abstraction(self, user: str | None = None, enabled: bool = True):
|
|
210
217
|
warnings.warn(
|
|
211
218
|
"user_dex_abstraction is deprecated and may be removed in a "
|
|
@@ -225,6 +232,7 @@ class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
|
225
232
|
sig = sign_user_dex_abstraction_action(self.account, action, self.is_mainnet)
|
|
226
233
|
return await self.exchange.post_action_with_sig(action, sig, nonce)
|
|
227
234
|
|
|
235
|
+
@private_key_required
|
|
228
236
|
async def user_set_abstraction(
|
|
229
237
|
self, abstraction: UserSetAbstraction, user: str | None = None
|
|
230
238
|
):
|
|
@@ -242,6 +250,7 @@ class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
|
242
250
|
sig = sign_user_set_abstraction_action(self.account, action, self.is_mainnet)
|
|
243
251
|
return await self.exchange.post_action_with_sig(action, sig, nonce)
|
|
244
252
|
|
|
253
|
+
@private_key_required
|
|
245
254
|
async def agent_enable_dex_abstraction(self):
|
|
246
255
|
warnings.warn(
|
|
247
256
|
"agent_enable_dex_abstraction is deprecated and may be removed "
|
|
@@ -254,6 +263,7 @@ class AsyncHyperliquidActionsClient(AsyncHyperliquidOrdersClient):
|
|
|
254
263
|
action, vault=self.vault, expires=self.expires
|
|
255
264
|
)
|
|
256
265
|
|
|
266
|
+
@private_key_required
|
|
257
267
|
async def agent_set_abstraction(self, abstraction: AgentAbstraction):
|
|
258
268
|
action = {"type": "agentSetAbstraction", "abstraction": abstraction}
|
|
259
269
|
return await self.exchange.post_action(
|
|
@@ -384,7 +384,9 @@ class AsyncHyperliquidOrdersClient(AsyncHyperliquidInfoClient):
|
|
|
384
384
|
"a": await self.get_coin_asset(coin),
|
|
385
385
|
"t": twap_id,
|
|
386
386
|
}
|
|
387
|
-
return await self.exchange.post_action(
|
|
387
|
+
return await self.exchange.post_action(
|
|
388
|
+
action, vault=self.vault, expires=self.expires
|
|
389
|
+
)
|
|
388
390
|
|
|
389
391
|
async def close_all_positions(
|
|
390
392
|
self, dexs: list[str] | None = None, *, builder: OrderBuilder | None = None
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/_async_hyperliquid/core.py
RENAMED
|
File without changes
|
{async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/_async_hyperliquid/info.py
RENAMED
|
File without changes
|
|
File without changes
|
{async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/async_hyperliquid.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/constants.py
RENAMED
|
File without changes
|
{async_hyperliquid-0.4.7 → async_hyperliquid-0.4.8}/src/async_hyperliquid/utils/decorators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|