@parallel-protocol/cli 0.2.6 → 0.2.7

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 (3) hide show
  1. package/README.md +45 -19
  2. package/dist/index.js +4710 -3926
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -173,33 +173,38 @@ parallel protocol supply --history usdp # USDp circulating supply over ti
173
173
 
174
174
  ### `parallel swap`
175
175
 
176
- Build Parallelizer transactions (mint / burn / redeem).
176
+ Build Parallelizer transactions (mint / redeem / redeem-all).
177
177
 
178
178
  ```bash
179
179
  # Get a quote first
180
- parallel swap quote --op mint --collateral <symbol> --amount <n> --chain <chain>
181
- parallel swap quote --op burn --collateral <symbol> --amount <n> --chain <chain>
182
- parallel swap quote --op redeem --amount <n> --chain <chain>
180
+ parallel swap quote --op mint --collateral <symbol> --amount <n> --chain <chain>
181
+ parallel swap quote --op redeem --collateral <symbol> --amount <n> --chain <chain>
182
+ parallel swap quote --op redeem-all --amount <n> --chain <chain>
183
183
 
184
184
  # Dry-run (shows raw unsigned tx — no wallet needed)
185
- parallel swap mint --collateral <symbol> --amount <n> --chain <chain> --dry-run
186
- parallel swap burn --collateral <symbol> --amount <n> --chain <chain> --dry-run
187
- parallel swap redeem --amount <n> --chain <chain> --dry-run
185
+ parallel swap mint --collateral <symbol> --amount <n> --chain <chain> --dry-run
186
+ parallel swap redeem --collateral <symbol> --amount <n> --chain <chain> --dry-run
187
+ parallel swap redeem-all --amount <n> --chain <chain> --dry-run
188
188
 
189
189
  # Sign and broadcast
190
- parallel swap mint --collateral <symbol> --amount <n> --chain <chain> --wallet
191
- parallel swap burn --collateral <symbol> --amount <n> --chain <chain> --wallet
192
- parallel swap redeem --amount <n> --chain <chain> --wallet # proportional redeem
190
+ parallel swap mint --collateral <symbol> --amount <n> --chain <chain> --wallet
191
+ parallel swap redeem --collateral <symbol> --amount <n> --chain <chain> --wallet
192
+ parallel swap redeem-all --amount <n> --chain <chain> --wallet # proportional redeem
193
193
  ```
194
194
 
195
+ > Command names match the MCP tools since 0.2.7: `redeem` targets ONE
196
+ > collateral (formerly `burn`), `redeem-all` redeems proportionally across the
197
+ > whole basket (formerly `redeem`). The old `swap burn` keeps working as a
198
+ > hidden legacy command.
199
+
195
200
  **Options:**
196
201
 
197
202
  | Flag | Default | Description |
198
203
  |---|---|---|
199
- | `--op <mint\|burn\|redeem>` | | Operation (quote only) |
204
+ | `--op <mint\|redeem\|redeem-all>` | | Operation (quote only) |
200
205
  | `--collateral <symbol>` | | Collateral symbol (e.g. `USDC`, `USDS`, `sUSDS`) |
201
206
  | `--amount <n>` | | Amount in USDp (or collateral units for mint) |
202
- | `--slippage <pct>` | `0.5` | Slippage tolerance in % (`mint` / `burn` / `redeem`) |
207
+ | `--slippage <pct>` | `0.5` | Slippage tolerance in % (`mint` / `redeem` / `redeem-all`) |
203
208
  | `--address <0x...>` | | Receiver address for dry-run (no key needed) |
204
209
 
205
210
  ---
@@ -263,7 +268,8 @@ parallel staking cooldown <address> # cooldown status + expiry date
263
268
  parallel staking stake --type sprl1 --amount <n> --dry-run
264
269
  parallel staking unstake --type sprl1 --amount <n> --dry-run
265
270
  parallel staking stake --type sprl1 --amount <n> --wallet
266
- parallel staking unstake --type sprl1 --amount <n> --wallet
271
+ parallel staking unstake --type sprl1 --amount <n> --wallet # initiate cooldown
272
+ parallel staking unstake --type sprl1 --wallet # execute ready withdrawals
267
273
 
268
274
  # sPRL2 — Ethereum only (Balancer BPT, multi-step: Balancer → Aura)
269
275
  parallel staking stake --type sprl2 --amount <n> --dry-run # BPT path
@@ -306,6 +312,13 @@ parallel pay quota <address> [--chain <chain>]
306
312
  parallel pay verify <txHash> --chain <chain>
