@lifi/perps-sdk-provider-hyperliquid 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +15 -6
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -7,14 +7,18 @@
7
7
 
8
8
  </div>
9
9
 
10
- # `@lifi/perps-sdk-provider-hyperliquid`
10
+ <h1 align="center"><code>@lifi/perps-sdk-provider-hyperliquid</code></h1>
11
11
 
12
- Hyperliquid provider plugin for [`@lifi/perps-sdk`](https://www.npmjs.com/package/@lifi/perps-sdk) — a workspace package of the [`perps-sdk`](https://www.npmjs.com/package/@lifi/perps-sdk) monorepo. Register it on a `PerpsClient` to trade Hyperliquid perpetuals through the SDK's unified interface.
12
+ Hyperliquid provider plugin for the [LI.FI Perps SDK](https://public-perps-docs.mintlify.app/). Register it on a `PerpsClient` to trade Hyperliquid perpetuals through the SDK's unified interface.
13
+
14
+ ## Installation
13
15
 
14
16
  ```bash
15
17
  pnpm add @lifi/perps-sdk @lifi/perps-sdk-provider-hyperliquid
16
18
  ```
17
19
 
20
+ ## Quick start
21
+
18
22
  ```ts
19
23
  import { createPerpsClient } from '@lifi/perps-sdk'
20
24
  import { hyperliquidProvider } from '@lifi/perps-sdk-provider-hyperliquid'
@@ -26,10 +30,15 @@ const client = createPerpsClient({
26
30
  })
27
31
  ```
28
32
 
29
- See the [`@lifi/perps-sdk` README](https://www.npmjs.com/package/@lifi/perps-sdk) and the [full documentation](https://public-perps-docs.mintlify.app/) for setup, options, the exported surface, and the agent signing model.
33
+ ## Agent key storage
34
+
35
+ Setup registers an agent keypair whose private key signs orders locally, so trading needs no per-order wallet popups. The agent key authorizes trading only — it cannot withdraw funds.
30
36
 
31
- ## Security: agent key storage
37
+ The keypair is persisted through a `StorageAdapter`. The default adapter encrypts values with AES-GCM before writing to browser `localStorage`, holding the master key as a non-extractable `CryptoKey` handle in IndexedDB, so key material is never stored as plaintext. Pass your own `StorageAdapter` to the `HyperliquidAgentStore` constructor to use a different backend — a custom adapter bypasses this encryption and is responsible for protecting the key at rest.
32
38
 
33
- 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.
39
+ ## Documentation
34
40
 
35
- 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.
41
+ - [`@lifi/perps-sdk` README](https://www.npmjs.com/package/@lifi/perps-sdk) client setup, options, and the WebSocket API
42
+ - [Full documentation](https://public-perps-docs.mintlify.app/) — the exported surface and the agent signing model
43
+ - [API reference](https://public-perps-docs.mintlify.app/api-reference)
44
+ - [Source and issues](https://github.com/lifinance/perps-sdk)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/perps-sdk-provider-hyperliquid",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Hyperliquid provider plugin for @lifi/perps-sdk",
5
5
  "homepage": "https://github.com/lifinance/perps-sdk",
6
6
  "bugs": {
@@ -48,10 +48,10 @@
48
48
  "dependencies": {
49
49
  "big.js": "^7.0.1",
50
50
  "viem": "^2.48.8",
51
- "@lifi/perps-types": "^2.0.0"
51
+ "@lifi/perps-types": "^2.0.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "@lifi/perps-sdk": "^3.0.0"
54
+ "@lifi/perps-sdk": "^3.1.1"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"