@t2000/sdk 1.27.0 → 1.27.2

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/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-Cv9ZQ7KK.cjs';
5
- export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, aw 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, ax as OPERATION_ASSETS, O as OUTBOUND_OPS, ay 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, az as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractTransferDetails, a6 as extractTxCommands, a7 as extractTxSender, a8 as fallbackLabel, a9 as formatAssetAmount, aa as formatSui, ab as formatUsd, aA as getCoinMeta, ac as getDecimals, ad as getDecimalsForCoinType, ae as getTier, aB as isAllowedAsset, aC as isInRegistry, af as isSupported, ag as isTier1, ah as isTier2, ai as mapMoveAbortCode, aj as mapWalletError, ak as mistToSui, aD as normalizeAsset, aE as normalizeCoinType, al as parseSuiRpcTx, aF as queryHistory, aG as queryTransaction, am as rawToStable, an as rawToUsdc, ao as refineLendingLabel, ap as resolveSymbol, aq as resolveTokenType, aH as simulateTransaction, ar as stableToRaw, as as suiToMist, aI as throwIfSimulationFailed, at as truncateAddress, au as usdcToRaw, av as validateAddress } from './types-Cv9ZQ7KK.cjs';
4
+ import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-DmXSwjQ1.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, 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, aA 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, aB as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aC as isAllowedAsset, aD as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aE as normalizeAsset, aF as normalizeCoinType, am as parseSuiRpcTx, aG as queryHistory, aH as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aI as simulateTransaction, as as stableToRaw, at as suiToMist, aJ as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-DmXSwjQ1.cjs';
6
6
  import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-BnbL3xN8.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-BnbL3xN8.cjs';
8
- import { m as T2000Options, P as PayOptions, d as PayResult, n as StakeVSuiResult, U as UnstakeVSuiResult, o as SwapResult, p as SwapQuoteResult, i as SendResult, B as BalanceResponse, T 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-BaYOyGKJ.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, x as addSwapToTx, k as buildSwapTx, y as deserializeCetusRoute, l as findSwapRoute, z as isCetusRouteFresh, I as serializeCetusRoute, J as verifyCetusRouteCoinMatch } from './types-BaYOyGKJ.cjs';
8
+ import { n as T2000Options, P as PayOptions, d as PayResult, o as StakeVSuiResult, U as UnstakeVSuiResult, p as SwapResult, q as SwapQuoteResult, i as SendResult, B as BalanceResponse, k as TransactionRecord, D as DepositInfo, r 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, s as CompoundRewardsResult, g as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, c as OverlayFeeConfig, j as SwapRouteResult, t as FinancialSummary } from './types-epj9U13o.cjs';
9
+ export { A as AssetRates, G as GasReserve, u as HFAlertLevel, O as OVERLAY_FEE_RATE, f as PositionEntry, v as SerializedCetusRoute, w as SerializedCetusRoutePath, x as SerializedRouterDataV3, T as TransactionLeg, y as addSwapToTx, l as buildSwapTx, z as deserializeCetusRoute, m as findSwapRoute, I as isCetusRouteFresh, J as serializeCetusRoute, K as verifyCetusRouteCoinMatch } from './types-epj9U13o.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';
@@ -758,6 +758,29 @@ interface AppenderResult<TPreview extends StepPreview> {
758
758
  outputCoin?: TransactionObjectArgument;
759
759
  }
760
760
  type AppenderFn<TInput, TPreview extends StepPreview> = (tx: Transaction, input: TInput, ctx: AppenderContext) => Promise<AppenderResult<TPreview>>;