307
313
  ```
308
314
 
315
+ > **Note:** `confirmed: true` means the facilitator actually settled this hash as an x402 payment —
316
+ > not merely that the transaction is mined. The response also carries `x402Payment` and `txMined`
317
+ > separately: a mined transaction that is not an x402 payment returns
318
+ > `{ confirmed: false, x402Payment: false, txMined: true }`; an unknown hash returns all three
319
+ > `false`. Route, amount, token and recipient (`route`, `amount`, `tokenOut`, `paidTo`) are filled
320
+ > only for confirmed payments.
321
+
309
322
  #### `parallel pay prepare`
310
323
 
311
324
  Builds a signed or unsigned x402 payment payload.
@@ -380,7 +393,17 @@ JSON envelope:
380
393
 
381
394
  ```json
382
395
  { "success": true, "data": { ... } }
383
- { "success": false, "error": { "code": "CHAIN_SUNSET", "message": "..." } }
396
+ { "success": false, "error": { "code": "CHAIN_SUNSET", "message": "...", "hint": "..." } }
397
+ ```
398
+
399
+ **Streams and exit codes:** success envelopes are written to **stdout**; error envelopes are written
400
+ to **stderr**, and the process exits with code `1` (`0` on success). stdout carries data only — on a
401
+ failure it stays empty, so `parallel … --json | jq` prints nothing when the command errors. Read
402
+ errors from stderr or branch on the exit code (`hint` is optional):
403
+
404
+ ```bash
405
+ parallel protocol tvl --chain nope --json 2>err.json || jq -r '.error.code' err.json
406
+ # → UNKNOWN_CHAIN
384
407
  ```
385
408
 
386
409
  ---
@@ -389,7 +412,7 @@ JSON envelope:
389
412
 
390
413
  `ethereum` · `base` · `arbitrum` · `optimism` · `polygon` · `avalanche` · `bsc` · `scroll` · `gnosis` · `sei` · `berachain` · `hyperevm` · `unichain` · `ink` · `tac` · `mantle` · `linea` · `xlayer` · `fraxtal` · `worldchain` · `hemi` · `plume` · `plasma` · `katana`
391
414
 
392
- > `sonic` is sunset (PIP-64) — read operations work, write operations return `CHAIN_SUNSET`.
415
+ > `sonic` is sunset (PIP-64) — Parallelizer/Savings operations return `CHAIN_SUNSET`; USDp bridging and balance reads stay active.
393
416
 
394
417
  Not all chains support every feature. Use `parallel protocol chains` to see the full feature matrix (Parallelizer, sUSDp, bridge).
395
418
 
@@ -406,13 +429,16 @@ Not all chains support every feature. Use `parallel protocol chains` to see the
406
429
  | `COLLATERAL_NOT_SUPPORTED` | Collateral (or bridge token) not accepted on this chain |
407
430
  | `WALLET_REQUIRED` | Signing requested but no wallet available (`--wallet` unresolvable) |
408
431
  | `INVALID_KEYSTORE` | Keystore unreadable, invalid format, or wrong decryption password |
409
- | `INVALID_AMOUNT` | Negative, zero, or unparseable amount |
410
- | `MISSING_OPTION` | Required flag not provided |
432
+ | `INVALID_AMOUNT` | Negative, zero, malformed, or sub-decimal amount / duration / slippage |
433
+ | `MISSING_OPTION` | Required flag, argument, or subcommand not provided |
434
+ | `INVALID_OPTION` | A provided flag or argument has an invalid value |
435
+ | `UNKNOWN_COMMAND` / `UNKNOWN_OPTION` | Typo in a command or flag name |
411
436
  | `INVALID_ADDRESS` | Argument is not a valid EVM address |
412
- | `RPC_ERROR` | RPC call failed (network issue or node unreachable) |
437
+ | `CONFIG_KEY_NOT_FOUND` | `config get` on a key absent from the config file |
438
+ | `RPC_ERROR` | An HTTP provider (facilitator, history APIs) is unreachable |
413
439
  | `UNKNOWN` | Any other failure |
414
440
 
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.
441
+ Protocol-layer errors (caps, bridge limits, sunset chains, partial reads…) are surfaced with their own code in the `code` field since 0.2.7 — e.g. `EXCEEDS_CAP`, `EXCEEDS_BRIDGE_LIMIT`, `EXCEEDS_GLOBAL_LIMIT`, `CHAIN_SUNSET`, `ROUTE_UNAVAILABLE`, `PARTIAL_READ`, `PARALLELIZER_NOT_DEPLOYED`, `COLLATERAL_NOT_SUPPORTED`, `INSUFFICIENT_BALANCE`. Match on `error.code`; the message carries the human detail (remaining capacity, valid values…) without the code prefix.
416
442
 
417
443
  ---
418
444