@parallel-protocol/cli 0.2.8 → 0.2.10

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 +4 -4
  2. package/dist/index.js +25 -33
  3. 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 since 0.2.7: `redeem` targets ONE
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.
@@ -251,7 +251,7 @@ parallel bridge status <txHash> --from <chain>
251
251
  parallel bridge history <address> [--limit <n>] [--offset <n>] # past transfers (default: 20)
252
252
  ```
253
253
 
254
- > **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.
254
+ > **Note:** only `usdp` can be bridged for now (`--token` defaults to it; other values are rejected). Every supported chain can bridge.
255
255
 
256
256
  ---
257
257
 
@@ -410,7 +410,7 @@ parallel protocol tvl --chain nope --json 2>err.json || jq -r '.error.code' err.
410
410
 
411
411
  ## Supported chains
412
412
 
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`
413
+ `ethereum` · `base` · `arbitrum` · `optimism` · `polygon` · `avalanche` · `bsc` · `scroll` · `gnosis` · `sei` · `berachain` · `hyperevm` · `unichain` · `ink` · `tac` · `linea` · `xlayer` · `fraxtal` · `worldchain` · `hemi` · `plume` · `plasma` · `katana`
414
414
 
415
415
  > `sonic` is sunset (PIP-64) — Parallelizer/Savings operations return `CHAIN_SUNSET`; USDp bridging and balance reads stay active.
416
416
 
@@ -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 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.
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,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { AsyncLocalStorage } from 'async_hooks';
3
- import { Command, Option, CommanderError } from 'commander';
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';
7
7
  import { config } from 'dotenv';
8
- import { hyperEvm, hemi, katana, plasma, plume, worldchain, fraxtal, xLayer, linea, mantle, sonic, tac, ink, unichain, berachain, sei, gnosis, scroll, bsc, avalanche, polygon, optimism, arbitrum, base, mainnet } from 'viem/chains';
8
+ import { hyperEvm, hemi, katana, plasma, plume, worldchain, fraxtal, xLayer, linea, sonic, tac, ink, unichain, berachain, sei, gnosis, scroll, bsc, avalanche, polygon, optimism, arbitrum, base, mainnet } from 'viem/chains';
9
9
  import { z } from 'zod';
10
10
  import { keccak256, toHex, isAddress, zeroAddress, parseUnits, isHex, formatUnits, encodeFunctionData, formatEther, createPublicClient, http, createWalletClient, getContract, encodeAbiParameters, concat, hashTypedData, BaseError, ContractFunctionRevertedError, ContractFunctionZeroDataError, custom } from 'viem';
11
11
  import { createEnv } from '@t3-oss/env-core';
