@t2000/sdk 0.19.24 → 0.20.1

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  # @t2000/sdk
2
2
 
3
- The complete TypeScript SDK for AI agent bank accounts on Sui. Send USDC, earn yield via NAVI + Suilend, borrow against collateral, and auto-rebalance for optimal yield — all from a single class. USDC in, USDC out — multi-stablecoin optimization is handled internally by rebalance.
3
+ The complete TypeScript SDK for AI agent bank accounts 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
  [![npm](https://img.shields.io/npm/v/@t2000/sdk)](https://www.npmjs.com/package/@t2000/sdk)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- **[Website](https://t2000.ai)** · **[GitHub](https://github.com/mission69b/t2000)** · **[CLI](https://www.npmjs.com/package/@t2000/cli)** · **[MPP](https://www.npmjs.com/package/@mppsui/mpp)** · **[MCP](https://www.npmjs.com/package/@t2000/mcp)**
8
+ **[Website](https://t2000.ai)** · **[GitHub](https://github.com/mission69b/t2000)** · **[CLI](https://www.npmjs.com/package/@t2000/cli)** · **[MPP](https://www.npmjs.com/package/@suimpp/mpp)** · **[MCP](https://www.npmjs.com/package/@t2000/mcp)**
9
9
 
10
10
  ## Installation
11
11
 
@@ -37,62 +37,14 @@ console.log(`$${balance.available} USDC available`);
37
37
  // Send USDC
38
38
  await agent.send({ to: '0x...', amount: 10 });
39
39
 
40
- // Save (earn yield — auto-selects best rate across NAVI + Suilend)
40
+ // Save (earn yield — auto-selects best rate via NAVI)
41
41
  await agent.save({ amount: 50 });
42
42
 
43
43
  // Borrow USDC against your collateral
44
44
  await agent.borrow({ amount: 25 });
45
45
 
46
- // Swap tokens (e.g. USDC ⇌ SUI)
47
- await agent.swap({ from: 'USDC', to: 'SUI', amount: 5 });
48
-
49
- // Rebalance — move savings to the best rate (dry-run first)
50
- const plan = await agent.rebalance({ dryRun: true });
51
- console.log(`+${plan.annualGain.toFixed(2)}/year, break-even: ${plan.breakEvenDays} days`);
52
- await agent.rebalance(); // execute
53
-
54
- // Withdraw — always returns USDC (auto-swaps non-USDC positions)
46
+ // Withdraw from savings (USDC)
55
47
  await agent.withdraw({ amount: 25 });
56
-
57
- // Buy crypto assets
58
- await agent.buy({ asset: 'SUI', usdAmount: 100 });
59
- await agent.buy({ asset: 'BTC', usdAmount: 500 });
60
- await agent.buy({ asset: 'ETH', usdAmount: 200 });
61
- await agent.buy({ asset: 'GOLD', usdAmount: 100 });
62
-
63
- // Check portfolio
64
- const portfolio = await agent.getPortfolio();
65
- console.log(`P&L: ${portfolio.unrealizedPnL}`);
66
-
67
- // Earn yield on investment (deposit into best-rate lending)
68
- await agent.investEarn({ asset: 'SUI' });
69
-
70
- // Stop earning (withdraw from lending, keep in portfolio)
71
- await agent.investUnearn({ asset: 'SUI' });
72
-
73
- // Rebalance earning positions to better-rate protocols
74
- await agent.investRebalance(); // execute
75
- await agent.investRebalance({ dryRun: true }); // preview only
76
-
77
- // Sell position (auto-withdraws if earning first)
78
- await agent.sell({ asset: 'SUI', usdAmount: 'all' });
79
-
80
- // Buy into a strategy (single atomic PTB)
81
- // bluechip: BTC 50%, ETH 30%, SUI 20%; all-weather: BTC 30%, ETH 20%, SUI 20%, GOLD 30%; safe-haven: BTC 50%, GOLD 50%
82
- await agent.investStrategy({ strategy: 'bluechip', usdAmount: 200 });
83
-
84
- // Check strategy status
85
- const status = await agent.getStrategyStatus({ strategy: 'bluechip' });
86
- console.log(`Total value: $${status.totalValue}`);
87
-
88
- // Rebalance strategy to target weights
89
- await agent.rebalanceStrategy({ strategy: 'bluechip' });
90
-
91
- // Set up dollar-cost averaging
92
- await agent.setupAutoInvest({ amount: 50, frequency: 'weekly', strategy: 'bluechip' });
93
-
94
- // Run pending DCA purchases
95
- await agent.runAutoInvest();
96
48
  ```
97
49
 
98
50
  ## API Reference
@@ -137,15 +89,13 @@ const agent = T2000.fromPrivateKey('suiprivkey1q...');
137
89
  | `agent.address()` | Wallet Sui address | `string` |
138
90
  | `agent.balance()` | Available USDC + savings + gas reserve | `BalanceResponse` |
139
91
  | `agent.send({ to, amount, asset? })` | Transfer USDC to any Sui address | `SendResult` |
140
- | `agent.save({ amount, protocol? })` | Deposit to savings (earn APY). Auto-converts non-USDC stables. Auto-selects best rate or specify `protocol`. `amount` can be `'all'`. | `SaveResult` |
141
- | `agent.withdraw({ amount })` | Withdraw from savings. Always returns USDC (auto-swaps non-USDC positions). `amount` can be `'all'`. | `WithdrawResult` |
92
+ | `agent.save({ amount, asset?, protocol? })` | Deposit to savings (earn APY). Auto-selects best rate or specify `protocol`. `amount` can be `'all'`. Optional `asset` for multi-asset NAVI deposits (default: USDC). | `SaveResult` |
93
+ | `agent.withdraw({ amount, asset? })` | Withdraw from savings. `amount` can be `'all'`. Optional `asset` for multi-asset withdrawals (default: USDC). | `WithdrawResult` |
142
94
  | `agent.borrow({ amount })` | Borrow USDC against collateral | `BorrowResult` |
143
- | `agent.repay({ amount })` | Repay outstanding debt (auto-swaps USDC to borrowed asset if non-USDC). `amount` can be `'all'`. | `RepayResult` |
144
- | `agent.rebalance({ dryRun?, minYieldDiff?, maxBreakEven? })` | Optimize yield move savings to best rate across protocols/stablecoins internally. Dry-run for preview. | `RebalanceResult` |
145
- | `agent.swap({ from, to, amount, maxSlippage? })` | Swap tokens via Cetus DEX (e.g. USDC SUI). On-chain slippage protection. | `SwapResult` |
146
- | `agent.swapQuote({ from, to, amount })` | Get swap quote without executing | `{ expectedOutput, priceImpact, poolPrice, fee }` |
147
- | `agent.buy({ asset, usdAmount, maxSlippage? })` | Buy crypto asset with USD | `InvestResult` |
148
- | `agent.sell({ asset, usdAmount \| 'all', maxSlippage? })` | Sell crypto back to USDC (auto-withdraws if earning) | `InvestResult` |
95
+ | `agent.repay({ amount })` | Repay outstanding debt in USDC. `amount` can be `'all'`. | `RepayResult` |
96
+ | `agent.swap({ from, to, amount, slippage? })` | Swap tokens via Cetus Aggregator (20+ DEXs). User-friendly names or full coin types. | `SwapResult` |
97
+ | `agent.stakeVSui({ amount })` | Stake SUI for vSUI via VOLO liquid staking (min 1 SUI) | `StakeVSuiResult` |
98
+ | `agent.unstakeVSui({ amount })` | Unstake vSUI back to SUI. `amount` can be `'all'`. | `UnstakeVSuiResult` |
149
99
  | `agent.exportKey()` | Export private key (bech32 format) | `string` |
150
100
 
151
101
  ### Query Methods
@@ -155,13 +105,14 @@ const agent = T2000.fromPrivateKey('suiprivkey1q...');
155
105
  | `agent.healthFactor()` | Lending health factor | `HealthFactorResult` |
156
106
  | `agent.earnings()` | Yield earned to date | `EarningsResult` |
157
107
  | `agent.rates()` | Best save/borrow APYs across protocols | `RatesResult` |
158
- | `agent.allRatesAcrossAssets()` | All rates for all stablecoins across all protocols | `Array<{ protocol, asset, rates }>` |
108
+ | `agent.allRatesAcrossAssets()` | Per-protocol rate data across assets | `Array<{ protocol, asset, rates }>` |
159
109
  | `agent.positions()` | All open DeFi positions | `PositionsResult` |
160
110
  | `agent.fundStatus()` | Complete savings summary | `FundStatusResult` |
161
111
  | `agent.maxWithdraw()` | Max safe withdrawal amount | `MaxWithdrawResult` |
162
112
  | `agent.maxBorrow()` | Max safe borrow amount | `MaxBorrowResult` |
163
113
  | `agent.deposit()` | Wallet address + funding instructions | `DepositInfo` |
164
114
  | `agent.history({ limit? })` | Transaction history (default: all) | `TransactionRecord[]` |
115
+ | `agent.swapQuote({ from, to, amount })` | Preview swap route, output amount, and price impact (no execution) | `SwapQuoteResult` |
165
116
 
166
117
  ### Contacts Methods
167
118
 
@@ -187,38 +138,6 @@ const agent = T2000.fromPrivateKey('suiprivkey1q...');
187
138
 
188
139
  **Types:** `SafeguardConfig` — `{ maxPerTx?, maxDailySend?, locked? }` · `SafeguardError` — thrown when limits exceeded or agent locked
189
140
 
190
- ### Investment Yield Methods
191
-
192
- | Method | Description | Returns |
193
- |--------|-------------|---------|
194
- | `agent.investEarn({ asset })` | Deposit held asset into best-rate lending for yield | `InvestEarnResult` |
195
- | `agent.investUnearn({ asset })` | Withdraw from lending, keep in portfolio | `InvestUnearnResult` |
196
- | `agent.investRebalance({ dryRun?, minYieldDiff? })` | Move earning positions to better-rate protocols | `InvestRebalanceResult` |
197
- | `agent.getPortfolio()` | Investment positions + P&L (grouped by strategy) | `PortfolioResult` |
198
-
199
- > **Deprecated aliases:** `agent.exchange()` and `agent.exchangeQuote()` still work but are deprecated — use `agent.swap()` and `agent.swapQuote()`. Similarly, `agent.investBuy()` and `agent.investSell()` are deprecated — use `agent.buy()` and `agent.sell()`.
200
-
201
- ### Strategy Methods
202
-
203
- | Method | Description | Returns |
204
- |--------|-------------|---------|
205
- | `agent.investStrategy({ strategy, usdAmount, maxSlippage?, dryRun? })` | Buy into a strategy (single atomic PTB) | `StrategyBuyResult` |
206
- | `agent.sellStrategy({ strategy, maxSlippage? })` | Sell all positions in a strategy | `StrategySellResult` |
207
- | `agent.rebalanceStrategy({ strategy, maxSlippage?, driftThreshold? })` | Rebalance to target weights | `StrategyRebalanceResult` |
208
- | `agent.getStrategyStatus({ strategy })` | Positions, weights, drift for a strategy | `StrategyStatusResult` |
209
- | `agent.getStrategies()` | List all available strategies | `StrategyDefinition[]` |
210
- | `agent.createStrategy({ name, allocations, description? })` | Create a custom strategy | `StrategyDefinition` |
211
- | `agent.deleteStrategy({ name })` | Delete a custom strategy (no active positions) | `void` |
212
-
213
- ### Auto-Invest (DCA) Methods
214
-
215
- | Method | Description | Returns |
216
- |--------|-------------|---------|
217
- | `agent.setupAutoInvest({ amount, frequency, strategy?, asset? })` | Schedule recurring purchases | `AutoInvestSchedule` |
218
- | `agent.getAutoInvestStatus()` | View schedules and pending runs | `AutoInvestStatus` |
219
- | `agent.runAutoInvest()` | Execute all pending DCA purchases | `AutoInvestRunResult` |
220
- | `agent.stopAutoInvest({ id? })` | Stop one or all schedules | `void` |
221
-
222
141
  ### Key Management
223
142
 
224
143
  ```typescript
@@ -294,7 +213,6 @@ import {
294
213
  rawToUsdc,
295
214
  formatUsd,
296
215
  formatSui,
297
- formatAssetAmount,
298
216
  validateAddress,
299
217
  truncateAddress,
300
218
  } from '@t2000/sdk';
@@ -304,16 +222,11 @@ usdcToRaw(10.50); // 10_500_000n
304
222
  formatUsd(1234.5); // "$1234.50"
305
223
  truncateAddress('0xabcdef...1234'); // "0xabcd...1234"
306
224
  validateAddress('0x...'); // throws if invalid
307
-
308
- // Asset-aware decimal formatting
309
- formatAssetAmount('BTC', 0.00123456); // "0.00123456" (8 decimals)
310
- formatAssetAmount('ETH', 1.5); // "1.50000000" (8 decimals)
311
- formatAssetAmount('SUI', 105.26); // "105.260000000" (9 decimals)
312
225
  ```
313
226
 
314
227
  ### Advanced: Exposed Internals
315
228
 
316
- For integrations (like `@mppsui/mpp`), the agent exposes:
229
+ For integrations (like `@suimpp/mpp`), the agent exposes:
317
230
 
318
231
  ```typescript
319
232
  agent.suiClient; // SuiJsonRpcClient instance
@@ -327,13 +240,13 @@ Every operation (send, save, borrow, repay, withdraw) routes through a 3-step ga
327
240
  | Step | Strategy | Condition | How it works |
328
241
  |------|----------|-----------|--------------|
329
242
  | 1 | **Self-funded** | SUI ≥ 0.05 | Uses the agent's own SUI for gas |
330
- | 2 | **Auto-topup** | SUI < 0.05, USDC ≥ $2 | Swaps $1 USDC → SUI (swap is gas-sponsored), then self-funds |
243
+ | 2 | **Auto-topup** | SUI < 0.05, USDC ≥ $2 | Converts $1 USDC → SUI (currently disabled, falls back to step 3) |
331
244
  | 3 | **Sponsored** | Steps 1 & 2 fail | Gas Station sponsors the full transaction |
332
245
  | 4 | **Error** | All fail | Throws `INSUFFICIENT_GAS` |
333
246
 
334
247
  Every transaction result includes a `gasMethod` field (`'self-funded'` | `'auto-topup'` | `'sponsored'`) indicating which strategy was used.
335
248
 
336
- **Architecture:** Each protocol operation (NAVI, Suilend, Cetus, send) exposes both `buildXxxTx()` (standalone transaction) and `addXxxToTx()` (composable PTB) functions. Multi-step operations (save with auto-convert, withdraw with auto-swap, rebalance) compose multiple protocol calls into a single atomic PTB. `executeWithGas()` handles execution with the gas fallback chain. If any step within a PTB fails, the entire transaction reverts — no funds left in intermediate states.
249
+ **Architecture:** Each protocol operation (NAVI, send) exposes both `buildXxxTx()` (standalone transaction) and `addXxxToTx()` (composable PTB) functions. Multi-step flows compose multiple protocol calls into a single atomic PTB. `executeWithGas()` handles execution with the gas fallback chain. If any step within a PTB fails, the entire transaction reverts — no funds left in intermediate states.
337
250
 
338
251
  ## Configuration
339
252
 
@@ -345,21 +258,12 @@ Options like `pin`, `keyPath`, and `rpcUrl` are passed directly to `T2000.create
345
258
 
346
259
  ## Supported Assets
347
260
 
348
- User-facing commands are denominated in USDC the user always thinks in USDC.
349
- Save auto-converts non-USDC wallet stablecoins, withdraw auto-swaps non-USDC
350
- positions back to USDC, and repay auto-swaps USDC to the borrowed asset if
351
- debt is non-USDC (from rebalance). Rebalance optimizes across all stablecoins internally.
352
-
353
- | Asset | Display | Type | Decimals | Save | Borrow | Withdraw | Rebalance (internal) | Invest |
354
- |-------|---------|------|----------|------|--------|----------|---------------------|--------|
355
- | USDC | USDC | `0xdba3...::usdc::USDC` | 6 | ✅ | ✅ | ✅ (always returns USDC) | ✅ | — |
356
- | USDT | suiUSDT | `0x375f...::usdt::USDT` | 6 | — (via rebalance) | — | — | ✅ | — |
357
- | USDe | suiUSDe | `0x41d5...::sui_usde::SUI_USDE` | 6 | — (via rebalance) | — | — | ✅ | — |
358
- | USDsui | USDsui | `0x44f8...::usdsui::USDSUI` | 6 | — (via rebalance) | — | — | ✅ | — |
359
- | SUI | SUI | `0x2::sui::SUI` | 9 | — | — | — | — | ✅ |
360
- | BTC | Bitcoin | `0xaafb...::btc::BTC` | 8 | — | — | — | — | ✅ |
361
- | ETH | Ethereum | `0xd0e8...::eth::ETH` | 8 | — | — | — | — | ✅ |
362
- | GOLD | Gold (XAUm) | `0x9d29...::xaum::XAUM` | 9 | — | — | — | — | ✅ |
261
+ User-facing savings, credit, and transfers are denominated in **USDC**.
262
+
263
+ | Asset | Display | Type | Decimals | Save | Borrow | Withdraw |
264
+ |-------|---------|------|----------|------|--------|----------|
265
+ | USDC | USDC | `0xdba3...::usdc::USDC` | 6 | ✅ | ✅ | ✅ |
266
+ | SUI | SUI | `0x2::sui::SUI` | 9 | | | |
363
267
 
364
268
  ## Error Handling
365
269
 
@@ -376,67 +280,47 @@ try {
376
280
  }
377
281
  ```
378
282
 
379
- Common error codes: `INSUFFICIENT_BALANCE` · `INVALID_ADDRESS` · `INVALID_AMOUNT` · `HEALTH_FACTOR_TOO_LOW` · `NO_COLLATERAL` · `WALLET_NOT_FOUND` · `WALLET_LOCKED` · `WALLET_EXISTS` · `SIMULATION_FAILED` · `TRANSACTION_FAILED` · `PROTOCOL_PAUSED` · `INSUFFICIENT_GAS` · `SLIPPAGE_EXCEEDED` · `ASSET_NOT_SUPPORTED` · `WITHDRAW_WOULD_LIQUIDATE` · `AUTO_TOPUP_FAILED` · `GAS_STATION_UNAVAILABLE`
380
-
381
- ## Protocol SDKs
283
+ Common error codes: `INSUFFICIENT_BALANCE` · `INVALID_ADDRESS` · `INVALID_AMOUNT` · `HEALTH_FACTOR_TOO_LOW` · `NO_COLLATERAL` · `WALLET_NOT_FOUND` · `WALLET_LOCKED` · `WALLET_EXISTS` · `SIMULATION_FAILED` · `TRANSACTION_FAILED` · `PROTOCOL_PAUSED` · `INSUFFICIENT_GAS` · `WITHDRAW_WOULD_LIQUIDATE` · `AUTO_TOPUP_FAILED` · `GAS_STATION_UNAVAILABLE` · `SWAP_NO_ROUTE` · `SWAP_FAILED`
382
284
 
383
- t2000 uses official protocol SDKs for reliable on-chain data. All position amounts, USD values, and rates come directly from the SDKs — no hand-rolled contract parsing.
285
+ ## Protocol Integration
384
286
 
385
- | Protocol | SDK | Used for |
386
- |----------|-----|----------|
387
- | NAVI | `@naviprotocol/lending` | Lending positions, deposits, withdrawals, borrows, rewards |
388
- | Suilend | `@suilend/sdk` | Lending positions, obligation management, rewards |
389
- | Cetus | `@cetusprotocol/aggregator-sdk` (V3) | DEX aggregation, token swaps |
287
+ t2000 uses an MCP-first integration model: NAVI MCP for reads, thin transaction builders for writes. No protocol SDK dependencies needed.
390
288
 
391
- Each `PositionEntry` includes an `amountUsd` field populated by the SDK, giving accurate USD valuations for all assets including non-stablecoins (ETH, SUI, BTC, GOLD).
289
+ | Protocol | Integration | Used for |
290
+ |----------|------------|----------|
291
+ | NAVI | MCP (reads) + thin tx builders (writes) | Lending positions, deposits, withdrawals, borrows, rewards |
292
+ | Cetus Aggregator V3 | `@cetusprotocol/aggregator-sdk` (isolated) | Multi-DEX swap routing — any token pair with liquidity |
293
+ | VOLO | Thin tx builders (direct Move calls) | Stake SUI → vSUI, unstake vSUI → SUI |
392
294
 
393
295
  ## Testing
394
296
 
395
297
  ```bash
396
- # Run all SDK unit tests (568 tests)
298
+ # Run all SDK unit tests
397
299
  pnpm --filter @t2000/sdk test
398
300
 
399
301
  # Run smoke tests against mainnet RPC (read-only, no transactions)
400
302
  SMOKE=1 pnpm --filter @t2000/sdk test -- src/__smoke__
401
303
  ```
402
304
 
403
- | Test File | Coverage |
404
- |-----------|----------|
405
- | `format.test.ts` | `mistToSui`, `suiToMist`, `usdcToRaw`, `rawToUsdc`, `rawToDisplay`, `displayToRaw`, `bpsToPercent`, `formatUsd`, `formatSui`, `formatLargeNumber` |
406
- | `sui.test.ts` | `validateAddress`, `truncateAddress` |
407
- | `simulate.test.ts` | `throwIfSimulationFailed` (success, failure, missing error, metadata) |
408
- | `hashcash.test.ts` | PoW generation and verification |
409
- | `keyManager.test.ts` | Key generation, encryption, decryption, import/export |
410
- | `errors.test.ts` | `T2000Error` construction, serialization, `mapWalletError`, `mapMoveAbortCode` |
411
- | `navi.test.ts` | NAVI math utilities (health factor, APY, position calculations) |
412
- | `send.test.ts` | Send transaction building and validation |
413
- | `manager.test.ts` | Gas resolution chain (self-fund, auto-topup, sponsored fallback) |
414
- | `autoTopUp.test.ts` | Auto-topup threshold logic and swap execution |
415
- | `compliance.test.ts` | Adapter contract compliance (49 checks across all adapters) |
416
- | `registry.test.ts` | Best rates, multi-protocol routing, quote aggregation |
417
- | `cetus.test.ts` | Cetus swap adapter (metadata, quotes, transaction building) |
418
- | `suilend.test.ts` | Suilend adapter (rates, positions, health, SDK mocks) |
419
- | `t2000.integration.test.ts` | End-to-end flows (save, withdraw, borrow, repay, rebalance, auto-swap) |
420
- | `protocolFee.test.ts` | Protocol fee calculation and collection |
421
- | `serialization.test.ts` | Transaction JSON serialization roundtrip |
422
-
423
305
  ## Protocol Fees
424
306
 
425
307
  | Operation | Fee | Notes |
426
308
  |-----------|-----|-------|
427
309
  | Save (deposit) | 0.10% | Protocol fee on deposit |
428
310
  | Borrow | 0.05% | Protocol fee on loan |
429
- | Swap | **Free** | Cetus pool fees only; used internally by rebalance/auto-convert |
430
311
  | Withdraw | Free | |
431
312
  | Repay | Free | |
432
313
  | Send | Free | |
314
+ | Swap | Free | Cetus Aggregator network fees only |
315
+ | Stake (vSUI) | Free | VOLO protocol fees only |
316
+ | Unstake (vSUI) | Free | |
433
317
  | Pay (MPP) | Free | Agent pays the API price, no t2000 surcharge |
434
318
 
435
319
  Fees are collected by the t2000 protocol treasury on-chain.
436
320
 
437
321
  ## MCP Server
438
322
 
439
- The SDK powers the [`@t2000/mcp`](https://www.npmjs.com/package/@t2000/mcp) server — 35 tools and 20 prompts for Claude Desktop, Cursor, and any MCP-compatible AI platform. Run `t2000 mcp` to start.
323
+ The SDK powers the [`@t2000/mcp`](https://www.npmjs.com/package/@t2000/mcp) server for Claude Desktop, Cursor, and any MCP-compatible AI platform. Run `t2000 mcp` to start.
440
324
 
441
325
  ## License
442
326
 
@@ -1,14 +1,6 @@
1
1
  'use strict';
2
2
 
3
- // src/constants.ts
4
- process.env.T2000_PACKAGE_ID ?? "0xab92e9f1fe549ad3d6a52924a73181b45791e76120b975138fac9ec9b75db9f3";
5
- process.env.T2000_CONFIG_ID ?? "0x408add9aa9322f93cfd87523d8f603006eb8713894f4c460283c58a6888dae8a";
6
- process.env.T2000_TREASURY_ID ?? "0x3bb501b8300125dca59019247941a42af6b292a150ce3cfcce9449456be2ec91";
7
- process.env.T2000_API_URL ?? "https://api.t2000.ai";
8
- var CETUS_PACKAGE = "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb";
9
-
10
3
  // src/adapters/descriptors.ts
11
- var SUILEND_PACKAGE = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
12
4
  var naviDescriptor = {
13
5
  id: "navi",
14
6
  name: "NAVI Protocol",
@@ -25,44 +17,11 @@ var naviDescriptor = {
25
17
  "incentive_v3::repay": "repay"
26
18
  }
27
19
  };
28
- var suilendDescriptor = {
29
- id: "suilend",
30
- name: "Suilend",
31
- packages: [SUILEND_PACKAGE],
32
- actionMap: {
33
- "lending_market::deposit_liquidity_and_mint_ctokens": "save",
34
- "lending_market::deposit_ctokens_into_obligation": "save",
35
- "lending_market::create_obligation": "save",
36
- "lending_market::withdraw_ctokens": "withdraw",
37
- "lending_market::redeem_ctokens_and_withdraw_liquidity": "withdraw",
38
- "lending_market::redeem_ctokens_and_withdraw_liquidity_request": "withdraw",
39
- "lending_market::fulfill_liquidity_request": "withdraw",
40
- "lending_market::unstake_sui_from_staker": "withdraw",
41
- "lending_market::borrow": "borrow",
42
- "lending_market::repay": "repay"
43
- }
44
- };
45
- var cetusDescriptor = {
46
- id: "cetus",
47
- name: "Cetus DEX",
48
- packages: [CETUS_PACKAGE],
49
- actionMap: {
50
- "router::swap": "swap",
51
- "router::swap_ab_bc": "swap",
52
- "router::swap_ab_cb": "swap",
53
- "router::swap_ba_bc": "swap",
54
- "router::swap_ba_cb": "swap"
55
- }
56
- };
57
20
  var allDescriptors = [
58
- naviDescriptor,
59
- suilendDescriptor,
60
- cetusDescriptor
21
+ naviDescriptor
61
22
  ];
62
23
 
63
24
  exports.allDescriptors = allDescriptors;
64
- exports.cetusDescriptor = cetusDescriptor;
65
25
  exports.naviDescriptor = naviDescriptor;
66
- exports.suilendDescriptor = suilendDescriptor;
67
26
  //# sourceMappingURL=descriptors.cjs.map
68
27
  //# sourceMappingURL=descriptors.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/constants.ts","../../src/adapters/descriptors.ts"],"names":[],"mappings":";;;AA6EgC,OAAA,CAAQ,GAAA,CAAI,gBAAA,IAAoB;AACjC,OAAA,CAAQ,GAAA,CAAI,eAAA,IAAmB;AAE7B,OAAA,CAAQ,GAAA,CAAI,iBAAA,IAAqB;AAOtC,OAAA,CAAQ,GAAA,CAAI,aAAA,IAAiB;AAIlD,IAAM,aAAA,GAAgB,oEAAA;;;ACtF7B,IAAM,eAAA,GAAkB,oEAAA;AAEjB,IAAM,cAAA,GAAqC;AAAA,EAChD,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EAAM,eAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,gBAAA,EAAkB,IAAA;AAAA,EAClB,SAAA,EAAW;AAAA,IACT,6BAAA,EAA+B,MAAA;AAAA,IAC/B,uBAAA,EAAyB,MAAA;AAAA,IACzB,2BAAA,EAA6B,UAAA;AAAA,IAC7B,8BAAA,EAAgC,UAAA;AAAA,IAChC,yBAAA,EAA2B,QAAA;AAAA,IAC3B,4BAAA,EAA8B,QAAA;AAAA,IAC9B,2BAAA,EAA6B,OAAA;AAAA,IAC7B,qBAAA,EAAuB;AAAA;AAE3B;AAEO,IAAM,iBAAA,GAAwC;AAAA,EACnD,EAAA,EAAI,SAAA;AAAA,EACJ,IAAA,EAAM,SAAA;AAAA,EACN,QAAA,EAAU,CAAC,eAAe,CAAA;AAAA,EAC1B,SAAA,EAAW;AAAA,IACT,oDAAA,EAAsD,MAAA;AAAA,IACtD,iDAAA,EAAmD,MAAA;AAAA,IACnD,mCAAA,EAAqC,MAAA;AAAA,IACrC,kCAAA,EAAoC,UAAA;AAAA,IACpC,uDAAA,EAAyD,UAAA;AAAA,IACzD,+DAAA,EAAiE,UAAA;AAAA,IACjE,2CAAA,EAA6C,UAAA;AAAA,IAC7C,yCAAA,EAA2C,UAAA;AAAA,IAC3C,wBAAA,EAA0B,QAAA;AAAA,IAC1B,uBAAA,EAAyB;AAAA;AAE7B;AAEO,IAAM,eAAA,GAAsC;AAAA,EACjD,EAAA,EAAI,OAAA;AAAA,EACJ,IAAA,EAAM,WAAA;AAAA,EACN,QAAA,EAAU,CAAC,aAAa,CAAA;AAAA,EACxB,SAAA,EAAW;AAAA,IACT,cAAA,EAAgB,MAAA;AAAA,IAChB,oBAAA,EAAsB,MAAA;AAAA,IACtB,oBAAA,EAAsB,MAAA;AAAA,IACtB,oBAAA,EAAsB,MAAA;AAAA,IACtB,oBAAA,EAAsB;AAAA;AAE1B;AAEO,IAAM,cAAA,GAAuC;AAAA,EAClD,cAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF","file":"descriptors.cjs","sourcesContent":["export const MIST_PER_SUI = 1_000_000_000n;\nexport const SUI_DECIMALS = 9;\nexport const USDC_DECIMALS = 6;\n\nexport const BPS_DENOMINATOR = 10_000n;\nexport const PRECISION = 1_000_000_000_000_000_000n;\n\nexport const MIN_DEPOSIT = 1_000_000n; // 1 USDC (6 decimals)\nexport const GAS_RESERVE_USDC = 1_000_000n; // $1 USDC reserved for gas\nexport const AUTO_TOPUP_THRESHOLD = 50_000_000n; // 0.05 SUI — minimum to attempt self-funded TX\nexport const GAS_RESERVE_TARGET = 150_000_000n; // 0.15 SUI — proactive top-up target (covers complex TXs)\nexport const AUTO_TOPUP_AMOUNT = 1_000_000n; // $1 USDC worth of SUI\nexport const AUTO_TOPUP_MIN_USDC = 2_000_000n; // $2 USDC minimum to trigger auto-topup\nexport const BOOTSTRAP_LIMIT = 10;\nexport const GAS_FEE_CEILING_USD = 0.05;\n\nexport const SAVE_FEE_BPS = 10n; // 0.1%\nexport const SWAP_FEE_BPS = 0n; // Free — Cetus already charges pool fees\nexport const BORROW_FEE_BPS = 5n; // 0.05%\n\nexport const CLOCK_ID = '0x6';\n\nexport const SUPPORTED_ASSETS = {\n USDC: {\n type: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n decimals: 6,\n symbol: 'USDC',\n displayName: 'USDC',\n },\n USDT: {\n type: '0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT',\n decimals: 6,\n symbol: 'USDT',\n displayName: 'suiUSDT',\n },\n USDe: {\n type: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n decimals: 6,\n symbol: 'USDe',\n displayName: 'suiUSDe',\n },\n USDsui: {\n type: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',\n decimals: 6,\n symbol: 'USDsui',\n displayName: 'USDsui',\n },\n SUI: {\n type: '0x2::sui::SUI',\n decimals: 9,\n symbol: 'SUI',\n displayName: 'SUI',\n },\n BTC: {\n type: '0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC',\n decimals: 8,\n symbol: 'BTC',\n displayName: 'Bitcoin',\n },\n ETH: {\n type: '0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH',\n decimals: 8,\n symbol: 'ETH',\n displayName: 'Ethereum',\n },\n GOLD: {\n type: '0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM',\n decimals: 9,\n symbol: 'GOLD',\n displayName: 'Gold',\n },\n} as const;\n\nexport type SupportedAsset = keyof typeof SUPPORTED_ASSETS;\nexport type StableAsset = Exclude<SupportedAsset, 'SUI' | 'BTC' | 'ETH' | 'GOLD'>;\nexport const STABLE_ASSETS: readonly StableAsset[] = ['USDC', 'USDT', 'USDe', 'USDsui'] as const;\n\nexport const T2000_PACKAGE_ID = process.env.T2000_PACKAGE_ID ?? '0xab92e9f1fe549ad3d6a52924a73181b45791e76120b975138fac9ec9b75db9f3';\nexport const T2000_CONFIG_ID = process.env.T2000_CONFIG_ID ?? '0x408add9aa9322f93cfd87523d8f603006eb8713894f4c460283c58a6888dae8a';\nexport const T2000_ADMIN_CAP_ID = '0x863d1b02cba1b93d0fe9b87eb92d58b60c1e85c001022cb2a760e07bade47e65';\nexport const T2000_TREASURY_ID = process.env.T2000_TREASURY_ID ?? '0x3bb501b8300125dca59019247941a42af6b292a150ce3cfcce9449456be2ec91';\n\nexport const DEFAULT_NETWORK = 'mainnet' as const;\nexport const DEFAULT_RPC_URL = 'https://fullnode.mainnet.sui.io:443';\nexport const DEFAULT_KEY_PATH = '~/.t2000/wallet.key';\nexport const DEFAULT_CONFIG_PATH = '~/.t2000/config.json';\n\nexport const API_BASE_URL = process.env.T2000_API_URL ?? 'https://api.t2000.ai';\n\nexport const CETUS_USDC_SUI_POOL = '0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab';\nexport const CETUS_GLOBAL_CONFIG = '0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f';\nexport const CETUS_PACKAGE = '0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb';\n\n// --- Investment ---\n\nexport const INVESTMENT_ASSETS = {\n SUI: SUPPORTED_ASSETS.SUI,\n BTC: SUPPORTED_ASSETS.BTC,\n ETH: SUPPORTED_ASSETS.ETH,\n GOLD: SUPPORTED_ASSETS.GOLD,\n} as const;\n\nexport type InvestmentAsset = keyof typeof INVESTMENT_ASSETS;\n\nexport const DEFAULT_STRATEGIES = {\n bluechip: {\n name: 'Bluechip / Large-Cap',\n allocations: { BTC: 50, ETH: 30, SUI: 20 },\n description: 'Large-cap crypto index',\n custom: false,\n },\n layer1: {\n name: 'Smart Contract Platforms',\n allocations: { ETH: 50, SUI: 50 },\n description: 'Smart contract platforms',\n custom: false,\n },\n 'sui-heavy': {\n name: 'Sui-Weighted Portfolio',\n allocations: { BTC: 20, ETH: 20, SUI: 60 },\n description: 'Sui-weighted portfolio',\n custom: false,\n },\n 'all-weather': {\n name: 'All-Weather Portfolio',\n allocations: { BTC: 30, ETH: 20, SUI: 20, GOLD: 30 },\n description: 'Crypto and commodities',\n custom: false,\n },\n 'safe-haven': {\n name: 'Safe Haven',\n allocations: { BTC: 50, GOLD: 50 },\n description: 'Store-of-value assets',\n custom: false,\n },\n} as const;\n\nexport const PERPS_MARKETS = ['SUI-PERP'] as const;\nexport type PerpsMarket = (typeof PERPS_MARKETS)[number];\n\nexport const DEFAULT_MAX_LEVERAGE = 5;\nexport const DEFAULT_MAX_POSITION_SIZE = 1000;\nexport const INVEST_FEE_BPS = 0n;\nexport const GAS_RESERVE_MIN = 0.05; // minimum SUI to keep for gas\n","import type { ProtocolDescriptor } from './types.js';\nimport { CETUS_PACKAGE } from '../constants.js';\n\nexport type { ProtocolDescriptor } from './types.js';\n\nconst SUILEND_PACKAGE = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf';\n\nexport const naviDescriptor: ProtocolDescriptor = {\n id: 'navi',\n name: 'NAVI Protocol',\n packages: [],\n dynamicPackageId: true,\n actionMap: {\n 'incentive_v3::entry_deposit': 'save',\n 'incentive_v3::deposit': 'save',\n 'incentive_v3::withdraw_v2': 'withdraw',\n 'incentive_v3::entry_withdraw': 'withdraw',\n 'incentive_v3::borrow_v2': 'borrow',\n 'incentive_v3::entry_borrow': 'borrow',\n 'incentive_v3::entry_repay': 'repay',\n 'incentive_v3::repay': 'repay',\n },\n};\n\nexport const suilendDescriptor: ProtocolDescriptor = {\n id: 'suilend',\n name: 'Suilend',\n packages: [SUILEND_PACKAGE],\n actionMap: {\n 'lending_market::deposit_liquidity_and_mint_ctokens': 'save',\n 'lending_market::deposit_ctokens_into_obligation': 'save',\n 'lending_market::create_obligation': 'save',\n 'lending_market::withdraw_ctokens': 'withdraw',\n 'lending_market::redeem_ctokens_and_withdraw_liquidity': 'withdraw',\n 'lending_market::redeem_ctokens_and_withdraw_liquidity_request': 'withdraw',\n 'lending_market::fulfill_liquidity_request': 'withdraw',\n 'lending_market::unstake_sui_from_staker': 'withdraw',\n 'lending_market::borrow': 'borrow',\n 'lending_market::repay': 'repay',\n },\n};\n\nexport const cetusDescriptor: ProtocolDescriptor = {\n id: 'cetus',\n name: 'Cetus DEX',\n packages: [CETUS_PACKAGE],\n actionMap: {\n 'router::swap': 'swap',\n 'router::swap_ab_bc': 'swap',\n 'router::swap_ab_cb': 'swap',\n 'router::swap_ba_bc': 'swap',\n 'router::swap_ba_cb': 'swap',\n },\n};\n\nexport const allDescriptors: ProtocolDescriptor[] = [\n naviDescriptor,\n suilendDescriptor,\n cetusDescriptor,\n];\n"]}
1
+ {"version":3,"sources":["../../src/adapters/descriptors.ts"],"names":[],"mappings":";;;AAIO,IAAM,cAAA,GAAqC;AAAA,EAChD,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EAAM,eAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,gBAAA,EAAkB,IAAA;AAAA,EAClB,SAAA,EAAW;AAAA,IACT,6BAAA,EAA+B,MAAA;AAAA,IAC/B,uBAAA,EAAyB,MAAA;AAAA,IACzB,2BAAA,EAA6B,UAAA;AAAA,IAC7B,8BAAA,EAAgC,UAAA;AAAA,IAChC,yBAAA,EAA2B,QAAA;AAAA,IAC3B,4BAAA,EAA8B,QAAA;AAAA,IAC9B,2BAAA,EAA6B,OAAA;AAAA,IAC7B,qBAAA,EAAuB;AAAA;AAE3B;AAEO,IAAM,cAAA,GAAuC;AAAA,EAClD;AACF","file":"descriptors.cjs","sourcesContent":["import type { ProtocolDescriptor } from './types.js';\n\nexport type { ProtocolDescriptor } from './types.js';\n\nexport const naviDescriptor: ProtocolDescriptor = {\n id: 'navi',\n name: 'NAVI Protocol',\n packages: [],\n dynamicPackageId: true,\n actionMap: {\n 'incentive_v3::entry_deposit': 'save',\n 'incentive_v3::deposit': 'save',\n 'incentive_v3::withdraw_v2': 'withdraw',\n 'incentive_v3::entry_withdraw': 'withdraw',\n 'incentive_v3::borrow_v2': 'borrow',\n 'incentive_v3::entry_borrow': 'borrow',\n 'incentive_v3::entry_repay': 'repay',\n 'incentive_v3::repay': 'repay',\n },\n};\n\nexport const allDescriptors: ProtocolDescriptor[] = [\n naviDescriptor,\n];\n"]}
@@ -1,3 +1,3 @@
1
- export { $ as ProtocolDescriptor, a2 as allDescriptors, a3 as cetusDescriptor, a4 as naviDescriptor, a5 as suilendDescriptor } from '../descriptors-B6qt_mwi.cjs';
1
+ export { P as ProtocolDescriptor, d as allDescriptors, n as naviDescriptor } from '../descriptors-Be4FAgN5.cjs';
2
2
  import '@mysten/sui/transactions';
3
3
  import '@mysten/sui/jsonRpc';
@@ -1,3 +1,3 @@
1
- export { $ as ProtocolDescriptor, a2 as allDescriptors, a3 as cetusDescriptor, a4 as naviDescriptor, a5 as suilendDescriptor } from '../descriptors-B6qt_mwi.js';
1
+ export { P as ProtocolDescriptor, d as allDescriptors, n as naviDescriptor } from '../descriptors-Be4FAgN5.js';
2
2
  import '@mysten/sui/transactions';
3
3
  import '@mysten/sui/jsonRpc';
@@ -1,12 +1,4 @@
1
- // src/constants.ts
2
- process.env.T2000_PACKAGE_ID ?? "0xab92e9f1fe549ad3d6a52924a73181b45791e76120b975138fac9ec9b75db9f3";
3
- process.env.T2000_CONFIG_ID ?? "0x408add9aa9322f93cfd87523d8f603006eb8713894f4c460283c58a6888dae8a";
4
- process.env.T2000_TREASURY_ID ?? "0x3bb501b8300125dca59019247941a42af6b292a150ce3cfcce9449456be2ec91";
5
- process.env.T2000_API_URL ?? "https://api.t2000.ai";
6
- var CETUS_PACKAGE = "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb";
7
-
8
1
  // src/adapters/descriptors.ts
9
- var SUILEND_PACKAGE = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
10
2
  var naviDescriptor = {
11
3
  id: "navi",
12
4
  name: "NAVI Protocol",
@@ -23,41 +15,10 @@ var naviDescriptor = {
23
15
  "incentive_v3::repay": "repay"
24
16
  }
25
17
  };
26
- var suilendDescriptor = {
27
- id: "suilend",
28
- name: "Suilend",
29
- packages: [SUILEND_PACKAGE],
30
- actionMap: {
31
- "lending_market::deposit_liquidity_and_mint_ctokens": "save",
32
- "lending_market::deposit_ctokens_into_obligation": "save",
33
- "lending_market::create_obligation": "save",
34
- "lending_market::withdraw_ctokens": "withdraw",
35
- "lending_market::redeem_ctokens_and_withdraw_liquidity": "withdraw",
36
- "lending_market::redeem_ctokens_and_withdraw_liquidity_request": "withdraw",
37
- "lending_market::fulfill_liquidity_request": "withdraw",
38
- "lending_market::unstake_sui_from_staker": "withdraw",
39
- "lending_market::borrow": "borrow",
40
- "lending_market::repay": "repay"
41
- }
42
- };
43
- var cetusDescriptor = {
44
- id: "cetus",
45
- name: "Cetus DEX",
46
- packages: [CETUS_PACKAGE],
47
- actionMap: {
48
- "router::swap": "swap",
49
- "router::swap_ab_bc": "swap",
50
- "router::swap_ab_cb": "swap",
51
- "router::swap_ba_bc": "swap",
52
- "router::swap_ba_cb": "swap"
53
- }
54
- };
55
18
  var allDescriptors = [
56
- naviDescriptor,
57
- suilendDescriptor,
58
- cetusDescriptor
19
+ naviDescriptor
59
20
  ];
60
21
 
61
- export { allDescriptors, cetusDescriptor, naviDescriptor, suilendDescriptor };
22
+ export { allDescriptors, naviDescriptor };
62
23
  //# sourceMappingURL=descriptors.js.map
63
24
  //# sourceMappingURL=descriptors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/constants.ts","../../src/adapters/descriptors.ts"],"names":[],"mappings":";AA6EgC,OAAA,CAAQ,GAAA,CAAI,gBAAA,IAAoB;AACjC,OAAA,CAAQ,GAAA,CAAI,eAAA,IAAmB;AAE7B,OAAA,CAAQ,GAAA,CAAI,iBAAA,IAAqB;AAOtC,OAAA,CAAQ,GAAA,CAAI,aAAA,IAAiB;AAIlD,IAAM,aAAA,GAAgB,oEAAA;;;ACtF7B,IAAM,eAAA,GAAkB,oEAAA;AAEjB,IAAM,cAAA,GAAqC;AAAA,EAChD,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EAAM,eAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,gBAAA,EAAkB,IAAA;AAAA,EAClB,SAAA,EAAW;AAAA,IACT,6BAAA,EAA+B,MAAA;AAAA,IAC/B,uBAAA,EAAyB,MAAA;AAAA,IACzB,2BAAA,EAA6B,UAAA;AAAA,IAC7B,8BAAA,EAAgC,UAAA;AAAA,IAChC,yBAAA,EAA2B,QAAA;AAAA,IAC3B,4BAAA,EAA8B,QAAA;AAAA,IAC9B,2BAAA,EAA6B,OAAA;AAAA,IAC7B,qBAAA,EAAuB;AAAA;AAE3B;AAEO,IAAM,iBAAA,GAAwC;AAAA,EACnD,EAAA,EAAI,SAAA;AAAA,EACJ,IAAA,EAAM,SAAA;AAAA,EACN,QAAA,EAAU,CAAC,eAAe,CAAA;AAAA,EAC1B,SAAA,EAAW;AAAA,IACT,oDAAA,EAAsD,MAAA;AAAA,IACtD,iDAAA,EAAmD,MAAA;AAAA,IACnD,mCAAA,EAAqC,MAAA;AAAA,IACrC,kCAAA,EAAoC,UAAA;AAAA,IACpC,uDAAA,EAAyD,UAAA;AAAA,IACzD,+DAAA,EAAiE,UAAA;AAAA,IACjE,2CAAA,EAA6C,UAAA;AAAA,IAC7C,yCAAA,EAA2C,UAAA;AAAA,IAC3C,wBAAA,EAA0B,QAAA;AAAA,IAC1B,uBAAA,EAAyB;AAAA;AAE7B;AAEO,IAAM,eAAA,GAAsC;AAAA,EACjD,EAAA,EAAI,OAAA;AAAA,EACJ,IAAA,EAAM,WAAA;AAAA,EACN,QAAA,EAAU,CAAC,aAAa,CAAA;AAAA,EACxB,SAAA,EAAW;AAAA,IACT,cAAA,EAAgB,MAAA;AAAA,IAChB,oBAAA,EAAsB,MAAA;AAAA,IACtB,oBAAA,EAAsB,MAAA;AAAA,IACtB,oBAAA,EAAsB,MAAA;AAAA,IACtB,oBAAA,EAAsB;AAAA;AAE1B;AAEO,IAAM,cAAA,GAAuC;AAAA,EAClD,cAAA;AAAA,EACA,iBAAA;AAAA,EACA;AACF","file":"descriptors.js","sourcesContent":["export const MIST_PER_SUI = 1_000_000_000n;\nexport const SUI_DECIMALS = 9;\nexport const USDC_DECIMALS = 6;\n\nexport const BPS_DENOMINATOR = 10_000n;\nexport const PRECISION = 1_000_000_000_000_000_000n;\n\nexport const MIN_DEPOSIT = 1_000_000n; // 1 USDC (6 decimals)\nexport const GAS_RESERVE_USDC = 1_000_000n; // $1 USDC reserved for gas\nexport const AUTO_TOPUP_THRESHOLD = 50_000_000n; // 0.05 SUI — minimum to attempt self-funded TX\nexport const GAS_RESERVE_TARGET = 150_000_000n; // 0.15 SUI — proactive top-up target (covers complex TXs)\nexport const AUTO_TOPUP_AMOUNT = 1_000_000n; // $1 USDC worth of SUI\nexport const AUTO_TOPUP_MIN_USDC = 2_000_000n; // $2 USDC minimum to trigger auto-topup\nexport const BOOTSTRAP_LIMIT = 10;\nexport const GAS_FEE_CEILING_USD = 0.05;\n\nexport const SAVE_FEE_BPS = 10n; // 0.1%\nexport const SWAP_FEE_BPS = 0n; // Free — Cetus already charges pool fees\nexport const BORROW_FEE_BPS = 5n; // 0.05%\n\nexport const CLOCK_ID = '0x6';\n\nexport const SUPPORTED_ASSETS = {\n USDC: {\n type: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n decimals: 6,\n symbol: 'USDC',\n displayName: 'USDC',\n },\n USDT: {\n type: '0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT',\n decimals: 6,\n symbol: 'USDT',\n displayName: 'suiUSDT',\n },\n USDe: {\n type: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n decimals: 6,\n symbol: 'USDe',\n displayName: 'suiUSDe',\n },\n USDsui: {\n type: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',\n decimals: 6,\n symbol: 'USDsui',\n displayName: 'USDsui',\n },\n SUI: {\n type: '0x2::sui::SUI',\n decimals: 9,\n symbol: 'SUI',\n displayName: 'SUI',\n },\n BTC: {\n type: '0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC',\n decimals: 8,\n symbol: 'BTC',\n displayName: 'Bitcoin',\n },\n ETH: {\n type: '0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH',\n decimals: 8,\n symbol: 'ETH',\n displayName: 'Ethereum',\n },\n GOLD: {\n type: '0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM',\n decimals: 9,\n symbol: 'GOLD',\n displayName: 'Gold',\n },\n} as const;\n\nexport type SupportedAsset = keyof typeof SUPPORTED_ASSETS;\nexport type StableAsset = Exclude<SupportedAsset, 'SUI' | 'BTC' | 'ETH' | 'GOLD'>;\nexport const STABLE_ASSETS: readonly StableAsset[] = ['USDC', 'USDT', 'USDe', 'USDsui'] as const;\n\nexport const T2000_PACKAGE_ID = process.env.T2000_PACKAGE_ID ?? '0xab92e9f1fe549ad3d6a52924a73181b45791e76120b975138fac9ec9b75db9f3';\nexport const T2000_CONFIG_ID = process.env.T2000_CONFIG_ID ?? '0x408add9aa9322f93cfd87523d8f603006eb8713894f4c460283c58a6888dae8a';\nexport const T2000_ADMIN_CAP_ID = '0x863d1b02cba1b93d0fe9b87eb92d58b60c1e85c001022cb2a760e07bade47e65';\nexport const T2000_TREASURY_ID = process.env.T2000_TREASURY_ID ?? '0x3bb501b8300125dca59019247941a42af6b292a150ce3cfcce9449456be2ec91';\n\nexport const DEFAULT_NETWORK = 'mainnet' as const;\nexport const DEFAULT_RPC_URL = 'https://fullnode.mainnet.sui.io:443';\nexport const DEFAULT_KEY_PATH = '~/.t2000/wallet.key';\nexport const DEFAULT_CONFIG_PATH = '~/.t2000/config.json';\n\nexport const API_BASE_URL = process.env.T2000_API_URL ?? 'https://api.t2000.ai';\n\nexport const CETUS_USDC_SUI_POOL = '0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab';\nexport const CETUS_GLOBAL_CONFIG = '0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f';\nexport const CETUS_PACKAGE = '0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb';\n\n// --- Investment ---\n\nexport const INVESTMENT_ASSETS = {\n SUI: SUPPORTED_ASSETS.SUI,\n BTC: SUPPORTED_ASSETS.BTC,\n ETH: SUPPORTED_ASSETS.ETH,\n GOLD: SUPPORTED_ASSETS.GOLD,\n} as const;\n\nexport type InvestmentAsset = keyof typeof INVESTMENT_ASSETS;\n\nexport const DEFAULT_STRATEGIES = {\n bluechip: {\n name: 'Bluechip / Large-Cap',\n allocations: { BTC: 50, ETH: 30, SUI: 20 },\n description: 'Large-cap crypto index',\n custom: false,\n },\n layer1: {\n name: 'Smart Contract Platforms',\n allocations: { ETH: 50, SUI: 50 },\n description: 'Smart contract platforms',\n custom: false,\n },\n 'sui-heavy': {\n name: 'Sui-Weighted Portfolio',\n allocations: { BTC: 20, ETH: 20, SUI: 60 },\n description: 'Sui-weighted portfolio',\n custom: false,\n },\n 'all-weather': {\n name: 'All-Weather Portfolio',\n allocations: { BTC: 30, ETH: 20, SUI: 20, GOLD: 30 },\n description: 'Crypto and commodities',\n custom: false,\n },\n 'safe-haven': {\n name: 'Safe Haven',\n allocations: { BTC: 50, GOLD: 50 },\n description: 'Store-of-value assets',\n custom: false,\n },\n} as const;\n\nexport const PERPS_MARKETS = ['SUI-PERP'] as const;\nexport type PerpsMarket = (typeof PERPS_MARKETS)[number];\n\nexport const DEFAULT_MAX_LEVERAGE = 5;\nexport const DEFAULT_MAX_POSITION_SIZE = 1000;\nexport const INVEST_FEE_BPS = 0n;\nexport const GAS_RESERVE_MIN = 0.05; // minimum SUI to keep for gas\n","import type { ProtocolDescriptor } from './types.js';\nimport { CETUS_PACKAGE } from '../constants.js';\n\nexport type { ProtocolDescriptor } from './types.js';\n\nconst SUILEND_PACKAGE = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf';\n\nexport const naviDescriptor: ProtocolDescriptor = {\n id: 'navi',\n name: 'NAVI Protocol',\n packages: [],\n dynamicPackageId: true,\n actionMap: {\n 'incentive_v3::entry_deposit': 'save',\n 'incentive_v3::deposit': 'save',\n 'incentive_v3::withdraw_v2': 'withdraw',\n 'incentive_v3::entry_withdraw': 'withdraw',\n 'incentive_v3::borrow_v2': 'borrow',\n 'incentive_v3::entry_borrow': 'borrow',\n 'incentive_v3::entry_repay': 'repay',\n 'incentive_v3::repay': 'repay',\n },\n};\n\nexport const suilendDescriptor: ProtocolDescriptor = {\n id: 'suilend',\n name: 'Suilend',\n packages: [SUILEND_PACKAGE],\n actionMap: {\n 'lending_market::deposit_liquidity_and_mint_ctokens': 'save',\n 'lending_market::deposit_ctokens_into_obligation': 'save',\n 'lending_market::create_obligation': 'save',\n 'lending_market::withdraw_ctokens': 'withdraw',\n 'lending_market::redeem_ctokens_and_withdraw_liquidity': 'withdraw',\n 'lending_market::redeem_ctokens_and_withdraw_liquidity_request': 'withdraw',\n 'lending_market::fulfill_liquidity_request': 'withdraw',\n 'lending_market::unstake_sui_from_staker': 'withdraw',\n 'lending_market::borrow': 'borrow',\n 'lending_market::repay': 'repay',\n },\n};\n\nexport const cetusDescriptor: ProtocolDescriptor = {\n id: 'cetus',\n name: 'Cetus DEX',\n packages: [CETUS_PACKAGE],\n actionMap: {\n 'router::swap': 'swap',\n 'router::swap_ab_bc': 'swap',\n 'router::swap_ab_cb': 'swap',\n 'router::swap_ba_bc': 'swap',\n 'router::swap_ba_cb': 'swap',\n },\n};\n\nexport const allDescriptors: ProtocolDescriptor[] = [\n naviDescriptor,\n suilendDescriptor,\n cetusDescriptor,\n];\n"]}
1
+ {"version":3,"sources":["../../src/adapters/descriptors.ts"],"names":[],"mappings":";AAIO,IAAM,cAAA,GAAqC;AAAA,EAChD,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EAAM,eAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,gBAAA,EAAkB,IAAA;AAAA,EAClB,SAAA,EAAW;AAAA,IACT,6BAAA,EAA+B,MAAA;AAAA,IAC/B,uBAAA,EAAyB,MAAA;AAAA,IACzB,2BAAA,EAA6B,UAAA;AAAA,IAC7B,8BAAA,EAAgC,UAAA;AAAA,IAChC,yBAAA,EAA2B,QAAA;AAAA,IAC3B,4BAAA,EAA8B,QAAA;AAAA,IAC9B,2BAAA,EAA6B,OAAA;AAAA,IAC7B,qBAAA,EAAuB;AAAA;AAE3B;AAEO,IAAM,cAAA,GAAuC;AAAA,EAClD;AACF","file":"descriptors.js","sourcesContent":["import type { ProtocolDescriptor } from './types.js';\n\nexport type { ProtocolDescriptor } from './types.js';\n\nexport const naviDescriptor: ProtocolDescriptor = {\n id: 'navi',\n name: 'NAVI Protocol',\n packages: [],\n dynamicPackageId: true,\n actionMap: {\n 'incentive_v3::entry_deposit': 'save',\n 'incentive_v3::deposit': 'save',\n 'incentive_v3::withdraw_v2': 'withdraw',\n 'incentive_v3::entry_withdraw': 'withdraw',\n 'incentive_v3::borrow_v2': 'borrow',\n 'incentive_v3::entry_borrow': 'borrow',\n 'incentive_v3::entry_repay': 'repay',\n 'incentive_v3::repay': 'repay',\n },\n};\n\nexport const allDescriptors: ProtocolDescriptor[] = [\n naviDescriptor,\n];\n"]}