Metadata-Version: 2.4
Name: async-hyperliquid
Version: 1.0.0
Summary: Async Hyperliquid client using aiohttp
Keywords: dex,hyperliquid,async,aiohttp,trading,cryptocurrency,defi
Author: Yuki
Author-email: Yuki <yuqi.lyle@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Framework :: AsyncIO
Classifier: Framework :: aiohttp
Classifier: Typing :: Typed
Requires-Dist: aiohttp>=3.14.3,<4.0.0
Requires-Dist: msgpack>=1.2.1,<2.0.0
Requires-Dist: eth-account>=0.13.7,<0.14.0
Requires-Dist: eth-utils>=5.3.1,<6.0.0
Requires-Dist: coincurve>=21.0.0
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/owlyfi/async-hyperliquid
Project-URL: Documentation, https://async-hyperliquid.readthedocs.io/
Project-URL: Repository, https://github.com/owlyfi/async-hyperliquid
Project-URL: Issues, https://github.com/owlyfi/async-hyperliquid/issues
Project-URL: Changelog, https://github.com/owlyfi/async-hyperliquid/blob/main/CHANGELOG.md
Description-Content-Type: text/markdown

# Async Hyperliquid

[![CI](https://github.com/owlyfi/async-hyperliquid/actions/workflows/ci.yml/badge.svg)](https://github.com/owlyfi/async-hyperliquid/actions/workflows/ci.yml)
[![Documentation Status](https://readthedocs.org/projects/async-hyperliquid/badge/?version=latest)](https://async-hyperliquid.readthedocs.io/en/latest/?badge=latest)
[![PyPI](https://img.shields.io/pypi/v/async-hyperliquid.svg)](https://pypi.org/project/async-hyperliquid/)

`async-hyperliquid` is a typed, asynchronous Python client for the Hyperliquid
REST API. It provides credential-free market and account queries through
`InfoClient`, plus authenticated order workflows through `AsyncHyperliquid`.
The client uses `aiohttp`, keeps protocol-shaped responses as `TypedDict`, and
supports explicit mainnet and testnet routing.

## Installation

```bash
pip install async-hyperliquid
```

## Read market data

```python
import asyncio

from async_hyperliquid import InfoClient
from async_hyperliquid.types import Network


async def main() -> None:
    async with InfoClient(network=Network.MAINNET) as client:
        print(await client.mid_price("BTC"))


asyncio.run(main())
```

## Place a testnet order

Use a dedicated API-wallet key and start on testnet. This submits a signed
market order.

```python
import asyncio
import os

from async_hyperliquid import AsyncHyperliquid
from async_hyperliquid.types import Network


async def main() -> None:
    async with AsyncHyperliquid(
        os.environ["HL_ACCOUNT_ADDRESS"],
        os.environ["HL_SIGNING_KEY"],
        network=Network.TESTNET,
    ) as client:
        result = await client.place_order("BTC", True, 0.001, 0, is_market=True)
        print(result)


asyncio.run(main())
```

Learn more in the [Read the Docs documentation](https://async-hyperliquid.readthedocs.io/),
[API reference](https://async-hyperliquid.readthedocs.io/en/latest/reference/index.html),
[migration guide](https://async-hyperliquid.readthedocs.io/en/latest/migration-0.5-to-1.0.html),
[changelog](CHANGELOG.md), and [license](LICENSE).
