Introduction

A community-supported Hyperliquid APIarrow-up-right SDK for all major JS runtimes, written in TypeScript.

npm i @nktkas/hyperliquid

Type Safe

100% TypeScript. Full inference for 140+ API methods.

Tested

Types validated against real API responses.

Minimal

Few dependencies. Tree-shakeable.

Universal

Node.js, Deno, Bun, browsers, React Native.

Wallet Support


Examples

Read Data

import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";

const client = new InfoClient({ transport: new HttpTransport() });

// Order book
const book = await client.l2Book({ coin: "ETH" });
//    ^? { coin: string, time: number, levels: [{ px: string, sz: string, n: number }[], ...] }

// Account state
const state = await client.clearinghouseState({ user: "0x..." });
//    ^? { marginSummary: {...}, assetPositions: [...], withdrawable: string }

Place Orders

Real-time Updates

Last updated