jaspervault_cli 1.0.27 → 1.0.29

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 (57) hide show
  1. package/README.md +25 -24
  2. package/dist/bin/jv.js +6 -2
  3. package/dist/bin/jv.js.map +1 -1
  4. package/dist/src/client.js +28 -1
  5. package/dist/src/client.js.map +1 -1
  6. package/dist/src/commands/deposit.js +129 -125
  7. package/dist/src/commands/deposit.js.map +1 -1
  8. package/dist/src/commands/install.d.ts +2 -0
  9. package/dist/src/commands/install.js +184 -0
  10. package/dist/src/commands/install.js.map +1 -0
  11. package/dist/src/commands/limit-order.js +7 -0
  12. package/dist/src/commands/limit-order.js.map +1 -1
  13. package/dist/src/commands/mcp.d.ts +2 -0
  14. package/dist/src/commands/mcp.js +10 -0
  15. package/dist/src/commands/mcp.js.map +1 -0
  16. package/dist/src/commands/sl.js +12 -2
  17. package/dist/src/commands/sl.js.map +1 -1
  18. package/dist/src/commands/tp.js +12 -2
  19. package/dist/src/commands/tp.js.map +1 -1
  20. package/dist/src/commands/vault.js +111 -87
  21. package/dist/src/commands/vault.js.map +1 -1
  22. package/dist/src/commands/withdraw.d.ts +2 -0
  23. package/dist/src/commands/withdraw.js +114 -0
  24. package/dist/src/commands/withdraw.js.map +1 -0
  25. package/dist/src/mcp/executor.d.ts +23 -0
  26. package/dist/src/mcp/executor.js +75 -0
  27. package/dist/src/mcp/executor.js.map +1 -0
  28. package/dist/src/mcp/index.d.ts +1 -0
  29. package/dist/src/mcp/index.js +58 -0
  30. package/dist/src/mcp/index.js.map +1 -0
  31. package/dist/src/mcp/installer.d.ts +9 -0
  32. package/dist/src/mcp/installer.js +66 -0
  33. package/dist/src/mcp/installer.js.map +1 -0
  34. package/dist/src/mcp/tools.d.ts +15 -0
  35. package/dist/src/mcp/tools.js +250 -0
  36. package/dist/src/mcp/tools.js.map +1 -0
  37. package/dist/src/services/order-signer.js +1 -1
  38. package/dist/src/services/order-signer.js.map +1 -1
  39. package/dist/src/services/session-poller.d.ts +12 -0
  40. package/dist/src/services/session-poller.js +57 -0
  41. package/dist/src/services/session-poller.js.map +1 -0
  42. package/dist/src/templates/skill-body.d.ts +1 -1
  43. package/dist/src/templates/skill-body.js +1 -1
  44. package/dist/src/templates/skill-content/SKILL.core.md +52 -45
  45. package/dist/src/templates/skill-content/frontmatter/claude.md +1 -1
  46. package/dist/src/templates/skill-content/frontmatter/openclaw.md +2 -2
  47. package/dist/src/templates/skill-content/references/onboarding.md +68 -87
  48. package/dist/src/templates/skill-content/references/queries.md +58 -188
  49. package/dist/src/templates/skill-content/references/trading.md +128 -178
  50. package/dist/src/types.d.ts +13 -6
  51. package/dist/src/utils/config.d.ts +1 -1
  52. package/dist/src/utils/config.js +1 -1
  53. package/dist/src/utils/config.js.map +1 -1
  54. package/dist/src/utils/endpoints.d.ts +3 -0
  55. package/dist/src/utils/endpoints.js +5 -0
  56. package/dist/src/utils/endpoints.js.map +1 -1
  57. package/package.json +3 -5
@@ -1,245 +1,198 @@
1
1
  # Trading Reference
2
2
 
3
- ## 1. Create Order (`jv order create`)
3
+ ## 1. Create Order `create_order`
4
4
 
5
5
  Open, close, reduce, or add size to perpetual positions.
