@t2000/cli 0.25.15 → 0.26.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.
@@ -63840,6 +63840,21 @@ var init_errors = __esm2({
63840
63840
  };
63841
63841
  }
63842
63842
  });
63843
+ function isTier1(coinType) {
63844
+ const meta = BY_TYPE.get(coinType);
63845
+ return meta?.tier === 1;
63846
+ }
63847
+ function isTier2(coinType) {
63848
+ const meta = BY_TYPE.get(coinType);
63849
+ return meta?.tier === 2;
63850
+ }
63851
+ function isSupported(coinType) {
63852
+ const meta = BY_TYPE.get(coinType);
63853
+ return meta?.tier !== void 0;
63854
+ }
63855
+ function getTier(coinType) {
63856
+ return BY_TYPE.get(coinType)?.tier;
63857
+ }
63843
63858
  function getDecimalsForCoinType(coinType) {
63844
63859
  const direct = BY_TYPE.get(coinType);
63845
63860
  if (direct) return direct.decimals;
@@ -63880,32 +63895,32 @@ var ETH_TYPE;
63880
63895
  var WBTC_TYPE;
63881
63896
  var WAL_TYPE;
63882
63897
  var NAVX_TYPE;
63898
+ var IKA_TYPE;
63899
+ var LOFI_TYPE;
63900
+ var MANIFEST_TYPE;
63883
63901
  var init_token_registry = __esm2({
63884
63902
  "src/token-registry.ts"() {
63885
63903
  COIN_REGISTRY = {
63886
- SUI: { type: "0x2::sui::SUI", decimals: 9, symbol: "SUI" },
63887
- USDC: { type: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC", decimals: 6, symbol: "USDC" },
63904
+ // ── Tier 1 Financial layer ──────────────────────────────────────────
63905
+ USDC: { type: "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC", decimals: 6, symbol: "USDC", tier: 1 },
63906
+ // ── Tier 2 — Swap assets (13 tokens) ──────────────────────────────────
63907
+ SUI: { type: "0x2::sui::SUI", decimals: 9, symbol: "SUI", tier: 2 },
63908
+ wBTC: { type: "0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC", decimals: 8, symbol: "wBTC", tier: 2 },
63909
+ ETH: { type: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH", decimals: 8, symbol: "ETH", tier: 2 },
63910
+ GOLD: { type: "0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM", decimals: 6, symbol: "GOLD", tier: 2 },
63911
+ DEEP: { type: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP", decimals: 6, symbol: "DEEP", tier: 2 },
63912
+ WAL: { type: "0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL", decimals: 9, symbol: "WAL", tier: 2 },
63913
+ NS: { type: "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS", decimals: 6, symbol: "NS", tier: 2 },
63914
+ IKA: { type: "0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa::ika::IKA", decimals: 9, symbol: "IKA", tier: 2 },
63915
+ CETUS: { type: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS", decimals: 9, symbol: "CETUS", tier: 2 },
63916
+ NAVX: { type: "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX", decimals: 9, symbol: "NAVX", tier: 2 },
63917
+ vSUI: { type: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", decimals: 9, symbol: "vSUI", tier: 2 },
63918
+ LOFI: { type: "0xf22da9a24ad027cccb5f2d496cbe91de953d363513db08a3a734d361c7c17503::LOFI::LOFI", decimals: 9, symbol: "LOFI", tier: 2 },
63919
+ MANIFEST: { type: "0xc466c28d87b3d5cd34f3d5c088751532d71a38d93a8aae4551dd56272cfb4355::manifest::MANIFEST", decimals: 9, symbol: "MANIFEST", tier: 2 },
63920
+ // ── Legacy — no tier, kept for display accuracy on existing positions ──
63888
63921
  USDT: { type: "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT", decimals: 6, symbol: "USDT" },
63889
63922
  USDe: { type: "0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE", decimals: 6, symbol: "USDe" },
63890
- USDSUI: { type: "0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI", decimals: 6, symbol: "USDsui" },
63891
- WAL: { type: "0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL", decimals: 9, symbol: "WAL" },
63892
- ETH: { type: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH", decimals: 8, symbol: "ETH" },
63893
- wBTC: { type: "0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC", decimals: 8, symbol: "wBTC" },
63894
- NAVX: { type: "0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX", decimals: 9, symbol: "NAVX" },
63895
- CETUS: { type: "0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS", decimals: 9, symbol: "CETUS" },
63896
- DEEP: { type: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP", decimals: 6, symbol: "DEEP" },
63897
- NS: { type: "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS", decimals: 6, symbol: "NS" },
63898
- GOLD: { type: "0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM", decimals: 6, symbol: "GOLD" },
63899
- MANIFEST: { type: "0xc466c28d87b3d5cd34f3d5c088751532d71a38d93a8aae4551dd56272cfb4355::manifest::MANIFEST", decimals: 9, symbol: "MANIFEST" },
63900
- vSUI: { type: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", decimals: 9, symbol: "vSUI" },
63901
- haSUI: { type: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e136a8bc::hasui::HASUI", decimals: 9, symbol: "haSUI" },
63902
- afSUI: { type: "0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI", decimals: 9, symbol: "afSUI" },
63903
- FDUSD: { type: "0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD", decimals: 6, symbol: "FDUSD" },
63904
- AUSD: { type: "0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD", decimals: 6, symbol: "AUSD" },
63905
- BUCK: { type: "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK", decimals: 9, symbol: "BUCK" },
63906
- BLUB: { type: "0xfa7ac3951fdca12c1b6d18eb19e1aa2fbc31e4d45773c8e45b4ded3ef8d83f8a::blub::BLUB", decimals: 9, symbol: "BLUB" },
63907
- SCA: { type: "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA", decimals: 9, symbol: "SCA" },
63908
- TURBOS: { type: "0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a::turbos::TURBOS", decimals: 9, symbol: "TURBOS" }
63923
+ USDSUI: { type: "0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI", decimals: 6, symbol: "USDsui" }
63909
63924
  };
63910
63925
  BY_TYPE = /* @__PURE__ */ new Map();
63911
63926
  for (const meta of Object.values(COIN_REGISTRY)) {
@@ -63928,6 +63943,9 @@ var init_token_registry = __esm2({
63928
63943
  WBTC_TYPE = COIN_REGISTRY.wBTC.type;
63929
63944
  WAL_TYPE = COIN_REGISTRY.WAL.type;
63930
63945
  NAVX_TYPE = COIN_REGISTRY.NAVX.type;
63946
+ IKA_TYPE = COIN_REGISTRY.IKA.type;
63947
+ LOFI_TYPE = COIN_REGISTRY.LOFI.type;
63948
+ MANIFEST_TYPE = COIN_REGISTRY.MANIFEST.type;
63931
63949
  }
63932
63950
  });
63933
63951
  var volo_exports = {};
@@ -64051,7 +64069,9 @@ function getClient(walletAddress) {
64051
64069
  if (clientInstance) return clientInstance;
64052
64070
  clientInstance = new AggregatorClient({
64053
64071
  signer: walletAddress,
64054
- env: Env.Mainnet
64072
+ env: Env.Mainnet,
64073
+ overlayFeeRate: OVERLAY_FEE_RATE,
64074
+ overlayFeeReceiver: OVERLAY_FEE_RECEIVER
64055
64075
  });
64056
64076
  return clientInstance;
64057
64077
  }
@@ -64108,10 +64128,14 @@ async function simulateSwap(params) {
64108
64128
  return { success: false, error: err instanceof Error ? err.message : String(err) };
64109
64129
  }
64110
64130
  }
64131
+ var OVERLAY_FEE_RATE;
64132
+ var OVERLAY_FEE_RECEIVER;
64111
64133
  var clientInstance;
64112
64134
  var init_cetus_swap = __esm2({
64113
64135
  "src/protocols/cetus-swap.ts"() {
64114
64136
  init_token_registry();
64137
+ OVERLAY_FEE_RATE = 1e-3;
64138
+ OVERLAY_FEE_RECEIVER = process.env.T2000_TREASURY_ADDRESS ?? "0x3bb501b8300125dca59019247941a42af6b292a150ce3cfcce9449456be2ec91";
64115
64139
  clientInstance = null;
64116
64140
  }
64117
64141
  });
@@ -64181,7 +64205,7 @@ var SUPPORTED_ASSETS = {
64181
64205
  displayName: "XAUM"
64182
64206
  }
64183
64207
  };
64184
- var STABLE_ASSETS = ["USDC", "USDT", "USDe", "USDsui"];
64208
+ var STABLE_ASSETS = ["USDC"];
64185
64209
  var ALL_NAVI_ASSETS = Object.keys(SUPPORTED_ASSETS);
64186
64210
  var T2000_PACKAGE_ID = process.env.T2000_PACKAGE_ID ?? "0xab92e9f1fe549ad3d6a52924a73181b45791e76120b975138fac9ec9b75db9f3";
64187
64211
  var T2000_CONFIG_ID = process.env.T2000_CONFIG_ID ?? "0x408add9aa9322f93cfd87523d8f603006eb8713894f4c460283c58a6888dae8a";
@@ -66275,37 +66299,26 @@ var T2000 = class _T2000 extends import_index.default {
66275
66299
  // -- Savings --
66276
66300
  async save(params) {
66277
66301
  this.enforcer.assertNotLocked();
66278
- const asset = params.asset ?? "USDC";
66302
+ if (params.asset && params.asset !== "USDC") {
66303
+ throw new T2000Error("INVALID_ASSET", "Only USDC deposits are supported. Swap to USDC first.");
66304
+ }
66305
+ const asset = "USDC";
66279
66306
  const assetInfo = SUPPORTED_ASSETS[asset];
66280
- if (!assetInfo) throw new T2000Error("ASSET_NOT_SUPPORTED", `Unsupported asset: ${asset}`);
66281
- const isStable = STABLE_ASSETS.includes(asset);
66282
66307
  let amount;
66283
66308
  if (params.amount === "all") {
66284
- if (isStable) {
66285
- const bal = await queryBalance(this.client, this._address);
66286
- amount = (bal.available ?? 0) - 1;
66287
- } else if (asset === "SUI") {
66288
- const suiBal = await this.client.getBalance({ owner: this._address, coinType: assetInfo.type });
66289
- const suiAmount = Number(suiBal.totalBalance) / 10 ** assetInfo.decimals;
66290
- amount = suiAmount - 0.15;
66291
- } else {
66292
- const coins = await this._fetchCoins(assetInfo.type);
66293
- const totalRaw = coins.reduce((sum2, c) => sum2 + BigInt(c.balance), 0n);
66294
- amount = Number(totalRaw) / 10 ** assetInfo.decimals;
66295
- }
66309
+ const bal = await queryBalance(this.client, this._address);
66310
+ amount = (bal.available ?? 0) - 1;
66296
66311
  if (amount <= 0) {
66297
- throw new T2000Error("INSUFFICIENT_BALANCE", `No ${asset} available to save`, {
66312
+ throw new T2000Error("INSUFFICIENT_BALANCE", `No USDC available to save`, {
66298
66313
  reason: "insufficient_balance",
66299
66314
  asset
66300
66315
  });
66301
66316
  }
66302
66317
  } else {
66303
66318
  amount = params.amount;
66304
- if (isStable) {
66305
- const bal = await queryBalance(this.client, this._address);
66306
- if (amount > (bal.available ?? 0)) {
66307
- throw new T2000Error("INSUFFICIENT_BALANCE", `Insufficient balance. Available: $${(bal.available ?? 0).toFixed(2)}, requested: $${amount.toFixed(2)}`);
66308
- }
66319
+ const bal = await queryBalance(this.client, this._address);
66320
+ if (amount > (bal.available ?? 0)) {
66321
+ throw new T2000Error("INSUFFICIENT_BALANCE", `Insufficient balance. Available: $${(bal.available ?? 0).toFixed(2)}, requested: $${amount.toFixed(2)}`);
66309
66322
  }
66310
66323
  }
66311
66324
  const fee = calculateFee("save", amount);
@@ -66316,17 +66329,11 @@ var T2000 = class _T2000 extends import_index.default {
66316
66329
  if (canPTB) {
66317
66330
  const tx2 = new Transaction();
66318
66331
  tx2.setSender(this._address);
66319
- let inputCoin;
66320
- if (asset === "SUI") {
66321
- const rawAmount = BigInt(Math.floor(saveAmount * 10 ** assetInfo.decimals));
66322
- [inputCoin] = tx2.splitCoins(tx2.gas, [rawAmount]);
66323
- } else {
66324
- const coins = await this._fetchCoins(assetInfo.type);
66325
- if (coins.length === 0) throw new T2000Error("INSUFFICIENT_BALANCE", `No ${asset} coins found`);
66326
- const merged = this._mergeCoinsInTx(tx2, coins);
66327
- const rawAmount = BigInt(Math.floor(saveAmount * 10 ** assetInfo.decimals));
66328
- [inputCoin] = tx2.splitCoins(merged, [rawAmount]);
66329
- }
66332
+ const coins = await this._fetchCoins(assetInfo.type);
66333
+ if (coins.length === 0) throw new T2000Error("INSUFFICIENT_BALANCE", "No USDC coins found");
66334
+ const merged = this._mergeCoinsInTx(tx2, coins);
66335
+ const rawAmount = BigInt(Math.floor(saveAmount * 10 ** assetInfo.decimals));
66336
+ const [inputCoin] = tx2.splitCoins(merged, [rawAmount]);
66330
66337
  await adapter2.addSaveToTx(tx2, this._address, inputCoin, asset, { collectFee: true });
66331
66338
  return tx2;
66332
66339
  }
@@ -67037,6 +67044,10 @@ export {
67037
67044
  mapWalletError,
67038
67045
  mapMoveAbortCode,
67039
67046
  T2000Error,
67047
+ isTier1,
67048
+ isTier2,
67049
+ isSupported,
67050
+ getTier,
67040
67051
  getDecimalsForCoinType,
67041
67052
  resolveSymbol,
67042
67053
  resolveTokenType,
@@ -67051,6 +67062,9 @@ export {
67051
67062
  WBTC_TYPE,
67052
67063
  WAL_TYPE,
67053
67064
  NAVX_TYPE,
67065
+ IKA_TYPE,
67066
+ LOFI_TYPE,
67067
+ MANIFEST_TYPE,
67054
67068
  getVoloStats,
67055
67069
  buildStakeVSuiTx,
67056
67070
  buildUnstakeVSuiTx,
@@ -67161,4 +67175,4 @@ axios/dist/node/axios.cjs:
67161
67175
  @scure/bip39/index.js:
67162
67176
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
67163
67177
  */
67164
- //# sourceMappingURL=chunk-DNBWOMKV.js.map
67178
+ //# sourceMappingURL=chunk-FSE25UF3.js.map