Agent wallets and vaults
Agent wallets
import { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
import { privateKeyToAccount } from "viem/accounts";
const client = new ExchangeClient({
transport: new HttpTransport(),
wallet: privateKeyToAccount("0x..."), // agent's private key
});
// All trades are executed as the master account
await client.order({
orders: [{
a: 0,
b: true,
p: "50000",
s: "0.01",
r: false,
t: { limit: { tif: "Gtc" } },
}],
grouping: "na",
});Create an agent
Vaults
Manage vaults
Sub-accounts
Last updated