761
+ /**
762
+ * Cetus provider exclusion list for sponsored flows. Mirrors the
763
+ * audric host's `SPONSORED_TX_PROVIDERS` constant — these 7 providers
764
+ * reference `tx.gas` for Pyth oracle fee payments, which Enoki rejects.
765
+ *
766
+ * NOTE: keeping this hardcoded means `findSwapRoute` doesn't need a
767
+ * dependency on `@cetusprotocol/aggregator-sdk`'s `getProvidersExcluding`
768
+ * helper — composeTx forwards the literal list to Cetus, Cetus does the
769
+ * inverse lookup. Result is identical.
770
+ */
771
+ declare const SPONSORED_PYTH_DEPENDENT_PROVIDERS: readonly ["HAEDALPMM", "METASTABLE", "OBRIC", "STEAMM_OMM", "STEAMM_OMM_V2", "SEVENK", "HAEDALHMMV2"];
772
+ /**
773
+ * Get all eligible Cetus provider names except the Pyth-dependent ones,
774
+ * for sponsored swap context. Computed from the Cetus SDK's
775
+ * `getAllProviders()` minus the exclusion list.
776
+ *
777
+ * [Bug A fix / 2026-05-10] Exported so the engine's `swap_quote` tool can
778
+ * call this when discovering routes for sponsored hosts. Previously the
779
+ * engine only exclude these providers at COMPOSE time; now it excludes
780
+ * at QUOTE time too, so the precomputed route stashed on
781
+ * `pending_action.cetusRoute` is always sponsor-safe.
782
+ */
783
+ declare function getSponsoredSwapProviders(): Promise<string[]>;
761
784
  /**
762
785
  * The typed registry. Each entry is a wallet-mode dispatcher that takes
763
786
  * (tx, input, ctx) and returns a per-step preview. Compile-time check
@@ -1079,6 +1102,28 @@ declare function getSwapQuote(params: {
1079
1102
  to: string;
1080
1103
  amount: number;
1081
1104
  byAmountIn?: boolean;
1105
+ /**
1106
+ * [Bug A fix / 2026-05-10] Optional Cetus provider allow-list, forwarded to
1107
+ * `findSwapRoute`. Sponsored callers (Enoki) MUST pass
1108
+ * `getSponsoredSwapProviders()` to remove Pyth-dependent providers
1109
+ * (HAEDALPMM, METASTABLE, OBRIC, STEAMM_OMM/_V2, SEVENK, HAEDALHMMV2).
1110
+ * Those providers cause the Cetus aggregator's internal `routerSwap` to
1111
+ * insert a `tx.splitCoins(tx.gas, ...)` call for the Pyth update fee,
1112
+ * which Enoki rejects with HTTP 400 "Cannot use GasCoin as a transaction
1113
+ * argument" (3-step bundle smoke 2026-05-10).
1114
+ *
1115
+ * Pre-fix: `getSwapQuote` discovered routes against the FULL provider set,
1116
+ * stashed Pyth-dependent routes onto `pending_action.cetusRoute` (SPEC
1117
+ * 20.2 fast-path), and the audric `prepare` route's `swap_execute`
1118
+ * appender used the precomputed route AS-IS — bypassing the providers
1119
+ * filter that `composeTx` correctly applied. Result: every swap whose
1120
+ * best route happened to include a Pyth-dependent provider failed at
1121
+ * Enoki sponsorship.
1122
+ *
1123
+ * Non-sponsored callers (e.g. CLI direct swap) leave this undefined to
1124
+ * keep access to the full provider set including Pyth-dependent pools.
1125
+ */
1126
+ providers?: string[];
1082
1127
  }): Promise<SwapQuoteResult>;
1083
1128
 
1084
1129
  /**
@@ -1310,4 +1355,4 @@ declare function fullHandle(label: string): string;
1310
1355
  */
1311
1356
  declare function displayHandle(label: string): string;
1312
1357
 
