@t2000/cli 3.2.0 → 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.
@@ -16442,159 +16442,6 @@ var require_lodash = __commonJS2({
16442
16442
  module.exports = camelCase;
16443
16443
  }
16444
16444
  });
16445
- var volo_exports = {};
16446
- __export(volo_exports, {
16447
- MIN_STAKE_MIST: () => MIN_STAKE_MIST,
16448
- SUI_SYSTEM_STATE: () => SUI_SYSTEM_STATE,
16449
- VOLO_METADATA: () => VOLO_METADATA,
16450
- VOLO_PKG: () => VOLO_PKG,
16451
- VOLO_POOL: () => VOLO_POOL,
16452
- VSUI_TYPE: () => VSUI_TYPE,
16453
- addStakeVSuiToTx: () => addStakeVSuiToTx,
16454
- addUnstakeVSuiToTx: () => addUnstakeVSuiToTx,
16455
- buildStakeVSuiTx: () => buildStakeVSuiTx,
16456
- buildUnstakeVSuiTx: () => buildUnstakeVSuiTx,
16457
- getVoloStats: () => getVoloStats
16458
- });
16459
- async function getVoloStats() {
16460
- const res = await fetch(VOLO_STATS_URL, {
16461
- signal: AbortSignal.timeout(8e3)
16462
- });
16463
- if (!res.ok) {
16464
- throw new Error(`VOLO stats API error: HTTP ${res.status}`);
16465
- }
16466
- const data = await res.json();
16467
- const d = data.data ?? data;
16468
- return {
16469
- apy: d.apy ?? 0,
16470
- exchangeRate: d.exchange_rate ?? d.exchangeRate ?? 1,
16471
- tvl: d.tvl ?? 0
16472
- };
16473
- }
16474
- async function buildStakeVSuiTx(_client, address, amountMist) {
16475
- if (amountMist < MIN_STAKE_MIST) {
16476
- throw new Error(`Minimum stake is 1 SUI (${MIN_STAKE_MIST} MIST). Got: ${amountMist}`);
16477
- }
16478
- const tx = new Transaction();
16479
- tx.setSender(address);
16480
- const [suiCoin] = tx.splitCoins(tx.gas, [amountMist]);
16481
- const [vSuiCoin] = tx.moveCall({
16482
- target: `${VOLO_PKG}::stake_pool::stake`,
16483
- arguments: [
16484
- tx.object(VOLO_POOL),
16485
- tx.object(VOLO_METADATA),
16486
- tx.object(SUI_SYSTEM_STATE),
16487
- suiCoin
16488
- ]
16489
- });
16490
- tx.transferObjects([vSuiCoin], address);
16491
- return tx;
16492
- }
16493
- async function buildUnstakeVSuiTx(client, address, amountMist) {
16494
- const balResp = await client.getBalance({ owner: address, coinType: VSUI_TYPE });
16495
- const totalBalance = BigInt(balResp.totalBalance);
16496
- if (totalBalance === 0n) {
16497
- throw new Error("No vSUI found in wallet.");
16498
- }
16499
- const tx = new Transaction();
16500
- tx.setSender(address);
16501
- const requested = amountMist === "all" ? totalBalance : amountMist;
16502
- if (requested > totalBalance) {
16503
- throw new Error(`Insufficient vSUI: need ${requested} MIST, have ${totalBalance}`);
16504
- }
16505
- const vSuiCoin = coinWithBalance({ type: VSUI_TYPE, balance: requested })(tx);
16506
- const [suiCoin] = tx.moveCall({
16507
- target: `${VOLO_PKG}::stake_pool::unstake`,
16508
- arguments: [
16509
- tx.object(VOLO_POOL),
16510
- tx.object(VOLO_METADATA),
16511
- tx.object(SUI_SYSTEM_STATE),
16512
- vSuiCoin
16513
- ]
16514
- });
16515
- tx.transferObjects([suiCoin], address);
16516
- return tx;
16517
- }
16518
- async function addStakeVSuiToTx(tx, client, address, input) {
16519
- if (input.amountMist < MIN_STAKE_MIST) {
16520
- throw new Error(`Minimum stake is 1 SUI (${MIN_STAKE_MIST} MIST). Got: ${input.amountMist}`);
16521
- }
16522
- let suiCoin;
16523
- if (input.inputCoin) {
16524
- suiCoin = input.inputCoin;
16525
- } else {
16526
- const balResp = await client.getBalance({ owner: address, coinType: SUI_TYPE });
16527
- const totalBalance = BigInt(balResp.totalBalance);
16528
- if (totalBalance < input.amountMist) {
16529
- throw new Error(`Insufficient SUI: need ${input.amountMist} MIST, have ${totalBalance}`);
16530
- }
16531
- suiCoin = coinWithBalance({
16532
- type: SUI_TYPE,
16533
- balance: input.amountMist,
16534
- useGasCoin: false
16535
- })(tx);
16536
- }
16537
- const [vSuiCoin] = tx.moveCall({
16538
- target: `${VOLO_PKG}::stake_pool::stake`,
16539
- arguments: [
16540
- tx.object(VOLO_POOL),
16541
- tx.object(VOLO_METADATA),
16542
- tx.object(SUI_SYSTEM_STATE),
16543
- suiCoin
16544
- ]
16545
- });
16546
- return { coin: vSuiCoin, effectiveAmountMist: input.amountMist };
16547
- }
16548
- async function addUnstakeVSuiToTx(tx, client, address, input) {
16549
- let vSuiCoin;
16550
- if (input.inputCoin) {
16551
- if (input.amountMist === "all") {
16552
- vSuiCoin = input.inputCoin;
16553
- } else {
16554
- [vSuiCoin] = tx.splitCoins(input.inputCoin, [input.amountMist]);
16555
- }
16556
- } else {
16557
- const balResp = await client.getBalance({ owner: address, coinType: VSUI_TYPE });
16558
- const totalBalance = BigInt(balResp.totalBalance);
16559
- if (totalBalance === 0n) {
16560
- throw new Error("No vSUI found in wallet.");
16561
- }
16562
- const requested = input.amountMist === "all" ? totalBalance : input.amountMist;
16563
- if (requested > totalBalance) {
16564
- throw new Error(`Insufficient vSUI: need ${requested} MIST, have ${totalBalance}`);
16565
- }
16566
- vSuiCoin = coinWithBalance({ type: VSUI_TYPE, balance: requested })(tx);
16567
- }
16568
- const [suiCoin] = tx.moveCall({
16569
- target: `${VOLO_PKG}::stake_pool::unstake`,
16570
- arguments: [
16571
- tx.object(VOLO_POOL),
16572
- tx.object(VOLO_METADATA),
16573
- tx.object(SUI_SYSTEM_STATE),
16574
- vSuiCoin
16575
- ]
16576
- });
16577
- return { coin: suiCoin, effectiveAmountMist: input.amountMist };
16578
- }
16579
- var VOLO_PKG;
16580
- var VOLO_POOL;
16581
- var VOLO_METADATA;
16582
- var VSUI_TYPE;
16583
- var SUI_SYSTEM_STATE;
16584
- var MIN_STAKE_MIST;
16585
- var VOLO_STATS_URL;
16586
- var init_volo = __esm({
16587
- "src/protocols/volo.ts"() {
16588
- init_token_registry();
16589
- VOLO_PKG = "0x68d22cf8bdbcd11ecba1e094922873e4080d4d11133e2443fddda0bfd11dae20";
16590
- VOLO_POOL = "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5";
16591
- VOLO_METADATA = "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60";
16592
- VSUI_TYPE = "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT";
16593
- SUI_SYSTEM_STATE = "0x05";
16594
- MIN_STAKE_MIST = 1000000000n;
16595
- VOLO_STATS_URL = "https://open-api.naviprotocol.io/api/volo/stats";
16596
- }
16597
- });
16598
16445
  var coinSelection_exports = {};
