@parallel-protocol/cli 0.2.4 → 0.2.6
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 +35 -51
- package/dist/index.js +64 -55
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ npm install -g @parallel-protocol/cli
|
|
|
14
14
|
npx @parallel-protocol/cli <command>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
**Requirements:** Node.js ≥
|
|
17
|
+
**Requirements:** Node.js ≥ 22
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -36,7 +36,7 @@ parallel swap mint --collateral USDC --amount 1000 --chain avalanche --dry-run
|
|
|
36
36
|
|
|
37
37
|
> **Development (from the parallel-mcp repo):**
|
|
38
38
|
> ```bash
|
|
39
|
-
>
|
|
39
|
+
> bun run build:cli # build once
|
|
40
40
|
> alias parallel="node packages/cli/dist/index.js"
|
|
41
41
|
> parallel protocol overview
|
|
42
42
|
> ```
|
|
@@ -55,9 +55,6 @@ default_chain = "base"
|
|
|
55
55
|
|
|
56
56
|
[wallet]
|
|
57
57
|
keystore_path = "~/.parallel/keystore.json"
|
|
58
|
-
|
|
59
|
-
[display]
|
|
60
|
-
default_format = "table" # table | json
|
|
61
58
|
```
|
|
62
59
|
|
|
63
60
|
### `parallel config get / set`
|
|
@@ -76,8 +73,10 @@ The CLI uses the [Ethereum V3 keystore](https://github.com/ethereum/wiki/wiki/We
|
|
|
76
73
|
**Option A — Foundry `cast` (recommended for developers)**
|
|
77
74
|
|
|
78
75
|
```bash
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
mkdir -p ~/.parallel
|
|
77
|
+
cast wallet new ~/.parallel
|
|
78
|
+
# → generates a fresh address, encrypted with a password you choose,
|
|
79
|
+
# as ~/.parallel/<id> (random filename — rename it if you like)
|
|
81
80
|
```
|
|
82
81
|
|
|
83
82
|
**Option B — Geth**
|
|
@@ -91,27 +90,31 @@ geth account new --keystore ~/.parallel/
|
|
|
91
90
|
```bash
|
|
92
91
|
# 1. MetaMask → Account details → Export Private Key
|
|
93
92
|
# 2. Convert to keystore:
|
|
94
|
-
cast wallet import
|
|
95
|
-
# → paste the private key, set a password
|
|
93
|
+
cast wallet import parallel-cli --keystore-dir ~/.parallel --interactive
|
|
94
|
+
# → paste the private key, set a password — writes ~/.parallel/parallel-cli
|
|
96
95
|
```
|
|
97
96
|
|
|
98
97
|
Then point the CLI to it:
|
|
99
98
|
|
|
100
99
|
```bash
|
|
101
|
-
parallel config set wallet.keystore_path ~/.parallel/
|
|
102
|
-
# or pass it directly: --wallet ~/.parallel/
|
|
100
|
+
parallel config set wallet.keystore_path ~/.parallel/parallel-cli
|
|
101
|
+
# or pass it directly: --wallet ~/.parallel/parallel-cli
|
|
103
102
|
```
|
|
104
103
|
|
|
105
104
|
### Environment variables
|
|
106
105
|
|
|
107
|
-
All optional
|
|
106
|
+
All optional.
|
|
108
107
|
|
|
109
108
|
| Variable | Description |
|
|
110
109
|
|---|---|
|
|
111
|
-
| `PARALLEL_PRIVATE_KEY` | Raw private key (hex, `0x` prefix) — alternative to keystore, useful for scripts and CI |
|
|
110
|
+
| `PARALLEL_PRIVATE_KEY` | Raw private key (hex, `0x` prefix) — alternative to keystore, useful for scripts and CI. Used by `--wallet env`, or by `--wallet` alone when no keystore is configured |
|
|
112
111
|
| `PARALLEL_DEFAULT_CHAIN` | Default chain — overrides `network.default_chain` in config |
|
|
113
112
|
| `PARALLEL_JSON` | Set to `true` to force JSON output on all commands |
|
|
114
113
|
| `PARALLEL_API_URL` | Parallel API base URL for `--history` commands (default: `https://api.parallel.best`) |
|
|
114
|
+
| `FACILITATOR_URL` | Facilitator base URL for `pay` commands (default: `https://agents.parallel.best`) |
|
|
115
|
+
| `ALCHEMY_API_KEY` | Optional Alchemy key — upgrades RPC calls from public endpoints to Alchemy |
|
|
116
|
+
|
|
117
|
+
> **Precedence:** flags > environment > config file — except the wallet: `--wallet` used alone tries the config `keystore_path` **first**, then falls back to `PARALLEL_PRIVATE_KEY`.
|
|
115
118
|
|
|
116
119
|
|
|
117
120
|
---
|
|
@@ -196,6 +199,7 @@ parallel swap redeem --amount <n> --chain <chain> --wallet # proportional rede
|
|
|
196
199
|
| `--op <mint\|burn\|redeem>` | | Operation (quote only) |
|
|
197
200
|
| `--collateral <symbol>` | | Collateral symbol (e.g. `USDC`, `USDS`, `sUSDS`) |
|
|
198
201
|
| `--amount <n>` | | Amount in USDp (or collateral units for mint) |
|
|
202
|
+
| `--slippage <pct>` | `0.5` | Slippage tolerance in % (`mint` / `burn` / `redeem`) |
|
|
199
203
|
| `--address <0x...>` | | Receiver address for dry-run (no key needed) |
|
|
200
204
|
|
|
201
205
|
---
|
|
@@ -219,29 +223,30 @@ parallel savings deposit --amount <n> --chain <chain> --wallet
|
|
|
219
223
|
parallel savings withdraw --amount <n> --chain <chain> --wallet
|
|
220
224
|
```
|
|
221
225
|
|
|
222
|
-
> **Note:** `savings deposit`
|
|
226
|
+
> **Note:** in a terminal, `savings deposit` shows an interactive menu with two methods: **EIP-3009** `depositWithAuthorization` (no approval transaction — two EIP-712 signatures, one on-chain transaction) or **standard** approve + deposit (two transactions). In JSON / non-TTY mode the standard path is used automatically.
|
|
223
227
|
|
|
224
228
|
---
|
|
225
229
|
|
|
226
230
|
### `parallel bridge`
|
|
227
231
|
|
|
228
|
-
LayerZero cross-chain bridge (USDp
|
|
232
|
+
LayerZero cross-chain bridge (USDp).
|
|
229
233
|
|
|
230
234
|
```bash
|
|
231
|
-
parallel bridge quote --
|
|
232
|
-
parallel bridge fees --from <chain>
|
|
233
|
-
parallel bridge limits [--chain <chain>]
|
|
235
|
+
parallel bridge quote --from <chain> --to <chain> --amount <n>
|
|
236
|
+
parallel bridge fees --from <chain> # fees to all destinations
|
|
237
|
+
parallel bridge limits [--chain <chain>] # daily + global limits
|
|
234
238
|
|
|
235
239
|
# Dry-run
|
|
236
|
-
parallel bridge send --
|
|
240
|
+
parallel bridge send --from <chain> --to <chain> --amount <n> --dry-run
|
|
237
241
|
|
|
238
242
|
# Sign and broadcast
|
|
239
|
-
parallel bridge send --
|
|
243
|
+
parallel bridge send --from <chain> --to <chain> --amount <n> --wallet [--recipient <address>]
|
|
240
244
|
|
|
241
|
-
parallel bridge status
|
|
245
|
+
parallel bridge status <txHash> --from <chain>
|
|
246
|
+
parallel bridge history <address> [--limit <n>] [--offset <n>] # past transfers (default: 20)
|
|
242
247
|
```
|
|
243
248
|
|
|
244
|
-
> **Note:** Mantle does not support bridging (no BridgeableToken deployed)
|
|
249
|
+
> **Note:** only `usdp` can be bridged for now (`--token` defaults to it; other values are rejected). Mantle does not support bridging (no BridgeableToken deployed) — all other chains do.
|
|
245
250
|
|
|
246
251
|
---
|
|
247
252
|
|
|
@@ -295,7 +300,7 @@ x402 payment layer.
|
|
|
295
300
|
parallel pay capabilities [--chain <chain>]
|
|
296
301
|
|
|
297
302
|
# Gas sponsoring quota for an address
|
|
298
|
-
parallel pay quota
|
|
303
|
+
parallel pay quota <address> [--chain <chain>]
|
|
299
304
|
|
|
300
305
|
# Verify a payment on-chain
|
|
301
306
|
parallel pay verify <txHash> --chain <chain>
|
|
@@ -323,7 +328,7 @@ parallel pay prepare \
|
|
|
323
328
|
parallel pay prepare --amount <n> --recipient <address> --chain <chain> --pay-with <usdp|usdc|susdp>
|
|
324
329
|
```
|
|
325
330
|
|
|
326
|
-
**`--token`** controls what the **merchant receives** (default: `usdp`). Accepted values: `usdp` · `usdc` · `susdp` · any backing collateral symbol (`susds`, `sfrxusd`, …).
|
|
331
|
+
**`--token`** controls what the **merchant receives** (default: `usdp`). Accepted values: `usdp` · `usdc` · `susdp` · any backing collateral symbol (`susds`, `sfrxusd`, …) · a token contract address.
|
|
327
332
|
|
|
328
333
|
**`--pay-with`** overrides which token the **agent pays with** (default: auto-detected from wallet balance). Accepted values: `usdp` · `usdc` · `susdp`.
|
|
329
334
|
|
|
@@ -346,20 +351,6 @@ Without `--wallet`, the payload is unsigned and `tokenIn` defaults to `usdp`.
|
|
|
346
351
|
|
|
347
352
|
---
|
|
348
353
|
|
|
349
|
-
### `parallel cashback`
|
|
350
|
-
|
|
351
|
-
Cashback rewards — read-only, via facilitator API.
|
|
352
|
-
|
|
353
|
-
```bash
|
|
354
|
-
parallel cashback balance <address> # current month spend + earnings + tier
|
|
355
|
-
parallel cashback tier <address> # 4-tier breakdown + rates
|
|
356
|
-
parallel cashback history <address> [--limit <n>] # monthly history + distribution status
|
|
357
|
-
parallel cashback estimate <address> [--projected-spend <n>] # projected earnings this month
|
|
358
|
-
parallel cashback quota <address> [--chain <chain>] # gas sponsoring quota
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
---
|
|
362
|
-
|
|
363
354
|
### Utilities
|
|
364
355
|
|
|
365
356
|
```bash
|
|
@@ -409,26 +400,19 @@ Not all chains support every feature. Use `parallel protocol chains` to see the
|
|
|
409
400
|
| Code | Trigger |
|
|
410
401
|
|---|---|
|
|
411
402
|
| `CHAIN_SUNSET` | Operation not available on a sunset chain |
|
|
412
|
-
| `CHAIN_PAUSED` | Chain temporarily paused (auto-pause by Hypernative or governance) |
|
|
413
403
|
| `PARALLELIZER_NOT_DEPLOYED` | Feature requires Parallelizer, not deployed on this chain |
|
|
414
404
|
| `UNKNOWN_CHAIN` | Chain identifier not recognised |
|
|
415
405
|
| `INSUFFICIENT_BALANCE` | Wallet balance too low for the requested amount |
|
|
416
|
-
| `
|
|
417
|
-
| `
|
|
418
|
-
| `
|
|
419
|
-
| `COOLDOWN_ACTIVE` | Unstake impossible — cooldown period not yet expired |
|
|
420
|
-
| `COLLATERAL_NOT_SUPPORTED` | Collateral not accepted on this chain |
|
|
421
|
-
| `WALLET_REQUIRED` | Write command called without `--wallet` or `--dry-run` |
|
|
422
|
-
| `INVALID_KEYSTORE` | Keystore file not found or invalid format |
|
|
423
|
-
| `WRONG_PASSWORD` | Incorrect keystore decryption password |
|
|
406
|
+
| `COLLATERAL_NOT_SUPPORTED` | Collateral (or bridge token) not accepted on this chain |
|
|
407
|
+
| `WALLET_REQUIRED` | Signing requested but no wallet available (`--wallet` unresolvable) |
|
|
408
|
+
| `INVALID_KEYSTORE` | Keystore unreadable, invalid format, or wrong decryption password |
|
|
424
409
|
| `INVALID_AMOUNT` | Negative, zero, or unparseable amount |
|
|
425
410
|
| `MISSING_OPTION` | Required flag not provided |
|
|
426
411
|
| `INVALID_ADDRESS` | Argument is not a valid EVM address |
|
|
427
|
-
| `PAYMENT_EXPIRED` | x402 payment — `validBefore` exceeded, re-sign required |
|
|
428
|
-
| `INVALID_SIGNATURE` | x402 payment — EIP-712 signature invalid |
|
|
429
|
-
| `INVALID_NONCE` | x402 payment — nonce already used |
|
|
430
|
-
| `ROUTE_UNAVAILABLE` | x402 payment — no route available for this merchant/chain combination |
|
|
431
412
|
| `RPC_ERROR` | RPC call failed (network issue or node unreachable) |
|
|
413
|
+
| `UNKNOWN` | Any other failure |
|
|
414
|
+
|
|
415
|
+
Errors raised by the protocol layer (caps, bridge limits, slippage, cooldowns, expired authorizations…) surface with `code: "UNKNOWN"` and the underlying reason at the start of `message` — e.g. `[EXCEEDS_BRIDGE_LIMIT] Daily bridge limit reached`. Match on the message prefix, not the code, for these.
|
|
432
416
|
|
|
433
417
|
---
|
|
434
418
|
|
package/dist/index.js
CHANGED
|
@@ -1632,6 +1632,10 @@ var logger = new Logger({
|
|
|
1632
1632
|
function suppressLogs() {
|
|
1633
1633
|
logger.settings.minLevel = 7;
|
|
1634
1634
|
}
|
|
1635
|
+
|
|
1636
|
+
// package.json
|
|
1637
|
+
var package_default = {
|
|
1638
|
+
version: "0.2.6"};
|
|
1635
1639
|
function findEnvFile(dir) {
|
|
1636
1640
|
const candidate = join(dir, ".env");
|
|
1637
1641
|
if (existsSync(candidate)) return candidate;
|
|
@@ -3697,7 +3701,7 @@ var CHAINS_STATIC = {
|
|
|
3697
3701
|
accessManager: "0x94Ea8800444017695345156319e96bdB1E355F7a",
|
|
3698
3702
|
parallelizer: "0x6efeDDF9269c3683Ba516cb0e2124FE335F262a2",
|
|
3699
3703
|
usdp: "0x9B3a8f7CEC208e247d97dEE13313690977e24459",
|
|
3700
|
-
susdp: "
|
|
3704
|
+
susdp: "0xd3a452B305C8285c0Dd7b8537665c734d3D279eF",
|
|
3701
3705
|
bridgeableUsdp: "0x78BB4882b77D74aD9B04Ab71fE8e61f72595823C",
|
|
3702
3706
|
flashParallel: "0xC9B6279baa19dBB8bCc3250c89cAa093AaBA0bfc",
|
|
3703
3707
|
harvester: "0x36DA06796fD9d22BCD6287b66A87FfdadB12636C"
|
|
@@ -5161,13 +5165,16 @@ function quoteCmd() {
|
|
|
5161
5165
|
"usdp"
|
|
5162
5166
|
).option("--from <chain>", "source chain").option("--to <chain>", "destination chain").option("--amount <n>", "amount to bridge").action(async function() {
|
|
5163
5167
|
const opts = resolveOpts(this);
|
|
5164
|
-
if (!opts.from)
|
|
5165
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --from <chain>");
|
|
5166
|
-
if (!opts.to)
|
|
5167
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --to <chain>");
|
|
5168
|
-
if (!opts.amount)
|
|
5169
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --amount <n>");
|
|
5170
5168
|
try {
|
|
5169
|
+
if (!opts.from)
|
|
5170
|
+
throw new CliError(
|
|
5171
|
+
ErrorCode.MISSING_OPTION,
|
|
5172
|
+
"Missing --from <chain>"
|
|
5173
|
+
);
|
|
5174
|
+
if (!opts.to)
|
|
5175
|
+
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --to <chain>");
|
|
5176
|
+
if (!opts.amount)
|
|
5177
|
+
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --amount <n>");
|
|
5171
5178
|
validateToken(opts.token);
|
|
5172
5179
|
if (CHAINS[opts.from]?.status === "sunset")
|
|
5173
5180
|
throw new CliError(
|
|
@@ -5213,9 +5220,12 @@ function quoteCmd() {
|
|
|
5213
5220
|
function feesCmd() {
|
|
5214
5221
|
return new Command("fees").description("Show LayerZero bridge fees to all destinations from a chain").option("--token <token>", "token: usdp|susdp|prl (default: usdp)", "usdp").option("--from <chain>", "source chain").action(async function() {
|
|
5215
5222
|
const opts = resolveOpts(this);
|
|
5216
|
-
if (!opts.from)
|
|
5217
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --from <chain>");
|
|
5218
5223
|
try {
|
|
5224
|
+
if (!opts.from)
|
|
5225
|
+
throw new CliError(
|
|
5226
|
+
ErrorCode.MISSING_OPTION,
|
|
5227
|
+
"Missing --from <chain>"
|
|
5228
|
+
);
|
|
5219
5229
|
validateToken(opts.token);
|
|
5220
5230
|
if (CHAINS[opts.from]?.status === "sunset")
|
|
5221
5231
|
throw new CliError(
|
|
@@ -5251,13 +5261,16 @@ function sendCmd() {
|
|
|
5251
5261
|
"usdp"
|
|
5252
5262
|
).option("--from <chain>", "source chain").option("--to <chain>", "destination chain").option("--amount <n>", "amount to bridge").option("--recipient <addr>", "override destination recipient address").option("-w, --wallet [path|env]", "keystore path or 'env'").option("--address <addr>", "sender address (for dry-run without --wallet)").option("--dry-run", "build tx without broadcasting").action(async function() {
|
|
5253
5263
|
const opts = resolveOpts(this);
|
|
5254
|
-
if (!opts.from)
|
|
5255
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --from <chain>");
|
|
5256
|
-
if (!opts.to)
|
|
5257
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --to <chain>");
|
|
5258
|
-
if (!opts.amount)
|
|
5259
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --amount <n>");
|
|
5260
5264
|
try {
|
|
5265
|
+
if (!opts.from)
|
|
5266
|
+
throw new CliError(
|
|
5267
|
+
ErrorCode.MISSING_OPTION,
|
|
5268
|
+
"Missing --from <chain>"
|
|
5269
|
+
);
|
|
5270
|
+
if (!opts.to)
|
|
5271
|
+
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --to <chain>");
|
|
5272
|
+
if (!opts.amount)
|
|
5273
|
+
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --amount <n>");
|
|
5261
5274
|
validateToken(opts.token);
|
|
5262
5275
|
if (CHAINS[opts.from]?.status === "sunset")
|
|
5263
5276
|
throw new CliError(
|
|
@@ -13239,19 +13252,19 @@ function infoCmd() {
|
|
|
13239
13252
|
function stakeCmd() {
|
|
13240
13253
|
return new Command("stake").description("Stake PRL (sPRL1) or BPT/PRL+WETH (sPRL2)").option("--type <sprl1|sprl2>", "staking type: sprl1 or sprl2").option("--amount <n>", "amount of PRL (sPRL1) or BPT (sPRL2) to stake").option("--weth-amount <n>", "WETH amount for sPRL2 PRL+WETH path").option("-w, --wallet [path|env]", "keystore path or 'env'").option("--address <addr>", "sender address (for dry-run without --wallet)").option("--dry-run", "build tx without broadcasting").action(async function() {
|
|
13241
13254
|
const opts = resolveOpts(this);
|
|
13242
|
-
if (!opts.type)
|
|
13243
|
-
throw new CliError(
|
|
13244
|
-
ErrorCode.MISSING_OPTION,
|
|
13245
|
-
"Missing --type <sprl1|sprl2>"
|
|
13246
|
-
);
|
|
13247
|
-
if (!opts.amount)
|
|
13248
|
-
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --amount <n>");
|
|
13249
|
-
if (opts.type !== "sprl1" && opts.type !== "sprl2")
|
|
13250
|
-
throw new CliError(
|
|
13251
|
-
ErrorCode.INVALID_AMOUNT,
|
|
13252
|
-
`--type must be "sprl1" or "sprl2", got: ${opts.type}`
|
|
13253
|
-
);
|
|
13254
13255
|
try {
|
|
13256
|
+
if (!opts.type)
|
|
13257
|
+
throw new CliError(
|
|
13258
|
+
ErrorCode.MISSING_OPTION,
|
|
13259
|
+
"Missing --type <sprl1|sprl2>"
|
|
13260
|
+
);
|
|
13261
|
+
if (!opts.amount)
|
|
13262
|
+
throw new CliError(ErrorCode.MISSING_OPTION, "Missing --amount <n>");
|
|
13263
|
+
if (opts.type !== "sprl1" && opts.type !== "sprl2")
|
|
13264
|
+
throw new CliError(
|
|
13265
|
+
ErrorCode.INVALID_AMOUNT,
|
|
13266
|
+
`--type must be "sprl1" or "sprl2", got: ${opts.type}`
|
|
13267
|
+
);
|
|
13255
13268
|
const { account, sender } = await resolveWallet(opts);
|
|
13256
13269
|
if (opts.type === "sprl1") {
|
|
13257
13270
|
const result = await buildStakeSprl1Tx(opts.amount, sender);
|
|
@@ -13410,17 +13423,17 @@ function unstakeCmd() {
|
|
|
13410
13423
|
"shares to unstake (omit to execute ready withdrawals)"
|
|
13411
13424
|
).option("-w, --wallet [path|env]", "keystore path or 'env'").option("--address <addr>", "sender address (for dry-run without --wallet)").option("--dry-run", "build tx without broadcasting").action(async function() {
|
|
13412
13425
|
const opts = resolveOpts(this);
|
|
13413
|
-
if (!opts.type)
|
|
13414
|
-
throw new CliError(
|
|
13415
|
-
ErrorCode.MISSING_OPTION,
|
|
13416
|
-
"Missing --type <sprl1|sprl2>"
|
|
13417
|
-
);
|
|
13418
|
-
if (opts.type !== "sprl1" && opts.type !== "sprl2")
|
|
13419
|
-
throw new CliError(
|
|
13420
|
-
ErrorCode.INVALID_AMOUNT,
|
|
13421
|
-
`--type must be "sprl1" or "sprl2", got: ${opts.type}`
|
|
13422
|
-
);
|
|
13423
13426
|
try {
|
|
13427
|
+
if (!opts.type)
|
|
13428
|
+
throw new CliError(
|
|
13429
|
+
ErrorCode.MISSING_OPTION,
|
|
13430
|
+
"Missing --type <sprl1|sprl2>"
|
|
13431
|
+
);
|
|
13432
|
+
if (opts.type !== "sprl1" && opts.type !== "sprl2")
|
|
13433
|
+
throw new CliError(
|
|
13434
|
+
ErrorCode.INVALID_AMOUNT,
|
|
13435
|
+
`--type must be "sprl1" or "sprl2", got: ${opts.type}`
|
|
13436
|
+
);
|
|
13424
13437
|
const { account, sender } = await resolveWallet(opts);
|
|
13425
13438
|
if (sender !== ZERO_ADDRESS4 && opts.amount) {
|
|
13426
13439
|
const info = await getStakingInfo(sender);
|
|
@@ -13533,17 +13546,17 @@ function claimCmd() {
|
|
|
13533
13546
|
"reward type to claim: sprl1, sprl2, or all"
|
|
13534
13547
|
).option("-w, --wallet [path|env]", "keystore path or 'env'").option("--address <addr>", "sender address (for dry-run without --wallet)").option("--dry-run", "build tx without broadcasting").action(async function() {
|
|
13535
13548
|
const opts = resolveOpts(this);
|
|
13536
|
-
if (!opts.type)
|
|
13537
|
-
throw new CliError(
|
|
13538
|
-
ErrorCode.MISSING_OPTION,
|
|
13539
|
-
"Missing --type <sprl1|sprl2|all>"
|
|
13540
|
-
);
|
|
13541
|
-
if (opts.type !== "sprl1" && opts.type !== "sprl2" && opts.type !== "all")
|
|
13542
|
-
throw new CliError(
|
|
13543
|
-
ErrorCode.INVALID_AMOUNT,
|
|
13544
|
-
`--type must be "sprl1", "sprl2", or "all", got: ${opts.type}`
|
|
13545
|
-
);
|
|
13546
13549
|
try {
|
|
13550
|
+
if (!opts.type)
|
|
13551
|
+
throw new CliError(
|
|
13552
|
+
ErrorCode.MISSING_OPTION,
|
|
13553
|
+
"Missing --type <sprl1|sprl2|all>"
|
|
13554
|
+
);
|
|
13555
|
+
if (opts.type !== "sprl1" && opts.type !== "sprl2" && opts.type !== "all")
|
|
13556
|
+
throw new CliError(
|
|
13557
|
+
ErrorCode.INVALID_AMOUNT,
|
|
13558
|
+
`--type must be "sprl1", "sprl2", or "all", got: ${opts.type}`
|
|
13559
|
+
);
|
|
13547
13560
|
const { account, sender } = await resolveWallet(opts);
|
|
13548
13561
|
const result = await buildClaimRewardsTx(
|
|
13549
13562
|
opts.type,
|
|
@@ -14582,18 +14595,14 @@ function swapCommand() {
|
|
|
14582
14595
|
}
|
|
14583
14596
|
|
|
14584
14597
|
// ../mcp-server/package.json
|
|
14585
|
-
var package_default = {
|
|
14586
|
-
version: "1.0.0"};
|
|
14587
|
-
|
|
14588
|
-
// package.json
|
|
14589
14598
|
var package_default2 = {
|
|
14590
|
-
version: "0.
|
|
14599
|
+
version: "1.0.0"};
|
|
14591
14600
|
|
|
14592
14601
|
// src/commands/version.ts
|
|
14593
14602
|
function versionCommand() {
|
|
14594
14603
|
return new Command("version").description("Show CLI and runtime versions").action(() => {
|
|
14595
|
-
const cliVersion =
|
|
14596
|
-
const mcpVersion =
|
|
14604
|
+
const cliVersion = package_default.version;
|
|
14605
|
+
const mcpVersion = package_default2.version;
|
|
14597
14606
|
const runtime2 = process.version;
|
|
14598
14607
|
const entries = [
|
|
14599
14608
|
["parallel CLI", `v${cliVersion}`],
|
|
@@ -14611,7 +14620,7 @@ function versionCommand() {
|
|
|
14611
14620
|
loadEnv(import.meta.url);
|
|
14612
14621
|
suppressLogs();
|
|
14613
14622
|
var program = new Command();
|
|
14614
|
-
program.name("parallel").description("Parallel Protocol CLI").version(
|
|
14623
|
+
program.name("parallel").description("Parallel Protocol CLI").version(package_default.version).option("-c, --chain <chain>", "target chain (e.g. base, ethereum)").option("--rpc <url>", "custom RPC URL").option("-j, --json", "force JSON output").option("--dry-run", "build transaction without broadcasting").option(
|
|
14615
14624
|
"-w, --wallet [path|env]",
|
|
14616
14625
|
"keystore path, 'env', or alone to auto-resolve from config/env"
|
|
14617
14626
|
).option("--gas-limit <n>", "override gas limit").option("-v, --verbose", "verbose logs").option("--no-cache", "bypass TTL cache, force fresh RPC call").hook("preAction", (thisCommand) => {
|