@t2000/cli 0.17.17 → 0.17.19
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,8 +323,12 @@ function registerBalance(program2) {
|
|
|
323
323
|
printSeparator();
|
|
324
324
|
printKeyValue("Total", `${formatUsd2(bal.total)}`);
|
|
325
325
|
}
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
try {
|
|
327
|
+
const pending = await agent.getPendingRewards();
|
|
328
|
+
if (pending.length > 0) {
|
|
329
|
+
printKeyValue("Rewards", `${pc3.yellow("claimable")} ${pc3.dim("(run claim-rewards)")}`);
|
|
330
|
+
}
|
|
331
|
+
} catch {
|
|
328
332
|
}
|
|
329
333
|
if (limits) {
|
|
330
334
|
printBlank();
|
|
@@ -774,7 +778,7 @@ function registerPositions(program2) {
|
|
|
774
778
|
printKeyValue("Total", formatUsd8(totalSaved));
|
|
775
779
|
}
|
|
776
780
|
if (hasRewards) {
|
|
777
|
-
printLine(` ${pc6.dim("Run claim-rewards to collect
|
|
781
|
+
printLine(` ${pc6.dim("Run claim-rewards to collect and convert to USDC")}`);
|
|
778
782
|
}
|
|
779
783
|
printBlank();
|
|
780
784
|
}
|
|
@@ -1890,7 +1894,7 @@ function registerMcp(program2) {
|
|
|
1890
1894
|
mcp.command("start", { isDefault: true }).description("Start MCP server (stdio transport)").option("--key <path>", "Key file path").action(async (opts) => {
|
|
1891
1895
|
let mod;
|
|
1892
1896
|
try {
|
|
1893
|
-
mod = await import("./dist-
|
|
1897
|
+
mod = await import("./dist-F6YRISIO.js");
|
|
1894
1898
|
} catch {
|
|
1895
1899
|
console.error(
|
|
1896
1900
|
"MCP server not installed. Run:\n npm install -g @t2000/mcp"
|
|
@@ -2626,7 +2630,7 @@ function registerPortfolio(program2) {
|
|
|
2626
2630
|
|
|
2627
2631
|
// src/commands/claimRewards.ts
|
|
2628
2632
|
import pc15 from "picocolors";
|
|
2629
|
-
import { T2000 as T200026 } from "@t2000/sdk";
|
|
2633
|
+
import { T2000 as T200026, formatUsd as formatUsd17 } from "@t2000/sdk";
|
|
2630
2634
|
function registerClaimRewards(program2) {
|
|
2631
2635
|
program2.command("claim-rewards").description("Claim pending protocol rewards").option("--key <path>", "Key file path").action(async (opts) => {
|
|
2632
2636
|
try {
|
|
@@ -2644,8 +2648,17 @@ function registerClaimRewards(program2) {
|
|
|
2644
2648
|
return;
|
|
2645
2649
|
}
|
|
2646
2650
|
const protocols = [...new Set(result.rewards.map((r) => r.protocol))];
|
|
2647
|
-
printLine(` ${pc15.green("\u2713")} Claimed rewards
|
|
2651
|
+
printLine(` ${pc15.green("\u2713")} Claimed and converted rewards to USDC`);
|
|
2648
2652
|
printSeparator();
|
|
2653
|
+
const received = result.usdcReceived;
|
|
2654
|
+
if (received >= 0.01) {
|
|
2655
|
+
printKeyValue("Received", `${pc15.green(formatUsd17(received))} USDC`);
|
|
2656
|
+
} else if (received > 0) {
|
|
2657
|
+
printKeyValue("Received", `${pc15.green("< $0.01")} USDC`);
|
|
2658
|
+
} else {
|
|
2659
|
+
printKeyValue("Received", `${pc15.dim("< $0.01 USDC (rewards are still accruing)")}`);
|
|
2660
|
+
}
|
|
2661
|
+
printKeyValue("Source", protocols.join(", "));
|
|
2649
2662
|
if (result.tx) {
|
|
2650
2663
|
printKeyValue("Tx", `https://suiscan.xyz/mainnet/tx/${result.tx}`);
|
|
2651
2664
|
}
|