@parallel-protocol/cli 0.2.8 → 0.2.9
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 +2 -2
- package/dist/index.js +24 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -192,7 +192,7 @@ parallel swap redeem --collateral <symbol> --amount <n> --chain <chain> --wa
|
|
|
192
192
|
parallel swap redeem-all --amount <n> --chain <chain> --wallet # proportional redeem
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
> Command names match the MCP tools
|
|
195
|
+
> Command names match the MCP tools: `redeem` targets ONE
|
|
196
196
|
> collateral (formerly `burn`), `redeem-all` redeems proportionally across the
|
|
197
197
|
> whole basket (formerly `redeem`). The old `swap burn` keeps working as a
|
|
198
198
|
> hidden legacy command.
|
|
@@ -438,7 +438,7 @@ Not all chains support every feature. Use `parallel protocol chains` to see the
|
|
|
438
438
|
| `RPC_ERROR` | An HTTP provider (facilitator, history APIs) is unreachable |
|
|
439
439
|
| `UNKNOWN` | Any other failure |
|
|
440
440
|
|
|
441
|
-
Protocol-layer errors (caps, bridge limits, sunset chains, partial reads…) are surfaced with their own code in the `code` field
|
|
441
|
+
Protocol-layer errors (caps, bridge limits, sunset chains, partial reads…) are surfaced with their own code in the `code` field — 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.
|
|
442
442
|
|
|
443
443
|
---
|
|
444
444
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
|
-
import { Command,
|
|
3
|
+
import { Command, CommanderError } from 'commander';
|
|
4
4
|
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
5
5
|
import { join, dirname } from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
@@ -1635,7 +1635,7 @@ function suppressLogs() {
|
|
|
1635
1635
|
|
|
1636
1636
|
// package.json
|
|
1637
1637
|
var package_default = {
|
|
1638
|
-
version: "0.2.
|
|
1638
|
+
version: "0.2.9"};
|
|
1639
1639
|
function findEnvFile(dir) {
|
|
1640
1640
|
const candidate = join(dir, ".env");
|
|
1641
1641
|
if (existsSync(candidate)) return candidate;
|
|
@@ -11184,7 +11184,7 @@ async function renderSupplyHistory(token, opts) {
|
|
|
11184
11184
|
try {
|
|
11185
11185
|
if (token.toLowerCase() !== "usdp")
|
|
11186
11186
|
throw new CliError(
|
|
11187
|
-
ErrorCode.
|
|
11187
|
+
ErrorCode.INVALID_OPTION,
|
|
11188
11188
|
`supply --history is only available for usdp (got "${token}")`,
|
|
11189
11189
|
"Only USDp has a public historical supply source"
|
|
11190
11190
|
);
|
|
@@ -12802,8 +12802,8 @@ async function getStakingOverview() {
|
|
|
12802
12802
|
aprNote: "Base APR estimated from previous epoch rewards and token prices. Actual APR varies per user based on ParaBoost score. Same formula as app."
|
|
12803
12803
|
} : {
|
|
12804
12804
|
unavailableFields: {
|
|
12805
|
-
sprl1APR: "APR unavailable \u2014
|
|
12806
|
-
sprl2APR: "APR unavailable \u2014
|
|
12805
|
+
sprl1APR: "APR unavailable \u2014 the staking API returned no validated epoch data (unreachable, unauthorized, or no epoch settled yet).",
|
|
12806
|
+
sprl2APR: "APR unavailable \u2014 the staking API returned no validated epoch data (unreachable, unauthorized, or no epoch settled yet)."
|
|
12807
12807
|
}
|
|
12808
12808
|
}
|
|
12809
12809
|
};
|
|
@@ -12997,17 +12997,17 @@ async function getStakingInfo(userAddress) {
|
|
|
12997
12997
|
estimatedAPR: userAPR,
|
|
12998
12998
|
unavailableFields: {
|
|
12999
12999
|
...pendingRewards.sprl1Pending === null && {
|
|
13000
|
-
"sprl1.pendingRewards": "sPRL1 rewards are distributed via an off-chain Merkle distributor \u2014
|
|
13000
|
+
"sprl1.pendingRewards": "sPRL1 rewards are distributed via an off-chain Merkle distributor \u2014 the staking API returned no data for this field."
|
|
13001
13001
|
},
|
|
13002
13002
|
...pendingRewards.currentEpoch === null && {
|
|
13003
|
-
"sprl1.cooldown.epoch": "Current epoch unavailable \u2014
|
|
13003
|
+
"sprl1.cooldown.epoch": "Current epoch unavailable \u2014 the staking API returned no epoch data."
|
|
13004
13004
|
},
|
|
13005
13005
|
"sprl2.auraRewards": "BAL and AURA rewards from Aura Finance are automatically forwarded to the DAO treasury, not distributed to individual stakers.",
|
|
13006
13006
|
...pendingRewards.sprl2Pending === null && {
|
|
13007
|
-
"sprl2.protocolRewards": "Protocol rewards for sPRL2 are distributed via the same off-chain epoch-based Merkle distributor \u2014
|
|
13007
|
+
"sprl2.protocolRewards": "Protocol rewards for sPRL2 are distributed via the same off-chain epoch-based Merkle distributor \u2014 the staking API returned no data for this field."
|
|
13008
13008
|
},
|
|
13009
13009
|
...pendingRewards.paraboost === null && {
|
|
13010
|
-
"sprl2.paraboost": "Paraboost multiplier unavailable \u2014
|
|
13010
|
+
"sprl2.paraboost": "Paraboost multiplier unavailable \u2014 the staking API returned no data. Base multiplier is 2.5x; paraboost mechanics increase it over time."
|
|
13011
13011
|
},
|
|
13012
13012
|
...sprl2DelegationNotActive && {
|
|
13013
13013
|
"sprl2.votingPower": `Voting power is 0 despite having BPT staked. This address has not self-delegated. Call delegate(yourAddress) on the sPRL2 contract (${SPRL2_ADDRESS}) to activate on-chain voting power.`
|
|
@@ -13096,7 +13096,7 @@ async function getCooldownStatus(userAddress) {
|
|
|
13096
13096
|
address: userAddress,
|
|
13097
13097
|
unavailableFields: {
|
|
13098
13098
|
...epochMeta === null && {
|
|
13099
|
-
currentEpoch: "Current epoch unavailable \u2014
|
|
13099
|
+
currentEpoch: "Current epoch unavailable \u2014 the staking API returned no epoch data."
|
|
13100
13100
|
}
|
|
13101
13101
|
}
|
|
13102
13102
|
};
|
|
@@ -13298,7 +13298,7 @@ async function buildStakeSprl2Tx(amount, sender, wethAmount) {
|
|
|
13298
13298
|
const estimatedVotingPower = prlPer1Bpt !== null ? (parseFloat(amount) * prlPer1Bpt * userParaboost).toFixed(6) : null;
|
|
13299
13299
|
const unavailableFields = {};
|
|
13300
13300
|
if (estimatedAPR === null) {
|
|
13301
|
-
unavailableFields.estimatedAPR = "Failed to reach
|
|
13301
|
+
unavailableFields.estimatedAPR = "Failed to reach the staking API \u2014 APR unavailable.";
|
|
13302
13302
|
}
|
|
13303
13303
|
const { simulation: simResult, warnings: simWarnings } = toSimFields(
|
|
13304
13304
|
simulation,
|
|
@@ -15360,7 +15360,7 @@ function swapCommand() {
|
|
|
15360
15360
|
|
|
15361
15361
|
// ../mcp-server/package.json
|
|
15362
15362
|
var package_default2 = {
|
|
15363
|
-
version: "1.1.
|
|
15363
|
+
version: "1.1.1"};
|
|
15364
15364
|
|
|
15365
15365
|
// src/commands/version.ts
|
|
15366
15366
|
function versionCommand() {
|
|
@@ -15398,7 +15398,7 @@ var program = new Command();
|
|
|
15398
15398
|
program.name("parallel").description("Parallel Protocol CLI").version(package_default.version).option("-c, --chain <chain>", "target chain (e.g. base, ethereum)").option("-j, --json", "force JSON output").option("--dry-run", "build transaction without broadcasting").option(
|
|
15399
15399
|
"-w, --wallet [path|env]",
|
|
15400
15400
|
"keystore path, 'env', or alone to auto-resolve from config/env"
|
|
15401
|
-
).option("-v, --verbose", "verbose logs").option("--no-cache", "bypass TTL cache, force fresh RPC call").
|
|
15401
|
+
).option("-v, --verbose", "verbose logs").option("--no-cache", "bypass TTL cache, force fresh RPC call").hook("preAction", (thisCommand) => {
|
|
15402
15402
|
const opts = thisCommand.opts();
|
|
15403
15403
|
if (opts.json) process.env._PARALLEL_JSON_FLAG = "1";
|
|
15404
15404
|
});
|
|
@@ -15444,7 +15444,17 @@ try {
|
|
|
15444
15444
|
process.exitCode = 0;
|
|
15445
15445
|
} else {
|
|
15446
15446
|
if (isJsonMode()) {
|
|
15447
|
-
const invoked =
|
|
15447
|
+
const invoked = [];
|
|
15448
|
+
let node = program;
|
|
15449
|
+
for (const token of process.argv.slice(2)) {
|
|
15450
|
+
if (token.startsWith("-")) break;
|
|
15451
|
+
const child = node.commands.find(
|
|
15452
|
+
(c) => c.name() === token || c.aliases().includes(token)
|
|
15453
|
+
);
|
|
15454
|
+
if (!child) break;
|
|
15455
|
+
invoked.push(token);
|
|
15456
|
+
node = child;
|
|
15457
|
+
}
|
|
15448
15458
|
const message = err.code === "commander.help" ? `Missing subcommand for 'parallel ${invoked.join(" ")}'` : err.message.replace(/^error:\s*/, "");
|
|
15449
15459
|
console.error(
|
|
15450
15460
|
JSON.stringify(
|