6
6
 
7
- ### Syntax
8
-
9
- ```
10
- jv order create --side <long|short> --symbol <symbol> -m <margin> [options]
11
- ```
12
-
13
- ### Options
14
-
15
- | Option | Required | Default | Description |
16
- |--------|----------|---------|-------------|
17
- | `--side <long\|short>` | Yes | | Position side |
18
- | `--symbol <symbol>` | Yes | | Asset symbol (e.g., `JBTC`, `CBBTC`) |
19
- | `-m, --margin <usdc>` | Yes | — | Margin (collateral) in USDC |
20
- | `--leverage <n>` | No | `50` (from chain config) | Leverage multiplier |
21
- | `--limit-price <price>` | No | — | Limit price in USDC (omit for market order) |
22
- | `--margin-account <addr>` | No | from profile | Override margin vault address |
23
- | `--position-account <addr>` | No | from profile | Override position vault address |
24
- | `--ppo` | No | — | Enable PPO hedge option protection |
25
- | `--ppo-expire <duration>` | No | `30m` | PPO expiry: `30m` or `8h` |
26
- | `--ppo-category <ATM\|OTM>` | No | `ATM` | PPO option category |
27
- | `--ppo-tier <1-5>` | No | — | OTM strike offset tier (required if OTM) |
28
- | `--network <name>` | No | `jaspervault` | Network name |
29
- | `--ttl <seconds>` | No | `3600` | Order TTL in seconds |
30
- | `--pretty` | No | — | Pretty-print JSON output |
7
+ ### Parameters
8
+
9
+ | Parameter | Required | Default | Description |
10
+ |-----------|----------|---------|-------------|
11
+ | `side` | Yes | — | `long` or `short` |
12
+ | `symbol` | Yes | — | Asset symbol (e.g., `JBTC`, `CBBTC`) |
13
+ | `margin` | Yes | — | Margin (collateral) in USDC |
14
+ | `leverage` | No | `50` | Leverage multiplier |
15
+ | `limit_price` | No | | Limit price in USDC (omit for market order) |
16
+ | `ppo` | No | — | `true` to enable PPO hedge option protection |
17
+ | `ppo_expire` | No | `30m` | PPO expiry: `30m` or `8h` |
18
+ | `ppo_category` | No | `ATM` | PPO option category: `ATM` or `OTM` |
19
+ | `ppo_tier` | No | — | OTM strike offset tier 1-5 (required if OTM) |
20
+ | `ttl` | No | `3600` | Order TTL in seconds |
31
21
 
32
22
  ### Market Order vs Limit Order
33
23
 
34
- - **Market order** (no `--limit-price`): Executes immediately at current market price. The CLI auto-waits up to 60s for the on-chain result via SSE.
35
- - **Limit order** (`--limit-price <N>`): Places a limit order that triggers when price reaches the target. Returns immediately with a `limitOrderId`.
24
+ - **Market order** (no `limit_price`): Executes immediately. The tool auto-waits up to 60s for the on-chain result.
25
+ - **Limit order** (`limit_price` set): Places a limit order that triggers when price reaches the target. Returns immediately with a `limitOrderId`.
36
26
 
37
- ### Market Order Output (TWO JSON lines)
27
+ ### Market Order Response
38
28
 
39
- **Line 1 Submission:**
40
- ```json
41
- {"success":true,"orderType":"market","jobId":"MARKET_ORDER_xxx","statusUrl":"/api/job/status/...","streamUrl":"/api/job/stream/..."}
42
- ```
29
+ The tool returns the final execution result:
43
30
 
44
- **Line 2 — Execution result (auto-waits up to 60s):**
45
31
  ```json
46
- {"jobId":"MARKET_ORDER_xxx","status":"completed","transactionHash":"0x..."}
32
+ {
33
+ "jobId": "MARKET_ORDER_xxx",
34
+ "status": "completed",
35
+ "transactionHash": "0x..."
36
+ }
47
37
  ```
