@t2000/cli 0.17.14 → 0.17.15

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/dist/index.js CHANGED
@@ -323,6 +323,9 @@ function registerBalance(program2) {
323
323
  printSeparator();
324
324
  printKeyValue("Total", `${formatUsd2(bal.total)}`);
325
325
  }
326
+ if (bal.pendingRewards > 0.01) {
327
+ printKeyValue("Rewards", `${pc3.yellow(formatUsd2(bal.pendingRewards))} ${pc3.dim("(claimable \u2014 run claim-rewards)")}`);
328
+ }
326
329
  if (limits) {
327
330
  printBlank();
328
331
  printHeader("Limits");
@@ -1391,8 +1394,8 @@ function registerLock(program2) {
1391
1394
  if (!pin) {
1392
1395
  throw new Error("PIN required to unlock agent");
1393
1396
  }
1394
- const { T2000: T200026 } = await import("@t2000/sdk");
1395
- await T200026.create({ pin });
1397
+ const { T2000: T200027 } = await import("@t2000/sdk");
1398
+ await T200027.create({ pin });
1396
1399
  const enforcer = new SafeguardEnforcer2(CONFIG_DIR3);
1397
1400
  enforcer.load();
1398
1401
  enforcer.unlock();
@@ -1873,7 +1876,7 @@ function registerMcp(program2) {
1873
1876
  mcp.command("start", { isDefault: true }).description("Start MCP server (stdio transport)").option("--key <path>", "Key file path").action(async (opts) => {
1874
1877
  let mod;
1875
1878
  try {
1876
- mod = await import("./dist-S4OOC4XZ.js");
1879
+ mod = await import("./dist-3TGAP6PT.js");
1877
1880
  } catch {
1878
1881
  console.error(
1879
1882
  "MCP server not installed. Run:\n npm install -g @t2000/mcp"
@@ -2596,6 +2599,44 @@ function registerPortfolio(program2) {
2596
2599
  });
2597
2600
  }
2598
2601
 
2602
+ // src/commands/claimRewards.ts
2603
+ import pc15 from "picocolors";
2604
+ import { T2000 as T200026 } from "@t2000/sdk";
2605
+ function registerClaimRewards(program2) {
2606
+ program2.command("claim-rewards").description("Claim pending protocol rewards (vSUI, DEEP, SPRING_SUI)").option("--key <path>", "Key file path").action(async (opts) => {
2607
+ try {
2608
+ const pin = await resolvePin();
2609
+ const agent = await T200026.create({ pin, keyPath: opts.key });
2610
+ const result = await agent.claimRewards();
2611
+ if (isJsonMode()) {
2612
+ printJson(result);
2613
+ return;
2614
+ }
2615
+ printBlank();
2616
+ if (result.rewards.length === 0) {
2617
+ printLine(` ${pc15.dim("No rewards to claim")}`);
2618
+ printBlank();
2619
+ return;
2620
+ }
2621
+ printLine(` ${pc15.green("\u2713")} Claimed protocol rewards`);
2622
+ printSeparator();
2623
+ for (const reward of result.rewards) {
2624
+ printKeyValue(
2625
+ `${reward.symbol}`,
2626
+ `${pc15.dim(`from ${reward.protocol}`)}`
2627
+ );
2628
+ }
2629
+ printSeparator();
2630
+ if (result.tx) {
2631
+ printKeyValue("Tx", `https://suiscan.xyz/mainnet/tx/${result.tx}`);
2632
+ }
2633
+ printBlank();
2634
+ } catch (error) {
2635
+ handleError(error);
2636
+ }
2637
+ });
2638
+ }
2639
+
2599
2640
  // src/program.ts
2600
2641
  var require2 = createRequire(import.meta.url);
2601
2642
  var { version: CLI_VERSION } = require2("../package.json");
@@ -2634,6 +2675,7 @@ function createProgram() {
2634
2675
  registerContacts(program2);
2635
2676
  registerInvest(program2);
2636
2677
  registerPortfolio(program2);
2678
+ registerClaimRewards(program2);
2637
2679
  return program2;
2638
2680
  }
2639
2681