@lifi/perps-sdk-provider-hyperliquid
Hyperliquid provider plugin for @lifi/perps-sdk — a workspace package of the perps-sdk monorepo. Register it on a PerpsClient to trade Hyperliquid perpetuals through the SDK's unified interface.
pnpm add @lifi/perps-sdk @lifi/perps-sdk-provider-hyperliquidimport { createPerpsClient } from '@lifi/perps-sdk'
import { hyperliquidProvider } from '@lifi/perps-sdk-provider-hyperliquid'
const client = createPerpsClient({
integrator: 'my-app',
apiKey: 'your-api-key',
providers: [hyperliquidProvider()],
})See the @lifi/perps-sdk README and the full documentation for setup, options, the exported surface, and the agent signing model.
Security: agent key storage
The agent keypair is persisted via a StorageAdapter, which defaults to browser localStorage. The agent private key is therefore readable by any same-origin script — an XSS vulnerability in the host page can exfiltrate it. To harden this, pass a more secure StorageAdapter (e.g. one backed by an encrypted or in-memory store) to the HyperliquidAgentStore constructor.
The blast radius is bounded: the agent key authorizes trading only. Fund withdrawal still requires L1 APPROVE_AGENT consent, which the agent key alone cannot grant.