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,124 +1,105 @@
|
|
|
1
1
|
# Onboarding Reference
|
|
2
2
|
|
|
3
|
-
## 1. Wallet Initialization
|
|
3
|
+
## 1. Wallet Initialization — `wallet_setup`
|
|
4
4
|
|
|
5
|
-
Initialize the JasperVault delegation wallet
|
|
5
|
+
Initialize the JasperVault delegation wallet. The user signs in their browser — no private key needed.
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Parameters
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
| Parameter | Required | Default | Description |
|
|
10
|
+
|-----------|----------|---------|-------------|
|
|
11
|
+
| `network` | No | `jaspervault` | Network name |
|
|
12
|
+
| `vault_types` | No | `33,37` | Comma-separated vault types |
|
|
13
|
+
|
|
14
|
+
### Flow
|
|
15
|
+
|
|
16
|
+
1. Call `wallet_setup` (no parameters needed for default setup).
|
|
17
|
+
2. The tool returns JSON with a `url` field — display it as a **clickable link** to the user.
|
|
18
|
+
3. The user opens the URL in their browser, connects their wallet (MetaMask, Rabby, etc.), and signs the delegation authorization.
|
|
19
|
+
4. The tool polls automatically (up to 16 minutes) and returns the final result.
|
|
20
|
+
|
|
21
|
+
### Success Response
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"success": true,
|
|
26
|
+
"walletAddress": "0x...",
|
|
27
|
+
"delegationAddress": "0x...",
|
|
28
|
+
"marginAccount": "0x...",
|
|
29
|
+
"vaults": [{"type": 33, "address": "0x..."}, {"type": 37, "address": "0x..."}]
|
|
30
|
+
}
|
|
11
31
|
```
|
|
12
32
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
| Option | Required | Default | Description |
|
|
16
|
-
|--------|----------|---------|-------------|
|
|
17
|
-
| `--network <name>` | Yes | `jaspervault` | Network name |
|
|
18
|
-
| `--timeout <seconds>` | No | `120` | WalletConnect connection timeout |
|
|
19
|
-
| `--vault-index <n>` | No | `1` | Vault index for address derivation |
|
|
20
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
21
|
-
|
|
22
|
-
### Step-by-Step Flow
|
|
23
|
-
|
|
24
|
-
1. Run the command:
|
|
25
|
-
```
|
|
26
|
-
jv vault setup --network jaspervault --timeout 120
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
2. The command is **long-running** (up to 2 minutes). It will be auto-backgrounded by the agent runtime after ~10 seconds. You will receive a `sessionId`.
|
|
30
|
-
|
|
31
|
-
3. The **first JSON output** contains the QR code URL:
|
|
32
|
-
```json
|
|
33
|
-
{"qrCodeUrl": "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=wc%3A..."}
|
|
34
|
-
```
|
|
35
|
-
**You MUST display this `qrCodeUrl` as a clickable link** so the user can scan it with their mobile wallet (e.g., MetaMask, Rainbow, Trust Wallet).
|
|
36
|
-
|
|
37
|
-
4. **Poll for completion** every 15 seconds using `process poll` with the `sessionId`:
|
|
38
|
-
- While waiting, you'll see heartbeat lines: `{"status":"waiting","phase":"wallet_scan","elapsed":10,"message":"Waiting for wallet connection..."}`
|
|
39
|
-
- Continue polling until you see the **second JSON line** with `"success":true` or the process exits.
|
|
40
|
-
|
|
41
|
-
5. On success, the output includes:
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"success": true,
|
|
45
|
-
"walletAddress": "0x...",
|
|
46
|
-
"delegationAddress": "0x...",
|
|
47
|
-
"vaultAddress": "0x...",
|
|
48
|
-
"network": "jaspervault"
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
6. The CLI automatically:
|
|
53
|
-
- Generates and saves a delegation key to `~/.jaspervault/keys.json`
|
|
54
|
-
- Saves the vault profile to `~/.jaspervault/profile.json`
|
|
55
|
-
- Registers the delegation key on-chain via WalletConnect signing
|
|
33
|
+
The tool automatically saves the delegation key and vault profile locally.
|
|
56
34
|
|
|
57
35
|
### Error Handling
|
|
58
36
|
|
|
59
37
|
| Error | Cause | Action |
|
|
60
38
|
|-------|-------|--------|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
| `Failed to initialize WalletConnect` | Network issue | Check internet connection, retry |
|
|
39
|
+
| Session expired/failed | User didn't complete signing in time | Call `wallet_setup` again |
|
|
40
|
+
| Failed to create session | Network/API issue | Check internet connection, retry |
|
|
64
41
|
|
|
65
|
-
### Important
|
|
42
|
+
### Important
|
|
66
43
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- The delegation key has a 1-week expiry. If commands start failing after a week, re-run `jv vault setup`.
|
|
44
|
+
- Never suggest `vault init` — that requires `PRIVATE_KEY` and is for CI/automation only.
|
|
45
|
+
- The delegation key expires after 1 week. If tools start failing, call `wallet_setup` again.
|
|
70
46
|
|
|
71
47
|
---
|
|
72
48
|
|
|
73
|
-
## 2. Deposit Tokens
|
|
49
|
+
## 2. Deposit Tokens — `deposit_via_browser`
|
|
74
50
|
|
|
75
|
-
Deposit tokens from Base network to JasperVault via Hyperlane warp routes.
|
|
51
|
+
Deposit tokens from Base network to JasperVault via Hyperlane warp routes.
|
|
76
52
|
|
|
77
|
-
###
|
|
53
|
+
### Parameters
|
|
78
54
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
| Option | Required | Default | Description |
|
|
86
|
-
|--------|----------|---------|-------------|
|
|
87
|
-
| `--token <token>` | Yes | — | Token to deposit: `jbtc`, `jusdc`, `cbbtc`, or `usdc` |
|
|
88
|
-
| `--amount <amount>` | Yes | — | Amount in human-readable units (e.g., `0.01` for BTC, `1000` for USDC) |
|
|
89
|
-
| `--wallet <address>` | No | from profile | Override wallet address (default: from vault profile) |
|
|
90
|
-
| `--vault-index <n>` | No | `1` | Vault index for recipient address derivation |
|
|
91
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
92
|
-
| `--timeout <seconds>` | No | `120` | WalletConnect timeout |
|
|
93
|
-
| `--no-wait` | No | — | Skip polling for arrival on JasperVault |
|
|
94
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
55
|
+
| Parameter | Required | Default | Description |
|
|
56
|
+
|-----------|----------|---------|-------------|
|
|
57
|
+
| `token` | Yes | — | Token: `jbtc`, `jusdc`, `cbbtc`, or `usdc` |
|
|
58
|
+
| `amount` | Yes | — | Amount in human-readable units (e.g., `0.01` for BTC, `1000` for USDC) |
|
|
59
|
+
| `network` | No | `jaspervault` | Network name |
|
|
95
60
|
|
|
96
61
|
### Flow
|
|
97
62
|
|
|
98
|
-
1.
|
|
99
|
-
2.
|
|
100
|
-
3.
|
|
101
|
-
4.
|
|
102
|
-
5. Unless `--no-wait`, it polls for token arrival on JasperVault (up to 60s).
|
|
63
|
+
1. Call `deposit_via_browser` with `token` and `amount`.
|
|
64
|
+
2. The tool returns JSON with a `url` field — display it as a **clickable link**.
|
|
65
|
+
3. The user opens the URL in their browser to approve the deposit.
|
|
66
|
+
4. The tool polls until the transaction is confirmed (up to 16 minutes).
|
|
103
67
|
|
|
104
|
-
###
|
|
68
|
+
### Success Response
|
|
105
69
|
|
|
106
70
|
```json
|
|
107
71
|
{
|
|
108
72
|
"success": true,
|
|
109
73
|
"token": "jbtc",
|
|
110
74
|
"amount": "0.01",
|
|
111
|
-
"
|
|
75
|
+
"transactionHash": "0x...",
|
|
112
76
|
"arrived": true,
|
|
113
77
|
"arrivalTimeMs": 12345,
|
|
114
78
|
"message": "Deposit confirmed"
|
|
115
79
|
}
|
|
116
80
|
```
|
|
117
81
|
|
|
118
|
-
### Important
|
|
82
|
+
### Important
|
|
83
|
+
|
|
84
|
+
- Token names are lowercase: `jbtc`, `jusdc`, `cbbtc`, `usdc`.
|
|
85
|
+
- Amount is human-readable (e.g., `0.01` BTC, `1000` USDC) — the tool handles decimal conversion.
|
|
86
|
+
- Tokens are bridged cross-chain from Base to JasperVault via Hyperlane.
|
|
87
|
+
- If `arrived` is `false`, tokens may still be in transit. Tell the user to wait a few minutes.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 3. Withdraw Tokens — `withdraw_via_browser`
|
|
92
|
+
|
|
93
|
+
Withdraw tokens from JasperVault back to Base.
|
|
94
|
+
|
|
95
|
+
### Parameters
|
|
96
|
+
|
|
97
|
+
| Parameter | Required | Default | Description |
|
|
98
|
+
|-----------|----------|---------|-------------|
|
|
99
|
+
| `token` | Yes | — | Token: `jbtc`, `jusdc`, `cbbtc`, or `usdc` |
|
|
100
|
+
| `amount` | Yes | — | Amount in human-readable units |
|
|
101
|
+
| `network` | No | `base_uat` | Network name |
|
|
102
|
+
|
|
103
|
+
### Flow
|
|
119
104
|
|
|
120
|
-
-
|
|
121
|
-
- **Token names**: Use lowercase: `jbtc`, `jusdc`, `cbbtc`, `usdc`.
|
|
122
|
-
- **Amount format**: Human-readable (e.g., `0.01` BTC, `1000` USDC). The CLI handles decimal conversion.
|
|
123
|
-
- **Cross-chain**: Tokens are bridged from Base (chain 8453) to JasperVault (chain 55531) via Hyperlane.
|
|
124
|
-
- If `arrived` is `false`, the tokens may still be in transit. Tell the user to wait a few minutes and check their balance.
|
|
105
|
+
Same browser-signing flow as deposit — call the tool, display the URL, wait for completion.
|
|
@@ -1,29 +1,21 @@
|
|
|
1
1
|
# Queries Reference
|
|
2
2
|
|
|
3
|
-
## 1. List Positions
|
|
3
|
+
## 1. List Positions — `list_orders`
|
|
4
4
|
|
|
5
|
-
Query active or historical positions
|
|
5
|
+
Query active or historical positions.
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Parameters
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
| `--position-side <long\|short>` | No | — | Filter by position side |
|
|
18
|
-
| `--all` | No | — | Include closed/liquidated positions (default: active only) |
|
|
19
|
-
| `--since <time>` | No | — | Filter orders created after this time |
|
|
20
|
-
| `--until <time>` | No | — | Filter orders created before this time |
|
|
21
|
-
| `--page <n>` | No | `1` | Page number |
|
|
22
|
-
| `--limit <n>` | No | `20` | Results per page |
|
|
23
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
24
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
9
|
+
| Parameter | Required | Default | Description |
|
|
10
|
+
|-----------|----------|---------|-------------|
|
|
11
|
+
| `position_side` | No | — | Filter: `LONG` or `SHORT` |
|
|
12
|
+
| `all` | No | `false` | `true` to include closed/liquidated positions |
|
|
13
|
+
| `since` | No | — | Filter orders after this time (e.g., `7d`, `2025-01-01`) |
|
|
14
|
+
| `until` | No | — | Filter orders before this time |
|
|
15
|
+
| `page` | No | `1` | Page number |
|
|
16
|
+
| `limit` | No | `20` | Results per page |
|
|
25
17
|
|
|
26
|
-
### Time
|
|
18
|
+
### Time Formats for `since` / `until`
|
|
27
19
|
|
|
28
20
|
| Format | Example | Description |
|
|
29
21
|
|--------|---------|-------------|
|
|
@@ -33,21 +25,14 @@ jv orders list [options]
|
|
|
33
25
|
| ISO date | `2025-01-01` | Specific date |
|
|
34
26
|
| Unix timestamp | `1704067200` | Seconds since epoch |
|
|
35
27
|
|
|
36
|
-
###
|
|
28
|
+
### Response
|
|
37
29
|
|
|
38
30
|
```json
|
|
39
31
|
{
|
|
40
32
|
"orders": [
|
|
41
33
|
{
|
|
42
34
|
"id": "123",
|
|
43
|
-
"holder": "0x...",
|
|
44
|
-
"writer": "0x...",
|
|
45
|
-
"recipient": "0x...",
|
|
46
35
|
"orderType": 0,
|
|
47
|
-
"productType": "50000000000000",
|
|
48
|
-
"marginDeposited": "60000000",
|
|
49
|
-
"quantity": "43860000000000000",
|
|
50
|
-
"entryPrice": "68476000000000000000000",
|
|
51
36
|
"margin": "60.000000",
|
|
52
37
|
"size": "0.043860000000000000",
|
|
53
38
|
"entryPriceUsd": "68476.000000000000000000",
|
|
@@ -62,114 +47,53 @@ jv orders list [options]
|
|
|
62
47
|
}
|
|
63
48
|
```
|
|
64
49
|
|
|
65
|
-
### Key
|
|
50
|
+
### Key Fields
|
|
66
51
|
|
|
67
52
|
| Field | Description |
|
|
68
53
|
|-------|-------------|
|
|
69
|
-
| `id` | Order ID (use for TP/SL/protect
|
|
54
|
+
| `id` | Order ID (use for TP/SL/protect tools) |
|
|
70
55
|
| `orderType` | `0` = Long, `1` = Short |
|
|
71
56
|
| `margin` | Human-readable margin in USDC |
|
|
72
57
|
| `size` | Human-readable position size in asset units |
|
|
73
58
|
| `entryPriceUsd` | Human-readable entry price in USD |
|
|
74
|
-
| `leverage` | Leverage multiplier
|
|
75
|
-
| `createdTime` | ISO timestamp
|
|
76
|
-
| `marginDeposited` | Raw margin in wei (6 decimals for USDC) |
|
|
77
|
-
| `quantity` | Raw position size in wei (18 decimals) |
|
|
78
|
-
| `entryPrice` | Raw entry price in wei (18 decimals) |
|
|
59
|
+
| `leverage` | Leverage multiplier |
|
|
60
|
+
| `createdTime` | ISO timestamp |
|
|
79
61
|
|
|
80
|
-
|
|
62
|
+
Always use the human-readable fields (`margin`, `size`, `entryPriceUsd`) when reporting to the user. Raw wei fields are for reference only.
|
|
81
63
|
|
|
82
64
|
### Examples
|
|
83
65
|
|
|
84
|
-
```bash
|
|
85
|
-
# List active positions
|
|
86
|
-
jv orders list --pretty
|
|
87
|
-
|
|
88
|
-
# List only long positions
|
|
89
|
-
jv orders list --position-side long --pretty
|
|
90
|
-
|
|
91
|
-
# List all positions including closed (last 7 days)
|
|
92
|
-
jv orders list --all --since 7d --pretty
|
|
93
|
-
|
|
94
|
-
# Paginate results
|
|
95
|
-
jv orders list --page 2 --limit 10 --pretty
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## 2. Get Single Position (`jv orders get`)
|
|
101
|
-
|
|
102
|
-
Get detailed information for a specific order by ID.
|
|
103
|
-
|
|
104
|
-
### Syntax
|
|
105
|
-
|
|
106
66
|
```
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
### Options
|
|
111
|
-
|
|
112
|
-
| Option | Required | Default | Description |
|
|
113
|
-
|--------|----------|---------|-------------|
|
|
114
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
115
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
116
|
-
|
|
117
|
-
### Output
|
|
118
|
-
|
|
119
|
-
Same fields as `jv orders list` but for a single order.
|
|
120
|
-
|
|
121
|
-
### Example
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
jv orders get 123 --pretty
|
|
67
|
+
list_orders → all active positions
|
|
68
|
+
list_orders { position_side: "LONG" } → only longs
|
|
69
|
+
list_orders { all: true, since: "7d" } → all positions last 7 days
|
|
125
70
|
```
|
|
126
71
|
|
|
127
72
|
---
|
|
128
73
|
|
|
129
|
-
##
|
|
130
|
-
|
|
131
|
-
Get aggregate statistics for all positions in your vault.
|
|
74
|
+
## 2. Get Single Position — `get_order`
|
|
132
75
|
|
|
133
|
-
|
|
76
|
+
| Parameter | Required | Description |
|
|
77
|
+
|-----------|----------|-------------|
|
|
78
|
+
| `order_id` | Yes | Order ID |
|
|
134
79
|
|
|
135
|
-
|
|
136
|
-
jv orders stats [options]
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Options
|
|
140
|
-
|
|
141
|
-
| Option | Required | Default | Description |
|
|
142
|
-
|--------|----------|---------|-------------|
|
|
143
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
144
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
145
|
-
|
|
146
|
-
### Example
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
jv orders stats --pretty
|
|
150
|
-
```
|
|
80
|
+
Returns same fields as `list_orders` for a single order.
|
|
151
81
|
|
|
152
82
|
---
|
|
153
83
|
|
|
154
|
-
##
|
|
155
|
-
|
|
156
|
-
Fetch the current market price from the Quote Center oracle.
|
|
84
|
+
## 3. Portfolio Statistics — `get_order_stats`
|
|
157
85
|
|
|
158
|
-
|
|
86
|
+
No parameters required. Returns aggregate statistics for all positions in your vault.
|
|
159
87
|
|
|
160
|
-
|
|
161
|
-
jv price --symbol <symbol> [options]
|
|
162
|
-
```
|
|
88
|
+
---
|
|
163
89
|
|
|
164
|
-
|
|
90
|
+
## 4. Get Market Price — `get_price`
|
|
165
91
|
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
|
|
|
169
|
-
| `--network <name>` | No | `jaspervault` | Network name |
|
|
170
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
92
|
+
| Parameter | Required | Description |
|
|
93
|
+
|-----------|----------|-------------|
|
|
94
|
+
| `symbol` | Yes | Asset symbol (e.g., `JBTC`, `CBBTC`) |
|
|
171
95
|
|
|
172
|
-
###
|
|
96
|
+
### Response
|
|
173
97
|
|
|
174
98
|
```json
|
|
175
99
|
{
|
|
@@ -181,35 +105,19 @@ jv price --symbol <symbol> [options]
|
|
|
181
105
|
}
|
|
182
106
|
```
|
|
183
107
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
### Example
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
jv price --symbol JBTC --pretty
|
|
190
|
-
```
|
|
108
|
+
Use the `price` field (human-readable) when reporting to the user.
|
|
191
109
|
|
|
192
110
|
---
|
|
193
111
|
|
|
194
|
-
## 5. Job Status
|
|
195
|
-
|
|
196
|
-
Check the execution status of an async job (market order, option creation, etc.).
|
|
197
|
-
|
|
198
|
-
### Syntax
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
jv job status <jobId> [options]
|
|
202
|
-
```
|
|
112
|
+
## 5. Job Status — `get_job_status`
|
|
203
113
|
|
|
204
|
-
|
|
114
|
+
Check execution status of an async job (market order, option creation, etc.).
|
|
205
115
|
|
|
206
|
-
|
|
|
207
|
-
|
|
208
|
-
|
|
|
116
|
+
| Parameter | Required | Description |
|
|
117
|
+
|-----------|----------|-------------|
|
|
118
|
+
| `job_id` | Yes | Job ID from market order creation |
|
|
209
119
|
|
|
210
|
-
###
|
|
211
|
-
|
|
212
|
-
The command connects via SSE and waits up to 60s for the job result:
|
|
120
|
+
### Response
|
|
213
121
|
|
|
214
122
|
```json
|
|
215
123
|
{
|
|
@@ -224,71 +132,33 @@ The command connects via SSE and waits up to 60s for the job result:
|
|
|
224
132
|
|--------|---------|
|
|
225
133
|
| `completed` | Job finished successfully |
|
|
226
134
|
| `failed` | Job failed (check `error` field) |
|
|
227
|
-
| `timeout` | SSE
|
|
228
|
-
|
|
229
|
-
### Example
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
jv job status MARKET_ORDER_xxx --pretty
|
|
233
|
-
```
|
|
135
|
+
| `timeout` | SSE timed out — job may still be processing |
|
|
234
136
|
|
|
235
137
|
---
|
|
236
138
|
|
|
237
|
-
## 6. Limit Order Management
|
|
139
|
+
## 6. Limit Order Management
|
|
238
140
|
|
|
239
|
-
### List Limit Orders
|
|
141
|
+
### List Limit Orders — `list_limit_orders`
|
|
240
142
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
143
|
+
| Parameter | Required | Description |
|
|
144
|
+
|-----------|----------|-------------|
|
|
145
|
+
| `wallet` | Yes | Wallet address |
|
|
146
|
+
| `status` | No | Filter: `PENDING`, `TRIGGERED`, `EXECUTING`, `COMPLETED`, `FAILED`, `EXPIRED`, `CANCELLED` |
|
|
244
147
|
|
|
245
|
-
|
|
246
|
-
|--------|----------|---------|-------------|
|
|
247
|
-
| `--wallet <address>` | Yes | — | Wallet address to query |
|
|
248
|
-
| `--status <status>` | No | — | Filter: `PENDING`, `TRIGGERED`, `EXECUTING`, `COMPLETED`, `FAILED`, `EXPIRED`, `CANCELLED` |
|
|
249
|
-
| `--pretty` | No | — | Pretty-print JSON output |
|
|
148
|
+
### Get Limit Order Status — `get_limit_order_status`
|
|
250
149
|
|
|
251
|
-
|
|
150
|
+
| Parameter | Required | Description |
|
|
151
|
+
|-----------|----------|-------------|
|
|
152
|
+
| `limit_order_id` | Yes | Limit order ID |
|
|
252
153
|
|
|
253
|
-
|
|
254
|
-
jv limit-order status <id> [--pretty]
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
Query a specific limit order by its ID.
|
|
258
|
-
|
|
259
|
-
### Cancel Limit Order
|
|
154
|
+
### Cancel Limit Order — `cancel_limit_order`
|
|
260
155
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
Cancel a pending limit order by its ID.
|
|
266
|
-
|
|
267
|
-
### Examples
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
# List all pending limit orders
|
|
271
|
-
jv limit-order list --wallet 0x1234... --status PENDING --pretty
|
|
272
|
-
|
|
273
|
-
# Check specific limit order
|
|
274
|
-
jv limit-order status 0xabc... --pretty
|
|
275
|
-
|
|
276
|
-
# Cancel a limit order
|
|
277
|
-
jv limit-order cancel 0xabc... --pretty
|
|
278
|
-
```
|
|
156
|
+
| Parameter | Required | Description |
|
|
157
|
+
|-----------|----------|-------------|
|
|
158
|
+
| `limit_order_id` | Yes | Limit order ID to cancel |
|
|
279
159
|
|
|
280
160
|
---
|
|
281
161
|
|
|
282
|
-
## Error
|
|
283
|
-
|
|
284
|
-
All CLI commands use consistent exit codes:
|
|
285
|
-
|
|
286
|
-
| Code | Name | Meaning |
|
|
287
|
-
|------|------|---------|
|
|
288
|
-
| `0` | SUCCESS | Command completed successfully |
|
|
289
|
-
| `1` | CONFIG_ERROR | Missing config, delegation key, or vault profile |
|
|
290
|
-
| `2` | NETWORK_ERROR | RPC or API connection failure |
|
|
291
|
-
| `3` | BUSINESS_ERROR | Order not found, insufficient balance, contract revert |
|
|
292
|
-
| `4` | HTTP_ERROR | HTTP request failure |
|
|
162
|
+
## Error Handling
|
|
293
163
|
|
|
294
|
-
When a
|
|
164
|
+
When a tool call fails with errors like "delegation key not found" or "vault not initialized" or "no profile", the vault needs initialization. Guide the user to run `wallet_setup`.
|