perp-cli 0.3.12 → 0.3.14
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.
|
@@ -773,6 +773,15 @@ export class LighterAdapter {
|
|
|
773
773
|
static async getWasmClient() {
|
|
774
774
|
if (LighterAdapter._wasmClient)
|
|
775
775
|
return LighterAdapter._wasmClient;
|
|
776
|
+
// Resolve WASM path from SDK package location (fixes --prefix / global installs)
|
|
777
|
+
const { dirname, join } = await import("node:path");
|
|
778
|
+
const { fileURLToPath } = await import("node:url");
|
|
779
|
+
const sdkEntry = import.meta.resolve("lighter-ts-sdk");
|
|
780
|
+
// sdkEntry → file:///…/node_modules/lighter-ts-sdk/dist/esm/index.js
|
|
781
|
+
// Walk up to package root: dist/esm/index.js → 3 levels
|
|
782
|
+
const sdkRoot = dirname(dirname(dirname(fileURLToPath(sdkEntry))));
|
|
783
|
+
const wasmPath = join(sdkRoot, "wasm", "lighter-signer.wasm");
|
|
784
|
+
const wasmExecPath = join(sdkRoot, "wasm", "wasm_exec.js");
|
|
776
785
|
// Prevent Go WASM runtime from killing the process on panic
|
|
777
786
|
const origExit = process.exit;
|
|
778
787
|
process.exit = ((code) => {
|
|
@@ -781,7 +790,7 @@ export class LighterAdapter {
|
|
|
781
790
|
});
|
|
782
791
|
try {
|
|
783
792
|
const { WasmSignerClient } = await import("lighter-ts-sdk");
|
|
784
|
-
const client = new WasmSignerClient({});
|
|
793
|
+
const client = new WasmSignerClient({ wasmPath, wasmExecPath });
|
|
785
794
|
await client.initialize();
|
|
786
795
|
LighterAdapter._wasmClient = client;
|
|
787
796
|
return client;
|
package/package.json
CHANGED
package/skills/perp-cli/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ allowed-tools: "Bash(perp:*), Bash(npx perp-cli:*), Bash(npx -y perp-cli:*)"
|
|
|
5
5
|
license: MIT
|
|
6
6
|
metadata:
|
|
7
7
|
author: hypurrquant
|
|
8
|
-
version: "0.3.
|
|
8
|
+
version: "0.3.12"
|
|
9
9
|
mcp-server: perp-cli
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -30,6 +30,13 @@ Multi-DEX perpetual futures CLI — Pacifica (Solana), Hyperliquid (HyperEVM), L
|
|
|
30
30
|
npm install -g perp-cli
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
**No sudo / Docker / restricted environments:**
|
|
34
|
+
```bash
|
|
35
|
+
npm config set prefix ~/.npm-global
|
|
36
|
+
npm install -g perp-cli --prefix ~/.npm-global
|
|
37
|
+
export PATH="$HOME/.npm-global/bin:$PATH"
|
|
38
|
+
```
|
|
39
|
+
|
|
33
40
|
## Step 2: Configure Wallet
|
|
34
41
|
|
|
35
42
|
CRITICAL: Do NOT use `perp init` — it is interactive and will hang.
|