@t2000/cli 0.37.2 → 0.39.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-P7SWDSUQ.js → dist-LJKS6IJU.js} +8 -8
- package/dist/{dist-P7SWDSUQ.js.map → dist-LJKS6IJU.js.map} +1 -1
- package/dist/{dist-4XKBULY7.js → dist-X2WIJABG.js} +2 -26
- package/dist/index.js +3 -3
- package/package.json +3 -3
- 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]);
|
|
@@ -138007,7 +138007,7 @@ ${context}
|
|
|
138007
138007
|
})
|
|
138008
138008
|
);
|
|
138009
138009
|
}
|
|
138010
|
-
var PKG_VERSION = "0.
|
|
138010
|
+
var PKG_VERSION = "0.39.0";
|
|
138011
138011
|
console.log = (...args) => console.error("[log]", ...args);
|
|
138012
138012
|
console.warn = (...args) => console.error("[warn]", ...args);
|
|
138013
138013
|
async function startMcpServer(opts) {
|
|
@@ -138097,4 +138097,4 @@ axios/dist/node/axios.cjs:
|
|
|
138097
138097
|
*)
|
|
138098
138098
|
*)
|
|
138099
138099
|
*/
|
|
138100
|
-
//# sourceMappingURL=dist-
|
|
138100
|
+
//# sourceMappingURL=dist-LJKS6IJU.js.map
|