@t2000/cli 0.25.16 → 0.26.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-DNBWOMKV.js → chunk-FSE25UF3.js} +70 -56
- package/dist/{chunk-DNBWOMKV.js.map → chunk-FSE25UF3.js.map} +1 -1
- package/dist/{dist-ZHHT2ROZ.js → dist-AY4QEDAC.js} +8 -10
- package/dist/{dist-ZHHT2ROZ.js.map → dist-AY4QEDAC.js.map} +1 -1
- package/dist/{dist-JZ5RZWFT.js → dist-ZKTRDHRL.js} +16 -2
- package/dist/index.js +9 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- /package/dist/{dist-JZ5RZWFT.js.map → dist-ZKTRDHRL.js.map} +0 -0
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
DEFAULT_SAFEGUARD_CONFIG,
|
|
11
11
|
ETH_TYPE,
|
|
12
12
|
GAS_RESERVE_MIN,
|
|
13
|
+
IKA_TYPE,
|
|
13
14
|
KeypairSigner,
|
|
15
|
+
LOFI_TYPE,
|
|
16
|
+
MANIFEST_TYPE,
|
|
14
17
|
MIST_PER_SUI,
|
|
15
18
|
NAVX_TYPE,
|
|
16
19
|
NaviAdapter,
|
|
@@ -57,7 +60,11 @@ import {
|
|
|
57
60
|
getGasStatus,
|
|
58
61
|
getRates,
|
|
59
62
|
getSwapQuote,
|
|
63
|
+
getTier,
|
|
60
64
|
getVoloStats,
|
|
65
|
+
isSupported,
|
|
66
|
+
isTier1,
|
|
67
|
+
isTier2,
|
|
61
68
|
keypairFromPrivateKey,
|
|
62
69
|
loadKey,
|
|
63
70
|
mapMoveAbortCode,
|
|
@@ -79,7 +86,7 @@ import {
|
|
|
79
86
|
usdcToRaw,
|
|
80
87
|
validateAddress,
|
|
81
88
|
walletExists
|
|
82
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-FSE25UF3.js";
|
|
83
90
|
import "./chunk-V7PXDEKG.js";
|
|
84
91
|
import "./chunk-Q2LY5BHK.js";
|
|
85
92
|
import "./chunk-3XUF7GM3.js";
|
|
@@ -95,7 +102,10 @@ export {
|
|
|
95
102
|
DEFAULT_SAFEGUARD_CONFIG,
|
|
96
103
|
ETH_TYPE,
|
|
97
104
|
GAS_RESERVE_MIN,
|
|
105
|
+
IKA_TYPE,
|
|
98
106
|
KeypairSigner,
|
|
107
|
+
LOFI_TYPE,
|
|
108
|
+
MANIFEST_TYPE,
|
|
99
109
|
MIST_PER_SUI,
|
|
100
110
|
NAVX_TYPE,
|
|
101
111
|
NaviAdapter,
|
|
@@ -142,7 +152,11 @@ export {
|
|
|
142
152
|
getGasStatus,
|
|
143
153
|
getRates,
|
|
144
154
|
getSwapQuote,
|
|
155
|
+
getTier,
|
|
145
156
|
getVoloStats,
|
|
157
|
+
isSupported,
|
|
158
|
+
isTier1,
|
|
159
|
+
isTier2,
|
|
146
160
|
keypairFromPrivateKey,
|
|
147
161
|
loadKey,
|
|
148
162
|
mapMoveAbortCode,
|
|
@@ -165,4 +179,4 @@ export {
|
|
|
165
179
|
validateAddress,
|
|
166
180
|
walletExists
|
|
167
181
|
};
|
|
168
|
-
//# sourceMappingURL=dist-
|
|
182
|
+
//# sourceMappingURL=dist-ZKTRDHRL.js.map
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
saveKey,
|
|
18
18
|
truncateAddress,
|
|
19
19
|
walletExists
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FSE25UF3.js";
|
|
21
21
|
import "./chunk-V7PXDEKG.js";
|
|
22
22
|
import "./chunk-Q2LY5BHK.js";
|
|
23
23
|
import "./chunk-3XUF7GM3.js";
|
|
@@ -4090,14 +4090,13 @@ function registerSave(program3) {
|
|
|
4090
4090
|
if (amount !== "all" && (isNaN(amount) || amount <= 0)) {
|
|
4091
4091
|
throw new Error('Amount must be a positive number or "all"');
|
|
4092
4092
|
}
|
|
4093
|
-
const asset = opts.asset?.toUpperCase() ?? "USDC";
|
|
4094
4093
|
const pin = await resolvePin();
|
|
4095
4094
|
const agent = await T2000.create({ pin, keyPath: opts.key });
|
|
4096
4095
|
let gasManagerUsdc = 0;
|
|
4097
4096
|
agent.on("gasAutoTopUp", (data) => {
|
|
4098
4097
|
gasManagerUsdc = data.usdcSpent;
|
|
4099
4098
|
});
|
|
4100
|
-
const result = await agent.save({ amount,
|
|
4099
|
+
const result = await agent.save({ amount, protocol: opts.protocol });
|
|
4101
4100
|
if (isJsonMode()) {
|
|
4102
4101
|
printJson(result);
|
|
4103
4102
|
return;
|
|
@@ -4107,21 +4106,21 @@ function registerSave(program3) {
|
|
|
4107
4106
|
printSuccess(`Gas manager: ${import_picocolors5.default.yellow(formatUsd(gasManagerUsdc))} USDC \u2192 SUI`);
|
|
4108
4107
|
}
|
|
4109
4108
|
const protocolName = opts.protocol ?? "best rate";
|
|
4110
|
-
printSuccess(`Saved ${import_picocolors5.default.yellow(formatUsd(result.amount))}
|
|
4109
|
+
printSuccess(`Saved ${import_picocolors5.default.yellow(formatUsd(result.amount))} USDC to ${protocolName}`);
|
|
4111
4110
|
if (result.fee > 0) {
|
|
4112
4111
|
const feeRate = (result.fee / result.amount * 100).toFixed(1);
|
|
4113
|
-
printSuccess(`Protocol fee: ${import_picocolors5.default.dim(`${formatUsd(result.fee)}
|
|
4112
|
+
printSuccess(`Protocol fee: ${import_picocolors5.default.dim(`${formatUsd(result.fee)} USDC (${feeRate}%)`)}`);
|
|
4114
4113
|
}
|
|
4115
4114
|
printSuccess(`Current APY: ${import_picocolors5.default.green(`${result.apy.toFixed(2)}%`)}`);
|
|
4116
|
-
printSuccess(`Savings balance: ${import_picocolors5.default.yellow(formatUsd(result.savingsBalance))}
|
|
4115
|
+
printSuccess(`Savings balance: ${import_picocolors5.default.yellow(formatUsd(result.savingsBalance))} USDC`);
|
|
4117
4116
|
printKeyValue("Tx", explorerUrl(result.tx));
|
|
4118
4117
|
printBlank();
|
|
4119
4118
|
} catch (error) {
|
|
4120
4119
|
handleError(error);
|
|
4121
4120
|
}
|
|
4122
4121
|
};
|
|
4123
|
-
program3.command("save").description("Deposit into NAVI lending to earn yield
|
|
4124
|
-
program3.command("supply").description("Deposit into NAVI lending (alias for save)").argument("<amount>", 'Amount to save (or "all")').option("--key <path>", "Key file path").option("--protocol <name>", "Protocol to use (e.g. navi)").
|
|
4122
|
+
program3.command("save").description("Deposit USDC into NAVI lending to earn yield").argument("<amount>", 'Amount of USDC to save (or "all")').option("--key <path>", "Key file path").option("--protocol <name>", "Protocol to use (e.g. navi)").action(action);
|
|
4123
|
+
program3.command("supply").description("Deposit USDC into NAVI lending (alias for save)").argument("<amount>", 'Amount of USDC to save (or "all")').option("--key <path>", "Key file path").option("--protocol <name>", "Protocol to use (e.g. navi)").action(action);
|
|
4125
4124
|
}
|
|
4126
4125
|
|
|
4127
4126
|
// src/commands/withdraw.ts
|
|
@@ -7836,7 +7835,7 @@ function registerLock(program3) {
|
|
|
7836
7835
|
});
|
|
7837
7836
|
program3.command("unlock").description("Unlock agent \u2014 resume operations").action(async () => {
|
|
7838
7837
|
try {
|
|
7839
|
-
const { T2000: T20003 } = await import("./dist-
|
|
7838
|
+
const { T2000: T20003 } = await import("./dist-ZKTRDHRL.js");
|
|
7840
7839
|
const MAX_ATTEMPTS2 = 3;
|
|
7841
7840
|
let pin;
|
|
7842
7841
|
for (let attempt = 1; attempt <= MAX_ATTEMPTS2; attempt++) {
|
|
@@ -8010,7 +8009,7 @@ function registerMcp(program3) {
|
|
|
8010
8009
|
mcp.command("start", { isDefault: true }).description("Start MCP server (stdio transport)").option("--key <path>", "Key file path").action(async (opts) => {
|
|
8011
8010
|
let mod;
|
|
8012
8011
|
try {
|
|
8013
|
-
mod = await import("./dist-
|
|
8012
|
+
mod = await import("./dist-AY4QEDAC.js");
|
|
8014
8013
|
} catch {
|
|
8015
8014
|
console.error(
|
|
8016
8015
|
"MCP server not installed. Run:\n npm install -g @t2000/mcp"
|