48
38
 
49
- **CRITICAL rules after market order execution:**
50
- 1. If `status === "completed"` → the order IS executed. Do NOT retry or place another order.
39
+ **After market order execution:**
40
+ 1. If `status === "completed"` → the order IS executed. Don't retry.
51
41
  2. If `status === "failed"` → report the error to the user.
52
- 3. If `status === "timeout"` → use `jv job status <jobId> --pretty` to check later.
53
- 4. The `operation` field (if present) contains raw on-chain data in wei — do NOT interpret it.
54
- 5. To verify the actual position, run `jv orders list --pretty` and read the human-readable fields.
55
- 6. Report: "Order executed. Tx: {transactionHash}. Let me check your updated position..." then run `jv orders list --pretty`.
42
+ 3. If `status === "timeout"` → use `get_job_status` with the `jobId` to check later.
43
+ 4. The `operation` field (if present) contains raw on-chain data in wei — don't interpret it.
44
+ 5. To verify the actual position, call `list_orders` and read the human-readable fields.
45
+ 6. Report: "Order executed. Tx: {transactionHash}. Let me check your updated position..." then call `list_orders`.
46
+
47
+ ### Limit Order Response
56
48
 
57
- **Limit order output:**
58
49
  ```json
59
- {"success":true,"orderType":"limit","limitOrderId":"0x..."}
50
+ {
51
+ "success": true,
52
+ "orderType": "limit",
53
+ "limitOrderId": "0x..."
54
+ }
60
55
  ```
61
- Tell the user: "Limit order placed. ID: {limitOrderId}."
62
-
63
- ### Stderr Output
64
56
 
65
- Before submitting, the CLI prints an estimate to stderr:
66
- ```
67
- Estimated: ~0.043860 JBTC @ $68,476 (~$3,000 JUSDC total, 50x)
68
- ```
69
- This is informational only — the actual execution price may differ.
57
+ Tell the user: "Limit order placed. ID: {limitOrderId}."
70
58
 
71
59
  ### Common Patterns
72
60
 
73
61
  **Open a long position (market):**
74
- ```bash
75
- jv order create --side long --symbol JBTC -m 60 --pretty
62
+ ```json
63
+ { "side": "long", "symbol": "JBTC", "margin": 60 }
76
64
  ```
77
65
 
78
- **Open a short position (limit):**
79
- ```bash
80
- jv order create --side short --symbol JBTC -m 100 --limit-price 72000 --pretty
66
+ **Open a short position (limit at $72,000):**
67
+ ```json
68
+ { "side": "short", "symbol": "JBTC", "margin": 100, "limit_price": 72000 }
81
69
  ```
82
70
 
83
- **Close a long position (full close — use opposite side with same margin):**
84
- ```bash
85
- jv order create --side short --symbol JBTC -m 60 --pretty
71
+ **Close a long position (use opposite side with same margin):**
72
+ ```json
73
+ { "side": "short", "symbol": "JBTC", "margin": 60 }
86
74
  ```
87
75
 
88
76
  **Reduce a long position (partial close):**
89
- ```bash
90
- jv order create --side short --symbol JBTC -m 30 --pretty
77
+ ```json
78
+ { "side": "short", "symbol": "JBTC", "margin": 30 }
91
79
  ```
92
80
 
93
81
  **Add size to existing long:**
94
- ```bash
95
- jv order create --side long --symbol JBTC -m 50 --pretty
82
+ ```json
83
+ { "side": "long", "symbol": "JBTC", "margin": 50 }
96
84
  ```
97
85
 
98
86
  **Open with PPO protection (ATM, 30 min):**
99
- ```bash
100
- jv order create --side long --symbol JBTC -m 60 --ppo --pretty
87
+ ```json
88
+ { "side": "long", "symbol": "JBTC", "margin": 60, "ppo": true }
101
89
  ```
102
90
 
103
91
  **Open with PPO protection (OTM tier 3, 8 hours):**