@@ -1635,7 +1635,7 @@ function suppressLogs() {
1635
1635
 
1636
1636
  // package.json
1637
1637
  var package_default = {
1638
- version: "0.2.8"};
1638
+ version: "0.2.10"};
1639
1639
  function findEnvFile(dir) {
1640
1640
  const candidate = join(dir, ".env");
1641
1641
  if (existsSync(candidate)) return candidate;
@@ -1683,7 +1683,6 @@ var ChainEnum = z.enum([
1683
1683
  "ink",
1684
1684
  "tac",
1685
1685
  "sonic",
1686
- "mantle",
1687
1686
  "linea",
1688
1687
  "xlayer",
1689
1688
  "fraxtal",
@@ -1897,16 +1896,6 @@ var CHAINS_STATIC = {
1897
1896
  harvester: "0x120805265fA944834DC6e930De2995768806a9d2"
1898
1897
  }
1899
1898
  },
1900
- mantle: {
1901
- viem: mantle,
1902
- status: "active",
1903
- lzEid: 30181,
1904
- contracts: {
1905
- accessManager: "0xfD28f108e95f4D41daAE9dbfFf707D677985998E",
1906
- usdp: "0x9eE1963f05553eF838604Dd39403be21ceF26AA4",
1907
- flashParallel: "0x9e0DCF7a33bBde6689560C5c807dd2a3dF991277"
1908
- }
1909
- },
1910
1899
  linea: {
1911
1900
  viem: linea,
1912
1901
  status: "active",
@@ -2074,7 +2063,6 @@ var VIEM_CHAINS = {
2074
2063
  ink: ink2,
2075
2064
  tac: tac,
2076
2065
  sonic: sonic,
2077
- mantle: mantle,
2078
2066
  linea: linea,
2079
2067
  xlayer: xLayer,
2080
2068
  fraxtal: fraxtal,
@@ -2179,12 +2167,6 @@ var RPC_CONFIG = {
2179
2167
  publicNode: "https://sonic-rpc.publicnode.com",
2180
2168
  drpc: "https://sonic.drpc.org"
2181
2169
  },
2182
- mantle: {
2183
- public: mantle.rpcUrls.default.http[0],
2184
- ankr: "https://rpc.ankr.com/mantle",
2185
- publicNode: "https://mantle-rpc.publicnode.com",
2186
- drpc: "https://mantle.drpc.org"
2187
- },
2188
2170
  linea: {
2189
2171
  public: linea.rpcUrls.default.http[0],
2190
2172
  alchemy: "linea-mainnet",
@@ -11184,7 +11166,7 @@ async function renderSupplyHistory(token, opts) {
11184
11166
  try {
11185
11167
  if (token.toLowerCase() !== "usdp")
11186
11168
  throw new CliError(
11187
- ErrorCode.UNKNOWN,
11169
+ ErrorCode.INVALID_OPTION,
11188
11170
  `supply --history is only available for usdp (got "${token}")`,
11189
11171
  "Only USDp has a public historical supply source"
11190
11172
  );
@@ -12802,8 +12784,8 @@ async function getStakingOverview() {
12802
12784
  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
12785
  } : {
12804
12786
  unavailableFields: {
12805
- sprl1APR: "APR unavailable \u2014 STAKE_API_URL not configured.",
12806
- sprl2APR: "APR unavailable \u2014 STAKE_API_URL not configured."
12787
+ sprl1APR: "APR unavailable \u2014 the staking API returned no validated epoch data (unreachable, unauthorized, or no epoch settled yet).",
12788
+ sprl2APR: "APR unavailable \u2014 the staking API returned no validated epoch data (unreachable, unauthorized, or no epoch settled yet)."
12807
12789
  }
12808
12790
  }
12809
12791
  };
@@ -12997,17 +12979,17 @@ async function getStakingInfo(userAddress) {
12997
12979
  estimatedAPR: userAPR,
12998
12980
  unavailableFields: {
12999
12981
  ...pendingRewards.sprl1Pending === null && {
13000
- "sprl1.pendingRewards": "sPRL1 rewards are distributed via an off-chain Merkle distributor \u2014 configure STAKE_API_URL and GOLDSKY_SUBGRAPH_URL to enable."
12982
+ "sprl1.pendingRewards": "sPRL1 rewards are distributed via an off-chain Merkle distributor \u2014 the staking API returned no data for this field."
13001
12983
  },
13002
12984
  ...pendingRewards.currentEpoch === null && {
13003
- "sprl1.cooldown.epoch": "Current epoch unavailable \u2014 configure STAKE_API_URL to enable."
12985
+ "sprl1.cooldown.epoch": "Current epoch unavailable \u2014 the staking API returned no epoch data."
13004
12986
  },
13005
12987
  "sprl2.auraRewards": "BAL and AURA rewards from Aura Finance are automatically forwarded to the DAO treasury, not distributed to individual stakers.",
13006
12988
  ...pendingRewards.sprl2Pending === null && {
13007
- "sprl2.protocolRewards": "Protocol rewards for sPRL2 are distributed via the same off-chain epoch-based Merkle distributor \u2014 configure STAKE_API_URL and GOLDSKY_SUBGRAPH_URL to enable."
12989
+ "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
12990
  },
13009
12991
  ...pendingRewards.paraboost === null && {
13010
- "sprl2.paraboost": "Paraboost multiplier unavailable \u2014 configure STAKE_API_URL to enable. Base multiplier is 2.5x; paraboost mechanics increase it over time."
12992
+ "sprl2.paraboost": "Paraboost multiplier unavailable \u2014 the staking API returned no data. Base multiplier is 2.5x; paraboost mechanics increase it over time."
13011
12993
  },
13012
12994
  ...sprl2DelegationNotActive && {
13013
12995
  "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 +13078,7 @@ async function getCooldownStatus(userAddress) {
13096
13078
  address: userAddress,
13097
13079
  unavailableFields: {
13098
13080
  ...epochMeta === null && {
13099
- currentEpoch: "Current epoch unavailable \u2014 configure STAKE_API_URL to enable."
13081
+ currentEpoch: "Current epoch unavailable \u2014 the staking API returned no epoch data."
13100
13082
  }
13101
13083
  }
13102
13084
  };
@@ -13298,7 +13280,7 @@ async function buildStakeSprl2Tx(amount, sender, wethAmount) {
13298
13280
  const estimatedVotingPower = prlPer1Bpt !== null ? (parseFloat(amount) * prlPer1Bpt * userParaboost).toFixed(6) : null;
13299
13281
  const unavailableFields = {};
13300
13282
  if (estimatedAPR === null) {
13301
- unavailableFields.estimatedAPR = "Failed to reach APR API \u2014 configure STAKE_API_URL to enable.";
13283
+ unavailableFields.estimatedAPR = "Failed to reach the staking API \u2014 APR unavailable.";
13302
13284
  }
13303
13285
  const { simulation: simResult, warnings: simWarnings } = toSimFields(
13304
13286
  simulation,
@@ -15360,7 +15342,7 @@ function swapCommand() {
15360
15342
 
15361
15343
  // ../mcp-server/package.json
15362
15344
  var package_default2 = {
15363
- version: "1.1.0"};
15345
+ version: "1.2.0"};
15364
15346
 
15365
15347
  // src/commands/version.ts
15366
15348
  function versionCommand() {
@@ -15398,7 +15380,7 @@ var program = new Command();
15398
15380
  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
15381
  "-w, --wallet [path|env]",
15400
15382
  "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").addOption(new Option("--rpc <url>", "(not implemented)").hideHelp()).addOption(new Option("--gas-limit <n>", "(not implemented)").hideHelp()).hook("preAction", (thisCommand) => {
15383
+ ).option("-v, --verbose", "verbose logs").option("--no-cache", "bypass TTL cache, force fresh RPC call").hook("preAction", (thisCommand) => {
15402
15384
  const opts = thisCommand.opts();
15403
15385
  if (opts.json) process.env._PARALLEL_JSON_FLAG = "1";
15404
15386
  });
@@ -15444,7 +15426,17 @@ try {
15444
15426
  process.exitCode = 0;
15445
15427
  } else {
15446
15428
  if (isJsonMode()) {
15447
- const invoked = process.argv.slice(2).filter((a) => !a.startsWith("-"));
15429
+ const invoked = [];
15430
+ let node = program;
15431
+ for (const token of process.argv.slice(2)) {
15432
+ if (token.startsWith("-")) break;
15433
+ const child = node.commands.find(
15434
+ (c) => c.name() === token || c.aliases().includes(token)
15435
+ );
15436
+ if (!child) break;
15437
+ invoked.push(token);
15438
+ node = child;
15439
+ }
15448
15440
  const message = err.code === "commander.help" ? `Missing subcommand for 'parallel ${invoked.join(" ")}'` : err.message.replace(/^error:\s*/, "");
15449
15441
  console.error(
15450
15442
  JSON.stringify(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallel-protocol/cli",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [