async-hyperliquid 0.4.6__tar.gz → 0.4.7__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.6 → async_hyperliquid-0.4.7}/PKG-INFO +1 -1
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/pyproject.toml +1 -1
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/_async_hyperliquid/orders.py +22 -16
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/LICENSE +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/README.md +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/__init__.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/_async_hyperliquid/__init__.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/_async_hyperliquid/actions.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/_async_hyperliquid/core.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/_async_hyperliquid/info.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/async_api.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/async_hyperliquid.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/exchange.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/info.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/__init__.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/constants.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/decorators.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/miscs.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/signing.py +0 -0
- {async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/types.py +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import asyncio
|
|
2
1
|
import math
|
|
2
|
+
import asyncio
|
|
3
3
|
|
|
4
|
-
from async_hyperliquid.utils.
|
|
5
|
-
from async_hyperliquid.utils.miscs import get_coin_dex, round_float, round_px
|
|
6
|
-
from async_hyperliquid.utils.signing import encode_order, orders_to_action
|
|
4
|
+
from async_hyperliquid.utils.miscs import round_px, round_float, get_coin_dex
|
|
7
5
|
from async_hyperliquid.utils.types import (
|
|
8
|
-
BatchCancelRequest,
|
|
9
|
-
BatchPlaceOrderRequest,
|
|
10
6
|
Cloid,
|
|
11
|
-
GroupOptions,
|
|
12
7
|
LimitTif,
|
|
13
|
-
OrderBuilder,
|
|
14
8
|
OrderType,
|
|
9
|
+
GroupOptions,
|
|
10
|
+
OrderBuilder,
|
|
15
11
|
PlaceOrderRequest,
|
|
12
|
+
BatchCancelRequest,
|
|
13
|
+
BatchPlaceOrderRequest,
|
|
16
14
|
limit_order_type,
|
|
17
15
|
)
|
|
16
|
+
from async_hyperliquid.utils.signing import encode_order, orders_to_action
|
|
17
|
+
from async_hyperliquid.utils.constants import USD_FACTOR, SPOT_OFFSET, PERP_DEX_OFFSET
|
|
18
18
|
|
|
19
19
|
from .info import AsyncHyperliquidInfoClient
|
|
20
20
|
|
|
@@ -386,7 +386,9 @@ class AsyncHyperliquidOrdersClient(AsyncHyperliquidInfoClient):
|
|
|
386
386
|
}
|
|
387
387
|
return await self.exchange.post_action(action)
|
|
388
388
|
|
|
389
|
-
async def close_all_positions(
|
|
389
|
+
async def close_all_positions(
|
|
390
|
+
self, dexs: list[str] | None = None, *, builder: OrderBuilder | None = None
|
|
391
|
+
):
|
|
390
392
|
positions = await self.get_all_positions(dexs=dexs)
|
|
391
393
|
if not positions:
|
|
392
394
|
return None
|
|
@@ -403,12 +405,16 @@ class AsyncHyperliquidOrdersClient(AsyncHyperliquidInfoClient):
|
|
|
403
405
|
}
|
|
404
406
|
orders.append(order)
|
|
405
407
|
|
|
406
|
-
return await self.batch_place_orders(orders, is_market=True)
|
|
408
|
+
return await self.batch_place_orders(orders, is_market=True, builder=builder)
|
|
407
409
|
|
|
408
|
-
async def close_dex_positions(
|
|
409
|
-
|
|
410
|
+
async def close_dex_positions(
|
|
411
|
+
self, dex: str, *, builder: OrderBuilder | None = None
|
|
412
|
+
):
|
|
413
|
+
return await self.close_all_positions(dexs=[dex], builder=builder)
|
|
410
414
|
|
|
411
|
-
async def close_positions(
|
|
415
|
+
async def close_positions(
|
|
416
|
+
self, coins: list[str], *, builder: OrderBuilder | None = None
|
|
417
|
+
):
|
|
412
418
|
if not coins:
|
|
413
419
|
return None
|
|
414
420
|
|
|
@@ -434,7 +440,7 @@ class AsyncHyperliquidOrdersClient(AsyncHyperliquidInfoClient):
|
|
|
434
440
|
if not orders:
|
|
435
441
|
return None
|
|
436
442
|
|
|
437
|
-
return await self.batch_place_orders(orders, is_market=True)
|
|
443
|
+
return await self.batch_place_orders(orders, is_market=True, builder=builder)
|
|
438
444
|
|
|
439
|
-
async def close_position(self, coin: str):
|
|
440
|
-
return await self.close_positions([coin])
|
|
445
|
+
async def close_position(self, coin: str, *, builder: OrderBuilder | None = None):
|
|
446
|
+
return await self.close_positions([coin], builder=builder)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/_async_hyperliquid/core.py
RENAMED
|
File without changes
|
{async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/_async_hyperliquid/info.py
RENAMED
|
File without changes
|
|
File without changes
|
{async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/async_hyperliquid.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/constants.py
RENAMED
|
File without changes
|
{async_hyperliquid-0.4.6 → async_hyperliquid-0.4.7}/src/async_hyperliquid/utils/decorators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|