16599
16446
  __export(coinSelection_exports, {
16600
16447
  fetchAllCoins: () => fetchAllCoins,
@@ -22428,51 +22275,14 @@ var T2000 = class _T2000 extends import_index.default {
22428
22275
  receipt: paymentDigest ? { reference: paymentDigest, timestamp: (/* @__PURE__ */ new Date()).toISOString() } : void 0
22429
22276
  };
22430
22277
  }
22431
- // -- VOLO vSUI Staking --
22432
- async stakeVSui(params) {
22433
- this.enforcer.assertNotLocked();
22434
- const { buildStakeVSuiTx: buildStakeVSuiTx2, getVoloStats: getVoloStats2 } = await Promise.resolve().then(() => (init_volo(), volo_exports));
22435
- const amountMist = BigInt(Math.floor(params.amount * Number(MIST_PER_SUI)));
22436
- const stats = await getVoloStats2();
22437
- const gasResult = await executeTx(this.client, this._signer, async () => {
22438
- return buildStakeVSuiTx2(this.client, this._address, amountMist);
22439
- });
22440
- const vSuiReceived = params.amount / stats.exchangeRate;
22441
- return {
22442
- success: true,
22443
- tx: gasResult.digest,
22444
- amountSui: params.amount,
22445
- vSuiReceived,
22446
- apy: stats.apy,
22447
- gasCost: gasResult.gasCostSui
22448
- };
22449
- }
22450
- async unstakeVSui(params) {
22451
- this.enforcer.assertNotLocked();
22452
- const { buildUnstakeVSuiTx: buildUnstakeVSuiTx2, getVoloStats: getVoloStats2, VSUI_TYPE: VSUI_TYPE2 } = await Promise.resolve().then(() => (init_volo(), volo_exports));
22453
- let amountMist;
22454
- let vSuiAmount;
22455
- if (params.amount === "all") {
22456
- amountMist = "all";
22457
- const bal = await this.client.getBalance({ owner: this._address, coinType: VSUI_TYPE2 });
22458
- vSuiAmount = Number(bal.totalBalance) / 1e9;
22459
- } else {
22460
- amountMist = BigInt(Math.floor(params.amount * 1e9));
22461
- vSuiAmount = params.amount;
22462
- }
22463
- const stats = await getVoloStats2();
22464
- const gasResult = await executeTx(this.client, this._signer, async () => {
22465
- return buildUnstakeVSuiTx2(this.client, this._address, amountMist);
22466
- });
22467
- const suiReceived = vSuiAmount * stats.exchangeRate;
22468
- return {
22469
- success: true,
22470
- tx: gasResult.digest,
22471
- vSuiAmount,
22472
- suiReceived,
22473
- gasCost: gasResult.gasCostSui
22474
- };
22475
- }
22278
+ // [S.323 / 2026-05-25] VOLO vSUI staking surfaces removed (full cut).
22279
+ // Engine cut Volo in S.277; SDK + CLI + MCP followed in S.323 because the
22280
+ // product surface (five products: Passport / Intelligence / Finance / Pay
22281
+ // / Store) doesn't include a staking primitive. vSUI still appears in the
22282
+ // codebase as a passive token (NAVI reward rewards, Cetus swap routing),
22283
+ // but there is no longer any way to MINT or REDEEM vSUI through t2000.
22284
+ // History: see spec/archive/v07e/AUDIT_V07E_EARNS_ITS_KEEP_2026-05-23.md
22285
+ // and the S.323 build-tracker entry.
22476
22286
  // -- Swap --
22477
22287
  async swap(params) {
22478
22288
  this.enforcer.assertNotLocked();
@@ -23695,7 +23505,6 @@ async function buildHarvestRewardsTx(client, address, options = {}) {
23695
23505
  return { tx, plan };
23696
23506
  }
23697
23507
  init_cetus_swap();
23698
- init_volo();
23699
23508
  init_coinSelection();
23700
23509
  init_token_registry();
23701
23510
  init_errors();
@@ -23919,41 +23728,8 @@ var WRITE_APPENDER_REGISTRY = {
23919
23728
  expectedUsdcDeposited: plan.expectedUsdcDeposited
23920
23729
  }
23921
23730
  };
23922
- },
23923
- volo_stake: async (tx, input, ctx) => {
23924
- if (input.amountSui <= 0) {
23925
- throw new T2000Error("INVALID_AMOUNT", "Stake amount must be greater than zero");
23926
- }
23927
- const amountMist = BigInt(Math.floor(input.amountSui * 1e9));
23928
- const result = await addStakeVSuiToTx(tx, ctx.client, ctx.sender, {
23929
- amountMist,
23930
- inputCoin: ctx.chainedCoin
23931
- });
23932
- if (!ctx.isOutputConsumed) {
23933
- tx.transferObjects([result.coin], ctx.sender);
23934
- }
23935
- return {
23936
- preview: { toolName: "volo_stake", effectiveAmountMist: result.effectiveAmountMist },
23937
- outputCoin: result.coin
23938
- };
23939
- },
23940
- volo_unstake: async (tx, input, ctx) => {
23941
- const amountMist = input.amountVSui === "all" ? "all" : BigInt(Math.floor(input.amountVSui * 1e9));
23942
- if (amountMist !== "all" && amountMist <= 0n) {
23943
- throw new T2000Error("INVALID_AMOUNT", "Unstake amount must be greater than zero");
23944
- }
23945
- const result = await addUnstakeVSuiToTx(tx, ctx.client, ctx.sender, {
23946
- amountMist,
23947
- inputCoin: ctx.chainedCoin
23948
- });
23949
- if (!ctx.isOutputConsumed) {
23950
- tx.transferObjects([result.coin], ctx.sender);
23951
- }
23952
- return {
23953
- preview: { toolName: "volo_unstake", effectiveAmountMist: result.effectiveAmountMist },
23954
- outputCoin: result.coin
23955
- };
23956
23731
  }
