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.
- package/README.md +25 -24
- package/dist/bin/jv.js +6 -2
- package/dist/bin/jv.js.map +1 -1
- package/dist/src/client.js +28 -1
- package/dist/src/client.js.map +1 -1
- package/dist/src/commands/deposit.js +129 -125
- package/dist/src/commands/deposit.js.map +1 -1
- package/dist/src/commands/install.d.ts +2 -0
- package/dist/src/commands/install.js +184 -0
- package/dist/src/commands/install.js.map +1 -0
- package/dist/src/commands/limit-order.js +7 -0
- package/dist/src/commands/limit-order.js.map +1 -1
- package/dist/src/commands/mcp.d.ts +2 -0
- package/dist/src/commands/mcp.js +10 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/commands/sl.js +12 -2
- package/dist/src/commands/sl.js.map +1 -1
- package/dist/src/commands/tp.js +12 -2
- package/dist/src/commands/tp.js.map +1 -1
- package/dist/src/commands/vault.js +111 -87
- package/dist/src/commands/vault.js.map +1 -1
- package/dist/src/commands/withdraw.d.ts +2 -0
- package/dist/src/commands/withdraw.js +114 -0
- package/dist/src/commands/withdraw.js.map +1 -0
- package/dist/src/mcp/executor.d.ts +23 -0
- package/dist/src/mcp/executor.js +75 -0
- package/dist/src/mcp/executor.js.map +1 -0
- package/dist/src/mcp/index.d.ts +1 -0
- package/dist/src/mcp/index.js +58 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/installer.d.ts +9 -0
- package/dist/src/mcp/installer.js +66 -0
- package/dist/src/mcp/installer.js.map +1 -0
- package/dist/src/mcp/tools.d.ts +15 -0
- package/dist/src/mcp/tools.js +250 -0
- package/dist/src/mcp/tools.js.map +1 -0
- package/dist/src/services/order-signer.js +1 -1
- package/dist/src/services/order-signer.js.map +1 -1
- package/dist/src/services/session-poller.d.ts +12 -0
- package/dist/src/services/session-poller.js +57 -0
- package/dist/src/services/session-poller.js.map +1 -0
- package/dist/src/templates/skill-body.d.ts +1 -1
- package/dist/src/templates/skill-body.js +1 -1
- package/dist/src/templates/skill-content/SKILL.core.md +52 -45
- package/dist/src/templates/skill-content/frontmatter/claude.md +1 -1
- package/dist/src/templates/skill-content/frontmatter/openclaw.md +2 -2
- package/dist/src/templates/skill-content/references/onboarding.md +68 -87
- package/dist/src/templates/skill-content/references/queries.md +58 -188
- package/dist/src/templates/skill-content/references/trading.md +128 -178
- package/dist/src/types.d.ts +13 -6
- package/dist/src/utils/config.d.ts +1 -1
- package/dist/src/utils/config.js +1 -1
- package/dist/src/utils/config.js.map +1 -1
- package/dist/src/utils/endpoints.d.ts +3 -0
- package/dist/src/utils/endpoints.js +5 -0
- package/dist/src/utils/endpoints.js.map +1 -1
- package/package.json +3 -5
|
@@ -1,245 +1,198 @@
|
|
|
1
1
|
# Trading Reference
|
|
2
2
|
|
|
3
|
-
## 1. Create Order
|
|
3
|
+
## 1. Create Order — `create_order`
|
|
4
4
|
|
|
5
5
|
Open, close, reduce, or add size to perpetual positions.
|
|
6
6
|
|
|
7
|
-
###
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
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
|
|
35
|
-
- **Limit order** (
|
|
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
|
|
27
|
+
### Market Order Response
|
|
38
28
|
|
|
39
|
-
|
|
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
|
-
{
|
|
32
|
+
{
|
|
33
|
+
"jobId": "MARKET_ORDER_xxx",
|
|
34
|
+
"status": "completed",
|
|
35
|
+
"transactionHash": "0x..."
|
|
36
|
+
}
|
|
47
37
|
```
|
|
48
38
|
|
|
49
|
-
**
|
|
50
|
-
1. If `status === "completed"` → the order IS executed.
|
|
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 `
|
|
53
|
-
4. The `operation` field (if present) contains raw on-chain data in wei —
|
|
54
|
-
5. To verify the actual position,
|
|
55
|
-
6. Report: "Order executed. Tx: {transactionHash}. Let me check your updated position..." then
|
|
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
|
-
{
|
|
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
|
-
|
|
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
|
-
```
|
|
75
|
-
|
|
62
|
+
```json
|
|
63
|
+
{ "side": "long", "symbol": "JBTC", "margin": 60 }
|
|
76
64
|
```
|
|
77
65
|
|
|
78
|
-
**Open a short position (limit):**
|
|
79
|
-
```
|
|
80
|
-
|
|
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 (
|
|
84
|
-
```
|
|
85
|
-
|
|
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
|
-
```
|
|
90
|
-
|
|
77
|
+
```json
|
|
78
|
+
{ "side": "short", "symbol": "JBTC", "margin": 30 }
|
|
91
79
|
```
|
|
92
80
|
|
|
93
81
|
**Add size to existing long:**
|
|
94
|
-
```
|
|
95
|
-
|
|
82
|
+
```json
|
|
83
|
+
{ "side": "long", "symbol": "JBTC", "margin": 50 }
|
|
96
84
|
```
|
|
97
85
|
|
|
98
86
|
**Open with PPO protection (ATM, 30 min):**
|
|
99
|
-
```
|
|
100
|
-
|
|
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
|
-
```
|
|
105
|
-
|
|
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
|
|
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
|
-
###
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
jv order protect --order-id <id> --symbol <symbol> [options]
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Options
|
|
102
|
+
### Parameters
|
|
121
103
|
|
|
122
|
-
|
|
|
123
|
-
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
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
|
-
###
|
|
112
|
+
### Response
|
|
134
113
|
|
|
135
|
-
The
|
|
114
|
+
The tool auto-waits up to 60s for the on-chain result:
|
|
136
115
|
```json
|
|
137
|
-
{
|
|
116
|
+
{
|
|
117
|
+
"jobId": "OPTION_ORDER_xxx",
|
|
118
|
+
"status": "completed",
|
|
119
|
+
"transactionHash": "0x..."
|
|
120
|
+
}
|
|
138
121
|
```
|
|
139
122
|
|
|
140
123
|
### Important
|
|
141
124
|
|
|
142
|
-
- Use `
|
|
143
|
-
-
|
|
144
|
-
- The
|
|
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
|
|
131
|
+
## 3. Take-Profit — `set_take_profit`
|
|
149
132
|
|
|
150
133
|
Set a take-profit limit order for an existing position.
|
|
151
134
|
|
|
152
|
-
###
|
|
135
|
+
### Parameters
|
|
153
136
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
|
161
|
-
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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 |
|
|
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 |
|
|
230
|
-
|
|
231
|
-
| 1 | 0.1% |
|
|
232
|
-
| 2 | 0.2% |
|
|
233
|
-
| 3 | 0.3% |
|
|
234
|
-
| 4 | 0.4% |
|
|
235
|
-
| 5 | 0.5% |
|
|
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 |
|
|
240
|
-
|
|
241
|
-
| 30 minutes (default) |
|
|
242
|
-
| 8 hours |
|
|
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 |
|
|
252
|
-
|
|
253
|
-
| "
|
|
254
|
-
| "
|
|
255
|
-
| "
|
|
256
|
-
| "8
|
|
257
|
-
| "OTM"
|
|
258
|
-
| "
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
| "
|
|
268
|
-
| "
|
|
269
|
-
| "
|
|
270
|
-
|
|
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.
|
package/dist/src/types.d.ts
CHANGED
|
@@ -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;
|
package/dist/src/utils/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const DEFAULT_API_URL = 'https://
|
|
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,
|
|
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;
|
|
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.
|
|
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
|
-
"@
|
|
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",
|