@t2000/cli 2.18.0 → 2.19.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-ZNZ4MOY2.js → chunk-2TOYZOH3.js} +192 -3
- package/dist/chunk-2TOYZOH3.js.map +1 -0
- package/dist/{dist-UOMSU5UL.js → dist-EJKUXGU5.js} +130 -5
- package/dist/{dist-UOMSU5UL.js.map → dist-EJKUXGU5.js.map} +1 -1
- package/dist/{dist-EFTMN6BY.js → dist-LIH33AY2.js} +22 -2
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-ZNZ4MOY2.js.map +0 -1
- /package/dist/{dist-EFTMN6BY.js.map → dist-LIH33AY2.js.map} +0 -0
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
HF_CRITICAL_THRESHOLD,
|
|
17
17
|
HF_WARN_THRESHOLD,
|
|
18
18
|
IKA_TYPE,
|
|
19
|
+
InvalidAddressError,
|
|
19
20
|
KNOWN_TARGETS,
|
|
20
21
|
KeypairSigner,
|
|
21
22
|
LABEL_PATTERNS,
|
|
@@ -31,11 +32,16 @@ import {
|
|
|
31
32
|
SAVE_FEE_BPS,
|
|
32
33
|
SPONSORED_PYTH_DEPENDENT_PROVIDERS,
|
|
33
34
|
STABLE_ASSETS,
|
|
35
|
+
SUINS_NAME_REGEX,
|
|
36
|
+
SUI_ADDRESS_REGEX,
|
|
37
|
+
SUI_ADDRESS_STRICT_REGEX,
|
|
34
38
|
SUI_DECIMALS,
|
|
35
39
|
SUI_TYPE,
|
|
36
40
|
SUPPORTED_ASSETS,
|
|
37
41
|
SafeguardEnforcer,
|
|
38
42
|
SafeguardError,
|
|
43
|
+
SuinsNotRegisteredError,
|
|
44
|
+
SuinsRpcError,
|
|
39
45
|
T2000,
|
|
40
46
|
T2000Error,
|
|
41
47
|
T2000_OVERLAY_FEE_WALLET,
|
|
@@ -111,10 +117,12 @@ import {
|
|
|
111
117
|
isTier2,
|
|
112
118
|
keypairFromPrivateKey,
|
|
113
119
|
loadKey,
|
|
120
|
+
looksLikeSuiNs,
|
|
114
121
|
mapMoveAbortCode,
|
|
115
122
|
mapWalletError,
|
|
116
123
|
mistToSui,
|
|
117
124
|
naviDescriptor,
|
|
125
|
+
normalizeAddressInput,
|
|
118
126
|
normalizeAsset,
|
|
119
127
|
normalizeCoinType,
|
|
120
128
|
parseSuiRpcTx,
|
|
@@ -123,6 +131,8 @@ import {
|
|
|
123
131
|
rawToStable,
|
|
124
132
|
rawToUsdc,
|
|
125
133
|
refineLendingLabel,
|
|
134
|
+
resolveAddressToSuinsViaRpc,
|
|
135
|
+
resolveSuinsViaRpc,
|
|
126
136
|
resolveSymbol,
|
|
127
137
|
resolveTokenType,
|
|
128
138
|
saveKey,
|
|
@@ -139,7 +149,7 @@ import {
|
|
|
139
149
|
validateLabel,
|
|
140
150
|
verifyCetusRouteCoinMatch,
|
|
141
151
|
walletExists
|
|
142
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-2TOYZOH3.js";
|
|
143
153
|
import "./chunk-ZRPJE7U5.js";
|
|
144
154
|
import "./chunk-OCLKPYUU.js";
|
|
145
155
|
import "./chunk-SI54PO2N.js";
|
|
@@ -167,6 +177,7 @@ export {
|
|
|
167
177
|
HF_CRITICAL_THRESHOLD,
|
|
168
178
|
HF_WARN_THRESHOLD,
|
|
169
179
|
IKA_TYPE,
|
|
180
|
+
InvalidAddressError,
|
|
170
181
|
KNOWN_TARGETS,
|
|
171
182
|
KeypairSigner,
|
|
172
183
|
LABEL_PATTERNS,
|
|
@@ -182,11 +193,16 @@ export {
|
|
|
182
193
|
SAVE_FEE_BPS,
|
|
183
194
|
SPONSORED_PYTH_DEPENDENT_PROVIDERS,
|
|
184
195
|
STABLE_ASSETS,
|
|
196
|
+
SUINS_NAME_REGEX,
|
|
197
|
+
SUI_ADDRESS_REGEX,
|
|
198
|
+
SUI_ADDRESS_STRICT_REGEX,
|
|
185
199
|
SUI_DECIMALS,
|
|
186
200
|
SUI_TYPE,
|
|
187
201
|
SUPPORTED_ASSETS,
|
|
188
202
|
SafeguardEnforcer,
|
|
189
203
|
SafeguardError,
|
|
204
|
+
SuinsNotRegisteredError,
|
|
205
|
+
SuinsRpcError,
|
|
190
206
|
T2000,
|
|
191
207
|
T2000Error,
|
|
192
208
|
T2000_OVERLAY_FEE_WALLET,
|
|
@@ -262,10 +278,12 @@ export {
|
|
|
262
278
|
isTier2,
|
|
263
279
|
keypairFromPrivateKey,
|
|
264
280
|
loadKey,
|
|
281
|
+
looksLikeSuiNs,
|
|
265
282
|
mapMoveAbortCode,
|
|
266
283
|
mapWalletError,
|
|
267
284
|
mistToSui,
|
|
268
285
|
naviDescriptor,
|
|
286
|
+
normalizeAddressInput,
|
|
269
287
|
normalizeAsset,
|
|
270
288
|
normalizeCoinType,
|
|
271
289
|
parseSuiRpcTx,
|
|
@@ -274,6 +292,8 @@ export {
|
|
|
274
292
|
rawToStable,
|
|
275
293
|
rawToUsdc,
|
|
276
294
|
refineLendingLabel,
|
|
295
|
+
resolveAddressToSuinsViaRpc,
|
|
296
|
+
resolveSuinsViaRpc,
|
|
277
297
|
resolveSymbol,
|
|
278
298
|
resolveTokenType,
|
|
279
299
|
saveKey,
|
|
@@ -291,4 +311,4 @@ export {
|
|
|
291
311
|
verifyCetusRouteCoinMatch,
|
|
292
312
|
walletExists
|
|
293
313
|
};
|
|
294
|
-
//# sourceMappingURL=dist-
|
|
314
|
+
//# sourceMappingURL=dist-LIH33AY2.js.map
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
saveKey,
|
|
13
13
|
truncateAddress,
|
|
14
14
|
walletExists
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2TOYZOH3.js";
|
|
16
16
|
import {
|
|
17
17
|
esm_default3 as esm_default,
|
|
18
18
|
esm_default8 as esm_default2
|
|
@@ -3735,10 +3735,10 @@ function parseSendArgs(args) {
|
|
|
3735
3735
|
if (filtered.length >= 2) {
|
|
3736
3736
|
return { amount: parseFloat(filtered[0]), asset: "USDC", recipient: filtered[filtered.length - 1] };
|
|
3737
3737
|
}
|
|
3738
|
-
throw new Error("Usage: t2000 send <amount> [asset] [to] <
|
|
3738
|
+
throw new Error("Usage: t2000 send <amount> [asset] [to] <0x-address|suins-name|contact>");
|
|
3739
3739
|
}
|
|
3740
3740
|
function registerSend(program3) {
|
|
3741
|
-
program3.command("send").argument("<amount>", "Amount to send").argument("[args...]", 'Asset, "to" keyword, and recipient address or contact
|
|
3741
|
+
program3.command("send").argument("<amount>", "Amount to send").argument("[args...]", 'Asset, "to" keyword, and recipient (0x address, SuiNS name like alex.sui, or saved contact)').description("Send USDC (or other asset) to a 0x address, SuiNS name, or saved contact").option("--key <path>", "Key file path").action(async (amount, args, opts) => {
|
|
3742
3742
|
try {
|
|
3743
3743
|
const { amount: parsedAmount, asset, recipient } = parseSendArgs([amount, ...args]);
|
|
3744
3744
|
const pin = await resolvePin();
|
|
@@ -3753,7 +3753,14 @@ function registerSend(program3) {
|
|
|
3753
3753
|
return;
|
|
3754
3754
|
}
|
|
3755
3755
|
printBlank();
|
|
3756
|
-
|
|
3756
|
+
let displayTo;
|
|
3757
|
+
if (result.suinsName) {
|
|
3758
|
+
displayTo = `${result.suinsName} (${truncateAddress(result.to)})`;
|
|
3759
|
+
} else if (result.contactName) {
|
|
3760
|
+
displayTo = `${result.contactName} (${truncateAddress(result.to)})`;
|
|
3761
|
+
} else {
|
|
3762
|
+
displayTo = truncateAddress(result.to);
|
|
3763
|
+
}
|
|
3757
3764
|
printSuccess(`Sent ${formatUsd(result.amount)} ${asset.toUpperCase()} \u2192 ${displayTo}`);
|
|
3758
3765
|
printKeyValue("Gas", `${result.gasCost.toFixed(4)} ${result.gasCostUnit}`);
|
|
3759
3766
|
printKeyValue("Balance", formatUsd(result.balance.available) + " USDC");
|
|
@@ -7867,7 +7874,7 @@ function registerLock(program3) {
|
|
|
7867
7874
|
});
|
|
7868
7875
|
program3.command("unlock").description("Unlock agent \u2014 resume operations").action(async () => {
|
|
7869
7876
|
try {
|
|
7870
|
-
const { T2000: T20003 } = await import("./dist-
|
|
7877
|
+
const { T2000: T20003 } = await import("./dist-LIH33AY2.js");
|
|
7871
7878
|
const MAX_ATTEMPTS2 = 3;
|
|
7872
7879
|
let pin;
|
|
7873
7880
|
for (let attempt = 1; attempt <= MAX_ATTEMPTS2; attempt++) {
|
|
@@ -8041,7 +8048,7 @@ function registerMcp(program3) {
|
|
|
8041
8048
|
mcp.command("start", { isDefault: true }).description("Start MCP server (stdio transport)").option("--key <path>", "Key file path").action(async (opts) => {
|
|
8042
8049
|
let mod;
|
|
8043
8050
|
try {
|
|
8044
|
-
mod = await import("./dist-
|
|
8051
|
+
mod = await import("./dist-EJKUXGU5.js");
|
|
8045
8052
|
} catch {
|
|
8046
8053
|
console.error(
|
|
8047
8054
|
"MCP server not installed. Run:\n npm install -g @t2000/mcp"
|