104
- ```bash
105
- jv order create --side long --symbol JBTC -m 60 --ppo --ppo-expire 8h --ppo-category OTM --ppo-tier 3 --pretty
92
+ ```json
93
+ { "side": "long", "symbol": "JBTC", "margin": 60, "ppo": true, "ppo_expire": "8h", "ppo_category": "OTM", "ppo_tier": 3 }
106
94
  ```
107
95
 
108
96
  ---
109
97
 
110
- ## 2. Add PPO Protection (`jv order protect`)
98
+ ## 2. Add PPO Protection `protect_order`
111
99
 
112
100
  Add hedge option protection to an **existing position** without changing position size.
113
101
 
114
- ### Syntax
115
-
116
- ```
117
- jv order protect --order-id <id> --symbol <symbol> [options]
118
- ```
119
-
120
- ### Options
102
+ ### Parameters
121
103
 
122
- | Option | Required | Default | Description |
123
- |--------|----------|---------|-------------|
124
- | `--order-id <id>` | Yes | — | Existing perps order ID |
125
- | `--symbol <symbol>` | Yes | — | Asset symbol (e.g., `JBTC`) |
126
- | `--ppo-expire <duration>` | No | `30m` | Option expiry: `30m` or `8h` |
127
- | `--ppo-category <ATM\|OTM>` | No | `ATM` | Option category |
128
- | `--ppo-tier <1-5>` | No | — | OTM strike offset tier (required if OTM) |
129
- | `--network <name>` | No | `jaspervault` | Network name |
130
- | `--ttl <seconds>` | No | `3600` | Signature TTL in seconds |
131
- | `--pretty` | No | — | Pretty-print JSON output |
104
+ | Parameter | Required | Default | Description |
105
+ |-----------|----------|---------|-------------|
106
+ | `order_id` | Yes | — | Existing perps order ID |
107
+ | `symbol` | Yes | — | Asset symbol (e.g., `JBTC`) |
108
+ | `ppo_expire` | No | `30m` | Option expiry: `30m` or `8h` |
109
+ | `ppo_category` | No | `ATM` | Option category: `ATM` or `OTM` |
110
+ | `ppo_tier` | No | — | OTM strike offset tier 1-5 (required if OTM) |
132
111
 
133
- ### Output
112
+ ### Response
134
113
 
135
- The command auto-waits up to 60s for the on-chain result via SSE:
114
+ The tool auto-waits up to 60s for the on-chain result:
136
115
  ```json
