npm.io
1.3.0 • Published 3d ago

@lifi/perps-sdk-provider-hyperliquid

Licence
Apache-2.0
Version
1.3.0
Deps
3
Size
721 kB
Vulns
0
Weekly
1.0K

license npm latest package npm downloads Follow on Twitter

@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-hyperliquid
import { 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.

Keywords