A fully typed, validated async client for the Hyperliquid API.
Project description
Typed Hyperliquid
A fully typed, validated async client for the Hyperliquid API.
from hyperliquid import Hyperliquid
async with Hyperliquid.ws(public=True) as client:
stream = await client.streams.trades('BTC')
async for msg in stream:
for trade in msg:
print(trade['px'], trade['sz'], trade['side'])
Why Typed Hyperliquid?
- 🎯 Precise Types: Typed endpoint inputs and responses.
- ✅ Runtime Validation: Validated responses by default.
- ⚡ Async First: HTTP, WebSocket RPC, and subscriptions.
- 📚 Full API Surface:
client.info,client.exchange, andclient.streams.
Installation
pip install typed-hyperliquid
For authenticated exchange actions, set a private key:
export HYPERLIQUID_PRIVATE_KEY="your_private_key"
Overview
Typed Hyperliquid exposes the upstream API as three client surfaces:
client.info: public and account read methods likeall_mids,l2_book,clearinghouse_state,user_fills, and spot/perp metadata.client.exchange: signed actions like placing orders, canceling orders, transfers, withdrawals, staking, TWAPs, and leverage updates.client.streams: WebSocket subscriptions like trades, books, candles, user fills, user events, and open orders.
Use Hyperliquid.http() or Hyperliquid.ws() depending on the transport you
want for request-response methods:
from hyperliquid import Hyperliquid
async with Hyperliquid.http() as client:
mids = await client.info.all_mids()
result = await client.exchange.noop()
For testnet, pass mainnet=False and set HYPERLIQUID_TESTNET_PRIVATE_KEY.
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typed_hyperliquid-1.0.4.tar.gz.
File metadata
- Download URL: typed_hyperliquid-1.0.4.tar.gz
- Upload date:
- Size: 53.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f25d269ff45fa48331d63860852a855aa6b392effced2d6ec9c7eda501d0430
|
|
| MD5 |
6af9d014badd2175638dc0223aa7edcb
|
|
| BLAKE2b-256 |
1aa4fda7347bc58eebbee149acbeedaeaa34ff50d000b5f6989454496531249e
|
File details
Details for the file typed_hyperliquid-1.0.4-py3-none-any.whl.
File metadata
- Download URL: typed_hyperliquid-1.0.4-py3-none-any.whl
- Upload date:
- Size: 116.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d57e51a926fdabd9dd0d617fb28f7318ec7af4283380daafab1ea4fd97370086
|
|
| MD5 |
72167603eca358ae7ecbf94e213db122
|
|
| BLAKE2b-256 |
b77a6c74854eb40e05a2725fd822744a33d200d84da9d06f82f9fc50b4692d47
|