perp-cli 0.3.11 → 0.3.13

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,14 @@ 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");
776
784
  // Prevent Go WASM runtime from killing the process on panic
777
785
  const origExit = process.exit;
778
786
  process.exit = ((code) => {
@@ -781,7 +789,7 @@ export class LighterAdapter {
781
789
  });
782
790
  try {
783
791
  const { WasmSignerClient } = await import("lighter-ts-sdk");
784
- const client = new WasmSignerClient({});
792
+ const client = new WasmSignerClient({ wasmPath });
785
793
  await client.initialize();
786
794
  LighterAdapter._wasmClient = client;
787
795
  return client;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "perp-cli",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "description": "Multi-DEX Perpetual Futures CLI - Pacifica, Hyperliquid, Lighter",
5
5
  "bin": {
6
- "perp": "./dist/index.js",
7
- "perp-mcp": "./dist/mcp-server.js"
6
+ "perp": "dist/index.js",
7
+ "perp-mcp": "dist/mcp-server.js"
8
8
  },
9
9
  "files": [
10
10
  "dist",
@@ -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.10"
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.