137
- {"jobId":"OPTION_ORDER_xxx","status":"completed","transactionHash":"0x..."}
116
+ {
117
+ "jobId": "OPTION_ORDER_xxx",
118
+ "status": "completed",
119
+ "transactionHash": "0x..."
120
+ }
138
121
  ```
139
122
 
140
123
  ### Important
141
124
 
142
- - Use `jv order protect` to add hedge to an **existing** position.
143
- - Do NOT use `jv order create --ppo` for this — that adds position size.
144
- - The CLI auto-detects position side (LONG/SHORT) from the order and selects the correct hedge type (PUT for LONG, CALL for SHORT).
125
+ - Use `protect_order` to add hedge to an **existing** position.
126
+ - Don't use `create_order` with `ppo: true` for this — that adds position size.
127
+ - The tool auto-detects position side (LONG/SHORT) and selects the correct hedge type.
145
128
 
146
129
  ---
147
130
 
148
- ## 3. Take-Profit (`jv tp set`)
131
+ ## 3. Take-Profit `set_take_profit`
149
132
 
150
133
  Set a take-profit limit order for an existing position.
151
134
 
152
- ### Syntax
135
+ ### Parameters
153
136
 
154
- ```
155
- jv tp set --order-id <id> --price <usdc> --symbol <symbol> [options]
156
- ```
157
-
158
- ### Options
159
-
160
- | Option | Required | Default | Description |
161
- |--------|----------|---------|-------------|
162
- | `--order-id <id>` | Yes | | Existing order ID (position to close) |
163
- | `--price <usdc>` | Yes | — | Target price in USDC |
164
- | `--symbol <symbol>` | Yes | | Asset symbol (e.g., `JBTC`) |
165
- | `--side <long\|short>` | No | `long` | Position side being closed |
166
- | `--ppo` | No | — | Enable PPO hedge on the TP order |
167
- | `--ppo-expire <duration>` | No | `30m` | PPO expiry: `30m` or `8h` |
168
- | `--ppo-category <ATM\|OTM>` | No | `ATM` | PPO option category |
169
- | `--ppo-tier <1-5>` | No | — | OTM strike offset tier |
170
- | `--network <name>` | No | `jaspervault` | Network name |
171
- | `--ttl <seconds>` | No | `86400` | Order TTL in seconds (default: 24h) |
172
- | `--pretty` | No | — | Pretty-print JSON output |
173
-
174
- ### Output
175
-
176
- ```json
177
- {"success":true,"orderType":"limit","limitOrderId":"0x..."}
178
- ```
137
+ | Parameter | Required | Default | Description |
138
+ |-----------|----------|---------|-------------|
139
+ | `order_id` | Yes | — | Existing order ID |
140
+ | `price` | Yes | — | Target price in USDC |
141
+ | `symbol` | Yes | — | Asset symbol |
142
+ | `side` | No | `long` | Position side being closed |
143
+ | `ppo` | No | | Enable PPO hedge on the TP order |
144
+ | `ppo_expire` | No | `30m` | PPO expiry |
145
+ | `ppo_category` | No | `ATM` | PPO category |
146
+ | `ppo_tier` | No | — | OTM tier |
147
+ | `ttl` | No | `86400` | Order TTL (default: 24h) |
179
148
 
180
149
  ### Example
181
150
 
182
- ```bash
183
- # Set TP at $75,000 for a long position
184
- jv tp set --order-id 123 --price 75000 --symbol JBTC --pretty
185
-
186
- # Set TP for a short position
187
- jv tp set --order-id 456 --price 60000 --symbol JBTC --side short --pretty
151
+ Set TP at $75,000 for a long position:
152
+ ```json
153
+ { "order_id": "123", "price": 75000, "symbol": "JBTC" }
188
154
  ```
189
155
 
190
156
  ---
191
157
 
192
- ## 4. Stop-Loss (`jv sl set`)
193
-
194
- Set a stop-loss limit order for an existing position. Same options as `jv tp set`.
158
+ ## 4. Stop-Loss `set_stop_loss`
195
159
 
196
- ### Syntax
197
-
198
- ```
199
- jv sl set --order-id <id> --price <usdc> --symbol <symbol> [options]
200
- ```
201
-
202
- Options are identical to `jv tp set` (see above).
160
+ Same parameters as `set_take_profit`. Set a stop-loss limit order for an existing position.
203
161
 
204
162
  ### Example
205
163
 
