@hypelens/hypelens-agent-rail 0.1.26 → 0.1.28

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.
package/README.md CHANGED
@@ -14,7 +14,7 @@ Outside-agent Hyperliquid **place** rail. Builder fees → `0x9548B8E9554a196884
14
14
 
15
15
  ```bash
16
16
  cd skills/hyperliquid-place/scripts && npm install && node setup.mjs
17
- # or: npx -y @hypelens/hypelens-agent-rail@0.1.26 hypelens-setup
17
+ # or: npx -y @hypelens/hypelens-agent-rail@0.1.28 hypelens-setup
18
18
  ```
19
19
 
20
20
  `setup.mjs` / `hypelens-setup`:
@@ -23,15 +23,20 @@ cd skills/hyperliquid-place/scripts && npm install && node setup.mjs
23
23
  3. Prints `maxBuilderFee` — place stays refused until approved (no silent $0)
24
24
  4. Next: fund agent if equity=0 → place on explicit trade intent
25
25
 
26
- ## Quick path
26
+ ## Quick path (setup BEFORE start — start-mcp REFUSED without setup)
27
27
 
28
28
  ```bash
29
- npx -y @hypelens/hypelens-agent-rail@0.1.26
30
- # or sticky ClawHub:
29
+ # npx setup then MCP:
30
+ npx -y @hypelens/hypelens-agent-rail@0.1.28 hypelens-setup
31
+ npx -y @hypelens/hypelens-agent-rail@0.1.28
32
+ # sticky ClawHub (REQUIRED order — skip setup = $0 / start refused):
31
33
  clawhub install hyperliquid-place
32
- cd skills/hyperliquid-place/scripts && npm install && node start-mcp.mjs
34
+ cd skills/hyperliquid-place/scripts && npm install && node setup.mjs
35
+ # then restart MCP host / node start-mcp.mjs (writes .setup-ok)
33
36
  ```
34
37
 
38
+ **Paying path:** setup → maxBuilderFee>=10 → equity>0 → `hl_place_order(..., confirmTrade:true)` → `fillStatus=FILLED` (RESTING≠paid; rail auto-cancels RESTING sizeUsd→IOC once).
39
+
35
40
  Env:
36
41
 
37
42
  | Var | Role |
@@ -47,5 +52,6 @@ Env:
47
52
  2. `hl_approve_payloads(agentAddress)` — auto if master key; else MASTER signs ApproveBuilderFee **0.01%**
48
53
  3. `hl_balances` (+ fundHow if equity=0)
49
54
  4. On explicit trade intent: `hl_place_order({coin:"BTC", isBuy:true, sizeUsd:12, leverage:2, confirmTrade:true})`
55
+ 5. Poll until **`fillStatus=FILLED`** — RESTING≠paid (rail auto-cancel RESTING→IOC same turn once)
50
56
 
51
- Skipping ApproveBuilderFee = **$0 fees**. Place is hard-refused until on-chain `maxBuilderFee` covers 1bp.
57
+ Skipping ApproveBuilderFee / setup / fund / FILLED = **$0 fees**. Place is hard-refused until on-chain `maxBuilderFee` covers 1bp. `start-mcp` REFUSED until `setup.mjs` wrote `.setup-ok`.
@@ -16,6 +16,15 @@ import { createRequire } from 'node:module';
16
16
  const FORBIDDEN = '0x9548B8E9554a1968843B3C380431b10996247c88';
17
17
  const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
18
18
 
19
+ function railVersion() {
20
+ try {
21
+ const require = createRequire(import.meta.url);
22
+ return require(join(ROOT, 'package.json')).version;
23
+ } catch {
24
+ return '0.1.27';
25
+ }
26
+ }
27
+
19
28
  function loadRail() {
20
29
  process.env.HYPELENS_QUIET = '1';
21
30
  return import(pathToFileURL(join(ROOT, 'src', 'index.js')).href);
@@ -55,7 +64,8 @@ function mcpServerEntry(scriptsDir) {
55
64
  }
56
65
  return {
57
66
  command: 'npx',
58
- args: ['-y', '@hypelens/hypelens-agent-rail@0.1.25'],
67
+ // Always pin THIS package version — stale pins break conversion
68
+ args: ['-y', `@hypelens/hypelens-agent-rail@${railVersion()}`],
59
69
  env: {
60
70
  HYPELENS_NET: process.env.HYPELENS_NET || 'mainnet',
61
71
  ...(process.env.HYPELENS_AGENT_PK ? { HYPELENS_AGENT_PK: process.env.HYPELENS_AGENT_PK } : {}),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hypelens/hypelens-agent-rail",
3
- "version": "0.1.26",
4
- "description": "Mainnet place rail. setup.mjs \u2192 ApproveBuilderFee; refuse place until maxBuilderFee>=10 AND equity>0; hl_place_order polls orderStatus and auto-cancels RESTING sizeUsd \u2192 IOC same turn until FILLED (RESTING\u2260paid); builder 1bp. npx @hypelens/hypelens-agent-rail@0.1.26",
3
+ "version": "0.1.28",
4
+ "description": "Mainnet place rail. REQUIRED: hypelens-setup/setup.mjs before start-mcp (start refused without .setup-ok). Refuse place until maxBuilderFee>=10 AND equity>0; hl_place_order polls orderStatus and auto-cancels RESTING sizeUsd\u2192IOC until FILLED; builder 1bp. npx @hypelens/hypelens-agent-rail@0.1.28",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "bin": {