Clients
Read data
import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";
const transport = new HttpTransport();
const client = new InfoClient({ transport });
const mids = await client.allMids();
const book = await client.l2Book({ coin: "ETH" });Trading
import { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
import { privateKeyToAccount } from "viem/accounts";
const transport = new HttpTransport();
const client = new ExchangeClient({
transport,
wallet: privateKeyToAccount("0x..."),
});import { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
import { Wallet } from "ethers";
const transport = new HttpTransport();
const client = new ExchangeClient({
transport,
wallet: new Wallet("0x..."),
});import { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
import { createWalletClient, custom } from "viem";
import { arbitrum } from "viem/chains";
const wallet = createWalletClient({
chain: arbitrum,
transport: custom(window.ethereum!),
});
const transport = new HttpTransport();
const client = new ExchangeClient({ transport, wallet });Multi-sig
Vault and sub-account trading
Expiration
Signature chain ID
Nonce manager
Real-time updates
Unsubscribe
Handle failures
Common options
Cancellation
Last updated