206
- ```bash
207
- # Set SL at $65,000 for a long position
208
- jv sl set --order-id 123 --price 65000 --symbol JBTC --pretty
209
-
210
- # Set SL for a short position
211
- jv sl set --order-id 456 --price 80000 --symbol JBTC --side short --pretty
164
+ Set SL at $65,000 for a long position:
165
+ ```json
166
+ { "order_id": "123", "price": 65000, "symbol": "JBTC" }
212
167
  ```
213
168
 
214
169
  ---
215
170
 
216
171
  ## 5. PPO (Perpetual Put Option) Details
217
172
 
218
- PPO provides hedge protection for positions. Key concepts:
219
-
220
173
  ### Option Categories
221
174
 
222
- | Category | Description | `--ppo-tier` |
223
- |----------|-------------|--------------|
175
+ | Category | Description | `ppo_tier` |
176
+ |----------|-------------|------------|
224
177
  | `ATM` (default) | At-the-money — strike = current price | Not needed |
225
178
  | `OTM` | Out-of-the-money — strike offset from current price | Required (1-5) |
226
179
 
227
180
  ### OTM Tiers
228
181
 
229
- | Tier | Strike Offset | Ratio |
230
- |------|---------------|-------|
231
- | 1 | 0.1% | 0.001 |
232
- | 2 | 0.2% | 0.002 |
233
- | 3 | 0.3% | 0.003 |
234
- | 4 | 0.4% | 0.004 |
235
- | 5 | 0.5% | 0.005 |
182
+ | Tier | Strike Offset |
183
+ |------|---------------|
184
+ | 1 | 0.1% |
185
+ | 2 | 0.2% |
186
+ | 3 | 0.3% |
187
+ | 4 | 0.4% |
188
+ | 5 | 0.5% |
236
189
 
237
190
  ### Expiry Options
238
191
 
239
- | Duration | Seconds | Flag |
240
- |----------|---------|------|
241
- | 30 minutes (default) | 1800 | `--ppo-expire 30m` |
242
- | 8 hours | 28800 | `--ppo-expire 8h` |
192
+ | Duration | Flag |
193
+ |----------|------|
194
+ | 30 minutes (default) | `ppo_expire: "30m"` |
195
+ | 8 hours | `ppo_expire: "8h"` |
243
196
 
244
197
  ### Hedge Type (auto-selected)
245
198
 
@@ -248,27 +201,24 @@ PPO provides hedge protection for positions. Key concepts:
248
201
 
249
202
  ### Intent Mapping
250
203
 
251
- | User Says | Action | Command |
252
- |-----------|--------|---------|
253
- | "加保护" / "add protection" to existing | `jv order protect` | `jv order protect --order-id <id> --symbol JBTC` |
254
- | "开仓 + 保护" / "open with protection" | `jv order create --ppo` | `jv order create --side long -m 60 --symbol JBTC --ppo` |
255
- | "加仓 + 保护" / "add size with protection" | `jv order create --ppo` (same side) | `jv order create --side long -m 50 --symbol JBTC --ppo` |
256
- | "8小时" / "8 hour" | Add `--ppo-expire 8h` | |
257
- | "OTM" / "价外" | Add `--ppo-category OTM`, then ask for tier | |
258
- | "ATM" / "平价" or nothing | Default ATM, 30 min | |
259
- | "取消PPO" / "cancel PPO" / "remove hedge" | Order WITHOUT `--ppo` | See below |
260
-
261
- ### PPO Cancellation (IMPORTANT)
262
-
263
- The smart contract **automatically cancels** existing PPO hedge options when you execute any position operation (reduce, close, add size) **without** the `--ppo` flag. There is **NO separate "cancel PPO" command**.
264
-
265
- | User Request | Correct Action | Command |
266
- |--------------|---------------|---------|
267
- | "减仓 + 取消PPO" | Single reduce order without `--ppo` | `jv order create --side <opposite> -m <amount> --symbol JBTC` |
268
- | "加仓 + 取消PPO" | Single add-size order without `--ppo` | `jv order create --side <same> -m <amount> --symbol JBTC` |
269
- | "平仓" (full close) | Close order without `--ppo` | `jv order create --side <opposite> -m <full_margin> --symbol JBTC` |
270
- | "减仓 + 保留PPO" | Reduce order WITH `--ppo` | `jv order create --side <opposite> -m <amount> --symbol JBTC --ppo` |
271
-
272
- **NEVER do this:**
273
- - Do NOT try to cancel PPO as a separate step. There is no "cancel PPO" command.
274
- - Do NOT send two orders when one suffices. "减仓 + 取消PPO" = ONE order without `--ppo`.
204
+ | User Says | Tool | Parameters |
205
+ |-----------|------|------------|
206
+ | "add protection" to existing | `protect_order` | `{ order_id, symbol }` |
207
+ | "open with protection" | `create_order` | `{ side, symbol, margin, ppo: true }` |
208
+ | "add size with protection" | `create_order` (same side) | `{ side, symbol, margin, ppo: true }` |
209
+ | "8 hours" | any PPO tool | add `ppo_expire: "8h"` |
210
+ | "OTM" | any PPO tool | add `ppo_category: "OTM"`, then need `ppo_tier` |
211
+ | "cancel PPO" / "remove hedge" | `create_order` | without `ppo` see below |
212
+
213
+ ### PPO Cancellation
214
+
215
+ The smart contract **automatically cancels** existing PPO when you execute any position operation without `ppo: true`. There is no separate "cancel PPO" tool.
216
+
217
+ | User Request | Action | Parameters |
218
+ |-------------|--------|------------|
219
+ | "reduce + cancel PPO" | Single reduce order without `ppo` | `{ side: <opposite>, symbol, margin }` |
220
+ | "add size + cancel PPO" | Single add-size order without `ppo` | `{ side: <same>, symbol, margin }` |
221
+ | "close position" | Close order without `ppo` | `{ side: <opposite>, symbol, margin: <full> }` |
222
+ | "reduce + keep PPO" | Reduce order WITH `ppo` | `{ side: <opposite>, symbol, margin, ppo: true }` |
223
+
224
+ Never try to cancel PPO separately — there is no such tool. One order handles everything.
@@ -49,6 +49,10 @@ export interface TpSlIntentParams {
49
49
  side?: 'long' | 'short';
50
50
  network?: string;
51
51
  ttlSeconds?: number;
52
+ /** Existing position margin (raw string, e.g. "100000000" for 100 JUSDC) */
53
+ marginAmount?: string;
54
+ /** Existing position quantity (raw string) */
55
+ quantity?: string;
52
56
  }
53
57
  export interface SignData {
54
58
  limitType: number;
@@ -185,12 +189,6 @@ export interface OrdersListParams {
185
189
  healthFactorMin?: number;
186
190
  positionSide?: string;
187
191
  }
188
- export interface WcSessionInfo {
189
- walletAddress: string;
190
- chainId: number;
191
- sessionTopic: string;
192
- pairingTopic: string;
193
- }
194
192
  export interface VaultInitResponse {
195
193
  success: boolean;
196
194
  message: string;
@@ -200,6 +198,15 @@ export interface VaultInitResponse {
200
198
  executionTimeMs: number;
201
199
  errorMessage?: string;
202
200
  }
201
+ export interface CliSessionCreateResponse {
202
+ sessionId: string;
203
+ url: string;
204
+ expiresAt: string;
205
+ }
206
+ export interface CliSessionStatusResponse {
207
+ status: 'pending' | 'completed' | 'failed' | 'expired';
208
+ result?: Record<string, unknown>;
209
+ }
203
210
  export interface DepositResult {
204
211
  success: boolean;
205
212
  message: string;
@@ -1,4 +1,4 @@
1
- export declare const DEFAULT_API_URL = "https://trading-api-test.jaspervault.pro";
1
+ export declare const DEFAULT_API_URL = "https://marketpalce-api-test-shmm4.ondigitalocean.app";
2
2
  export interface CliConfig {
3
3
  apiUrl: string;
4
4
  apiKey?: string;
@@ -1,4 +1,4 @@
1
- export const DEFAULT_API_URL = 'https://trading-api-test.jaspervault.pro';
1
+ export const DEFAULT_API_URL = 'https://marketpalce-api-test-shmm4.ondigitalocean.app';
2
2
  export function loadConfig() {
3
3
  const apiUrl = process.env.JV_API_URL ?? DEFAULT_API_URL;
4
4
  const normalizedUrl = apiUrl.endsWith('/') ? apiUrl.slice(0, -1) : apiUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,0CAA0C,CAAC;AAQ1E,MAAM,UAAU,UAAU;IACxB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,eAAe,CAAC;IACzD,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE1E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU;QACpC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;QACtC,CAAC,CAAC,MAAM,CAAC;IAEX,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC9B,OAAO;KACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,uDAAuD,CAAC;AAQvF,MAAM,UAAU,UAAU;IACxB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,eAAe,CAAC;IACzD,MAAM,aAAa,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE1E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU;QACpC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;QACtC,CAAC,CAAC,MAAM,CAAC;IAEX,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC9B,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -5,4 +5,7 @@ export declare const ENDPOINTS: {
5
5
  readonly VAULT_INIT: "/order/createVaultRequest";
6
6
  readonly LIMIT_ORDER_LIST: "/order/getPerpsLimitOrderList";
7
7
  readonly LIMIT_ORDER_CANCEL: "/order/canclePerpsLimitOrder";
8
+ readonly CLI_SESSION_CREATE: "/api/cli-session";
9
+ readonly CLI_SESSION_STATUS: "/api/cli-session";
10
+ readonly VAULT_REDEEM_QUOTA: "/api/vault/redeem/quota";
8
11
  };
@@ -9,5 +9,10 @@ export const ENDPOINTS = {
9
9
  // Limit orders
10
10
  LIMIT_ORDER_LIST: '/order/getPerpsLimitOrderList',
11
11
  LIMIT_ORDER_CANCEL: '/order/canclePerpsLimitOrder',
12
+ // CLI session (hosted wallet setup / deposit / withdraw)
13
+ CLI_SESSION_CREATE: '/api/cli-session',
14
+ CLI_SESSION_STATUS: '/api/cli-session', // append /{sessionId}/status
15
+ // Vault redeem (withdraw)
16
+ VAULT_REDEEM_QUOTA: '/api/vault/redeem/quota',
12
17
  };
13
18
  //# sourceMappingURL=endpoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../src/utils/endpoints.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB;IACjB,YAAY,EAAE,cAAc;IAC5B,mBAAmB,EAAE,0BAA0B;IAE/C,0EAA0E;IAC1E,SAAS,EAAE,iBAAiB;IAE5B,QAAQ;IACR,UAAU,EAAE,2BAA2B;IAEvC,eAAe;IACf,gBAAgB,EAAE,+BAA+B;IACjD,kBAAkB,EAAE,8BAA8B;CAC1C,CAAC"}
1
+ {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../src/utils/endpoints.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB;IACjB,YAAY,EAAE,cAAc;IAC5B,mBAAmB,EAAE,0BAA0B;IAE/C,0EAA0E;IAC1E,SAAS,EAAE,iBAAiB;IAE5B,QAAQ;IACR,UAAU,EAAE,2BAA2B;IAEvC,eAAe;IACf,gBAAgB,EAAE,+BAA+B;IACjD,kBAAkB,EAAE,8BAA8B;IAElD,yDAAyD;IACzD,kBAAkB,EAAE,kBAAkB;IACtC,kBAAkB,EAAE,kBAAkB,EAAE,6BAA6B;IAErE,0BAA0B;IAC1B,kBAAkB,EAAE,yBAAyB;CACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaspervault_cli",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "description": "JasperVault CLI for interacting with the JasperVault Manager API",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,17 +31,15 @@
31
31
  "license": "MIT",
32
32
  "homepage": "https://www.jaspervault.io/",
33
33
  "dependencies": {
34
- "@walletconnect/sign-client": "^2.23.7",
34
+ "@modelcontextprotocol/sdk": "^1.28.0",
35
35
  "commander": "^14.0.3",
36
36
  "ethers": "^6.8.1",
37
37
  "graphql": "^16.13.0",
38
- "graphql-request": "^7.4.0",
39
- "qrcode": "^1.5.4"
38
+ "graphql-request": "^7.4.0"
40
39
  },
41
40
  "devDependencies": {
42
41
  "@types/jest": "^30.0.0",
43
42
  "@types/node": "^25.3.3",
44
- "@types/qrcode": "^1.5.6",
45
43
  "jest": "^30.2.0",
46
44
  "ts-jest": "^29.4.6",
47
45
  "tsx": "^4.21.0",