Hyperliquid API TypeScript SDK

@nktkas/hyperliquid is a TypeScript SDK for the
Hyperliquid API.
Features
- 🖋️ Typed: Source code is 100% TypeScript.
- 🧪 Tested: Good code coverage and type relevance.
- 📦 Minimal dependencies: A few small trusted dependencies.
- 🌐 Cross-Environment Support: Compatible with all major JS runtimes.
- 🔧 Integratable: Easy to use with wallet providers (viem or
ethers).
Installation
npm i @nktkas/hyperliquid
Quick Example
import { ExchangeClient, HttpTransport, InfoClient } from "@nktkas/hyperliquid";
import { privateKeyToAccount } from "viem/accounts";
const info = new InfoClient({ transport: new HttpTransport() });
const mids = await info.allMids();
console.log(mids);
const exchange = new ExchangeClient({
transport: new HttpTransport(),
wallet: privateKeyToAccount("0x..."),
});
const result = await exchange.order({
orders: [{
a: 0,
b: true,
p: "95000",
s: "0.01",
r: false,
t: { limit: { tif: "Gtc" } },
}],
grouping: "na",
});
Documentation
📚 Read the full documentation
License
MIT License © 2024-2025 nktkas