1313
- 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, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput, StakeVSuiResult, type StepPreview, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStakeInput, type VoloStats, type VoloUnstakeInput, WRITE_APPENDER_REGISTRY, type WithdrawInput, WithdrawResult, type WriteStep, type WriteToolName, ZkLoginProof, addClaimRewardsToTx, addSendToTx, addStakeVSuiToTx, addUnstakeVSuiToTx, aggregateClaimableRewards, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, buildStakeVSuiTx, buildUnstakeVSuiTx, composeTx, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fetchAllCoins, fullHandle, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey, selectAndSplitCoin, selectSuiCoin, validateLabel, walletExists };
1358
+ 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, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput, StakeVSuiResult, type StepPreview, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStakeInput, type VoloStats, type VoloUnstakeInput, WRITE_APPENDER_REGISTRY, type WithdrawInput, WithdrawResult, type WriteStep, type WriteToolName, ZkLoginProof, addClaimRewardsToTx, addSendToTx, addStakeVSuiToTx, addUnstakeVSuiToTx, aggregateClaimableRewards, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, buildStakeVSuiTx, buildUnstakeVSuiTx, composeTx, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fetchAllCoins, fullHandle, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSponsoredSwapProviders, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, 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-Bheg9UZP.js';
5
- export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, aw 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, ax as OPERATION_ASSETS, O as OUTBOUND_OPS, ay 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, az as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractTransferDetails, a6 as extractTxCommands, a7 as extractTxSender, a8 as fallbackLabel, a9 as formatAssetAmount, aa as formatSui, ab as formatUsd, aA as getCoinMeta, ac as getDecimals, ad as getDecimalsForCoinType, ae as getTier, aB as isAllowedAsset, aC as isInRegistry, af as isSupported, ag as isTier1, ah as isTier2, ai as mapMoveAbortCode, aj as mapWalletError, ak as mistToSui, aD as normalizeAsset, aE as normalizeCoinType, al as parseSuiRpcTx, aF as queryHistory, aG as queryTransaction, am as rawToStable, an as rawToUsdc, ao as refineLendingLabel, ap as resolveSymbol, aq as resolveTokenType, aH as simulateTransaction, ar as stableToRaw, as as suiToMist, aI as throwIfSimulationFailed, at as truncateAddress, au as usdcToRaw, av as validateAddress } from './types-Bheg9UZP.js';
4
+ import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-CvBZ1IrA.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, 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, aA 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, aB as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aC as isAllowedAsset, aD as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aE as normalizeAsset, aF as normalizeCoinType, am as parseSuiRpcTx, aG as queryHistory, aH as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aI as simulateTransaction, as as stableToRaw, at as suiToMist, aJ as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-CvBZ1IrA.js';
6
6
  import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-BnbL3xN8.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-BnbL3xN8.js';
8
- import { m as T2000Options, P as PayOptions, d as PayResult, n as StakeVSuiResult, U as UnstakeVSuiResult, o as SwapResult, p as SwapQuoteResult, i as SendResult, B as BalanceResponse, T 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-BaYOyGKJ.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, x as addSwapToTx, k as buildSwapTx, y as deserializeCetusRoute, l as findSwapRoute, z as isCetusRouteFresh, I as serializeCetusRoute, J as verifyCetusRouteCoinMatch } from './types-BaYOyGKJ.js';
8
+ import { n as T2000Options, P as PayOptions, d as PayResult, o as StakeVSuiResult, U as UnstakeVSuiResult, p as SwapResult, q as SwapQuoteResult, i as SendResult, B as BalanceResponse, k as TransactionRecord, D as DepositInfo, r 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, s as CompoundRewardsResult, g as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, c as OverlayFeeConfig, j as SwapRouteResult, t as FinancialSummary } from './types-epj9U13o.js';
9
+ export { A as AssetRates, G as GasReserve, u as HFAlertLevel, O as OVERLAY_FEE_RATE, f as PositionEntry, v as SerializedCetusRoute, w as SerializedCetusRoutePath, x as SerializedRouterDataV3, T as TransactionLeg, y as addSwapToTx, l as buildSwapTx, z as deserializeCetusRoute, m as findSwapRoute, I as isCetusRouteFresh, J as serializeCetusRoute, K as verifyCetusRouteCoinMatch } from './types-epj9U13o.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';
@@ -758,6 +758,29 @@ interface AppenderResult<TPreview extends StepPreview> {
758
758
  outputCoin?: TransactionObjectArgument;
759
759
  }
760
760
  type AppenderFn<TInput, TPreview extends StepPreview> = (tx: Transaction, input: TInput, ctx: AppenderContext) => Promise<AppenderResult<TPreview>>;
