@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/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
|
-
import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-
|
|
5
|
-
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer,
|
|
4
|
+
import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-C1DH4kPA.cjs';
|
|
5
|
+
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, aA as SAVEABLE_ASSETS, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, aB as SaveableAsset, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer, aC as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractAllUserLegs, a6 as extractTransferDetails, a7 as extractTxCommands, a8 as extractTxSender, a9 as fallbackLabel, aa as formatAssetAmount, ab as formatSui, ac as formatUsd, aD as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aE as isAllowedAsset, aF as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aG as normalizeAsset, aH as normalizeCoinType, am as parseSuiRpcTx, aI as queryHistory, aJ as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aK as simulateTransaction, as as stableToRaw, at as suiToMist, aL as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-C1DH4kPA.cjs';
|
|
6
6
|
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-DqIb4AnV.cjs';
|
|
7
7
|
export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from './descriptors-DqIb4AnV.cjs';
|
|
8
|
-
import { n as T2000Options, P as PayOptions, d as PayResult, o as
|
|
9
|
-
export { A as AssetRates, G as GasReserve,
|
|
8
|
+
import { n as T2000Options, P as PayOptions, d as PayResult, o as SwapResult, p as SwapQuoteResult, i as SendResult, B as BalanceResponse, k as TransactionRecord, D as DepositInfo, q as PaymentRequest, S as SaveResult, W as WithdrawResult, b as MaxWithdrawResult, a as BorrowResult, h as RepayResult, M as MaxBorrowResult, H as HealthFactorResult, e as PendingReward, C as ClaimRewardsResult, r as CompoundRewardsResult, g as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, c as OverlayFeeConfig, j as SwapRouteResult, s as FinancialSummary } from './types-HJGbXJ37.cjs';
|
|
9
|
+
export { A as AssetRates, G as GasReserve, t as HFAlertLevel, O as OVERLAY_FEE_RATE, f as PositionEntry, u as SerializedCetusRoute, v as SerializedCetusRoutePath, w as SerializedRouterDataV3, T as TransactionLeg, x as addSwapToTx, l as buildSwapTx, y as deserializeCetusRoute, m as findSwapRoute, z as isCetusRouteFresh, I as serializeCetusRoute, J as verifyCetusRouteCoinMatch } from './types-HJGbXJ37.cjs';
|
|
10
10
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
11
11
|
import { SuinsClient } from '@mysten/suins';
|
|
12
12
|
export { NaviAdapter, ProtocolRegistry } from './adapters/index.cjs';
|
|
@@ -111,12 +111,6 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
111
111
|
/** Transaction signer (works for both keypair and zkLogin). */
|
|
112
112
|
get signer(): TransactionSigner;
|
|
113
113
|
pay(options: PayOptions): Promise<PayResult>;
|
|
114
|
-
stakeVSui(params: {
|
|
115
|
-
amount: number;
|
|
116
|
-
}): Promise<StakeVSuiResult>;
|
|
117
|
-
unstakeVSui(params: {
|
|
118
|
-
amount: number | 'all';
|
|
119
|
-
}): Promise<UnstakeVSuiResult>;
|
|
120
114
|
swap(params: {
|
|
121
115
|
from: string;
|
|
122
116
|
to: string;
|
|
@@ -124,11 +118,20 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
124
118
|
byAmountIn?: boolean;
|
|
125
119
|
slippage?: number;
|
|
126
120
|
}): Promise<SwapResult>;
|
|
121
|
+
/**
|
|
122
|
+
* [SPEC_AGENTIC_STACK P1 / SDK F2 — 2026-05-25]
|
|
123
|
+
* Thin wrapper around the standalone `getSwapQuote()`. Pre-Phase 1 this method
|
|
124
|
+
* was ~50 LoC duplicating `swap-quote.ts` — missing `serializedRoute` (SPEC 20.2
|
|
125
|
+
* fast-path) and the `providers` allow-list (Bug A fix / Pyth-dependent
|
|
126
|
+
* provider filter for sponsored callers). Routing both API surfaces through
|
|
127
|
+
* one implementation ensures fixes land for both.
|
|
128
|
+
*/
|
|
127
129
|
swapQuote(params: {
|
|
128
130
|
from: string;
|
|
129
131
|
to: string;
|
|
130
132
|
amount: number;
|
|
131
133
|
byAmountIn?: boolean;
|
|
134
|
+
providers?: string[];
|
|
132
135
|
}): Promise<SwapQuoteResult>;
|
|
133
136
|
address(): string;
|
|
134
137
|
send(params: {
|
|
@@ -173,6 +176,14 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
173
176
|
}): Promise<TransactionRecord[]>;
|
|
174
177
|
transactionDetail(digest: string): Promise<TransactionRecord | null>;
|
|
175
178
|
deposit(): Promise<DepositInfo>;
|
|
179
|
+
/**
|
|
180
|
+
* [SPEC_AGENTIC_STACK P1 / SDK F2 (CLI rename support) — 2026-05-25]
|
|
181
|
+
* Preferred alias of `deposit()`. The CLI surface is `t2000 fund` post-Phase 1
|
|
182
|
+
* (more intuitive than "deposit" which sounds like a NAVI lending action).
|
|
183
|
+
* `deposit()` stays as the canonical method name for back-compat; it is NOT
|
|
184
|
+
* deprecated. This wrapper exists so SDK consumers can mirror CLI naming.
|
|
185
|
+
*/
|
|
186
|
+
fund(): Promise<DepositInfo>;
|
|
176
187
|
receive(params?: {
|
|
177
188
|
amount?: number;
|
|
178
189
|
currency?: string;
|
|
@@ -566,13 +577,18 @@ declare function selectSuiCoin(tx: Transaction, client: SuiJsonRpcClient, owner:
|
|
|
566
577
|
*/
|
|
567
578
|
|
|
568
579
|
/**
|
|
569
|
-
* Canonical write tools. The
|
|
570
|
-
*
|
|
580
|
+
* Canonical write tools. The 8 tools that can be composed into a PTB.
|
|
581
|
+
*
|
|
582
|
+
* History:
|
|
583
|
+
* - 2026-05-08 (Track B): added `harvest_rewards` (compound macro).
|
|
584
|
+
* - 2026-05-25 (S.323): removed `volo_stake` / `volo_unstake` — full Volo
|
|
585
|
+
* cut across SDK/CLI/MCP after the engine cut Volo in S.277. vSUI
|
|
586
|
+
* remains as a passive token (NAVI reward, Cetus swap target).
|
|
571
587
|
*
|
|
572
588
|
* Excluded by design:
|
|
573
589
|
* - `save_contact` — no on-chain leg (Prisma-only).
|
|
574
590
|
*/
|
|
575
|
-
type WriteToolName = 'save_deposit' | 'withdraw' | 'borrow' | 'repay_debt' | 'send_transfer' | 'swap_execute' | 'claim_rewards' | 'harvest_rewards'
|
|
591
|
+
type WriteToolName = 'save_deposit' | 'withdraw' | 'borrow' | 'repay_debt' | 'send_transfer' | 'swap_execute' | 'claim_rewards' | 'harvest_rewards';
|
|
576
592
|
interface SaveDepositInput {
|
|
577
593
|
amount: number;
|
|
578
594
|
asset?: 'USDC' | 'USDsui';
|
|
@@ -627,12 +643,6 @@ interface HarvestRewardsInput {
|
|
|
627
643
|
/** USD floor for "is this worth swapping?" — dust below transfers to wallet. Default $0.01. */
|
|
628
644
|
minRewardUsd?: number;
|
|
629
645
|
}
|
|
630
|
-
interface VoloStakeInput {
|
|
631
|
-
amountSui: number;
|
|
632
|
-
}
|
|
633
|
-
interface VoloUnstakeInput {
|
|
634
|
-
amountVSui: number | 'all';
|
|
635
|
-
}
|
|
636
646
|
/**
|
|
637
647
|
* Discriminated union mapping `toolName` → `input`. Used to type
|
|
638
648
|
* `WriteStep` so consumers get autocomplete + compile-time validation
|
|
@@ -678,14 +688,6 @@ type WriteStep = {
|
|
|
678
688
|
} | {
|
|
679
689
|
toolName: 'harvest_rewards';
|
|
680
690
|
input: HarvestRewardsInput;
|
|
681
|
-
} | {
|
|
682
|
-
toolName: 'volo_stake';
|
|
683
|
-
input: VoloStakeInput;
|
|
684
|
-
inputCoinFromStep?: number;
|
|
685
|
-
} | {
|
|
686
|
-
toolName: 'volo_unstake';
|
|
687
|
-
input: VoloUnstakeInput;
|
|
688
|
-
inputCoinFromStep?: number;
|
|
689
691
|
};
|
|
690
692
|
interface ComposeTxOptions {
|
|
691
693
|
sender: string;
|
|
@@ -814,12 +816,6 @@ type StepPreview = {
|
|
|
814
816
|
reason: 'untradeable' | 'dust' | 'no-route';
|
|
815
817
|
}>;
|
|
816
818
|
expectedUsdcDeposited: number;
|
|
817
|
-
} | {
|
|
818
|
-
toolName: 'volo_stake';
|
|
819
|
-
effectiveAmountMist: bigint;
|
|
820
|
-
} | {
|
|
821
|
-
toolName: 'volo_unstake';
|
|
822
|
-
effectiveAmountMist: bigint | 'all';
|
|
823
819
|
};
|
|
824
820
|
interface ComposeTxResult {
|
|
825
821
|
tx: Transaction;
|
|
@@ -881,8 +877,9 @@ interface AppenderContext {
|
|
|
881
877
|
* downstream consumer's `chainedCoin`. Terminal consumers
|
|
882
878
|
* (`save_deposit`, `repay_debt`, `send_transfer`) omit it.
|
|
883
879
|
*
|
|
884
|
-
* `swap_execute
|
|
885
|
-
*
|
|
880
|
+
* `swap_execute` is the only dual-mode tool — it accepts `chainedCoin`
|
|
881
|
+
* AND populates `outputCoin`. (`volo_stake` / `volo_unstake` were also
|
|
882
|
+
* dual-mode prior to S.323 / 2026-05-25; cut with the full Volo removal.)
|
|
886
883
|
*/
|
|
887
884
|
interface AppenderResult<TPreview extends StepPreview> {
|
|
888
885
|
preview: TPreview;
|
|
@@ -915,7 +912,7 @@ declare function getSponsoredSwapProviders(): Promise<string[]>;
|
|
|
915
912
|
/**
|
|
916
913
|
* The typed registry. Each entry is a wallet-mode dispatcher that takes
|
|
917
914
|
* (tx, input, ctx) and returns a per-step preview. Compile-time check
|
|
918
|
-
* that all
|
|
915
|
+
* that all 8 `WriteToolName` values have an entry — TypeScript will
|
|
919
916
|
* fail the build if a tool is missing.
|
|
920
917
|
*/
|
|
921
918
|
declare const WRITE_APPENDER_REGISTRY: {
|
|
@@ -943,12 +940,6 @@ declare const WRITE_APPENDER_REGISTRY: {
|
|
|
943
940
|
harvest_rewards: AppenderFn<HarvestRewardsInput, Extract<StepPreview, {
|
|
944
941
|
toolName: 'harvest_rewards';
|
|
945
942
|
}>>;
|
|
946
|
-
volo_stake: AppenderFn<VoloStakeInput, Extract<StepPreview, {
|
|
947
|
-
toolName: 'volo_stake';
|
|
948
|
-
}>>;
|
|
949
|
-
volo_unstake: AppenderFn<VoloUnstakeInput, Extract<StepPreview, {
|
|
950
|
-
toolName: 'volo_unstake';
|
|
951
|
-
}>>;
|
|
952
943
|
};
|
|
953
944
|
/**
|
|
954
945
|
* Walks the assembled PTB's command list and extracts every recipient
|
|
@@ -1257,98 +1248,6 @@ declare function getSwapQuote(params: {
|
|
|
1257
1248
|
providers?: string[];
|
|
1258
1249
|
}): Promise<SwapQuoteResult>;
|
|
1259
1250
|
|
|
1260
|
-
/**
|
|
1261
|
-
* VOLO vSUI liquid staking — thin transaction builders.
|
|
1262
|
-
* No SDK dependency. Two Move calls, immutable contract addresses.
|
|
1263
|
-
*/
|
|
1264
|
-
|
|
1265
|
-
declare const VOLO_PKG = "0x68d22cf8bdbcd11ecba1e094922873e4080d4d11133e2443fddda0bfd11dae20";
|
|
1266
|
-
declare const VOLO_POOL = "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5";
|
|
1267
|
-
declare const VOLO_METADATA = "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60";
|
|
1268
|
-
declare const VSUI_TYPE = "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT";
|
|
1269
|
-
interface VoloStats {
|
|
1270
|
-
apy: number;
|
|
1271
|
-
exchangeRate: number;
|
|
1272
|
-
tvl: number;
|
|
1273
|
-
}
|
|
1274
|
-
/**
|
|
1275
|
-
* Fetch VOLO vSUI staking stats (APY, exchange rate, TVL).
|
|
1276
|
-
*/
|
|
1277
|
-
declare function getVoloStats(): Promise<VoloStats>;
|
|
1278
|
-
/**
|
|
1279
|
-
* Build a PTB to stake SUI for vSUI.
|
|
1280
|
-
*/
|
|
1281
|
-
declare function buildStakeVSuiTx(_client: SuiJsonRpcClient, address: string, amountMist: bigint): Promise<Transaction>;
|
|
1282
|
-
/**
|
|
1283
|
-
* Build a PTB to unstake vSUI back to SUI.
|
|
1284
|
-
*/
|
|
1285
|
-
declare function buildUnstakeVSuiTx(client: SuiJsonRpcClient, address: string, amountMist: bigint | 'all'): Promise<Transaction>;
|
|
1286
|
-
/**
|
|
1287
|
-
* SPEC 7 § "Layer 1" Volo stake appender. Two modes.
|
|
1288
|
-
*
|
|
1289
|
-
* Wallet mode (`inputCoin` omitted): pre-flights via `getBalance` and
|
|
1290
|
-
* sources SUI through `coinWithBalance({ type: SUI, useGasCoin: false })`,
|
|
1291
|
-
* which resolves coin objects + address balance at build time. Mirrors
|
|
1292
|
-
* the audric host's `transactions/prepare/route.ts:524-545` volo-stake
|
|
1293
|
-
* branch — sponsored-flow safe (does NOT consume `tx.gas`, which
|
|
1294
|
-
* belongs to the Enoki sponsor in sponsored flows).
|
|
1295
|
-
*
|
|
1296
|
-
* For non-sponsored flows where the caller owns `tx.gas`, prefer
|
|
1297
|
-
* `buildStakeVSuiTx` directly (it splits from gas, which avoids one
|
|
1298
|
-
* `getBalance` RTT).
|
|
1299
|
-
*
|
|
1300
|
-
* Chain mode (`inputCoin` provided): consumes the passed-in SUI coin
|
|
1301
|
-
* ref entirely. Used for chained flows like "swap USDC → SUI → stake".
|
|
1302
|
-
* The caller is responsible for splitting upstream if they only want
|
|
1303
|
-
* part of the input coin staked.
|
|
1304
|
-
*
|
|
1305
|
-
* @returns
|
|
1306
|
-
* - `coin`: vSUI output coin ref, ready for downstream consumption or
|
|
1307
|
-
* wallet transfer (`tx.transferObjects`).
|
|
1308
|
-
* - `effectiveAmountMist`: SUI mist consumed (echoes `input.amountMist`
|
|
1309
|
-
* in both modes; chain-mode trusts the caller-supplied value since
|
|
1310
|
-
* the actual coin balance is opaque).
|
|
1311
|
-
*/
|
|
1312
|
-
declare function addStakeVSuiToTx(tx: Transaction, client: SuiJsonRpcClient, address: string, input: {
|
|
1313
|
-
amountMist: bigint;
|
|
1314
|
-
inputCoin?: TransactionObjectArgument;
|
|
1315
|
-
}): Promise<{
|
|
1316
|
-
coin: TransactionObjectArgument;
|
|
1317
|
-
effectiveAmountMist: bigint;
|
|
1318
|
-
}>;
|
|
1319
|
-
/**
|
|
1320
|
-
* SPEC 7 § "Layer 1" Volo unstake appender. Two modes.
|
|
1321
|
-
*
|
|
1322
|
-
* Wallet mode (`inputCoin` omitted): pre-flights via `getBalance` and
|
|
1323
|
-
* sources vSUI through `coinWithBalance({ type: VSUI, balance })`,
|
|
1324
|
-
* which resolves coin objects + address balance at build time. With
|
|
1325
|
-
* `'all'`, the entire balance is consumed.
|
|
1326
|
-
*
|
|
1327
|
-
* Chain mode (`inputCoin` provided): consumes the passed-in vSUI coin
|
|
1328
|
-
* ref. With `amountMist = 'all'`, the entire input coin is unstaked.
|
|
1329
|
-
* With a bigint `amountMist`, the input coin is split internally and
|
|
1330
|
-
* only that portion unstaked (the leftover stays accessible via the
|
|
1331
|
-
* original ref). Used for chained flows where vSUI was just produced
|
|
1332
|
-
* by a prior step.
|
|
1333
|
-
*
|
|
1334
|
-
* @returns
|
|
1335
|
-
* - `coin`: SUI output coin ref, ready for downstream consumption
|
|
1336
|
-
* (e.g. `addSendToTx`, `addStakeVSuiToTx` re-stake) or wallet
|
|
1337
|
-
* transfer (`tx.transferObjects`).
|
|
1338
|
-
* - `effectiveAmountMist`: input vSUI mist consumed; echoes
|
|
1339
|
-
* `input.amountMist` (`'all'` is preserved as-is — the actual SUI
|
|
1340
|
-
* received differs from input vSUI by the pool exchange rate, so
|
|
1341
|
-
* callers needing the SUI amount must query `getVoloStats` or
|
|
1342
|
-
* parse balance changes from the executed tx).
|
|
1343
|
-
*/
|
|
1344
|
-
declare function addUnstakeVSuiToTx(tx: Transaction, client: SuiJsonRpcClient, address: string, input: {
|
|
1345
|
-
amountMist: bigint | 'all';
|
|
1346
|
-
inputCoin?: TransactionObjectArgument;
|
|
1347
|
-
}): Promise<{
|
|
1348
|
-
coin: TransactionObjectArgument;
|
|
1349
|
-
effectiveAmountMist: bigint | 'all';
|
|
1350
|
-
}>;
|
|
1351
|
-
|
|
1352
1251
|
/**
|
|
1353
1252
|
* SuiNS leaf-subname builders for the `audric.sui` parent NFT.
|
|
1354
1253
|
*
|
|
@@ -1488,4 +1387,4 @@ declare function fullHandle(label: string): string;
|
|
|
1488
1387
|
*/
|
|
1489
1388
|
declare function displayHandle(label: string): string;
|
|
1490
1389
|
|
|
1491
|
-
export { AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type AppenderContext, BalanceResponse, type BorrowInput, BorrowResult, type BuildAddLeafParams, type BuildHarvestRewardsTxOptions, type BuildRevokeLeafParams, type ClaimRewardsInput, ClaimRewardsResult, type CoinPage, type ComposeTxFeeHookContext, type ComposeTxFeeHooks, type ComposeTxOptions, type ComposeTxResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, type HarvestPlan, type HarvestSkippedLeg, type HarvestSwapLeg, HealthFactorResult, InvalidAddressError, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput,
|
|
1390
|
+
export { AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type AppenderContext, BalanceResponse, type BorrowInput, BorrowResult, type BuildAddLeafParams, type BuildHarvestRewardsTxOptions, type BuildRevokeLeafParams, type ClaimRewardsInput, ClaimRewardsResult, type CoinPage, type ComposeTxFeeHookContext, type ComposeTxFeeHooks, type ComposeTxOptions, type ComposeTxResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, type HarvestPlan, type HarvestSkippedLeg, type HarvestSwapLeg, HealthFactorResult, InvalidAddressError, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput, type StepPreview, SuinsNotRegisteredError, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, WRITE_APPENDER_REGISTRY, type WithdrawInput, WithdrawResult, type WriteStep, type WriteToolName, ZkLoginProof, addClaimRewardsToTx, addSendToTx, aggregateClaimableRewards, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, composeTx, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fetchAllCoins, fullHandle, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSponsoredSwapProviders, getSwapQuote, keypairFromPrivateKey, loadKey, looksLikeSuiNs, normalizeAddressInput, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveKey, selectAndSplitCoin, selectSuiCoin, validateLabel, walletExists };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
|
-
import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-
|
|
5
|
-
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer,
|
|
4
|
+
import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-DjeENMuV.js';
|
|
5
|
+
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, aA as SAVEABLE_ASSETS, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, aB as SaveableAsset, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer, aC as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractAllUserLegs, a6 as extractTransferDetails, a7 as extractTxCommands, a8 as extractTxSender, a9 as fallbackLabel, aa as formatAssetAmount, ab as formatSui, ac as formatUsd, aD as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aE as isAllowedAsset, aF as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aG as normalizeAsset, aH as normalizeCoinType, am as parseSuiRpcTx, aI as queryHistory, aJ as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aK as simulateTransaction, as as stableToRaw, at as suiToMist, aL as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-DjeENMuV.js';
|
|
6
6
|
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-DqIb4AnV.js';
|
|
7
7
|
export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from './descriptors-DqIb4AnV.js';
|
|
8
|
-
import { n as T2000Options, P as PayOptions, d as PayResult, o as
|
|
9
|
-
export { A as AssetRates, G as GasReserve,
|
|
8
|
+
import { n as T2000Options, P as PayOptions, d as PayResult, o as SwapResult, p as SwapQuoteResult, i as SendResult, B as BalanceResponse, k as TransactionRecord, D as DepositInfo, q as PaymentRequest, S as SaveResult, W as WithdrawResult, b as MaxWithdrawResult, a as BorrowResult, h as RepayResult, M as MaxBorrowResult, H as HealthFactorResult, e as PendingReward, C as ClaimRewardsResult, r as CompoundRewardsResult, g as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, c as OverlayFeeConfig, j as SwapRouteResult, s as FinancialSummary } from './types-HJGbXJ37.js';
|
|
9
|
+
export { A as AssetRates, G as GasReserve, t as HFAlertLevel, O as OVERLAY_FEE_RATE, f as PositionEntry, u as SerializedCetusRoute, v as SerializedCetusRoutePath, w as SerializedRouterDataV3, T as TransactionLeg, x as addSwapToTx, l as buildSwapTx, y as deserializeCetusRoute, m as findSwapRoute, z as isCetusRouteFresh, I as serializeCetusRoute, J as verifyCetusRouteCoinMatch } from './types-HJGbXJ37.js';
|
|
10
10
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
11
11
|
import { SuinsClient } from '@mysten/suins';
|
|
12
12
|
export { NaviAdapter, ProtocolRegistry } from './adapters/index.js';
|
|
@@ -111,12 +111,6 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
111
111
|
/** Transaction signer (works for both keypair and zkLogin). */
|
|
112
112
|
get signer(): TransactionSigner;
|
|
113
113
|
pay(options: PayOptions): Promise<PayResult>;
|
|
114
|
-
stakeVSui(params: {
|
|
115
|
-
amount: number;
|
|
116
|
-
}): Promise<StakeVSuiResult>;
|
|
117
|
-
unstakeVSui(params: {
|
|
118
|
-
amount: number | 'all';
|
|
119
|
-
}): Promise<UnstakeVSuiResult>;
|
|
120
114
|
swap(params: {
|
|
121
115
|
from: string;
|
|
122
116
|
to: string;
|
|
@@ -124,11 +118,20 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
124
118
|
byAmountIn?: boolean;
|
|
125
119
|
slippage?: number;
|
|
126
120
|
}): Promise<SwapResult>;
|
|
121
|
+
/**
|
|
122
|
+
* [SPEC_AGENTIC_STACK P1 / SDK F2 — 2026-05-25]
|
|
123
|
+
* Thin wrapper around the standalone `getSwapQuote()`. Pre-Phase 1 this method
|
|
124
|
+
* was ~50 LoC duplicating `swap-quote.ts` — missing `serializedRoute` (SPEC 20.2
|
|
125
|
+
* fast-path) and the `providers` allow-list (Bug A fix / Pyth-dependent
|
|
126
|
+
* provider filter for sponsored callers). Routing both API surfaces through
|
|
127
|
+
* one implementation ensures fixes land for both.
|
|
128
|
+
*/
|
|
127
129
|
swapQuote(params: {
|
|
128
130
|
from: string;
|
|
129
131
|
to: string;
|
|
130
132
|
amount: number;
|
|
131
133
|
byAmountIn?: boolean;
|
|
134
|
+
providers?: string[];
|
|
132
135
|
}): Promise<SwapQuoteResult>;
|
|
133
136
|
address(): string;
|
|
134
137
|
send(params: {
|
|
@@ -173,6 +176,14 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
173
176
|
}): Promise<TransactionRecord[]>;
|
|
174
177
|
transactionDetail(digest: string): Promise<TransactionRecord | null>;
|
|
175
178
|
deposit(): Promise<DepositInfo>;
|
|
179
|
+
/**
|
|
180
|
+
* [SPEC_AGENTIC_STACK P1 / SDK F2 (CLI rename support) — 2026-05-25]
|
|
181
|
+
* Preferred alias of `deposit()`. The CLI surface is `t2000 fund` post-Phase 1
|
|
182
|
+
* (more intuitive than "deposit" which sounds like a NAVI lending action).
|
|
183
|
+
* `deposit()` stays as the canonical method name for back-compat; it is NOT
|
|
184
|
+
* deprecated. This wrapper exists so SDK consumers can mirror CLI naming.
|
|
185
|
+
*/
|
|
186
|
+
fund(): Promise<DepositInfo>;
|
|
176
187
|
receive(params?: {
|
|
177
188
|
amount?: number;
|
|
178
189
|
currency?: string;
|
|
@@ -566,13 +577,18 @@ declare function selectSuiCoin(tx: Transaction, client: SuiJsonRpcClient, owner:
|
|
|
566
577
|
*/
|
|
567
578
|
|
|
568
579
|
/**
|
|
569
|
-
* Canonical write tools. The
|
|
570
|
-
*
|
|
580
|
+
* Canonical write tools. The 8 tools that can be composed into a PTB.
|
|
581
|
+
*
|
|
582
|
+
* History:
|
|
583
|
+
* - 2026-05-08 (Track B): added `harvest_rewards` (compound macro).
|
|
584
|
+
* - 2026-05-25 (S.323): removed `volo_stake` / `volo_unstake` — full Volo
|
|
585
|
+
* cut across SDK/CLI/MCP after the engine cut Volo in S.277. vSUI
|
|
586
|
+
* remains as a passive token (NAVI reward, Cetus swap target).
|
|
571
587
|
*
|
|
572
588
|
* Excluded by design:
|
|
573
589
|
* - `save_contact` — no on-chain leg (Prisma-only).
|
|
574
590
|
*/
|
|
575
|
-
type WriteToolName = 'save_deposit' | 'withdraw' | 'borrow' | 'repay_debt' | 'send_transfer' | 'swap_execute' | 'claim_rewards' | 'harvest_rewards'
|
|
591
|
+
type WriteToolName = 'save_deposit' | 'withdraw' | 'borrow' | 'repay_debt' | 'send_transfer' | 'swap_execute' | 'claim_rewards' | 'harvest_rewards';
|
|
576
592
|
interface SaveDepositInput {
|
|
577
593
|
amount: number;
|
|
578
594
|
asset?: 'USDC' | 'USDsui';
|
|
@@ -627,12 +643,6 @@ interface HarvestRewardsInput {
|
|
|
627
643
|
/** USD floor for "is this worth swapping?" — dust below transfers to wallet. Default $0.01. */
|
|
628
644
|
minRewardUsd?: number;
|
|
629
645
|
}
|
|
630
|
-
interface VoloStakeInput {
|
|
631
|
-
amountSui: number;
|
|
632
|
-
}
|
|
633
|
-
interface VoloUnstakeInput {
|
|
634
|
-
amountVSui: number | 'all';
|
|
635
|
-
}
|
|
636
646
|
/**
|
|
637
647
|
* Discriminated union mapping `toolName` → `input`. Used to type
|
|
638
648
|
* `WriteStep` so consumers get autocomplete + compile-time validation
|
|
@@ -678,14 +688,6 @@ type WriteStep = {
|
|
|
678
688
|
} | {
|
|
679
689
|
toolName: 'harvest_rewards';
|
|
680
690
|
input: HarvestRewardsInput;
|
|
681
|
-
} | {
|
|
682
|
-
toolName: 'volo_stake';
|
|
683
|
-
input: VoloStakeInput;
|
|
684
|
-
inputCoinFromStep?: number;
|
|
685
|
-
} | {
|
|
686
|
-
toolName: 'volo_unstake';
|
|
687
|
-
input: VoloUnstakeInput;
|
|
688
|
-
inputCoinFromStep?: number;
|
|
689
691
|
};
|
|
690
692
|
interface ComposeTxOptions {
|
|
691
693
|
sender: string;
|
|
@@ -814,12 +816,6 @@ type StepPreview = {
|
|
|
814
816
|
reason: 'untradeable' | 'dust' | 'no-route';
|
|
815
817
|
}>;
|
|
816
818
|
expectedUsdcDeposited: number;
|
|
817
|
-
} | {
|
|
818
|
-
toolName: 'volo_stake';
|
|
819
|
-
effectiveAmountMist: bigint;
|
|
820
|
-
} | {
|
|
821
|
-
toolName: 'volo_unstake';
|
|
822
|
-
effectiveAmountMist: bigint | 'all';
|
|
823
819
|
};
|
|
824
820
|
interface ComposeTxResult {
|
|
825
821
|
tx: Transaction;
|
|
@@ -881,8 +877,9 @@ interface AppenderContext {
|
|
|
881
877
|
* downstream consumer's `chainedCoin`. Terminal consumers
|
|
882
878
|
* (`save_deposit`, `repay_debt`, `send_transfer`) omit it.
|
|
883
879
|
*
|
|
884
|
-
* `swap_execute
|
|
885
|
-
*
|
|
880
|
+
* `swap_execute` is the only dual-mode tool — it accepts `chainedCoin`
|
|
881
|
+
* AND populates `outputCoin`. (`volo_stake` / `volo_unstake` were also
|
|
882
|
+
* dual-mode prior to S.323 / 2026-05-25; cut with the full Volo removal.)
|
|
886
883
|
*/
|
|
887
884
|
interface AppenderResult<TPreview extends StepPreview> {
|
|
888
885
|
preview: TPreview;
|
|
@@ -915,7 +912,7 @@ declare function getSponsoredSwapProviders(): Promise<string[]>;
|
|
|
915
912
|
/**
|
|
916
913
|
* The typed registry. Each entry is a wallet-mode dispatcher that takes
|
|
917
914
|
* (tx, input, ctx) and returns a per-step preview. Compile-time check
|
|
918
|
-
* that all
|
|
915
|
+
* that all 8 `WriteToolName` values have an entry — TypeScript will
|
|
919
916
|
* fail the build if a tool is missing.
|
|
920
917
|
*/
|
|
921
918
|
declare const WRITE_APPENDER_REGISTRY: {
|
|
@@ -943,12 +940,6 @@ declare const WRITE_APPENDER_REGISTRY: {
|
|
|
943
940
|
harvest_rewards: AppenderFn<HarvestRewardsInput, Extract<StepPreview, {
|
|
944
941
|
toolName: 'harvest_rewards';
|
|
945
942
|
}>>;
|
|
946
|
-
volo_stake: AppenderFn<VoloStakeInput, Extract<StepPreview, {
|
|
947
|
-
toolName: 'volo_stake';
|
|
948
|
-
}>>;
|
|
949
|
-
volo_unstake: AppenderFn<VoloUnstakeInput, Extract<StepPreview, {
|
|
950
|
-
toolName: 'volo_unstake';
|
|
951
|
-
}>>;
|
|
952
943
|
};
|
|
953
944
|
/**
|
|
954
945
|
* Walks the assembled PTB's command list and extracts every recipient
|
|
@@ -1257,98 +1248,6 @@ declare function getSwapQuote(params: {
|
|
|
1257
1248
|
providers?: string[];
|
|
1258
1249
|
}): Promise<SwapQuoteResult>;
|
|
1259
1250
|
|
|
1260
|
-
/**
|
|
1261
|
-
* VOLO vSUI liquid staking — thin transaction builders.
|
|
1262
|
-
* No SDK dependency. Two Move calls, immutable contract addresses.
|
|
1263
|
-
*/
|
|
1264
|
-
|
|
1265
|
-
declare const VOLO_PKG = "0x68d22cf8bdbcd11ecba1e094922873e4080d4d11133e2443fddda0bfd11dae20";
|
|
1266
|
-
declare const VOLO_POOL = "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5";
|
|
1267
|
-
declare const VOLO_METADATA = "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60";
|
|
1268
|
-
declare const VSUI_TYPE = "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT";
|
|
1269
|
-
interface VoloStats {
|
|
1270
|
-
apy: number;
|
|
1271
|
-
exchangeRate: number;
|
|
1272
|
-
tvl: number;
|
|
1273
|
-
}
|
|
1274
|
-
/**
|
|
1275
|
-
* Fetch VOLO vSUI staking stats (APY, exchange rate, TVL).
|
|
1276
|
-
*/
|
|
1277
|
-
declare function getVoloStats(): Promise<VoloStats>;
|
|
1278
|
-
/**
|
|
1279
|
-
* Build a PTB to stake SUI for vSUI.
|
|
1280
|
-
*/
|
|
1281
|
-
declare function buildStakeVSuiTx(_client: SuiJsonRpcClient, address: string, amountMist: bigint): Promise<Transaction>;
|
|
1282
|
-
/**
|
|
1283
|
-
* Build a PTB to unstake vSUI back to SUI.
|
|
1284
|
-
*/
|
|
1285
|
-
declare function buildUnstakeVSuiTx(client: SuiJsonRpcClient, address: string, amountMist: bigint | 'all'): Promise<Transaction>;
|
|
1286
|
-
/**
|
|
1287
|
-
* SPEC 7 § "Layer 1" Volo stake appender. Two modes.
|
|
1288
|
-
*
|
|
1289
|
-
* Wallet mode (`inputCoin` omitted): pre-flights via `getBalance` and
|
|
1290
|
-
* sources SUI through `coinWithBalance({ type: SUI, useGasCoin: false })`,
|
|
1291
|
-
* which resolves coin objects + address balance at build time. Mirrors
|
|
1292
|
-
* the audric host's `transactions/prepare/route.ts:524-545` volo-stake
|
|
1293
|
-
* branch — sponsored-flow safe (does NOT consume `tx.gas`, which
|
|
1294
|
-
* belongs to the Enoki sponsor in sponsored flows).
|
|
1295
|
-
*
|
|
1296
|
-
* For non-sponsored flows where the caller owns `tx.gas`, prefer
|
|
1297
|
-
* `buildStakeVSuiTx` directly (it splits from gas, which avoids one
|
|
1298
|
-
* `getBalance` RTT).
|
|
1299
|
-
*
|
|
1300
|
-
* Chain mode (`inputCoin` provided): consumes the passed-in SUI coin
|
|
1301
|
-
* ref entirely. Used for chained flows like "swap USDC → SUI → stake".
|
|
1302
|
-
* The caller is responsible for splitting upstream if they only want
|
|
1303
|
-
* part of the input coin staked.
|
|
1304
|
-
*
|
|
1305
|
-
* @returns
|
|
1306
|
-
* - `coin`: vSUI output coin ref, ready for downstream consumption or
|
|
1307
|
-
* wallet transfer (`tx.transferObjects`).
|
|
1308
|
-
* - `effectiveAmountMist`: SUI mist consumed (echoes `input.amountMist`
|
|
1309
|
-
* in both modes; chain-mode trusts the caller-supplied value since
|
|
1310
|
-
* the actual coin balance is opaque).
|
|
1311
|
-
*/
|
|
1312
|
-
declare function addStakeVSuiToTx(tx: Transaction, client: SuiJsonRpcClient, address: string, input: {
|
|
1313
|
-
amountMist: bigint;
|
|
1314
|
-
inputCoin?: TransactionObjectArgument;
|
|
1315
|
-
}): Promise<{
|
|
1316
|
-
coin: TransactionObjectArgument;
|
|
1317
|
-
effectiveAmountMist: bigint;
|
|
1318
|
-
}>;
|
|
1319
|
-
/**
|
|
1320
|
-
* SPEC 7 § "Layer 1" Volo unstake appender. Two modes.
|
|
1321
|
-
*
|
|
1322
|
-
* Wallet mode (`inputCoin` omitted): pre-flights via `getBalance` and
|
|
1323
|
-
* sources vSUI through `coinWithBalance({ type: VSUI, balance })`,
|
|
1324
|
-
* which resolves coin objects + address balance at build time. With
|
|
1325
|
-
* `'all'`, the entire balance is consumed.
|
|
1326
|
-
*
|
|
1327
|
-
* Chain mode (`inputCoin` provided): consumes the passed-in vSUI coin
|
|
1328
|
-
* ref. With `amountMist = 'all'`, the entire input coin is unstaked.
|
|
1329
|
-
* With a bigint `amountMist`, the input coin is split internally and
|
|
1330
|
-
* only that portion unstaked (the leftover stays accessible via the
|
|
1331
|
-
* original ref). Used for chained flows where vSUI was just produced
|
|
1332
|
-
* by a prior step.
|
|
1333
|
-
*
|
|
1334
|
-
* @returns
|
|
1335
|
-
* - `coin`: SUI output coin ref, ready for downstream consumption
|
|
1336
|
-
* (e.g. `addSendToTx`, `addStakeVSuiToTx` re-stake) or wallet
|
|
1337
|
-
* transfer (`tx.transferObjects`).
|
|
1338
|
-
* - `effectiveAmountMist`: input vSUI mist consumed; echoes
|
|
1339
|
-
* `input.amountMist` (`'all'` is preserved as-is — the actual SUI
|
|
1340
|
-
* received differs from input vSUI by the pool exchange rate, so
|
|
1341
|
-
* callers needing the SUI amount must query `getVoloStats` or
|
|
1342
|
-
* parse balance changes from the executed tx).
|
|
1343
|
-
*/
|
|
1344
|
-
declare function addUnstakeVSuiToTx(tx: Transaction, client: SuiJsonRpcClient, address: string, input: {
|
|
1345
|
-
amountMist: bigint | 'all';
|
|
1346
|
-
inputCoin?: TransactionObjectArgument;
|
|
1347
|
-
}): Promise<{
|
|
1348
|
-
coin: TransactionObjectArgument;
|
|
1349
|
-
effectiveAmountMist: bigint | 'all';
|
|
1350
|
-
}>;
|
|
1351
|
-
|
|
1352
1251
|
/**
|
|
1353
1252
|
* SuiNS leaf-subname builders for the `audric.sui` parent NFT.
|
|
1354
1253
|
*
|
|
@@ -1488,4 +1387,4 @@ declare function fullHandle(label: string): string;
|
|
|
1488
1387
|
*/
|
|
1489
1388
|
declare function displayHandle(label: string): string;
|
|
1490
1389
|
|
|
1491
|
-
export { AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type AppenderContext, BalanceResponse, type BorrowInput, BorrowResult, type BuildAddLeafParams, type BuildHarvestRewardsTxOptions, type BuildRevokeLeafParams, type ClaimRewardsInput, ClaimRewardsResult, type CoinPage, type ComposeTxFeeHookContext, type ComposeTxFeeHooks, type ComposeTxOptions, type ComposeTxResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, type HarvestPlan, type HarvestSkippedLeg, type HarvestSwapLeg, HealthFactorResult, InvalidAddressError, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput,
|
|
1390
|
+
export { AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type AppenderContext, BalanceResponse, type BorrowInput, BorrowResult, type BuildAddLeafParams, type BuildHarvestRewardsTxOptions, type BuildRevokeLeafParams, type ClaimRewardsInput, ClaimRewardsResult, type CoinPage, type ComposeTxFeeHookContext, type ComposeTxFeeHooks, type ComposeTxOptions, type ComposeTxResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, type HarvestPlan, type HarvestSkippedLeg, type HarvestSwapLeg, HealthFactorResult, InvalidAddressError, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput, type StepPreview, SuinsNotRegisteredError, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, WRITE_APPENDER_REGISTRY, type WithdrawInput, WithdrawResult, type WriteStep, type WriteToolName, ZkLoginProof, addClaimRewardsToTx, addSendToTx, aggregateClaimableRewards, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, composeTx, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fetchAllCoins, fullHandle, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSponsoredSwapProviders, getSwapQuote, keypairFromPrivateKey, loadKey, looksLikeSuiNs, normalizeAddressInput, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveKey, selectAndSplitCoin, selectSuiCoin, validateLabel, walletExists };
|