SDKs
Python and TypeScript SDKs for trading on HyperLink, the prime broker for Hyperliquid, using Hyperliquid-compatible signing and order formats throughout.
Base URL
Language
Package
Repository
TypeScript
npm install @nktkas/hyperliquid viemimport { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
import { privateKeyToAccount } from "viem/accounts";
// Point the transport at HyperLink instead of Hyperliquid.
const transport = new HttpTransport({ apiUrl: "https://api.hyperlink.xyz" });
const wallet = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
// Signed trading actions.
const exchange = new ExchangeClient({ transport, wallet });
// Place a limit order. Asset is the numeric index (perps 0-9999, spot 10000+index).
const result = await exchange.order({
orders: [
{
a: 0, // asset index
b: true, // isBuy
p: "50000", // limit price
s: "0.1", // size
r: false, // reduceOnly
t: { limit: { tif: "Gtc" } },
c: "0x1234567890abcdef1234567890abcdef", // cloid (required)
},
],
grouping: "na",
});
console.log(result);Python
Parameter
Required
Description
Discovering asset indexes
Market
Index range
Signed private reads
Feature
Action / endpoint
Next steps
Last updated