761
+ /**
762
+ * Cetus provider exclusion list for sponsored flows. Mirrors the
763
+ * audric host's `SPONSORED_TX_PROVIDERS` constant — these 7 providers
764
+ * reference `tx.gas` for Pyth oracle fee payments, which Enoki rejects.
765
+ *
766
+ * NOTE: keeping this hardcoded means `findSwapRoute` doesn't need a
767
+ * dependency on `@cetusprotocol/aggregator-sdk`'s `getProvidersExcluding`
768
+ * helper — composeTx forwards the literal list to Cetus, Cetus does the
769
+ * inverse lookup. Result is identical.
770
+ */
771
+ declare const SPONSORED_PYTH_DEPENDENT_PROVIDERS: readonly ["HAEDALPMM", "METASTABLE", "OBRIC", "STEAMM_OMM", "STEAMM_OMM_V2", "SEVENK", "HAEDALHMMV2"];
772
+ /**
773
+ * Get all eligible Cetus provider names except the Pyth-dependent ones,
774
+ * for sponsored swap context. Computed from the Cetus SDK's
775
+ * `getAllProviders()` minus the exclusion list.
776
+ *
777
+ * [Bug A fix / 2026-05-10] Exported so the engine's `swap_quote` tool can
778
+ * call this when discovering routes for sponsored hosts. Previously the
779
+ * engine only exclude these providers at COMPOSE time; now it excludes
780
+ * at QUOTE time too, so the precomputed route stashed on
781
+ * `pending_action.cetusRoute` is always sponsor-safe.
782
+ */
783
+ declare function getSponsoredSwapProviders(): Promise<string[]>;
761
784
  /**
762
785
  * The typed registry. Each entry is a wallet-mode dispatcher that takes
763
786
  * (tx, input, ctx) and returns a per-step preview. Compile-time check
@@ -1079,6 +1102,28 @@ declare function getSwapQuote(params: {
1079
1102
  to: string;
1080
1103
  amount: number;
1081
1104
  byAmountIn?: boolean;
1105
+ /**
1106
+ * [Bug A fix / 2026-05-10] Optional Cetus provider allow-list, forwarded to
1107
+ * `findSwapRoute`. Sponsored callers (Enoki) MUST pass
1108
+ * `getSponsoredSwapProviders()` to remove Pyth-dependent providers
1109
+ * (HAEDALPMM, METASTABLE, OBRIC, STEAMM_OMM/_V2, SEVENK, HAEDALHMMV2).
1110
+ * Those providers cause the Cetus aggregator's internal `routerSwap` to
1111
+ * insert a `tx.splitCoins(tx.gas, ...)` call for the Pyth update fee,
1112
+ * which Enoki rejects with HTTP 400 "Cannot use GasCoin as a transaction
1113
+ * argument" (3-step bundle smoke 2026-05-10).
1114
+ *
1115
+ * Pre-fix: `getSwapQuote` discovered routes against the FULL provider set,
1116
+ * stashed Pyth-dependent routes onto `pending_action.cetusRoute` (SPEC
1117
+ * 20.2 fast-path), and the audric `prepare` route's `swap_execute`
1118
+ * appender used the precomputed route AS-IS — bypassing the providers
1119
+ * filter that `composeTx` correctly applied. Result: every swap whose
1120
+ * best route happened to include a Pyth-dependent provider failed at
1121
+ * Enoki sponsorship.
1122
+ *
1123
+ * Non-sponsored callers (e.g. CLI direct swap) leave this undefined to
1124
+ * keep access to the full provider set including Pyth-dependent pools.
1125
+ */
1126
+ providers?: string[];
1082
1127
  }): Promise<SwapQuoteResult>;
1083
1128
 
1084
1129
  /**
@@ -1310,4 +1355,4 @@ declare function fullHandle(label: string): string;
1310
1355
  */
1311
1356
  declare function displayHandle(label: string): string;
1312
1357
 
