@t2000/sdk 3.1.1 → 3.3.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 +5 -8
- package/dist/adapters/index.cjs +3 -3
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +3 -3
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +101 -318
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -135
- package/dist/index.d.ts +34 -135
- package/dist/index.js +102 -315
- package/dist/index.js.map +1 -1
- package/dist/{types-DOnXJXL2.d.cts → types-C1DH4kPA.d.cts} +5 -3
- package/dist/{types-CfBlFLmU.d.ts → types-DjeENMuV.d.ts} +5 -3
- package/dist/{types-Bk7NncQ_.d.cts → types-HJGbXJ37.d.cts} +1 -16
- package/dist/{types-Bk7NncQ_.d.ts → types-HJGbXJ37.d.ts} +1 -16
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @t2000/sdk
|
|
2
2
|
|
|
3
|
-
The complete TypeScript SDK for
|
|
3
|
+
The complete TypeScript SDK for Agentic Wallets on Sui. Send USDC, earn yield via NAVI, and borrow against collateral — all from a single class. USDC in, USDC out.
|
|
4
4
|
|
|
5
5
|
In Audric, this SDK powers **Audric Passport** (wallet, signing), **Audric Finance** (NAVI lending/borrowing builders, Cetus swap), and **Audric Pay** (USDC transfers, payment links), and is wrapped by `@t2000/engine` to implement **Audric Intelligence**'s Agent Harness.
|
|
6
6
|
|
|
@@ -26,7 +26,7 @@ yarn add @t2000/sdk
|
|
|
26
26
|
```typescript
|
|
27
27
|
import { T2000 } from '@t2000/sdk';
|
|
28
28
|
|
|
29
|
-
// Create a new
|
|
29
|
+
// Create a new Agentic Wallet
|
|
30
30
|
const { agent, address } = await T2000.init({ pin: 'my-secret' });
|
|
31
31
|
|
|
32
32
|
// Or load an existing one
|
|
@@ -56,7 +56,7 @@ await agent.withdraw({ amount: 25 });
|
|
|
56
56
|
|
|
57
57
|
### `T2000.init(options)` — Create a new wallet
|
|
58
58
|
|
|
59
|
-
Creates a new
|
|
59
|
+
Creates a new Agentic Wallet (generates keypair, encrypts, and saves to disk). Fund the returned address with a small amount of SUI for gas (Mercuryo: https://exchange.mercuryo.io/?widget_id=89960d1a-8db7-49e5-8823-4c5e01c1cea2) plus USDC to transact.
|
|
60
60
|
|
|
61
61
|
```typescript
|
|
62
62
|
const { agent, address } = await T2000.init({
|
|
@@ -67,7 +67,7 @@ const { agent, address } = await T2000.init({
|
|
|
67
67
|
|
|
68
68
|
### `T2000.create(options)` — Load an existing wallet
|
|
69
69
|
|
|
70
|
-
Loads an existing
|
|
70
|
+
Loads an existing Agentic Wallet from an encrypted key file. Throws `WALLET_NOT_FOUND` if no wallet exists.
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
73
|
const agent = await T2000.create({
|
|
@@ -99,8 +99,6 @@ const agent = T2000.fromPrivateKey('suiprivkey1q...');
|
|
|
99
99
|
| `agent.borrow({ amount, asset? })` | Borrow **USDC or USDsui** against collateral (v0.51.0+). `asset` defaults to `'USDC'`. | `BorrowResult` |
|
|
100
100
|
| `agent.repay({ amount, asset? })` | Repay outstanding **USDC or USDsui** debt (v0.51.1+). Pass `asset` to target a specific debt; omit for highest-APY repay. **Symmetry enforced:** USDsui debt is repaid with USDsui coins (and USDC with USDC). `amount` can be `'all'`. | `RepayResult` |
|
|
101
101
|
| `agent.swap({ from, to, amount, slippage? })` | Swap tokens via Cetus Aggregator (20+ DEXs). User-friendly names or full coin types. | `SwapResult` |
|
|
102
|
-
| `agent.stakeVSui({ amount })` | Stake SUI for vSUI via VOLO liquid staking (min 1 SUI) | `StakeVSuiResult` |
|
|
103
|
-
| `agent.unstakeVSui({ amount })` | Unstake vSUI back to SUI. `amount` can be `'all'`. | `UnstakeVSuiResult` |
|
|
104
102
|
| `agent.exportKey()` | Export private key (bech32 format) | `string` |
|
|
105
103
|
|
|
106
104
|
### Query Methods
|
|
@@ -309,7 +307,6 @@ t2000 uses an MCP-first integration model: NAVI MCP for reads, thin transaction
|
|
|
309
307
|
|----------|------------|----------|
|
|
310
308
|
| NAVI | MCP (reads) + thin tx builders (writes) | Lending positions, deposits, withdrawals, borrows, rewards |
|
|
311
309
|
| Cetus Aggregator V3 | `@cetusprotocol/aggregator-sdk` (isolated) | Multi-DEX swap routing — overlay fee on swaps (`cetus-swap.ts`) |
|
|
312
|
-
| VOLO | Thin tx builders (direct Move calls) | Stake SUI → vSUI, unstake vSUI → SUI |
|
|
313
310
|
|
|
314
311
|
## Testing
|
|
315
312
|
|
|
@@ -332,7 +329,7 @@ Fees only apply when the **Audric** consumer app calls these primitives. Audric
|
|
|
332
329
|
| Save (deposit) | 0.10% | Free | USDC only; USDsui save is free in Audric too |
|
|
333
330
|
| Borrow | 0.05% | Free | USDC only; USDsui borrow is free in Audric too |
|
|
334
331
|
| Swap | 0.10% | Free | Audric passes Cetus `overlayFee`. CLI omits it. Cetus Aggregator network fees still apply both ways. |
|
|
335
|
-
| Withdraw / Repay / Send / Receive /
|
|
332
|
+
| Withdraw / Repay / Send / Receive / Pay (MPP) | Free | Free | No surcharge anywhere. |
|
|
336
333
|
|
|
337
334
|
How Audric collects fees: `prepare/route.ts` calls `addFeeTransfer(tx, paymentCoin, FEE_BPS, T2000_OVERLAY_FEE_WALLET, amount)` for save/borrow and passes `overlayFee.receiver = T2000_OVERLAY_FEE_WALLET` for swaps. Both flows produce a USDC transfer to the treasury wallet inside the same atomic Payment Intent. The t2000 server-side indexer detects the on-chain USDC inflow and records a `ProtocolFeeLedger` row — no off-chain submission is involved.
|
|
338
335
|
|
package/dist/adapters/index.cjs
CHANGED
|
@@ -488,7 +488,7 @@ var SUPPORTED_ASSETS = {
|
|
|
488
488
|
displayName: "XAUM"
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
|
-
var
|
|
491
|
+
var SAVEABLE_ASSETS = ["USDC", "USDsui"];
|
|
492
492
|
var ALL_NAVI_ASSETS = Object.keys(SUPPORTED_ASSETS);
|
|
493
493
|
process.env.T2000_OVERLAY_FEE_WALLET ?? "0x5366efbf2b4fe5767fe2e78eb197aa5f5d138d88ac3333fbf3f80a1927da473a";
|
|
494
494
|
process.env.T2000_API_URL ?? "https://api.t2000.ai";
|
|
@@ -536,7 +536,7 @@ var ProtocolRegistry = class {
|
|
|
536
536
|
}
|
|
537
537
|
async bestSaveRateAcrossAssets() {
|
|
538
538
|
const candidates = [];
|
|
539
|
-
for (const asset of
|
|
539
|
+
for (const asset of SAVEABLE_ASSETS) {
|
|
540
540
|
for (const adapter of this.lending.values()) {
|
|
541
541
|
if (!adapter.supportedAssets.includes(asset)) continue;
|
|
542
542
|
if (!adapter.capabilities.includes("save")) continue;
|
|
@@ -556,7 +556,7 @@ var ProtocolRegistry = class {
|
|
|
556
556
|
async allRatesAcrossAssets() {
|
|
557
557
|
const results = [];
|
|
558
558
|
const seen = /* @__PURE__ */ new Set();
|
|
559
|
-
for (const asset of
|
|
559
|
+
for (const asset of SAVEABLE_ASSETS) {
|
|
560
560
|
if (seen.has(asset)) continue;
|
|
561
561
|
seen.add(asset);
|
|
562
562
|
for (const adapter of this.lending.values()) {
|