Introduction
Installation
npm i @nktkas/hyperliquidpnpm add @nktkas/hyperliquidyarn add @nktkas/hyperliquidbun add @nktkas/hyperliquiddeno add jsr:@nktkas/hyperliquid<script type="module">
import * as hl from "https://esm.sh/jsr/@nktkas/hyperliquid";
</script>Quick start
import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";
const transport = new HttpTransport();
const client = new InfoClient({ transport });
const mids = await client.allMids();import { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
import { privateKeyToAccount } from "viem/accounts";
const wallet = privateKeyToAccount("0x...");
const transport = new HttpTransport();
const client = new ExchangeClient({ transport, wallet });
await client.order({
orders: [{
a: 0,
b: true,
p: "50000",
s: "0.01",
r: false,
t: { limit: { tif: "Gtc" } },
}],
grouping: "na",
});Last updated