A fully typed, validated async client for the Hyperliquid API.
Project description
Typed Hyperliquid
A fully typed, validated async client for the Hyperliquid API.
Use autocomplete instead of documentation.
from hyperliquid import Info
async with Info.http() as info:
mids = await info.all_mids()
print(mids['BTC'])
Why Typed Hyperliquid?
- 🎯 Precise Types: Strong typing throughout, so your editor can help before runtime does.
- ✅ Automatic Validation: Catch upstream API changes earlier, where they are easier to debug.
- ⚡ Async First: Built for concurrent, network-heavy workflows.
- 🔒 Safer Usage: Typed inputs and explicit errors reduce avoidable mistakes.
- 🎨 Better DX: Clear routing, sensible defaults, and minimal ceremony.
- 📦 Practical Extras: HTTP, request-response WS, streams, and exchange actions under one package.
Package Shape
This package exposes four public entry points:
Infofor read-only request-response access to the info endpointExchangefor signed exchange actionsStreamsfor WebSocket subscriptionsHyperliquidas a convenience bundle of all three
Installation
pip install typed-hyperliquid
Quick Start
Public reads
Use Info for request-response reads over HTTP:
from hyperliquid import Info
async with Info.http() as info:
mids = await info.all_mids()
book = await info.l2_book('BTC')
print(mids['BTC'], book['levels'][0][0]['px'])
Public streams
Use Streams for subscription workflows:
from hyperliquid import Streams
async with Streams.new() as streams:
trades = await streams.trades('BTC')
async for batch in trades:
print(batch[0]['px'])
break
Authenticated actions
Hyperliquid auth is wallet-based, not API-key based:
export HYPERLIQUID_PRIVATE_KEY="your_private_key"
from hyperliquid import Hyperliquid
async with Hyperliquid.http() as client:
result = await client.exchange.noop()
print(result['status'])
Transport Model
This package intentionally separates Hyperliquid's three usage modes:
Info.http()andInfo.ws()for read-only request-response callsExchange.http(wallet)andExchange.ws(wallet)for signed exchange actionsStreams.new()for subscriptionsHyperliquid.http()andHyperliquid.ws()as convenience bundles
Exchange.http() and Exchange.ws() accept either a wallet object or a raw private key. Hyperliquid.http() and Hyperliquid.ws() also accept those forms, and can additionally read HYPERLIQUID_PRIVATE_KEY when no wallet is passed.
Documentation
Project details
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.1.tar.gz.
File metadata
- Download URL: typed_hyperliquid-1.0.1.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d212dbaa963716d1dded87f465eae895e0e4e4b5ae0b54080a5df1fd8ba4c064
|
|
| MD5 |
14cddb0d3b9134fcf9474b1a4a9f640f
|
|
| BLAKE2b-256 |
cd17171b5fe3f2cbd4cb6766c39138c71a60aa9b127e47f5213df7e3c5492acb
|
File details
Details for the file typed_hyperliquid-1.0.1-py3-none-any.whl.
File metadata
- Download URL: typed_hyperliquid-1.0.1-py3-none-any.whl
- Upload date:
- Size: 110.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63222c12d9428bc427de3009315eba43d154e1263e5722e5bc5e0e6d697c255d
|
|
| MD5 |
b64ede30137520136de9918ef07824a4
|
|
| BLAKE2b-256 |
4e51d0024d288f8e2df37e6c77effc9da2ec0f311136d1b3b322b6e3edeb75a2
|