@t2000/sdk 1.24.0 → 1.24.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/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/index.cjs +22 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -1
- package/dist/index.d.ts +60 -1
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -829,6 +829,28 @@ type FinancialSummaryOptions = Record<string, never>;
|
|
|
829
829
|
declare function getFinancialSummary(client: SuiJsonRpcClient, walletAddress: string, _options?: FinancialSummaryOptions): Promise<FinancialSummary>;
|
|
830
830
|
|
|
831
831
|
declare function getRates(client: SuiJsonRpcClient): Promise<RatesResult>;
|
|
832
|
+
/**
|
|
833
|
+
* [Track B follow-up / 2026-05-08] Stateless wrapper around `getPendingRewards`
|
|
834
|
+
* that creates its own `SuiJsonRpcClient`. Used by the engine's
|
|
835
|
+
* `pending_rewards` tool — engine doesn't import `@mysten/sui` directly
|
|
836
|
+
* (would expand its dep surface), so this helper accepts just `(address,
|
|
837
|
+
* suiRpcUrl?)` and instantiates the client internally.
|
|
838
|
+
*
|
|
839
|
+
* **Why this exists.** Pre-fix the engine tool went through
|
|
840
|
+
* `requireAgent(context).getPendingRewards()`, which threw
|
|
841
|
+
* "Tool requires a T2000 agent instance — pass `agent` in EngineConfig"
|
|
842
|
+
* in audric prod (audric uses sponsored-tx flow, never instantiates a
|
|
843
|
+
* T2000 agent). Live mainnet smoke on funkii's wallet 2026-05-08 caught
|
|
844
|
+
* this immediately when the LLM correctly called pending_rewards before
|
|
845
|
+
* harvest_rewards. This helper makes the audric/CLI paths symmetric
|
|
846
|
+
* (both work, neither requires an agent).
|
|
847
|
+
*
|
|
848
|
+
* Defaults `suiRpcUrl` to mainnet fullnode for CLI / standalone callers
|
|
849
|
+
* that don't pass one. Errors propagate with the same `T2000Error`
|
|
850
|
+
* shape as the underlying `getPendingRewards` (PROTOCOL_UNAVAILABLE on
|
|
851
|
+
* NAVI degradation, etc.) so the engine tool's catch path is unchanged.
|
|
852
|
+
*/
|
|
853
|
+
declare function getPendingRewardsByAddress(address: string, suiRpcUrl?: string): Promise<PendingReward$1[]>;
|
|
832
854
|
declare function getPendingRewards(client: SuiJsonRpcClient, address: string): Promise<PendingReward$1[]>;
|
|
833
855
|
declare function addClaimRewardsToTx(tx: Transaction, client: SuiJsonRpcClient, address: string): Promise<PendingReward$1[]>;
|
|
834
856
|
/**
|
|
@@ -970,6 +992,22 @@ interface HarvestPlan {
|
|
|
970
992
|
/** Display-units USDC that will be deposited to the NAVI USDC pool. */
|
|
971
993
|
expectedUsdcDeposited: number;
|
|
972
994
|
}
|
|
995
|
+
/**
|
|
996
|
+
* Callback invoked right before the harvest's internal `addSaveToTx`.
|
|
997
|
+
* Mirrors the shape of `composeTx`'s `feeHooks.save_deposit` so audric's
|
|
998
|
+
* existing hook can be threaded straight through without adapters. The
|
|
999
|
+
* SDK never invents a fee — the host decides whether to skim from
|
|
1000
|
+
* `coin` and to where. See CLAUDE.md rule #9 (fees are a host concern).
|
|
1001
|
+
*/
|
|
1002
|
+
type HarvestSaveFeeHook = (ctx: {
|
|
1003
|
+
tx: Transaction;
|
|
1004
|
+
coin: TransactionObjectArgument;
|
|
1005
|
+
input: {
|
|
1006
|
+
asset: 'USDC';
|
|
1007
|
+
amount: number;
|
|
1008
|
+
};
|
|
1009
|
+
sender: string;
|
|
1010
|
+
}) => void | Promise<void>;
|
|
973
1011
|
interface BuildHarvestRewardsTxOptions {
|
|
974
1012
|
/** Per-swap slippage tolerance (0.001–0.05). Defaults to 0.01 (1%). */
|
|
975
1013
|
slippage?: number;
|
|
@@ -992,6 +1030,27 @@ interface BuildHarvestRewardsTxOptions {
|
|
|
992
1030
|
* Pyth-free. Non-sponsored callers omit this.
|
|
993
1031
|
*/
|
|
994
1032
|
providers?: string[];
|
|
1033
|
+
/**
|
|
1034
|
+
* [v1.24.2 fee wiring] Overlay fee forwarded to EACH internal
|
|
1035
|
+
* `addSwapToTx` call. When set, every swap leg charges the rate to
|
|
1036
|
+
* the receiver (typically `T2000_OVERLAY_FEE_WALLET` for audric).
|
|
1037
|
+
* Omit for fee-free harvests (CLI / direct SDK callers).
|
|
1038
|
+
*/
|
|
1039
|
+
overlayFee?: OverlayFeeConfig;
|
|
1040
|
+
/**
|
|
1041
|
+
* [v1.24.2 fee wiring] Fired immediately before the internal
|
|
1042
|
+
* `addSaveToTx` consumes the merged USDC deposit coin. The hook
|
|
1043
|
+
* receives the deposit handle so it can split a fee off via
|
|
1044
|
+
* `addFeeTransfer(...)` (host's call). Audric threads its
|
|
1045
|
+
* `feeHooks.save_deposit` straight through here so a harvest's
|
|
1046
|
+
* deposit leg pays the same `SAVE_FEE_BPS` as a single-op `save`.
|
|
1047
|
+
*
|
|
1048
|
+
* Order is load-bearing: this hook fires AFTER all USDC handles
|
|
1049
|
+
* are merged into one and BEFORE the NAVI deposit consumes it.
|
|
1050
|
+
* Fee receiver gets recorded as a top-level transferObjects, so
|
|
1051
|
+
* it's automatically picked up by `derivedAllowedAddresses`.
|
|
1052
|
+
*/
|
|
1053
|
+
saveFeeHook?: HarvestSaveFeeHook;
|
|
995
1054
|
}
|
|
996
1055
|
/**
|
|
997
1056
|
* Standalone harvest builder — creates a fresh PTB, sets the sender,
|
|
@@ -1242,4 +1301,4 @@ declare function fullHandle(label: string): string;
|
|
|
1242
1301
|
*/
|
|
1243
1302
|
declare function displayHandle(label: string): string;
|
|
1244
1303
|
|
|
1245
|
-
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, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey, selectAndSplitCoin, selectSuiCoin, validateLabel, walletExists };
|
|
1304
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -829,6 +829,28 @@ type FinancialSummaryOptions = Record<string, never>;
|
|
|
829
829
|
declare function getFinancialSummary(client: SuiJsonRpcClient, walletAddress: string, _options?: FinancialSummaryOptions): Promise<FinancialSummary>;
|
|
830
830
|
|
|
831
831
|
declare function getRates(client: SuiJsonRpcClient): Promise<RatesResult>;
|
|
832
|
+
/**
|
|
833
|
+
* [Track B follow-up / 2026-05-08] Stateless wrapper around `getPendingRewards`
|
|
834
|
+
* that creates its own `SuiJsonRpcClient`. Used by the engine's
|
|
835
|
+
* `pending_rewards` tool — engine doesn't import `@mysten/sui` directly
|
|
836
|
+
* (would expand its dep surface), so this helper accepts just `(address,
|
|
837
|
+
* suiRpcUrl?)` and instantiates the client internally.
|
|
838
|
+
*
|
|
839
|
+
* **Why this exists.** Pre-fix the engine tool went through
|
|
840
|
+
* `requireAgent(context).getPendingRewards()`, which threw
|
|
841
|
+
* "Tool requires a T2000 agent instance — pass `agent` in EngineConfig"
|
|
842
|
+
* in audric prod (audric uses sponsored-tx flow, never instantiates a
|
|
843
|
+
* T2000 agent). Live mainnet smoke on funkii's wallet 2026-05-08 caught
|
|
844
|
+
* this immediately when the LLM correctly called pending_rewards before
|
|
845
|
+
* harvest_rewards. This helper makes the audric/CLI paths symmetric
|
|
846
|
+
* (both work, neither requires an agent).
|
|
847
|
+
*
|
|
848
|
+
* Defaults `suiRpcUrl` to mainnet fullnode for CLI / standalone callers
|
|
849
|
+
* that don't pass one. Errors propagate with the same `T2000Error`
|
|
850
|
+
* shape as the underlying `getPendingRewards` (PROTOCOL_UNAVAILABLE on
|
|
851
|
+
* NAVI degradation, etc.) so the engine tool's catch path is unchanged.
|
|
852
|
+
*/
|
|
853
|
+
declare function getPendingRewardsByAddress(address: string, suiRpcUrl?: string): Promise<PendingReward$1[]>;
|
|
832
854
|
declare function getPendingRewards(client: SuiJsonRpcClient, address: string): Promise<PendingReward$1[]>;
|
|
833
855
|
declare function addClaimRewardsToTx(tx: Transaction, client: SuiJsonRpcClient, address: string): Promise<PendingReward$1[]>;
|
|
834
856
|
/**
|
|
@@ -970,6 +992,22 @@ interface HarvestPlan {
|
|
|
970
992
|
/** Display-units USDC that will be deposited to the NAVI USDC pool. */
|
|
971
993
|
expectedUsdcDeposited: number;
|
|
972
994
|
}
|
|
995
|
+
/**
|
|
996
|
+
* Callback invoked right before the harvest's internal `addSaveToTx`.
|
|
997
|
+
* Mirrors the shape of `composeTx`'s `feeHooks.save_deposit` so audric's
|
|
998
|
+
* existing hook can be threaded straight through without adapters. The
|
|
999
|
+
* SDK never invents a fee — the host decides whether to skim from
|
|
1000
|
+
* `coin` and to where. See CLAUDE.md rule #9 (fees are a host concern).
|
|
1001
|
+
*/
|
|
1002
|
+
type HarvestSaveFeeHook = (ctx: {
|
|
1003
|
+
tx: Transaction;
|
|
1004
|
+
coin: TransactionObjectArgument;
|
|
1005
|
+
input: {
|
|
1006
|
+
asset: 'USDC';
|
|
1007
|
+
amount: number;
|
|
1008
|
+
};
|
|
1009
|
+
sender: string;
|
|
1010
|
+
}) => void | Promise<void>;
|
|
973
1011
|
interface BuildHarvestRewardsTxOptions {
|
|
974
1012
|
/** Per-swap slippage tolerance (0.001–0.05). Defaults to 0.01 (1%). */
|
|
975
1013
|
slippage?: number;
|
|
@@ -992,6 +1030,27 @@ interface BuildHarvestRewardsTxOptions {
|
|
|
992
1030
|
* Pyth-free. Non-sponsored callers omit this.
|
|
993
1031
|
*/
|
|
994
1032
|
providers?: string[];
|
|
1033
|
+
/**
|
|
1034
|
+
* [v1.24.2 fee wiring] Overlay fee forwarded to EACH internal
|
|
1035
|
+
* `addSwapToTx` call. When set, every swap leg charges the rate to
|
|
1036
|
+
* the receiver (typically `T2000_OVERLAY_FEE_WALLET` for audric).
|
|
1037
|
+
* Omit for fee-free harvests (CLI / direct SDK callers).
|
|
1038
|
+
*/
|
|
1039
|
+
overlayFee?: OverlayFeeConfig;
|
|
1040
|
+
/**
|
|
1041
|
+
* [v1.24.2 fee wiring] Fired immediately before the internal
|
|
1042
|
+
* `addSaveToTx` consumes the merged USDC deposit coin. The hook
|
|
1043
|
+
* receives the deposit handle so it can split a fee off via
|
|
1044
|
+
* `addFeeTransfer(...)` (host's call). Audric threads its
|
|
1045
|
+
* `feeHooks.save_deposit` straight through here so a harvest's
|
|
1046
|
+
* deposit leg pays the same `SAVE_FEE_BPS` as a single-op `save`.
|
|
1047
|
+
*
|
|
1048
|
+
* Order is load-bearing: this hook fires AFTER all USDC handles
|
|
1049
|
+
* are merged into one and BEFORE the NAVI deposit consumes it.
|
|
1050
|
+
* Fee receiver gets recorded as a top-level transferObjects, so
|
|
1051
|
+
* it's automatically picked up by `derivedAllowedAddresses`.
|
|
1052
|
+
*/
|
|
1053
|
+
saveFeeHook?: HarvestSaveFeeHook;
|
|
995
1054
|
}
|
|
996
1055
|
/**
|
|
997
1056
|
* Standalone harvest builder — creates a fresh PTB, sets the sender,
|
|
@@ -1242,4 +1301,4 @@ declare function fullHandle(label: string): string;
|
|
|
1242
1301
|
*/
|
|
1243
1302
|
declare function displayHandle(label: string): string;
|
|
1244
1303
|
|
|
1245
|
-
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, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey, selectAndSplitCoin, selectSuiCoin, validateLabel, walletExists };
|
|
1304
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -5634,6 +5634,14 @@ async function maxBorrowAmount(client, address) {
|
|
|
5634
5634
|
const maxAmount = Math.max(0, hf.supplied * ltv / MIN_HEALTH_FACTOR - hf.borrowed);
|
|
5635
5635
|
return { maxAmount, healthFactorAfter: MIN_HEALTH_FACTOR, currentHF: hf.healthFactor };
|
|
5636
5636
|
}
|
|
5637
|
+
async function getPendingRewardsByAddress(address, suiRpcUrl) {
|
|
5638
|
+
const { SuiJsonRpcClient: SuiJsonRpcClient2, getJsonRpcFullnodeUrl: getJsonRpcFullnodeUrl2 } = await import('@mysten/sui/jsonRpc');
|
|
5639
|
+
const client = new SuiJsonRpcClient2({
|
|
5640
|
+
url: suiRpcUrl ?? getJsonRpcFullnodeUrl2("mainnet"),
|
|
5641
|
+
network: "mainnet"
|
|
5642
|
+
});
|
|
5643
|
+
return getPendingRewards(client, address);
|
|
5644
|
+
}
|
|
5637
5645
|
async function getPendingRewards(client, address) {
|
|
5638
5646
|
let rewards;
|
|
5639
5647
|
try {
|
|
@@ -7558,7 +7566,8 @@ async function addHarvestToTx(tx, client, address, options = {}) {
|
|
|
7558
7566
|
amount: aggRow.amount,
|
|
7559
7567
|
slippage,
|
|
7560
7568
|
inputCoin: coin,
|
|
7561
|
-
providers: options.providers
|
|
7569
|
+
providers: options.providers,
|
|
7570
|
+
overlayFee: options.overlayFee
|
|
7562
7571
|
});
|
|
7563
7572
|
usdcHandles.push(swapResult.coin);
|
|
7564
7573
|
expectedUsdcDeposited += swapResult.expectedAmountOut;
|
|
@@ -7592,6 +7601,14 @@ async function addHarvestToTx(tx, client, address, options = {}) {
|
|
|
7592
7601
|
tx.mergeCoins(primary, rest);
|
|
7593
7602
|
depositCoin = primary;
|
|
7594
7603
|
}
|
|
7604
|
+
if (options.saveFeeHook) {
|
|
7605
|
+
await options.saveFeeHook({
|
|
7606
|
+
tx,
|
|
7607
|
+
coin: depositCoin,
|
|
7608
|
+
input: { asset: "USDC", amount: expectedUsdcDeposited },
|
|
7609
|
+
sender: address
|
|
7610
|
+
});
|
|
7611
|
+
}
|
|
7595
7612
|
try {
|
|
7596
7613
|
await addSaveToTx(tx, client, address, depositCoin, { asset: "USDC" });
|
|
7597
7614
|
} catch (err) {
|
|
@@ -7829,7 +7846,9 @@ var WRITE_APPENDER_REGISTRY = {
|
|
|
7829
7846
|
const plan = await addHarvestToTx(tx, ctx.client, ctx.sender, {
|
|
7830
7847
|
slippage: input.slippage,
|
|
7831
7848
|
minRewardUsd: input.minRewardUsd,
|
|
7832
|
-
providers
|
|
7849
|
+
providers,
|
|
7850
|
+
overlayFee: ctx.overlayFee,
|
|
7851
|
+
saveFeeHook: ctx.feeHooks?.save_deposit
|
|
7833
7852
|
});
|
|
7834
7853
|
return {
|
|
7835
7854
|
preview: {
|
|
@@ -8256,6 +8275,6 @@ function displayHandle(label) {
|
|
|
8256
8275
|
(*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
8257
8276
|
*/
|
|
8258
8277
|
|
|
8259
|
-
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, displayHandle, exportPrivateKey, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getCoinMeta, getDecimals, getDecimalsForCoinType, getFinancialSummary, getPendingRewards, getRates, getSwapQuote, getTier, getVoloStats, isAllowedAsset, isInRegistry, isSupported, isTier1, isTier2, keypairFromPrivateKey, loadKey, mapMoveAbortCode, mapWalletError, mistToSui, naviDescriptor, normalizeAsset, normalizeCoinType, parseSuiRpcTx, queryHistory, queryTransaction, rawToStable, rawToUsdc, refineLendingLabel, resolveSymbol, resolveTokenType, saveKey, selectAndSplitCoin, selectSuiCoin, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, walletExists };
|
|
8278
|
+
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, 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, isInRegistry, isSupported, isTier1, isTier2, keypairFromPrivateKey, loadKey, mapMoveAbortCode, mapWalletError, mistToSui, naviDescriptor, normalizeAsset, normalizeCoinType, parseSuiRpcTx, queryHistory, queryTransaction, rawToStable, rawToUsdc, refineLendingLabel, resolveSymbol, resolveTokenType, saveKey, selectAndSplitCoin, selectSuiCoin, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, walletExists };
|
|
8260
8279
|
//# sourceMappingURL=index.js.map
|
|
8261
8280
|
//# sourceMappingURL=index.js.map
|