23732
+ // [S.323 / 2026-05-25] volo_stake / volo_unstake appenders removed.
23957
23733
  };
23958
23734
  function deriveAllowedAddressesFromPtb(tx) {
23959
23735
  const addresses = /* @__PURE__ */ new Set();
@@ -24014,7 +23790,7 @@ async function composeTx(opts) {
24014
23790
  if (producer.toolName === "save_deposit" || producer.toolName === "repay_debt" || producer.toolName === "send_transfer" || producer.toolName === "claim_rewards") {
24015
23791
  throw new T2000Error(
24016
23792
  "CHAIN_MODE_INVALID",
24017
- `Step ${i} (${step.toolName}) references step ${idx} (${producer.toolName}) as producer, but '${producer.toolName}' is a terminal consumer that does not produce a chainable coin handle. Allowed producers: withdraw, borrow, swap_execute, volo_stake, volo_unstake.`
23793
+ `Step ${i} (${step.toolName}) references step ${idx} (${producer.toolName}) as producer, but '${producer.toolName}' is a terminal consumer that does not produce a chainable coin handle. Allowed producers: withdraw, borrow, swap_execute.`
24018
23794
  );
24019
23795
  }
24020
23796
  consumedSteps.add(idx);
@@ -24226,7 +24002,6 @@ function parseMoveAbort(errorStr) {
24226
24002
  init_swap_quote();
24227
24003
  init_cetus_swap();
24228
24004
  init_token_registry();
24229
- init_volo();
24230
24005
  var AUDRIC_PARENT_NAME = "audric.sui";
24231
24006
  var AUDRIC_PARENT_NFT_ID = "0x070456e283ec988b6302bdd6cc5172bbdcb709998cf116586fb98d19b0870198";
24232
24007
  var LABEL_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
@@ -24316,15 +24091,6 @@ export {
24316
24091
  IKA_TYPE,
24317
24092
  LOFI_TYPE,
24318
24093
  MANIFEST_TYPE,
24319
- getVoloStats,
24320
- buildStakeVSuiTx,
24321
- buildUnstakeVSuiTx,
24322
- addStakeVSuiToTx,
24323
- addUnstakeVSuiToTx,
24324
- VOLO_PKG,
24325
- VOLO_POOL,
24326
- VOLO_METADATA,
24327
- VSUI_TYPE,
24328
24094
  fetchAllCoins,
24329
24095
  selectAndSplitCoin,
24330
24096
  selectSuiCoin,
@@ -24464,4 +24230,4 @@ axios/dist/node/axios.cjs:
24464
24230
  @scure/bip39/index.js:
24465
24231
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
24466
24232
  */
24467
- //# sourceMappingURL=chunk-ZH6PX6WS.js.map
24233
+ //# sourceMappingURL=chunk-YSV3YXTK.js.map