1313
- 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, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput, StakeVSuiResult, type StepPreview, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStakeInput, type VoloStats, type VoloUnstakeInput, WRITE_APPENDER_REGISTRY, type WithdrawInput, WithdrawResult, type WriteStep, type WriteToolName, ZkLoginProof, addClaimRewardsToTx, addSendToTx, addStakeVSuiToTx, addUnstakeVSuiToTx, aggregateClaimableRewards, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, buildStakeVSuiTx, buildUnstakeVSuiTx, composeTx, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fetchAllCoins, fullHandle, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey, selectAndSplitCoin, selectSuiCoin, validateLabel, walletExists };
1358
+ 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, type LabelValidationResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, type RepayDebtInput, RepayResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SafeguardConfig, SafeguardEnforcer, type SaveDepositInput, SaveResult, type SelectAndSplitResult, SendResult, type SendTransferInput, StakeVSuiResult, type StepPreview, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStakeInput, type VoloStats, type VoloUnstakeInput, WRITE_APPENDER_REGISTRY, type WithdrawInput, WithdrawResult, type WriteStep, type WriteToolName, ZkLoginProof, addClaimRewardsToTx, addSendToTx, addStakeVSuiToTx, addUnstakeVSuiToTx, aggregateClaimableRewards, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, buildStakeVSuiTx, buildUnstakeVSuiTx, composeTx, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fetchAllCoins, fullHandle, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSponsoredSwapProviders, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey, selectAndSplitCoin, selectSuiCoin, validateLabel, walletExists };
package/dist/index.js CHANGED
@@ -921,6 +921,7 @@ __export(cetus_swap_exports, {
921
921
  deserializeCetusRoute: () => deserializeCetusRoute,
922
922
  findSwapRoute: () => findSwapRoute,
923
923
  isCetusRouteFresh: () => isCetusRouteFresh,
924
+ isPrecomputedRouteCompatibleWithProviders: () => isPrecomputedRouteCompatibleWithProviders,
924
925
  resolveTokenType: () => resolveTokenType,
925
926
  serializeCetusRoute: () => serializeCetusRoute,
926
927
  simulateSwap: () => simulateSwap,
@@ -1037,6 +1038,14 @@ function getClient(walletAddress, overlayFee) {
1037
1038
  clientCache.set(key, client);
1038
1039
  return client;
1039
1040
  }
1041
+ function isPrecomputedRouteCompatibleWithProviders(route, providers) {
1042
+ if (!providers || providers.length === 0) return true;
1043
+ const allowed = new Set(providers);
1044
+ for (const path of route.routerData.paths) {
1045
+ if (!allowed.has(path.provider)) return false;
1046
+ }
1047
+ return true;
1048
+ }
1040
1049
  async function findSwapRoute(params) {
1041
1050
  const client = getClient(params.walletAddress, params.overlayFee);
1042
1051
  const findParams = {
@@ -1114,7 +1123,7 @@ async function addSwapToTx(tx, client, address, input) {
1114
1123
  }
1115
1124
  let route;
1116
1125
  let usedPrecomputedRoute = false;
1117
- if (input.precomputedRoute && input.precomputedRoute.amountIn === effectiveRaw.toString() && input.precomputedRoute.byAmountIn === byAmountIn) {
1126
+ if (input.precomputedRoute && input.precomputedRoute.amountIn === effectiveRaw.toString() && input.precomputedRoute.byAmountIn === byAmountIn && isPrecomputedRouteCompatibleWithProviders(input.precomputedRoute, input.providers)) {
1118
1127
  route = input.precomputedRoute;
1119
1128
  usedPrecomputedRoute = true;
1120
1129
  } else {
@@ -1722,6 +1731,26 @@ function extractTransferDetails(changes, sender) {
1722
1731
  function bigintAbs(n) {
1723
1732
  return n < 0n ? -n : n;
1724
1733
  }
1734
+ function extractAllUserLegs(changes, sender) {
1735
+ if (!changes || changes.length === 0) return [];
1736
+ const legs = [];
1737
+ for (const c of changes) {
1738
+ if (resolveOwner(c.owner) !== sender) continue;
1739
+ const raw = BigInt(c.amount);
1740
+ if (raw === 0n) continue;
1741
+ const decimals = getDecimalsForCoinType(c.coinType);
1742
+ const absAmount = bigintAbs(raw);
1743
+ legs.push({
1744
+ coinType: c.coinType,
1745
+ asset: resolveSymbol(c.coinType),
1746
+ decimals,
1747
+ amount: Number(absAmount) / 10 ** decimals,
1748
+ rawAmount: raw.toString(),
1749
+ direction: raw < 0n ? "out" : "in"
1750
+ });
1751
+ }
1752
+ return legs;
1753
+ }
1725
1754
 
1726
1755
  // src/wallet/history.ts
1727
1756
  async function queryHistory(client, address, limit = 20) {
@@ -1765,6 +1794,7 @@ function parseTxRecord(tx, address) {
1765
1794
  const gasCost = gasUsed ? (Number(gasUsed.computationCost) + Number(gasUsed.storageCost) - Number(gasUsed.storageRebate)) / 1e9 : void 0;
1766
1795
  const { moveCallTargets, commandTypes } = extractCommands(tx.transaction);
1767
1796
  const balanceChanges = tx.balanceChanges ?? [];
1797
+ const legs = extractAllUserLegs(balanceChanges, address);
1768
1798
  const { amount, asset, recipient, direction } = extractTransferDetails(balanceChanges, address);
1769
1799
  const { action, label } = classifyTransaction(
1770
1800
  moveCallTargets,
@@ -1776,6 +1806,7 @@ function parseTxRecord(tx, address) {
1776
1806
  digest: tx.digest,
1777
1807
  action,
1778
1808
  label,
1809
+ legs,
1779
1810
  amount,
1780
1811
  asset,
1781
1812
  recipient,
@@ -8329,7 +8360,8 @@ async function getSwapQuote(params) {
8329
8360
  from: fromType,
8330
8361
  to: toType,
8331
8362
  amount: rawAmount,
8332
- byAmountIn
8363
+ byAmountIn,
8364
+ providers: params.providers
8333
8365
  });
8334
8366
  if (!route) throw new T2000Error("SWAP_FAILED", `No swap route found for ${params.from} -> ${params.to}.`);
8335
8367
  if (route.insufficientLiquidity) {
@@ -8423,6 +8455,6 @@ function displayHandle(label) {
8423
8455
  (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
8424
8456
  */
8425
8457
 
8426
- export { ALL_NAVI_ASSETS, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, BORROW_FEE_BPS, BPS_DENOMINATOR, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, ContactManager, DEFAULT_NETWORK, DEFAULT_SAFEGUARD_CONFIG, ETH_TYPE, GAS_RESERVE_MIN, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, IKA_TYPE, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, MANIFEST_TYPE, MIST_PER_SUI, NAVX_TYPE, NaviAdapter, OPERATION_ASSETS, OUTBOUND_OPS, OVERLAY_FEE_RATE, ProtocolRegistry, SAVE_FEE_BPS, STABLE_ASSETS, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SafeguardEnforcer, SafeguardError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addClaimRewardsToTx, addFeeTransfer, addSendToTx, addStakeVSuiToTx, addSwapToTx, addUnstakeVSuiToTx, aggregateClaimableRewards, allDescriptors, assertAllowedAsset, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, buildStakeVSuiTx, buildSwapTx, buildUnstakeVSuiTx, calculateFee, classifyAction, classifyLabel, classifyTransaction, composeTx, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, exportPrivateKey, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getCoinMeta, getDecimals, getDecimalsForCoinType, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSwapQuote, getTier, getVoloStats, isAllowedAsset, isCetusRouteFresh, isInRegistry, isSupported, isTier1, isTier2, keypairFromPrivateKey, loadKey, mapMoveAbortCode, mapWalletError, mistToSui, naviDescriptor, normalizeAsset, normalizeCoinType, parseSuiRpcTx, queryHistory, queryTransaction, rawToStable, rawToUsdc, refineLendingLabel, resolveSymbol, resolveTokenType, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, walletExists };
8458
+ export { ALL_NAVI_ASSETS, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, BORROW_FEE_BPS, BPS_DENOMINATOR, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, ContactManager, DEFAULT_NETWORK, DEFAULT_SAFEGUARD_CONFIG, ETH_TYPE, GAS_RESERVE_MIN, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, IKA_TYPE, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, MANIFEST_TYPE, MIST_PER_SUI, NAVX_TYPE, NaviAdapter, OPERATION_ASSETS, OUTBOUND_OPS, OVERLAY_FEE_RATE, ProtocolRegistry, SAVE_FEE_BPS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SafeguardEnforcer, SafeguardError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addClaimRewardsToTx, addFeeTransfer, addSendToTx, addStakeVSuiToTx, addSwapToTx, addUnstakeVSuiToTx, aggregateClaimableRewards, allDescriptors, assertAllowedAsset, buildAddLeafTx, buildClaimRewardsTx, buildHarvestRewardsTx, buildRevokeLeafTx, buildSendTx, buildStakeVSuiTx, buildSwapTx, buildUnstakeVSuiTx, calculateFee, classifyAction, classifyLabel, classifyTransaction, composeTx, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getCoinMeta, getDecimals, getDecimalsForCoinType, getFinancialSummary, getPendingRewards, getPendingRewardsByAddress, getRates, getSponsoredSwapProviders, getSwapQuote, getTier, getVoloStats, isAllowedAsset, isCetusRouteFresh, isInRegistry, isSupported, isTier1, isTier2, keypairFromPrivateKey, loadKey, mapMoveAbortCode, mapWalletError, mistToSui, naviDescriptor, normalizeAsset, normalizeCoinType, parseSuiRpcTx, queryHistory, queryTransaction, rawToStable, rawToUsdc, refineLendingLabel, resolveSymbol, resolveTokenType, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, walletExists };
8427
8459
  //# sourceMappingURL=index.js.map
8428
8460
  //# sourceMappingURL=index.js.map