@t2000/cli 0.38.0 → 0.40.0
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/{chunk-J7X23P3A.js → chunk-4YV63VD3.js} +11 -205
- package/dist/chunk-4YV63VD3.js.map +1 -0
- package/dist/{dist-CEF2K35K.js → dist-NPNSPZLJ.js} +11 -52
- package/dist/{dist-CEF2K35K.js.map → dist-NPNSPZLJ.js.map} +1 -1
- package/dist/{dist-4XKBULY7.js → dist-X2WIJABG.js} +2 -26
- package/dist/index.js +3 -3
- package/package.json +4 -4
- package/dist/chunk-J7X23P3A.js.map +0 -1
- /package/dist/{dist-4XKBULY7.js.map → dist-X2WIJABG.js.map} +0 -0
|
@@ -136393,7 +136393,7 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
136393
136393
|
async compoundRewards(options = {}) {
|
|
136394
136394
|
this.enforcer.assertNotLocked();
|
|
136395
136395
|
const minValue = options.minValueUsd ?? 0.1;
|
|
136396
|
-
const
|
|
136396
|
+
const USDC_TYPE2 = SUPPORTED_ASSETS.USDC.type;
|
|
136397
136397
|
const USDC_DEC = SUPPORTED_ASSETS.USDC.decimals;
|
|
136398
136398
|
const pending = await this.getPendingRewards();
|
|
136399
136399
|
const nonTrivial = pending.filter((r) => r.amount > 0);
|
|
@@ -136420,7 +136420,7 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
136420
136420
|
totalGasCost: 0
|
|
136421
136421
|
};
|
|
136422
136422
|
}
|
|
136423
|
-
const preUsdcCoins = await this._fetchCoins(
|
|
136423
|
+
const preUsdcCoins = await this._fetchCoins(USDC_TYPE2);
|
|
136424
136424
|
const preUsdcRaw = preUsdcCoins.reduce((s, c) => s + BigInt(c.balance), 0n);
|
|
136425
136425
|
const claimResult = await this.claimRewards();
|
|
136426
136426
|
if (!claimResult.tx) {
|
|
@@ -136439,7 +136439,7 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
136439
136439
|
let totalGasCost = claimResult.gasCost;
|
|
136440
136440
|
for (const reward of nonTrivial) {
|
|
136441
136441
|
if (!reward.coinType) continue;
|
|
136442
|
-
if (reward.coinType ===
|
|
136442
|
+
if (reward.coinType === USDC_TYPE2) continue;
|
|
136443
136443
|
try {
|
|
136444
136444
|
const decimals2 = getDecimalsForCoinType(reward.coinType) ?? 9;
|
|
136445
136445
|
const rawAmount = BigInt(Math.floor(reward.amount * 10 ** decimals2));
|
|
@@ -136449,7 +136449,7 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
136449
136449
|
const route = await findSwapRoute2({
|
|
136450
136450
|
walletAddress: this._address,
|
|
136451
136451
|
from: reward.coinType,
|
|
136452
|
-
to:
|
|
136452
|
+
to: USDC_TYPE2,
|
|
136453
136453
|
amount: rawAmount,
|
|
136454
136454
|
byAmountIn: true
|
|
136455
136455
|
});
|
|
@@ -136477,7 +136477,7 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
136477
136477
|
console.warn(`[compound] Failed to swap ${reward.symbol}:`, err instanceof Error ? err.message : err);
|
|
136478
136478
|
}
|
|
136479
136479
|
}
|
|
136480
|
-
const postUsdcCoins = await this._fetchCoins(
|
|
136480
|
+
const postUsdcCoins = await this._fetchCoins(USDC_TYPE2);
|
|
136481
136481
|
const postUsdcRaw = postUsdcCoins.reduce((s, c) => s + BigInt(c.balance), 0n);
|
|
136482
136482
|
const gainedRaw = postUsdcRaw > preUsdcRaw ? postUsdcRaw - preUsdcRaw : 0n;
|
|
136483
136483
|
const depositUsdc = Number(gainedRaw) / 10 ** USDC_DEC;
|
|
@@ -136488,7 +136488,7 @@ var T2000 = class _T2000 extends import_index2.default {
|
|
|
136488
136488
|
const depositResult = await executeWithGas(this.client, this._signer, async () => {
|
|
136489
136489
|
const tx = new Transaction();
|
|
136490
136490
|
tx.setSender(this._address);
|
|
136491
|
-
const coins = await this._fetchCoins(
|
|
136491
|
+
const coins = await this._fetchCoins(USDC_TYPE2);
|
|
136492
136492
|
if (coins.length === 0) throw new T2000Error("INSUFFICIENT_BALANCE", "No USDC coins after swap");
|
|
136493
136493
|
const merged = this._mergeCoinsInTx(tx, coins);
|
|
136494
136494
|
const [inputCoin] = tx.splitCoins(merged, [gainedRaw]);
|
|
@@ -136695,7 +136695,7 @@ function errorResult(err) {
|
|
|
136695
136695
|
function registerReadTools(server, agent) {
|
|
136696
136696
|
server.tool(
|
|
136697
136697
|
"t2000_overview",
|
|
136698
|
-
"Complete account snapshot in ONE call \u2014 balance, savings positions, health factor, yield earnings, fund status, and pending rewards. Use this for
|
|
136698
|
+
"Complete account snapshot in ONE call \u2014 balance, savings positions, health factor, yield earnings, fund status, and pending rewards. Use this for general account questions or any time you need the full picture. Prefer this over calling individual tools.",
|
|
136699
136699
|
{},
|
|
136700
136700
|
async () => {
|
|
136701
136701
|
try {
|
|
@@ -137537,47 +137537,6 @@ ${context}
|
|
|
137537
137537
|
}]
|
|
137538
137538
|
})
|
|
137539
137539
|
);
|
|
137540
|
-
server.prompt(
|
|
137541
|
-
"morning-briefing",
|
|
137542
|
-
"Daily financial snapshot \u2014 balance changes, yield earned, savings performance, health warnings.",
|
|
137543
|
-
async () => ({
|
|
137544
|
-
messages: [{
|
|
137545
|
-
role: "user",
|
|
137546
|
-
content: {
|
|
137547
|
-
type: "text",
|
|
137548
|
-
text: [
|
|
137549
|
-
"You are a personal financial briefing assistant for a t2000 AI agent bank account on Sui.",
|
|
137550
|
-
"",
|
|
137551
|
-
"IMPORTANT: Call t2000_overview FIRST \u2014 it returns balance, positions, health, earnings, fund status, and pending rewards in one call.",
|
|
137552
|
-
"Optionally call t2000_all_rates to compare USDC APYs across protocols.",
|
|
137553
|
-
"",
|
|
137554
|
-
"Present everything as a single structured briefing. NEVER ask follow-up questions before presenting the briefing.",
|
|
137555
|
-
"",
|
|
137556
|
-
"\u2600\uFE0F MORNING BRIEFING",
|
|
137557
|
-
"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
137558
|
-
"",
|
|
137559
|
-
"Show a compact account summary table:",
|
|
137560
|
-
" Checking $XX.XX",
|
|
137561
|
-
" Savings $XX.XX \xB7 X.XX% APY",
|
|
137562
|
-
" Credit -$XX.XX (only if borrowed)",
|
|
137563
|
-
" Net Worth $XX.XX",
|
|
137564
|
-
"",
|
|
137565
|
-
"If there are savings positions, show daily yield earned.",
|
|
137566
|
-
"If pending rewards exist, mention them.",
|
|
137567
|
-
"",
|
|
137568
|
-
"\u{1F4CB} Action Items (max 4, only if applicable):",
|
|
137569
|
-
" - Idle funds in checking \u2192 suggest saving",
|
|
137570
|
-
" - Outstanding debt \u2192 suggest repaying to stop interest",
|
|
137571
|
-
" - Better USDC yield elsewhere \u2192 note APY gap; suggest reviewing savings placement",
|
|
137572
|
-
" - Claimable rewards \u2192 suggest claiming",
|
|
137573
|
-
" - Low health factor \u2192 warn about liquidation risk",
|
|
137574
|
-
"",
|
|
137575
|
-
"If everything is optimized, say so. Keep it scannable \u2014 numbers first, narrative second."
|
|
137576
|
-
].join("\n")
|
|
137577
|
-
}
|
|
137578
|
-
}]
|
|
137579
|
-
})
|
|
137580
|
-
);
|
|
137581
137540
|
server.prompt(
|
|
137582
137541
|
"what-if",
|
|
137583
137542
|
'Scenario planning \u2014 "What if I save $X?" or "What if I borrow $X?" Shows projected impact on yield and risk.',
|
|
@@ -137849,7 +137808,7 @@ ${context}
|
|
|
137849
137808
|
"",
|
|
137850
137809
|
"IF they already have savings:",
|
|
137851
137810
|
` "Looks like you're already set up! Here's your quick status:"`,
|
|
137852
|
-
" Show a mini
|
|
137811
|
+
" Show a mini summary (balance + savings + APY), then offer to optimize",
|
|
137853
137812
|
"",
|
|
137854
137813
|
'End with: "What would you like to do first?"',
|
|
137855
137814
|
"",
|
|
@@ -137997,7 +137956,7 @@ ${context}
|
|
|
137997
137956
|
" \u2192 Offer to save it all now: t2000_save",
|
|
137998
137957
|
"",
|
|
137999
137958
|
"If they need regular deposits:",
|
|
138000
|
-
" \u2192 Suggest a
|
|
137959
|
+
" \u2192 Suggest a manual rhythm (weekly / monthly) the user can run themselves",
|
|
138001
137960
|
" \u2192 Show how yield accelerates the goal",
|
|
138002
137961
|
"",
|
|
138003
137962
|
"End with a clear YES/NO on whether the goal is achievable in the timeline."
|
|
@@ -138007,7 +137966,7 @@ ${context}
|
|
|
138007
137966
|
})
|
|
138008
137967
|
);
|
|
138009
137968
|
}
|
|
138010
|
-
var PKG_VERSION = "0.
|
|
137969
|
+
var PKG_VERSION = "0.40.0";
|
|
138011
137970
|
console.log = (...args) => console.error("[log]", ...args);
|
|
138012
137971
|
console.warn = (...args) => console.error("[warn]", ...args);
|
|
138013
137972
|
async function startMcpServer(opts) {
|
|
@@ -138097,4 +138056,4 @@ axios/dist/node/axios.cjs:
|
|
|
138097
138056
|
*)
|
|
138098
138057
|
*)
|
|
138099
138058
|
*/
|
|
138100
|
-
//# sourceMappingURL=dist-
|
|
138059
|
+
//# sourceMappingURL=dist-NPNSPZLJ.js.map
|