@t2000/cli 3.1.1 → 3.2.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/README.md +12 -7
- package/dist/{chunk-R7KXQRHQ.js → chunk-ZH6PX6WS.js} +91 -82
- package/dist/{chunk-R7KXQRHQ.js.map → chunk-ZH6PX6WS.js.map} +1 -1
- package/dist/{dist-2LJUAYXZ.js → dist-NH7XYB4F.js} +105 -50
- package/dist/{dist-2LJUAYXZ.js.map → dist-NH7XYB4F.js.map} +1 -1
- package/dist/{dist-A7D5R6SM.js → dist-UOJPIH47.js} +4 -2
- package/dist/index.js +52 -37
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- /package/dist/{dist-A7D5R6SM.js.map → dist-UOJPIH47.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @t2000/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Agentic Wallet for AI agents on Sui. Guided setup, MCP integration for Claude Desktop / Cursor / Windsurf, send USDC, earn yield, borrow, and pay for APIs. USDC in, USDC out.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@t2000/cli)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -23,7 +23,7 @@ t2000 init
|
|
|
23
23
|
|
|
24
24
|
┌─────────────────────────────────────────┐
|
|
25
25
|
│ Welcome to t2000 │
|
|
26
|
-
│
|
|
26
|
+
│ Agentic Wallet for AI agents │
|
|
27
27
|
└─────────────────────────────────────────┘
|
|
28
28
|
|
|
29
29
|
Step 1 of 3 — Create wallet
|
|
@@ -33,7 +33,7 @@ t2000 init
|
|
|
33
33
|
✓ Network Sui mainnet
|
|
34
34
|
✓ Checking ✓ Savings ✓ Credit
|
|
35
35
|
|
|
36
|
-
🎉
|
|
36
|
+
🎉 Agentic Wallet created
|
|
37
37
|
Address: 0x8b3e...d412
|
|
38
38
|
|
|
39
39
|
ℹ Fund your wallet with SUI for gas + USDC to transact.
|
|
@@ -136,8 +136,8 @@ See the [MCP setup guide](../../docs/mcp-setup.md) for manual configuration.
|
|
|
136
136
|
| `t2000 balance` | Show available USDC + savings + gas reserve |
|
|
137
137
|
| `t2000 balance --show-limits` | Include maxWithdraw, maxBorrow, and health factor |
|
|
138
138
|
| `t2000 address` | Show wallet address |
|
|
139
|
-
| `t2000
|
|
140
|
-
| `t2000 import` | Import an existing
|
|
139
|
+
| `t2000 fund` | Show how to fund your Agentic Wallet (receive address + supported networks) |
|
|
140
|
+
| `t2000 import` | Import an existing wallet from private key |
|
|
141
141
|
| `t2000 export` | Export private key (bech32 `suiprivkey1...` format) |
|
|
142
142
|
| `t2000 history` | Transaction history |
|
|
143
143
|
|
|
@@ -256,7 +256,7 @@ Config is stored at `~/.t2000/config.json`.
|
|
|
256
256
|
|
|
257
257
|
| Variable | Description |
|
|
258
258
|
|----------|-------------|
|
|
259
|
-
| `T2000_PIN` |
|
|
259
|
+
| `T2000_PIN` | Agentic Wallet PIN (skip interactive prompt) |
|
|
260
260
|
| `T2000_PRIVATE_KEY` | Private key for `t2000 import` (skip interactive prompt) |
|
|
261
261
|
|
|
262
262
|
## Gas
|
|
@@ -281,12 +281,17 @@ Audric (the consumer product on top of the SDK) charges a small overlay fee on s
|
|
|
281
281
|
## Examples
|
|
282
282
|
|
|
283
283
|
```bash
|
|
284
|
-
# Full DeFi cycle
|
|
284
|
+
# Full DeFi cycle (USDC)
|
|
285
285
|
t2000 save all # Deposit all available USDC
|
|
286
286
|
t2000 borrow 40 # Borrow against it
|
|
287
287
|
t2000 repay 40 # Pay it back
|
|
288
288
|
t2000 withdraw all # Get everything out (USDC by default; pass --asset USDsui for USDsui)
|
|
289
289
|
|
|
290
|
+
# Save / borrow / repay in USDsui (strategic stable, v0.51.0+)
|
|
291
|
+
t2000 save 50 --asset USDsui # Deposit USDsui to NAVI
|
|
292
|
+
t2000 borrow 20 --asset USDsui # Borrow USDsui against collateral
|
|
293
|
+
t2000 repay all --asset USDsui # Repay all USDsui debts (must match borrow asset)
|
|
294
|
+
|
|
290
295
|
# Automation-friendly (no prompts, JSON output)
|
|
291
296
|
t2000 balance --json
|
|
292
297
|
t2000 save 10 --yes --json
|
|
@@ -16937,6 +16937,63 @@ var init_cetus_swap = __esm({
|
|
|
16937
16937
|
clientCache = /* @__PURE__ */ new Map();
|
|
16938
16938
|
}
|
|
16939
16939
|
});
|
|
16940
|
+
var swap_quote_exports = {};
|
|
16941
|
+
__export(swap_quote_exports, {
|
|
16942
|
+
getSwapQuote: () => getSwapQuote
|
|
16943
|
+
});
|
|
16944
|
+
async function getSwapQuote(params) {
|
|
16945
|
+
const { findSwapRoute: findSwapRoute2, resolveTokenType: resolveTokenType2 } = await Promise.resolve().then(() => (init_cetus_swap(), cetus_swap_exports));
|
|
16946
|
+
const fromType = resolveTokenType2(params.from);
|
|
16947
|
+
const toType = resolveTokenType2(params.to);
|
|
16948
|
+
if (!fromType) {
|
|
16949
|
+
throw new T2000Error(
|
|
16950
|
+
"ASSET_NOT_SUPPORTED",
|
|
16951
|
+
`Unknown token: ${params.from}. Provide the symbol (USDC, SUI, ...) or full coin type.`
|
|
16952
|
+
);
|
|
16953
|
+
}
|
|
16954
|
+
if (!toType) {
|
|
16955
|
+
throw new T2000Error(
|
|
16956
|
+
"ASSET_NOT_SUPPORTED",
|
|
16957
|
+
`Unknown token: ${params.to}. Provide the symbol (USDC, SUI, ...) or full coin type.`
|
|
16958
|
+
);
|
|
16959
|
+
}
|
|
16960
|
+
const byAmountIn = params.byAmountIn ?? true;
|
|
16961
|
+
const fromDecimals = getDecimalsForCoinType(fromType);
|
|
16962
|
+
const rawAmount = BigInt(Math.floor(params.amount * 10 ** fromDecimals));
|
|
16963
|
+
const route = await findSwapRoute2({
|
|
16964
|
+
walletAddress: params.walletAddress,
|
|
16965
|
+
from: fromType,
|
|
16966
|
+
to: toType,
|
|
16967
|
+
amount: rawAmount,
|
|
16968
|
+
byAmountIn,
|
|
16969
|
+
providers: params.providers
|
|
16970
|
+
});
|
|
16971
|
+
if (!route) throw new T2000Error("SWAP_FAILED", `No swap route found for ${params.from} -> ${params.to}.`);
|
|
16972
|
+
if (route.insufficientLiquidity) {
|
|
16973
|
+
throw new T2000Error("SWAP_FAILED", `Insufficient liquidity for ${params.from} -> ${params.to}.`);
|
|
16974
|
+
}
|
|
16975
|
+
const toDecimals = getDecimalsForCoinType(toType);
|
|
16976
|
+
const fromAmount = Number(route.amountIn) / 10 ** fromDecimals;
|
|
16977
|
+
const toAmount = Number(route.amountOut) / 10 ** toDecimals;
|
|
16978
|
+
const routeDesc = route.routerData.paths?.map((p) => p.provider).filter(Boolean).slice(0, 3).join(" + ") ?? "Cetus Aggregator";
|
|
16979
|
+
const { serializeCetusRoute: serializeCetusRoute2 } = await Promise.resolve().then(() => (init_cetus_swap(), cetus_swap_exports));
|
|
16980
|
+
const serializedRoute = serializeCetusRoute2(route, { fromCoinType: fromType, toCoinType: toType });
|
|
16981
|
+
return {
|
|
16982
|
+
fromToken: params.from,
|
|
16983
|
+
toToken: params.to,
|
|
16984
|
+
fromAmount,
|
|
16985
|
+
toAmount,
|
|
16986
|
+
priceImpact: route.priceImpact,
|
|
16987
|
+
route: routeDesc,
|
|
16988
|
+
serializedRoute
|
|
16989
|
+
};
|
|
16990
|
+
}
|
|
16991
|
+
var init_swap_quote = __esm({
|
|
16992
|
+
"src/swap-quote.ts"() {
|
|
16993
|
+
init_errors();
|
|
16994
|
+
init_token_registry();
|
|
16995
|
+
}
|
|
16996
|
+
});
|
|
16940
16997
|
init_errors();
|
|
16941
16998
|
var MIST_PER_SUI = 1000000000n;
|
|
16942
16999
|
var SUI_DECIMALS = 9;
|
|
@@ -17001,7 +17058,8 @@ var SUPPORTED_ASSETS = {
|
|
|
17001
17058
|
displayName: "XAUM"
|
|
17002
17059
|
}
|
|
17003
17060
|
};
|
|
17004
|
-
var STABLE_ASSETS = ["USDC"];
|
|
17061
|
+
var STABLE_ASSETS = ["USDC", "USDsui"];
|
|
17062
|
+
var SAVEABLE_ASSETS = ["USDC", "USDsui"];
|
|
17005
17063
|
var ALL_NAVI_ASSETS = Object.keys(SUPPORTED_ASSETS);
|
|
17006
17064
|
var OPERATION_ASSETS = {
|
|
17007
17065
|
save: ["USDC", "USDsui"],
|
|
@@ -21754,7 +21812,7 @@ var ProtocolRegistry = class {
|
|
|
21754
21812
|
}
|
|
21755
21813
|
async bestSaveRateAcrossAssets() {
|
|
21756
21814
|
const candidates = [];
|
|
21757
|
-
for (const asset of
|
|
21815
|
+
for (const asset of SAVEABLE_ASSETS) {
|
|
21758
21816
|
for (const adapter of this.lending.values()) {
|
|
21759
21817
|
if (!adapter.supportedAssets.includes(asset)) continue;
|
|
21760
21818
|
if (!adapter.capabilities.includes("save")) continue;
|
|
@@ -21774,7 +21832,7 @@ var ProtocolRegistry = class {
|
|
|
21774
21832
|
async allRatesAcrossAssets() {
|
|
21775
21833
|
const results = [];
|
|
21776
21834
|
const seen = /* @__PURE__ */ new Set();
|
|
21777
|
-
for (const asset of
|
|
21835
|
+
for (const asset of SAVEABLE_ASSETS) {
|
|
21778
21836
|
if (seen.has(asset)) continue;
|
|
21779
21837
|
seen.add(asset);
|
|
21780
21838
|
for (const adapter of this.lending.values()) {
|
|
@@ -22522,36 +22580,24 @@ var T2000 = class _T2000 extends import_index.default {
|
|
|
22522
22580
|
gasCost: gasResult.gasCostSui
|
|
22523
22581
|
};
|
|
22524
22582
|
}
|
|
22583
|
+
/**
|
|
22584
|
+
* [SPEC_AGENTIC_STACK P1 / SDK F2 — 2026-05-25]
|
|
22585
|
+
* Thin wrapper around the standalone `getSwapQuote()`. Pre-Phase 1 this method
|
|
22586
|
+
* was ~50 LoC duplicating `swap-quote.ts` — missing `serializedRoute` (SPEC 20.2
|
|
22587
|
+
* fast-path) and the `providers` allow-list (Bug A fix / Pyth-dependent
|
|
22588
|
+
* provider filter for sponsored callers). Routing both API surfaces through
|
|
22589
|
+
* one implementation ensures fixes land for both.
|
|
22590
|
+
*/
|
|
22525
22591
|
async swapQuote(params) {
|
|
22526
|
-
const {
|
|
22527
|
-
|
|
22528
|
-
const toType = resolveTokenType2(params.to);
|
|
22529
|
-
if (!fromType) throw new T2000Error("ASSET_NOT_SUPPORTED", `Unknown token: ${params.from}. Provide the full coin type.`);
|
|
22530
|
-
if (!toType) throw new T2000Error("ASSET_NOT_SUPPORTED", `Unknown token: ${params.to}. Provide the full coin type.`);
|
|
22531
|
-
const byAmountIn = params.byAmountIn ?? true;
|
|
22532
|
-
const fromDecimals = getDecimalsForCoinType(fromType);
|
|
22533
|
-
const rawAmount = BigInt(Math.floor(params.amount * 10 ** fromDecimals));
|
|
22534
|
-
const route = await findSwapRoute2({
|
|
22592
|
+
const { getSwapQuote: getSwapQuote2 } = await Promise.resolve().then(() => (init_swap_quote(), swap_quote_exports));
|
|
22593
|
+
return getSwapQuote2({
|
|
22535
22594
|
walletAddress: this._address,
|
|
22536
|
-
from:
|
|
22537
|
-
to:
|
|
22538
|
-
amount:
|
|
22539
|
-
byAmountIn
|
|
22595
|
+
from: params.from,
|
|
22596
|
+
to: params.to,
|
|
22597
|
+
amount: params.amount,
|
|
22598
|
+
byAmountIn: params.byAmountIn,
|
|
22599
|
+
providers: params.providers
|
|
22540
22600
|
});
|
|
22541
|
-
if (!route) throw new T2000Error("SWAP_NO_ROUTE", `No swap route found for ${params.from} -> ${params.to}.`);
|
|
22542
|
-
if (route.insufficientLiquidity) throw new T2000Error("SWAP_NO_ROUTE", `Insufficient liquidity for ${params.from} -> ${params.to}.`);
|
|
22543
|
-
const toDecimals = getDecimalsForCoinType(toType);
|
|
22544
|
-
const fromAmount = Number(route.amountIn) / 10 ** fromDecimals;
|
|
22545
|
-
const toAmount = Number(route.amountOut) / 10 ** toDecimals;
|
|
22546
|
-
const routeDesc = route.routerData.paths?.map((p) => p.provider).filter(Boolean).slice(0, 3).join(" + ") ?? "Cetus Aggregator";
|
|
22547
|
-
return {
|
|
22548
|
-
fromToken: params.from,
|
|
22549
|
-
toToken: params.to,
|
|
22550
|
-
fromAmount,
|
|
22551
|
-
toAmount,
|
|
22552
|
-
priceImpact: route.priceImpact,
|
|
22553
|
-
route: routeDesc
|
|
22554
|
-
};
|
|
22555
22601
|
}
|
|
22556
22602
|
// -- Wallet --
|
|
22557
22603
|
address() {
|
|
@@ -22682,6 +22728,16 @@ var T2000 = class _T2000 extends import_index.default {
|
|
|
22682
22728
|
].join("\n")
|
|
22683
22729
|
};
|
|
22684
22730
|
}
|
|
22731
|
+
/**
|
|
22732
|
+
* [SPEC_AGENTIC_STACK P1 / SDK F2 (CLI rename support) — 2026-05-25]
|
|
22733
|
+
* Preferred alias of `deposit()`. The CLI surface is `t2000 fund` post-Phase 1
|
|
22734
|
+
* (more intuitive than "deposit" which sounds like a NAVI lending action).
|
|
22735
|
+
* `deposit()` stays as the canonical method name for back-compat; it is NOT
|
|
22736
|
+
* deprecated. This wrapper exists so SDK consumers can mirror CLI naming.
|
|
22737
|
+
*/
|
|
22738
|
+
async fund() {
|
|
22739
|
+
return this.deposit();
|
|
22740
|
+
}
|
|
22685
22741
|
receive(params) {
|
|
22686
22742
|
const amount = params?.amount ?? null;
|
|
22687
22743
|
const currency = params?.currency ?? "USDC";
|
|
@@ -23396,7 +23452,7 @@ var T2000 = class _T2000 extends import_index.default {
|
|
|
23396
23452
|
this.emit("yield", {
|
|
23397
23453
|
earned: result.dailyEarning,
|
|
23398
23454
|
total: result.totalYieldEarned,
|
|
23399
|
-
apy: result.currentApy
|
|
23455
|
+
apy: result.currentApy,
|
|
23400
23456
|
timestamp: Date.now()
|
|
23401
23457
|
});
|
|
23402
23458
|
}
|
|
@@ -24167,55 +24223,7 @@ function parseMoveAbort(errorStr) {
|
|
|
24167
24223
|
}
|
|
24168
24224
|
return { reason: errorStr };
|
|
24169
24225
|
}
|
|
24170
|
-
|
|
24171
|
-
init_token_registry();
|
|
24172
|
-
async function getSwapQuote(params) {
|
|
24173
|
-
const { findSwapRoute: findSwapRoute2, resolveTokenType: resolveTokenType2 } = await Promise.resolve().then(() => (init_cetus_swap(), cetus_swap_exports));
|
|
24174
|
-
const fromType = resolveTokenType2(params.from);
|
|
24175
|
-
const toType = resolveTokenType2(params.to);
|
|
24176
|
-
if (!fromType) {
|
|
24177
|
-
throw new T2000Error(
|
|
24178
|
-
"ASSET_NOT_SUPPORTED",
|
|
24179
|
-
`Unknown token: ${params.from}. Provide the symbol (USDC, SUI, ...) or full coin type.`
|
|
24180
|
-
);
|
|
24181
|
-
}
|
|
24182
|
-
if (!toType) {
|
|
24183
|
-
throw new T2000Error(
|
|
24184
|
-
"ASSET_NOT_SUPPORTED",
|
|
24185
|
-
`Unknown token: ${params.to}. Provide the symbol (USDC, SUI, ...) or full coin type.`
|
|
24186
|
-
);
|
|
24187
|
-
}
|
|
24188
|
-
const byAmountIn = params.byAmountIn ?? true;
|
|
24189
|
-
const fromDecimals = getDecimalsForCoinType(fromType);
|
|
24190
|
-
const rawAmount = BigInt(Math.floor(params.amount * 10 ** fromDecimals));
|
|
24191
|
-
const route = await findSwapRoute2({
|
|
24192
|
-
walletAddress: params.walletAddress,
|
|
24193
|
-
from: fromType,
|
|
24194
|
-
to: toType,
|
|
24195
|
-
amount: rawAmount,
|
|
24196
|
-
byAmountIn,
|
|
24197
|
-
providers: params.providers
|
|
24198
|
-
});
|
|
24199
|
-
if (!route) throw new T2000Error("SWAP_FAILED", `No swap route found for ${params.from} -> ${params.to}.`);
|
|
24200
|
-
if (route.insufficientLiquidity) {
|
|
24201
|
-
throw new T2000Error("SWAP_FAILED", `Insufficient liquidity for ${params.from} -> ${params.to}.`);
|
|
24202
|
-
}
|
|
24203
|
-
const toDecimals = getDecimalsForCoinType(toType);
|
|
24204
|
-
const fromAmount = Number(route.amountIn) / 10 ** fromDecimals;
|
|
24205
|
-
const toAmount = Number(route.amountOut) / 10 ** toDecimals;
|
|
24206
|
-
const routeDesc = route.routerData.paths?.map((p) => p.provider).filter(Boolean).slice(0, 3).join(" + ") ?? "Cetus Aggregator";
|
|
24207
|
-
const { serializeCetusRoute: serializeCetusRoute2 } = await Promise.resolve().then(() => (init_cetus_swap(), cetus_swap_exports));
|
|
24208
|
-
const serializedRoute = serializeCetusRoute2(route, { fromCoinType: fromType, toCoinType: toType });
|
|
24209
|
-
return {
|
|
24210
|
-
fromToken: params.from,
|
|
24211
|
-
toToken: params.to,
|
|
24212
|
-
fromAmount,
|
|
24213
|
-
toAmount,
|
|
24214
|
-
priceImpact: route.priceImpact,
|
|
24215
|
-
route: routeDesc,
|
|
24216
|
-
serializedRoute
|
|
24217
|
-
};
|
|
24218
|
-
}
|
|
24226
|
+
init_swap_quote();
|
|
24219
24227
|
init_cetus_swap();
|
|
24220
24228
|
init_token_registry();
|
|
24221
24229
|
init_volo();
|
|
@@ -24328,6 +24336,7 @@ export {
|
|
|
24328
24336
|
buildSwapTx,
|
|
24329
24337
|
addSwapToTx,
|
|
24330
24338
|
OVERLAY_FEE_RATE,
|
|
24339
|
+
getSwapQuote,
|
|
24331
24340
|
MIST_PER_SUI,
|
|
24332
24341
|
SUI_DECIMALS,
|
|
24333
24342
|
USDC_DECIMALS,
|
|
@@ -24337,6 +24346,7 @@ export {
|
|
|
24337
24346
|
CLOCK_ID,
|
|
24338
24347
|
SUPPORTED_ASSETS,
|
|
24339
24348
|
STABLE_ASSETS,
|
|
24349
|
+
SAVEABLE_ASSETS,
|
|
24340
24350
|
ALL_NAVI_ASSETS,
|
|
24341
24351
|
OPERATION_ASSETS,
|
|
24342
24352
|
isAllowedAsset,
|
|
@@ -24423,7 +24433,6 @@ export {
|
|
|
24423
24433
|
getFinancialSummary,
|
|
24424
24434
|
simulateTransaction,
|
|
24425
24435
|
throwIfSimulationFailed,
|
|
24426
|
-
getSwapQuote,
|
|
24427
24436
|
AUDRIC_PARENT_NAME,
|
|
24428
24437
|
AUDRIC_PARENT_NFT_ID,
|
|
24429
24438
|
validateLabel,
|
|
@@ -24455,4 +24464,4 @@ axios/dist/node/axios.cjs:
|
|
|
24455
24464
|
@scure/bip39/index.js:
|
|
24456
24465
|
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
24457
24466
|
*/
|
|
24458
|
-
//# sourceMappingURL=chunk-
|
|
24467
|
+
//# sourceMappingURL=chunk-ZH6PX6WS.js.map
|