@t2000/sdk 0.10.1 → 0.10.3

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.
Files changed (2) hide show
  1. package/README.md +6 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -43,6 +43,9 @@ await agent.save({ amount: 50 });
43
43
  // Borrow USDC against your collateral
44
44
  await agent.borrow({ amount: 25 });
45
45
 
46
+ // Exchange tokens (e.g. USDC ⇌ SUI)
47
+ await agent.exchange({ from: 'USDC', to: 'SUI', amount: 5 });
48
+
46
49
  // Rebalance — move savings to the best rate (dry-run first)
47
50
  const plan = await agent.rebalance({ dryRun: true });
48
51
  console.log(`+${plan.annualGain.toFixed(2)}/year, break-even: ${plan.breakEvenDays} days`);
@@ -99,6 +102,8 @@ const agent = T2000.fromPrivateKey('suiprivkey1q...');
99
102
  | `agent.borrow({ amount })` | Borrow USDC against collateral | `BorrowResult` |
100
103
  | `agent.repay({ amount })` | Repay outstanding USDC borrows. `amount` can be `'all'`. | `RepayResult` |
101
104
  | `agent.rebalance({ dryRun?, minYieldDiff?, maxBreakEven? })` | Optimize yield — move savings to best rate across protocols/stablecoins internally. Dry-run for preview. | `RebalanceResult` |
105
+ | `agent.exchange({ from, to, amount, maxSlippage? })` | Exchange tokens via Cetus DEX (e.g. USDC ⇌ SUI). On-chain slippage protection. | `SwapResult` |
106
+ | `agent.exchangeQuote({ from, to, amount })` | Get exchange quote without executing | `{ expectedOutput, priceImpact, poolPrice, fee }` |
102
107
  | `agent.exportKey()` | Export private key (bech32 format) | `string` |
103
108
 
104
109
  ### Query Methods
@@ -306,7 +311,7 @@ pnpm --filter @t2000/sdk test
306
311
  |-----------|-----|-------|
307
312
  | Save (deposit) | 0.10% | Protocol fee on deposit |
308
313
  | Borrow | 0.05% | Protocol fee on loan |
309
- | Swap (internal) | **Free** | Cetus pool fees only; used internally by rebalance/auto-convert |
314
+ | Exchange | **Free** | Cetus pool fees only; used internally by rebalance/auto-convert |
310
315
  | Withdraw | Free | |
311
316
  | Repay | Free | |
312
317
  | Send | Free | |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t2000/sdk",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "description": "TypeScript SDK for AI agent bank accounts on Sui — send, save, borrow, rebalance",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",