@exponent-labs/exponent-sdk 0.9.2 → 0.9.3
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/build/addressLookupTableUtil.d.ts +13 -13
- package/build/addressLookupTableUtil.js +5 -5
- package/build/addressLookupTableUtil.js.map +1 -1
- package/build/client/clmm/accounts/lpPosition.js +5 -6
- package/build/client/clmm/accounts/lpPosition.js.map +1 -1
- package/build/client/clmm/accounts/marketThree.js +5 -6
- package/build/client/clmm/accounts/marketThree.js.map +1 -1
- package/build/client/clmm/accounts/vault.js +5 -6
- package/build/client/clmm/accounts/vault.js.map +1 -1
- package/build/client/clmm/index.d.ts +1 -2
- package/build/client/clmm/instructions/addFarm.js +1 -2
- package/build/client/clmm/instructions/addFarm.js.map +1 -1
- package/build/client/clmm/instructions/addLiquidity.js +1 -2
- package/build/client/clmm/instructions/addLiquidity.js.map +1 -1
- package/build/client/clmm/instructions/addMarketEmission.js +1 -2
- package/build/client/clmm/instructions/addMarketEmission.js.map +1 -1
- package/build/client/clmm/instructions/buyPt.js +1 -2
- package/build/client/clmm/instructions/buyPt.js.map +1 -1
- package/build/client/clmm/instructions/buyYt.js +1 -2
- package/build/client/clmm/instructions/buyYt.js.map +1 -1
- package/build/client/clmm/instructions/claimFarmEmission.js +1 -2
- package/build/client/clmm/instructions/claimFarmEmission.js.map +1 -1
- package/build/client/clmm/instructions/closeMarket.js +1 -2
- package/build/client/clmm/instructions/closeMarket.js.map +1 -1
- package/build/client/clmm/instructions/depositLiquidity.js +1 -2
- package/build/client/clmm/instructions/depositLiquidity.js.map +1 -1
- package/build/client/clmm/instructions/initializeMarket.js +1 -2
- package/build/client/clmm/instructions/initializeMarket.js.map +1 -1
- package/build/client/clmm/instructions/marketAccrueEmission.js +1 -2
- package/build/client/clmm/instructions/marketAccrueEmission.js.map +1 -1
- package/build/client/clmm/instructions/marketCollectEmission.js +1 -2
- package/build/client/clmm/instructions/marketCollectEmission.js.map +1 -1
- package/build/client/clmm/instructions/modifyFarm.js +1 -2
- package/build/client/clmm/instructions/modifyFarm.js.map +1 -1
- package/build/client/clmm/instructions/modifyMarketSetting.js +1 -2
- package/build/client/clmm/instructions/modifyMarketSetting.js.map +1 -1
- package/build/client/clmm/instructions/sellPt.js +1 -2
- package/build/client/clmm/instructions/sellPt.js.map +1 -1
- package/build/client/clmm/instructions/sellYt.js +1 -2
- package/build/client/clmm/instructions/sellYt.js.map +1 -1
- package/build/client/clmm/instructions/tradePt.js +1 -2
- package/build/client/clmm/instructions/tradePt.js.map +1 -1
- package/build/client/clmm/instructions/tradePtExactOut.js +1 -2
- package/build/client/clmm/instructions/tradePtExactOut.js.map +1 -1
- package/build/client/clmm/instructions/withdrawLiquidity.js +1 -2
- package/build/client/clmm/instructions/withdrawLiquidity.js.map +1 -1
- package/build/client/clmm/instructions/wrapperBuyYt.js +1 -2
- package/build/client/clmm/instructions/wrapperBuyYt.js.map +1 -1
- package/build/client/clmm/instructions/wrapperProvideLiquidity.js +1 -2
- package/build/client/clmm/instructions/wrapperProvideLiquidity.js.map +1 -1
- package/build/client/clmm/instructions/wrapperProvideLiquidityBase.js +1 -2
- package/build/client/clmm/instructions/wrapperProvideLiquidityBase.js.map +1 -1
- package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.js +1 -2
- package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.js.map +1 -1
- package/build/client/clmm/instructions/wrapperSellYt.js +1 -2
- package/build/client/clmm/instructions/wrapperSellYt.js.map +1 -1
- package/build/client/clmm/instructions/wrapperWithdrawLiquidity.js +1 -2
- package/build/client/clmm/instructions/wrapperWithdrawLiquidity.js.map +1 -1
- package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.js +1 -2
- package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.js.map +1 -1
- package/build/client/clmm/types/addFarmEvent.d.ts +1 -25
- package/build/client/clmm/types/amount.d.ts +1 -19
- package/build/client/clmm/types/amount.js +3 -3
- package/build/client/clmm/types/amount.js.map +1 -1
- package/build/client/clmm/types/buyPtEvent.d.ts +1 -16
- package/build/client/clmm/types/buyYtEvent.d.ts +1 -40
- package/build/client/clmm/types/claimFarmEmissionsEvent.d.ts +1 -149
- package/build/client/clmm/types/claimLimits.d.ts +1 -16
- package/build/client/clmm/types/closeMarketEvent.d.ts +1 -16
- package/build/client/clmm/types/configurationOptions.d.ts +1 -25
- package/build/client/clmm/types/cpiAccounts.d.ts +1 -99
- package/build/client/clmm/types/cpiCoreAccounts.d.ts +1 -42
- package/build/client/clmm/types/cpiInterfaceContext.d.ts +1 -13
- package/build/client/clmm/types/crossingSplit.d.ts +1 -109
- package/build/client/clmm/types/depositLiquidityEvent.d.ts +1 -149
- package/build/client/clmm/types/depositLiquidityReturnData.d.ts +1 -49
- package/build/client/clmm/types/emissionInfo.d.ts +1 -25
- package/build/client/clmm/types/farmEmission.d.ts +1 -16
- package/build/client/clmm/types/liquidityNetBalanceLimits.d.ts +1 -19
- package/build/client/clmm/types/lpFarm.d.ts +1 -30
- package/build/client/clmm/types/marketAccrueEmissionEvent.d.ts +1 -134
- package/build/client/clmm/types/marketAdminAction.d.ts +1 -306
- package/build/client/clmm/types/marketAdminAction.js +3 -3
- package/build/client/clmm/types/marketAdminAction.js.map +1 -1
- package/build/client/clmm/types/marketCollectEmissionEvent.d.ts +1 -143
- package/build/client/clmm/types/marketEmission.d.ts +1 -13
- package/build/client/clmm/types/marketEmissions.d.ts +1 -23
- package/build/client/clmm/types/marketFinancials.d.ts +1 -19
- package/build/client/clmm/types/marketThreeInitEvent.d.ts +1 -52
- package/build/client/clmm/types/mergeEvent.d.ts +1 -61
- package/build/client/clmm/types/modifiedTick.d.ts +1 -13
- package/build/client/clmm/types/modifiedTicks.d.ts +1 -35
- package/build/client/clmm/types/modifyFarmEvent.d.ts +1 -31
- package/build/client/clmm/types/number.d.ts +1 -1
- package/build/client/clmm/types/personalYieldTracker.d.ts +1 -10
- package/build/client/clmm/types/personalYieldTrackers.d.ts +1 -19
- package/build/client/clmm/types/principalShare.d.ts +1 -42
- package/build/client/clmm/types/principalShareTrackers.d.ts +1 -59
- package/build/client/clmm/types/sellPtEvent.d.ts +1 -16
- package/build/client/clmm/types/sellYtEvent.d.ts +1 -34
- package/build/client/clmm/types/stripEvent.d.ts +1 -61
- package/build/client/clmm/types/swapDirection.d.ts +1 -1
- package/build/client/clmm/types/tradePtEvent.d.ts +1 -90
- package/build/client/clmm/types/withdrawLiquidityEvent.d.ts +1 -158
- package/build/client/clmm/types/withdrawLiquidityReturnData.d.ts +1 -34
- package/build/client/clmm/types/wrapperBuyYtEvent.d.ts +1 -16
- package/build/client/clmm/types/wrapperProvideLiquidityBaseEvent.d.ts +1 -40
- package/build/client/clmm/types/wrapperProvideLiquidityClassicEvent.d.ts +1 -37
- package/build/client/clmm/types/wrapperProvideLiquidityEvent.d.ts +1 -40
- package/build/client/clmm/types/wrapperSellYtEvent.d.ts +1 -16
- package/build/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.d.ts +1 -43
- package/build/client/clmm/types/wrapperWithdrawLiquidityEvent.d.ts +1 -43
- package/build/client/core/accounts/admin.js +5 -6
- package/build/client/core/accounts/admin.js.map +1 -1
- package/build/client/core/accounts/lpPosition.js +5 -6
- package/build/client/core/accounts/lpPosition.js.map +1 -1
- package/build/client/core/accounts/marketTwo.js +5 -6
- package/build/client/core/accounts/marketTwo.js.map +1 -1
- package/build/client/core/accounts/vault.js +5 -6
- package/build/client/core/accounts/vault.js.map +1 -1
- package/build/client/core/accounts/yieldTokenPosition.js +5 -6
- package/build/client/core/accounts/yieldTokenPosition.js.map +1 -1
- package/build/client/core/index.d.ts +1 -2
- package/build/client/core/instructions/addEmission.js +1 -2
- package/build/client/core/instructions/addEmission.js.map +1 -1
- package/build/client/core/instructions/addFarm.js +1 -2
- package/build/client/core/instructions/addFarm.js.map +1 -1
- package/build/client/core/instructions/addLpTokensMetadata.js +1 -2
- package/build/client/core/instructions/addLpTokensMetadata.js.map +1 -1
- package/build/client/core/instructions/addMarketEmission.js +1 -2
- package/build/client/core/instructions/addMarketEmission.js.map +1 -1
- package/build/client/core/instructions/buyYt.js +1 -2
- package/build/client/core/instructions/buyYt.js.map +1 -1
- package/build/client/core/instructions/claimFarmEmissions.js +1 -2
- package/build/client/core/instructions/claimFarmEmissions.js.map +1 -1
- package/build/client/core/instructions/collectEmission.js +1 -2
- package/build/client/core/instructions/collectEmission.js.map +1 -1
- package/build/client/core/instructions/collectInterest.js +1 -2
- package/build/client/core/instructions/collectInterest.js.map +1 -1
- package/build/client/core/instructions/collectTreasuryEmission.js +1 -2
- package/build/client/core/instructions/collectTreasuryEmission.js.map +1 -1
- package/build/client/core/instructions/collectTreasuryInterest.js +1 -2
- package/build/client/core/instructions/collectTreasuryInterest.js.map +1 -1
- package/build/client/core/instructions/depositYt.js +1 -2
- package/build/client/core/instructions/depositYt.js.map +1 -1
- package/build/client/core/instructions/initLpPosition.js +1 -2
- package/build/client/core/instructions/initLpPosition.js.map +1 -1
- package/build/client/core/instructions/initMarketTwo.js +1 -2
- package/build/client/core/instructions/initMarketTwo.js.map +1 -1
- package/build/client/core/instructions/initializeVault.js +1 -2
- package/build/client/core/instructions/initializeVault.js.map +1 -1
- package/build/client/core/instructions/initializeYieldPosition.js +1 -2
- package/build/client/core/instructions/initializeYieldPosition.js.map +1 -1
- package/build/client/core/instructions/marketCollectEmission.js +1 -2
- package/build/client/core/instructions/marketCollectEmission.js.map +1 -1
- package/build/client/core/instructions/marketDepositLp.js +1 -2
- package/build/client/core/instructions/marketDepositLp.js.map +1 -1
- package/build/client/core/instructions/marketTwoDepositLiquidity.js +1 -2
- package/build/client/core/instructions/marketTwoDepositLiquidity.js.map +1 -1
- package/build/client/core/instructions/marketTwoWithdrawLiquidity.js +1 -2
- package/build/client/core/instructions/marketTwoWithdrawLiquidity.js.map +1 -1
- package/build/client/core/instructions/marketWithdrawLp.js +1 -2
- package/build/client/core/instructions/marketWithdrawLp.js.map +1 -1
- package/build/client/core/instructions/merge.js +1 -2
- package/build/client/core/instructions/merge.js.map +1 -1
- package/build/client/core/instructions/modifyFarm.js +1 -2
- package/build/client/core/instructions/modifyFarm.js.map +1 -1
- package/build/client/core/instructions/modifyMarketSetting.js +1 -2
- package/build/client/core/instructions/modifyMarketSetting.js.map +1 -1
- package/build/client/core/instructions/modifyVaultSetting.js +1 -2
- package/build/client/core/instructions/modifyVaultSetting.js.map +1 -1
- package/build/client/core/instructions/reallocMarket.js +1 -2
- package/build/client/core/instructions/reallocMarket.js.map +1 -1
- package/build/client/core/instructions/sellYt.js +1 -2
- package/build/client/core/instructions/sellYt.js.map +1 -1
- package/build/client/core/instructions/stageYtYield.js +1 -2
- package/build/client/core/instructions/stageYtYield.js.map +1 -1
- package/build/client/core/instructions/strip.js +1 -2
- package/build/client/core/instructions/strip.js.map +1 -1
- package/build/client/core/instructions/tradePt.js +1 -2
- package/build/client/core/instructions/tradePt.js.map +1 -1
- package/build/client/core/instructions/withdrawYt.js +1 -2
- package/build/client/core/instructions/withdrawYt.js.map +1 -1
- package/build/client/core/instructions/wrapperBuyPt.js +1 -2
- package/build/client/core/instructions/wrapperBuyPt.js.map +1 -1
- package/build/client/core/instructions/wrapperBuyYt.js +1 -2
- package/build/client/core/instructions/wrapperBuyYt.js.map +1 -1
- package/build/client/core/instructions/wrapperCollectInterest.js +1 -2
- package/build/client/core/instructions/wrapperCollectInterest.js.map +1 -1
- package/build/client/core/instructions/wrapperMerge.js +1 -2
- package/build/client/core/instructions/wrapperMerge.js.map +1 -1
- package/build/client/core/instructions/wrapperProvideLiquidity.js +1 -2
- package/build/client/core/instructions/wrapperProvideLiquidity.js.map +1 -1
- package/build/client/core/instructions/wrapperProvideLiquidityBase.js +1 -2
- package/build/client/core/instructions/wrapperProvideLiquidityBase.js.map +1 -1
- package/build/client/core/instructions/wrapperProvideLiquidityClassic.js +1 -2
- package/build/client/core/instructions/wrapperProvideLiquidityClassic.js.map +1 -1
- package/build/client/core/instructions/wrapperSellPt.js +1 -2
- package/build/client/core/instructions/wrapperSellPt.js.map +1 -1
- package/build/client/core/instructions/wrapperSellYt.js +1 -2
- package/build/client/core/instructions/wrapperSellYt.js.map +1 -1
- package/build/client/core/instructions/wrapperStrip.js +1 -2
- package/build/client/core/instructions/wrapperStrip.js.map +1 -1
- package/build/client/core/instructions/wrapperWithdrawLiquidity.js +1 -2
- package/build/client/core/instructions/wrapperWithdrawLiquidity.js.map +1 -1
- package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.js +1 -2
- package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.js.map +1 -1
- package/build/client/core/types/adminAction.d.ts +1 -269
- package/build/client/core/types/adminAction.js +3 -3
- package/build/client/core/types/adminAction.js.map +1 -1
- package/build/client/core/types/amount.d.ts +1 -19
- package/build/client/core/types/amount.js +3 -3
- package/build/client/core/types/amount.js.map +1 -1
- package/build/client/core/types/buyPtEvent.d.ts +1 -19
- package/build/client/core/types/buyYtEvent.d.ts +1 -49
- package/build/client/core/types/claimFarmEmissionsEvent.d.ts +1 -31
- package/build/client/core/types/claimFarmEmissionsEventV2.d.ts +1 -83
- package/build/client/core/types/claimLimits.d.ts +1 -16
- package/build/client/core/types/collectEmissionEvent.d.ts +1 -25
- package/build/client/core/types/collectEmissionEventV2.d.ts +1 -55
- package/build/client/core/types/collectInterestEvent.d.ts +1 -22
- package/build/client/core/types/collectInterestEventV2.d.ts +1 -52
- package/build/client/core/types/collectTreasuryEmissionKind.d.ts +1 -1
- package/build/client/core/types/collectTreasuryInterestKind.d.ts +1 -1
- package/build/client/core/types/cpiAccounts.d.ts +1 -99
- package/build/client/core/types/cpiInterfaceContext.d.ts +1 -13
- package/build/client/core/types/depositLiquidityEvent.d.ts +1 -49
- package/build/client/core/types/depositLpEvent.d.ts +1 -31
- package/build/client/core/types/depositLpEventV2.d.ts +1 -83
- package/build/client/core/types/depositYtEvent.d.ts +1 -40
- package/build/client/core/types/depositYtEventV2.d.ts +1 -70
- package/build/client/core/types/emissionInfo.d.ts +1 -25
- package/build/client/core/types/farmEmission.d.ts +1 -16
- package/build/client/core/types/initLpPositionEvent.d.ts +1 -25
- package/build/client/core/types/initializeYieldPositionEvent.d.ts +1 -16
- package/build/client/core/types/liquidityNetBalanceLimits.d.ts +1 -19
- package/build/client/core/types/lpFarm.d.ts +1 -30
- package/build/client/core/types/marketAdminAction.d.ts +1 -239
- package/build/client/core/types/marketAdminAction.js +3 -3
- package/build/client/core/types/marketAdminAction.js.map +1 -1
- package/build/client/core/types/marketCollectEmissionEvent.d.ts +1 -28
- package/build/client/core/types/marketCollectEmissionEventV2.d.ts +1 -80
- package/build/client/core/types/marketEmission.d.ts +1 -13
- package/build/client/core/types/marketEmissions.d.ts +1 -23
- package/build/client/core/types/marketFinancials.d.ts +1 -22
- package/build/client/core/types/mergeEvent.d.ts +1 -61
- package/build/client/core/types/number.d.ts +1 -1
- package/build/client/core/types/personalYieldTracker.d.ts +1 -10
- package/build/client/core/types/personalYieldTrackers.d.ts +1 -19
- package/build/client/core/types/principleDetails.d.ts +1 -7
- package/build/client/core/types/principles.d.ts +1 -70
- package/build/client/core/types/sellPtEvent.d.ts +1 -19
- package/build/client/core/types/sellYtEvent.d.ts +1 -43
- package/build/client/core/types/stageYieldEvent.d.ts +1 -31
- package/build/client/core/types/stageYieldEventV2.d.ts +1 -58
- package/build/client/core/types/stripEvent.d.ts +1 -61
- package/build/client/core/types/tradePtEvent.d.ts +1 -37
- package/build/client/core/types/withdrawLiquidityEvent.d.ts +1 -43
- package/build/client/core/types/withdrawLpEvent.d.ts +1 -31
- package/build/client/core/types/withdrawLpEventV2.d.ts +1 -83
- package/build/client/core/types/withdrawYtEvent.d.ts +1 -40
- package/build/client/core/types/withdrawYtEventV2.d.ts +1 -70
- package/build/client/core/types/wrapperBuyYtEvent.d.ts +1 -19
- package/build/client/core/types/wrapperCollectInterestEvent.d.ts +1 -16
- package/build/client/core/types/wrapperMergeEvent.d.ts +1 -19
- package/build/client/core/types/wrapperProvideLiquidityBaseEvent.d.ts +1 -25
- package/build/client/core/types/wrapperProvideLiquidityClassicEvent.d.ts +1 -22
- package/build/client/core/types/wrapperProvideLiquidityEvent.d.ts +1 -22
- package/build/client/core/types/wrapperSellYtEvent.d.ts +1 -19
- package/build/client/core/types/wrapperStripEvent.d.ts +1 -19
- package/build/client/core/types/wrapperWithdrawLiquidityClassicEvent.d.ts +1 -22
- package/build/client/core/types/wrapperWithdrawLiquidityEvent.d.ts +1 -19
- package/build/client/core/types/yieldTokenTracker.d.ts +1 -10
- package/build/client/orderbook/accounts/cpiAccountsOrderbook.js +5 -6
- package/build/client/orderbook/accounts/cpiAccountsOrderbook.js.map +1 -1
- package/build/client/orderbook/accounts/vault.js +5 -6
- package/build/client/orderbook/accounts/vault.js.map +1 -1
- package/build/client/orderbook/index.d.ts +1 -2
- package/build/client/orderbook/instructions/collectAdminEmission.js +1 -2
- package/build/client/orderbook/instructions/collectAdminEmission.js.map +1 -1
- package/build/client/orderbook/instructions/collectAdminFee.js +1 -2
- package/build/client/orderbook/instructions/collectAdminFee.js.map +1 -1
- package/build/client/orderbook/instructions/collectInterest.js +1 -2
- package/build/client/orderbook/instructions/collectInterest.js.map +1 -1
- package/build/client/orderbook/instructions/initializeOrderbook.js +1 -2
- package/build/client/orderbook/instructions/initializeOrderbook.js.map +1 -1
- package/build/client/orderbook/instructions/marketOffer.js +1 -2
- package/build/client/orderbook/instructions/marketOffer.js.map +1 -1
- package/build/client/orderbook/instructions/postOffer.js +1 -2
- package/build/client/orderbook/instructions/postOffer.js.map +1 -1
- package/build/client/orderbook/instructions/reallocOrderbookAccount.js +1 -2
- package/build/client/orderbook/instructions/reallocOrderbookAccount.js.map +1 -1
- package/build/client/orderbook/instructions/removeExpiredOffers.js +1 -2
- package/build/client/orderbook/instructions/removeExpiredOffers.js.map +1 -1
- package/build/client/orderbook/instructions/removeOffer.js +1 -2
- package/build/client/orderbook/instructions/removeOffer.js.map +1 -1
- package/build/client/orderbook/instructions/setConfigurationOptions.js +1 -2
- package/build/client/orderbook/instructions/setConfigurationOptions.js.map +1 -1
- package/build/client/orderbook/instructions/withdrawFunds.js +1 -2
- package/build/client/orderbook/instructions/withdrawFunds.js.map +1 -1
- package/build/client/orderbook/instructions/wrapperCollectAdminFee.js +1 -2
- package/build/client/orderbook/instructions/wrapperCollectAdminFee.js.map +1 -1
- package/build/client/orderbook/instructions/wrapperCollectInterest.js +1 -2
- package/build/client/orderbook/instructions/wrapperCollectInterest.js.map +1 -1
- package/build/client/orderbook/instructions/wrapperMarketOffer.js +1 -2
- package/build/client/orderbook/instructions/wrapperMarketOffer.js.map +1 -1
- package/build/client/orderbook/instructions/wrapperPostOffer.js +1 -2
- package/build/client/orderbook/instructions/wrapperPostOffer.js.map +1 -1
- package/build/client/orderbook/instructions/wrapperRemoveOffer.js +1 -2
- package/build/client/orderbook/instructions/wrapperRemoveOffer.js.map +1 -1
- package/build/client/orderbook/instructions/wrapperWithdrawFunds.js +1 -2
- package/build/client/orderbook/instructions/wrapperWithdrawFunds.js.map +1 -1
- package/build/client/orderbook/types/amount.d.ts +1 -19
- package/build/client/orderbook/types/amount.js +3 -3
- package/build/client/orderbook/types/amount.js.map +1 -1
- package/build/client/orderbook/types/claimLimits.d.ts +1 -16
- package/build/client/orderbook/types/collectAdminEmissionEvent.d.ts +1 -19
- package/build/client/orderbook/types/collectAdminFeeEvent.d.ts +1 -19
- package/build/client/orderbook/types/collectEmissionEventV2.d.ts +1 -55
- package/build/client/orderbook/types/collectInterestEventV2.d.ts +1 -52
- package/build/client/orderbook/types/collectUserInterestEvent.d.ts +1 -16
- package/build/client/orderbook/types/cpiAccounts.d.ts +1 -99
- package/build/client/orderbook/types/cpiInterfaceContext.d.ts +1 -13
- package/build/client/orderbook/types/emissionInfo.d.ts +1 -25
- package/build/client/orderbook/types/exponentCoreCpiAccounts.d.ts +1 -99
- package/build/client/orderbook/types/filledOffersEvent.d.ts +1 -22
- package/build/client/orderbook/types/marketOfferEvent.d.ts +1 -74
- package/build/client/orderbook/types/mergeEvent.d.ts +1 -61
- package/build/client/orderbook/types/number.d.ts +1 -1
- package/build/client/orderbook/types/offerOptions.d.ts +1 -13
- package/build/client/orderbook/types/offerOptions.js +3 -3
- package/build/client/orderbook/types/offerOptions.js.map +1 -1
- package/build/client/orderbook/types/offerType.d.ts +1 -1
- package/build/client/orderbook/types/orderbookInitEvent.d.ts +1 -28
- package/build/client/orderbook/types/postOfferEvent.d.ts +1 -96
- package/build/client/orderbook/types/removeOfferEvent.d.ts +1 -28
- package/build/client/orderbook/types/setConfigurationOptionsEnum.d.ts +1 -49
- package/build/client/orderbook/types/setConfigurationOptionsEnum.js +3 -3
- package/build/client/orderbook/types/setConfigurationOptionsEnum.js.map +1 -1
- package/build/client/orderbook/types/stripEvent.d.ts +1 -61
- package/build/client/orderbook/types/withdrawFundsEvent.d.ts +1 -28
- package/build/client/orderbook/types/wrapperCollectAdminFeeEvent.d.ts +1 -13
- package/build/client/orderbook/types/wrapperCollectInterestEvent.d.ts +1 -10
- package/build/client/orderbook/types/wrapperMarketOfferEvent.d.ts +1 -13
- package/build/client/orderbook/types/wrapperPostOfferEvent.d.ts +1 -28
- package/build/client/orderbook/types/wrapperRemoveOfferEvent.d.ts +1 -10
- package/build/client/orderbook/types/wrapperWithdrawFundsEvent.d.ts +1 -19
- package/build/client/orderbook/types/yieldTokenTracker.d.ts +1 -10
- package/build/client/vaults/accounts/actionProposal.js +5 -6
- package/build/client/vaults/accounts/actionProposal.js.map +1 -1
- package/build/client/vaults/accounts/exponentStrategyVault.js +5 -6
- package/build/client/vaults/accounts/exponentStrategyVault.js.map +1 -1
- package/build/client/vaults/accounts/programConfig.js +5 -6
- package/build/client/vaults/accounts/programConfig.js.map +1 -1
- package/build/client/vaults/accounts/voteAccount.js +5 -6
- package/build/client/vaults/accounts/voteAccount.js.map +1 -1
- package/build/client/vaults/accounts/withdrawalAccount.js +5 -6
- package/build/client/vaults/accounts/withdrawalAccount.js.map +1 -1
- package/build/client/vaults/eventRegistry.d.ts +8 -2
- package/build/client/vaults/eventRegistry.js +6 -0
- package/build/client/vaults/eventRegistry.js.map +1 -1
- package/build/client/vaults/index.d.ts +4 -2
- package/build/client/vaults/index.js +3 -0
- package/build/client/vaults/index.js.map +1 -1
- package/build/client/vaults/instructions/activateProposal.d.ts +2 -0
- package/build/client/vaults/instructions/activateProposal.js +3 -2
- package/build/client/vaults/instructions/activateProposal.js.map +1 -1
- package/build/client/vaults/instructions/addPolicy.js +1 -2
- package/build/client/vaults/instructions/addPolicy.js.map +1 -1
- package/build/client/vaults/instructions/appendProposalActions.js +1 -2
- package/build/client/vaults/instructions/appendProposalActions.js.map +1 -1
- package/build/client/vaults/instructions/cancelProposal.d.ts +2 -0
- package/build/client/vaults/instructions/cancelProposal.js +3 -2
- package/build/client/vaults/instructions/cancelProposal.js.map +1 -1
- package/build/client/vaults/instructions/cancelWithdrawal.d.ts +2 -0
- package/build/client/vaults/instructions/cancelWithdrawal.js +3 -2
- package/build/client/vaults/instructions/cancelWithdrawal.js.map +1 -1
- package/build/client/vaults/instructions/collectManagementFee.js +1 -2
- package/build/client/vaults/instructions/collectManagementFee.js.map +1 -1
- package/build/client/vaults/instructions/depositLiquidity.js +1 -2
- package/build/client/vaults/instructions/depositLiquidity.js.map +1 -1
- package/build/client/vaults/instructions/executeProposal.d.ts +2 -0
- package/build/client/vaults/instructions/executeProposal.js +3 -2
- package/build/client/vaults/instructions/executeProposal.js.map +1 -1
- package/build/client/vaults/instructions/executeWithdrawal.js +1 -2
- package/build/client/vaults/instructions/executeWithdrawal.js.map +1 -1
- package/build/client/vaults/instructions/executeWithdrawalFromReserves.d.ts +2 -0
- package/build/client/vaults/instructions/executeWithdrawalFromReserves.js +3 -2
- package/build/client/vaults/instructions/executeWithdrawalFromReserves.js.map +1 -1
- package/build/client/vaults/instructions/fillWithdrawal.js +1 -2
- package/build/client/vaults/instructions/fillWithdrawal.js.map +1 -1
- package/build/client/vaults/instructions/finalizeProposal.d.ts +2 -0
- package/build/client/vaults/instructions/finalizeProposal.js +3 -2
- package/build/client/vaults/instructions/finalizeProposal.js.map +1 -1
- package/build/client/vaults/instructions/initProposal.js +1 -2
- package/build/client/vaults/instructions/initProposal.js.map +1 -1
- package/build/client/vaults/instructions/initializePrices.js +1 -2
- package/build/client/vaults/instructions/initializePrices.js.map +1 -1
- package/build/client/vaults/instructions/initializeVault.js +1 -2
- package/build/client/vaults/instructions/initializeVault.js.map +1 -1
- package/build/client/vaults/instructions/makeSentienelManager.js +1 -2
- package/build/client/vaults/instructions/makeSentienelManager.js.map +1 -1
- package/build/client/vaults/instructions/managePrices.js +1 -2
- package/build/client/vaults/instructions/managePrices.js.map +1 -1
- package/build/client/vaults/instructions/manageVaultSettings.js +1 -2
- package/build/client/vaults/instructions/manageVaultSettings.js.map +1 -1
- package/build/client/vaults/instructions/managerUpdatePosition.js +1 -2
- package/build/client/vaults/instructions/managerUpdatePosition.js.map +1 -1
- package/build/client/vaults/instructions/queueWithdrawal.d.ts +2 -0
- package/build/client/vaults/instructions/queueWithdrawal.js +3 -2
- package/build/client/vaults/instructions/queueWithdrawal.js.map +1 -1
- package/build/client/vaults/instructions/removePolicy.js +1 -2
- package/build/client/vaults/instructions/removePolicy.js.map +1 -1
- package/build/client/vaults/instructions/sentinelSetVaultFlags.d.ts +2 -0
- package/build/client/vaults/instructions/sentinelSetVaultFlags.js +3 -2
- package/build/client/vaults/instructions/sentinelSetVaultFlags.js.map +1 -1
- package/build/client/vaults/instructions/stakeVote.d.ts +2 -0
- package/build/client/vaults/instructions/stakeVote.js +3 -2
- package/build/client/vaults/instructions/stakeVote.js.map +1 -1
- package/build/client/vaults/instructions/unstakeVote.js +1 -2
- package/build/client/vaults/instructions/unstakeVote.js.map +1 -1
- package/build/client/vaults/instructions/updatePolicy.js +1 -2
- package/build/client/vaults/instructions/updatePolicy.js.map +1 -1
- package/build/client/vaults/instructions/updatePolicyManager.js +1 -2
- package/build/client/vaults/instructions/updatePolicyManager.js.map +1 -1
- package/build/client/vaults/instructions/updatePrice.js +1 -2
- package/build/client/vaults/instructions/updatePrice.js.map +1 -1
- package/build/client/vaults/instructions/validateInteractionHook.js +1 -2
- package/build/client/vaults/instructions/validateInteractionHook.js.map +1 -1
- package/build/client/vaults/instructions/wrapperAddPolicy.js +1 -2
- package/build/client/vaults/instructions/wrapperAddPolicy.js.map +1 -1
- package/build/client/vaults/instructions/wrapperExecuteWithdrawal.js +1 -2
- package/build/client/vaults/instructions/wrapperExecuteWithdrawal.js.map +1 -1
- package/build/client/vaults/instructions/wrapperManageVaultSettings.js +1 -2
- package/build/client/vaults/instructions/wrapperManageVaultSettings.js.map +1 -1
- package/build/client/vaults/instructions/wrapperManagerUpdatePosition.js +1 -2
- package/build/client/vaults/instructions/wrapperManagerUpdatePosition.js.map +1 -1
- package/build/client/vaults/instructions/wrapperRemovePolicy.js +1 -2
- package/build/client/vaults/instructions/wrapperRemovePolicy.js.map +1 -1
- package/build/client/vaults/instructions/wrapperUpdatePolicy.js +1 -2
- package/build/client/vaults/instructions/wrapperUpdatePolicy.js.map +1 -1
- package/build/client/vaults/types/accountConstraint.d.ts +1 -13
- package/build/client/vaults/types/accountConstraintType.d.ts +1 -1
- package/build/client/vaults/types/accountConstraintType.js +3 -3
- package/build/client/vaults/types/accountConstraintType.js.map +1 -1
- package/build/client/vaults/types/allowedSettingsChange.d.ts +1 -54
- package/build/client/vaults/types/allowedSettingsChange.js +3 -3
- package/build/client/vaults/types/allowedSettingsChange.js.map +1 -1
- package/build/client/vaults/types/cancelProposalEvent.d.ts +1 -19
- package/build/client/vaults/types/cancelWithdrawalEvent.d.ts +12 -0
- package/build/client/vaults/types/cancelWithdrawalEvent.js +29 -0
- package/build/client/vaults/types/cancelWithdrawalEvent.js.map +1 -0
- package/build/client/vaults/types/clmmPositionEntry.d.ts +1 -80
- package/build/client/vaults/types/dataConstraint.d.ts +1 -109
- package/build/client/vaults/types/dataOperator.d.ts +1 -1
- package/build/client/vaults/types/dataValue.d.ts +1 -73
- package/build/client/vaults/types/dataValue.js +3 -3
- package/build/client/vaults/types/dataValue.js.map +1 -1
- package/build/client/vaults/types/depositLiquidityEvent.d.ts +1 -40
- package/build/client/vaults/types/executeProposalEvent.d.ts +1 -19
- package/build/client/vaults/types/executeWithdrawalEvent.d.ts +8 -10
- package/build/client/vaults/types/executeWithdrawalEvent.js +19 -0
- package/build/client/vaults/types/executeWithdrawalEvent.js.map +1 -1
- package/build/client/vaults/types/executeWithdrawalFromReservesEvent.d.ts +19 -0
- package/build/client/vaults/types/executeWithdrawalFromReservesEvent.js +48 -0
- package/build/client/vaults/types/executeWithdrawalFromReservesEvent.js.map +1 -0
- package/build/client/vaults/types/fillParam.d.ts +1 -10
- package/build/client/vaults/types/finalizeProposalEvent.d.ts +1 -34
- package/build/client/vaults/types/hook.d.ts +1 -35
- package/build/client/vaults/types/hookCompiledInstruction.d.ts +1 -13
- package/build/client/vaults/types/index.d.ts +3 -0
- package/build/client/vaults/types/index.js +3 -0
- package/build/client/vaults/types/index.js.map +1 -1
- package/build/client/vaults/types/instructionConstraint.d.ts +1 -165
- package/build/client/vaults/types/internalFundTransferPolicyCreationPayload.d.ts +1 -13
- package/build/client/vaults/types/kaminoFarmEntry.d.ts +1 -10
- package/build/client/vaults/types/kaminoObligationEntry.d.ts +1 -122
- package/build/client/vaults/types/limitedQuantityConstraints.d.ts +1 -7
- package/build/client/vaults/types/limitedSpendingLimit.d.ts +1 -97
- package/build/client/vaults/types/limitedTimeConstraints.d.ts +1 -61
- package/build/client/vaults/types/loopscaleLoanEntry.d.ts +1 -7
- package/build/client/vaults/types/loopscaleStrategyEntry.d.ts +1 -7
- package/build/client/vaults/types/number.d.ts +1 -1
- package/build/client/vaults/types/obligationType.d.ts +1 -1
- package/build/client/vaults/types/obligationType.js +3 -3
- package/build/client/vaults/types/obligationType.js.map +1 -1
- package/build/client/vaults/types/orderbookEntry.d.ts +1 -54
- package/build/client/vaults/types/periodV2.d.ts +1 -37
- package/build/client/vaults/types/periodV2.js +3 -3
- package/build/client/vaults/types/periodV2.js.map +1 -1
- package/build/client/vaults/types/permissions.d.ts +1 -7
- package/build/client/vaults/types/policyAction.d.ts +1 -40
- package/build/client/vaults/types/policyAction.js +3 -3
- package/build/client/vaults/types/policyAction.js.map +1 -1
- package/build/client/vaults/types/policyCreationPayload.d.ts +1 -260
- package/build/client/vaults/types/policyCreationPayload.js +3 -3
- package/build/client/vaults/types/policyCreationPayload.js.map +1 -1
- package/build/client/vaults/types/policyExpirationArgs.d.ts +1 -19
- package/build/client/vaults/types/policyExpirationArgs.js +3 -3
- package/build/client/vaults/types/policyExpirationArgs.js.map +1 -1
- package/build/client/vaults/types/positionUpdate.js +3 -3
- package/build/client/vaults/types/positionUpdate.js.map +1 -1
- package/build/client/vaults/types/priceId.d.ts +1 -25
- package/build/client/vaults/types/priceId.js +3 -3
- package/build/client/vaults/types/priceId.js.map +1 -1
- package/build/client/vaults/types/priceType.d.ts +1 -1
- package/build/client/vaults/types/proposalAction.d.ts +2 -204
- package/build/client/vaults/types/proposalAction.js +6 -3
- package/build/client/vaults/types/proposalAction.js.map +1 -1
- package/build/client/vaults/types/proposalActionKind.d.ts +1 -1
- package/build/client/vaults/types/proposalStatus.d.ts +1 -1
- package/build/client/vaults/types/proposalVoteConfig.d.ts +1 -34
- package/build/client/vaults/types/proposeActionEvent.d.ts +1 -34
- package/build/client/vaults/types/quantityConstraints.d.ts +1 -13
- package/build/client/vaults/types/queueWithdrawalEvent.d.ts +11 -0
- package/build/client/vaults/types/queueWithdrawalEvent.js +31 -0
- package/build/client/vaults/types/queueWithdrawalEvent.js.map +1 -0
- package/build/client/vaults/types/reserveFarmMapping.d.ts +1 -13
- package/build/client/vaults/types/reservePriceMapping.d.ts +1 -42
- package/build/client/vaults/types/settingsChangePolicyCreationPayload.d.ts +1 -77
- package/build/client/vaults/types/spendingLimitPolicyCreationPayload.d.ts +1 -130
- package/build/client/vaults/types/stakeVoteEvent.d.ts +1 -28
- package/build/client/vaults/types/strategyPosition.d.ts +1 -1
- package/build/client/vaults/types/strategyPosition.js +3 -3
- package/build/client/vaults/types/strategyPosition.js.map +1 -1
- package/build/client/vaults/types/timeConstraints.d.ts +1 -64
- package/build/client/vaults/types/tokenAccountBalance.d.ts +1 -45
- package/build/client/vaults/types/tokenAccountEntry.d.ts +1 -66
- package/build/client/vaults/types/tokenEntry.d.ts +1 -51
- package/build/client/vaults/types/unstakeVoteEvent.d.ts +1 -25
- package/build/client/vaults/types/updatePriceAction.d.ts +1 -124
- package/build/client/vaults/types/updatePriceAction.js +3 -3
- package/build/client/vaults/types/updatePriceAction.js.map +1 -1
- package/build/client/vaults/types/updatePriceInput.d.ts +1 -10
- package/build/client/vaults/types/usageState.d.ts +1 -10
- package/build/client/vaults/types/vaultConfig.d.ts +1 -74
- package/build/client/vaults/types/vaultFinancials.d.ts +1 -43
- package/build/client/vaults/types/vaultFlagAction.d.ts +1 -37
- package/build/client/vaults/types/vaultFlagAction.js +3 -3
- package/build/client/vaults/types/vaultFlagAction.js.map +1 -1
- package/build/client/vaults/types/vaultFlagsUpdatedEvent.d.ts +1 -16
- package/build/client/vaults/types/vaultRoleKind.d.ts +1 -1
- package/build/client/vaults/types/vaultRoles.d.ts +1 -16
- package/build/client/vaults/types/vaultSettingsAction.js +3 -3
- package/build/client/vaults/types/vaultSettingsAction.js.map +1 -1
- package/build/client/vaults/types/voteChoice.d.ts +1 -1
- package/build/client/vaults/types/withdrawalPeriodSettings.d.ts +1 -31
- package/build/client/vaults/types/withdrawalPeriodSettings.js +3 -3
- package/build/client/vaults/types/withdrawalPeriodSettings.js.map +1 -1
- package/build/client/vaults/types/withdrawalTokenFill.d.ts +1 -13
- package/build/client/vaults/types/yieldPositionEntry.d.ts +1 -45
- package/build/clmm/codamaEvents.d.ts +1 -2
- package/build/codamaEvents.d.ts +1 -2
- package/build/exponentVaults/aumCalculator.d.ts +0 -2
- package/build/exponentVaults/aumCalculator.js +20 -10
- package/build/exponentVaults/aumCalculator.js.map +1 -1
- package/build/exponentVaults/events.d.ts +1 -2
- package/build/exponentVaults/fetcher.js +4 -4
- package/build/exponentVaults/fetcher.js.map +1 -1
- package/build/exponentVaults/index.js +17 -7
- package/build/exponentVaults/index.js.map +1 -1
- package/build/exponentVaults/kamino-farms.d.ts +0 -2
- package/build/exponentVaults/kamino-farms.js +14 -14
- package/build/exponentVaults/kamino-farms.js.map +1 -1
- package/build/exponentVaults/kamino-markets.d.ts +394 -394
- package/build/exponentVaults/kamino-markets.js +2 -2
- package/build/exponentVaults/kamino-markets.js.map +1 -1
- package/build/exponentVaults/loopscale/helpers.js +6 -7
- package/build/exponentVaults/loopscale/helpers.js.map +1 -1
- package/build/exponentVaults/loopscale/prepared-transactions.js +1 -2
- package/build/exponentVaults/loopscale/prepared-transactions.js.map +1 -1
- package/build/exponentVaults/policyBuilders.d.ts +73 -75
- package/build/exponentVaults/policyBuilders.js +26 -27
- package/build/exponentVaults/policyBuilders.js.map +1 -1
- package/build/exponentVaults/policyMatcher.js +6 -7
- package/build/exponentVaults/policyMatcher.js.map +1 -1
- package/build/exponentVaults/pricePathResolver.js +7 -8
- package/build/exponentVaults/pricePathResolver.js.map +1 -1
- package/build/exponentVaults/scope-refresh.js +1 -2
- package/build/exponentVaults/scope-refresh.js.map +1 -1
- package/build/exponentVaults/squadsVaultTxnResolver/helpers.js +6 -7
- package/build/exponentVaults/squadsVaultTxnResolver/helpers.js.map +1 -1
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.js +5 -6
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.js.map +1 -1
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.js +1 -2
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.js.map +1 -1
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.js +1 -2
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.js.map +1 -1
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.js +1 -2
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.js.map +1 -1
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.js +1 -2
- package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.js.map +1 -1
- package/build/exponentVaults/squadsVaultTxnResolver/utils.d.ts +1 -3
- package/build/exponentVaults/squadsVaultTxnResolver/utils.js +1 -2
- package/build/exponentVaults/squadsVaultTxnResolver/utils.js.map +1 -1
- package/build/exponentVaults/syncTransaction.d.ts +1 -1
- package/build/exponentVaults/syncTransaction.js +4 -4
- package/build/exponentVaults/syncTransaction.js.map +1 -1
- package/build/exponentVaults/titan-quote.js +1 -2
- package/build/exponentVaults/titan-quote.js.map +1 -1
- package/build/exponentVaults/vault-interaction.d.ts +3 -2538
- package/build/exponentVaults/vault-interaction.js +34 -24
- package/build/exponentVaults/vault-interaction.js.map +1 -1
- package/build/exponentVaults/vault.d.ts +9 -25
- package/build/exponentVaults/vault.js +28 -12
- package/build/exponentVaults/vault.js.map +1 -1
- package/build/flavors.js +19 -20
- package/build/flavors.js.map +1 -1
- package/build/index.js +17 -7
- package/build/index.js.map +1 -1
- package/build/market.d.ts +31 -31
- package/build/market.js +17 -7
- package/build/market.js.map +1 -1
- package/build/marketThree.d.ts +42 -48
- package/build/marketThree.js +20 -8
- package/build/marketThree.js.map +1 -1
- package/build/orderbook/codamaEvents.d.ts +1 -2
- package/build/orderbook/index.js +17 -7
- package/build/orderbook/index.js.map +1 -1
- package/build/orderbook/math.d.ts +4 -4
- package/build/orderbook/math.js +13 -13
- package/build/orderbook/math.js.map +1 -1
- package/build/orderbook/orderbook.d.ts +19 -21
- package/build/orderbook/orderbook.js +17 -7
- package/build/orderbook/orderbook.js.map +1 -1
- package/build/orderbook/types.js +17 -7
- package/build/orderbook/types.js.map +1 -1
- package/build/orderbook/utils.js +6 -7
- package/build/orderbook/utils.js.map +1 -1
- package/build/syPosition.js +3 -4
- package/build/syPosition.js.map +1 -1
- package/build/tokenUtil.js +2 -3
- package/build/tokenUtil.js.map +1 -1
- package/build/utils/altUtil.js +2 -3
- package/build/utils/altUtil.js.map +1 -1
- package/build/utils/binSolver.js +1 -2
- package/build/utils/binSolver.js.map +1 -1
- package/build/utils/index.d.ts +2 -2
- package/build/utils/index.js +3 -4
- package/build/utils/index.js.map +1 -1
- package/build/vault.d.ts +11 -12
- package/build/vault.js +20 -10
- package/build/vault.js.map +1 -1
- package/build/ytPosition.d.ts +7 -7
- package/build/ytPosition.js +17 -7
- package/build/ytPosition.js.map +1 -1
- package/package.json +35 -33
- package/build/client/vaults/instructions/proposeAction.d.ts +0 -16
- package/build/client/vaults/instructions/proposeAction.js +0 -29
- package/build/client/vaults/instructions/proposeAction.js.map +0 -1
- package/build/exponentVaults/loopscale/client.test.d.ts +0 -1
- package/build/exponentVaults/loopscale/client.test.js +0 -183
- package/build/exponentVaults/loopscale/client.test.js.map +0 -1
- package/build/exponentVaults/loopscale/prepared-transactions.test.d.ts +0 -1
- package/build/exponentVaults/loopscale/prepared-transactions.test.js +0 -400
- package/build/exponentVaults/loopscale/prepared-transactions.test.js.map +0 -1
- package/build/exponentVaults/loopscale/response-plan.d.ts +0 -69
- package/build/exponentVaults/loopscale/response-plan.js +0 -141
- package/build/exponentVaults/loopscale/response-plan.js.map +0 -1
- package/build/exponentVaults/loopscale/response-plan.test.d.ts +0 -1
- package/build/exponentVaults/loopscale/response-plan.test.js +0 -139
- package/build/exponentVaults/loopscale/response-plan.test.js.map +0 -1
- package/build/exponentVaults/loopscale/send-plan.d.ts +0 -75
- package/build/exponentVaults/loopscale/send-plan.js +0 -235
- package/build/exponentVaults/loopscale/send-plan.js.map +0 -1
- package/build/exponentVaults/loopscale-client.d.ts +0 -130
- package/build/exponentVaults/loopscale-client.js +0 -489
- package/build/exponentVaults/loopscale-client.js.map +0 -1
- package/build/exponentVaults/loopscale-client.test.d.ts +0 -1
- package/build/exponentVaults/loopscale-client.test.js +0 -162
- package/build/exponentVaults/loopscale-client.test.js.map +0 -1
- package/build/exponentVaults/loopscale-client.types.d.ts +0 -425
- package/build/exponentVaults/loopscale-client.types.js +0 -3
- package/build/exponentVaults/loopscale-client.types.js.map +0 -1
- package/build/exponentVaults/loopscale-execution.d.ts +0 -125
- package/build/exponentVaults/loopscale-execution.js +0 -341
- package/build/exponentVaults/loopscale-execution.js.map +0 -1
- package/build/exponentVaults/loopscale-execution.test.d.ts +0 -1
- package/build/exponentVaults/loopscale-execution.test.js +0 -139
- package/build/exponentVaults/loopscale-execution.test.js.map +0 -1
- package/build/exponentVaults/loopscale-vault.d.ts +0 -115
- package/build/exponentVaults/loopscale-vault.js +0 -275
- package/build/exponentVaults/loopscale-vault.js.map +0 -1
- package/build/exponentVaults/loopscale-vault.test.d.ts +0 -1
- package/build/exponentVaults/loopscale-vault.test.js +0 -102
- package/build/exponentVaults/loopscale-vault.test.js.map +0 -1
- package/build/exponentVaults/pricePathResolver.test.d.ts +0 -1
- package/build/exponentVaults/pricePathResolver.test.js +0 -369
- package/build/exponentVaults/pricePathResolver.test.js.map +0 -1
- package/build/exponentVaults/vault-interaction.kamino-vault.test.d.ts +0 -1
- package/build/exponentVaults/vault-interaction.kamino-vault.test.js +0 -143
- package/build/exponentVaults/vault-interaction.kamino-vault.test.js.map +0 -1
- package/build/exponentVaults/vaultTransactionBuilder.test.d.ts +0 -1
- package/build/exponentVaults/vaultTransactionBuilder.test.js +0 -297
- package/build/exponentVaults/vaultTransactionBuilder.test.js.map +0 -1
- package/build/marketThree.test.d.ts +0 -1
- package/build/marketThree.test.js +0 -166
- package/build/marketThree.test.js.map +0 -1
- package/build/utils/binSolver.test.d.ts +0 -1
- package/build/utils/binSolver.test.js +0 -16
- package/build/utils/binSolver.test.js.map +0 -1
- package/jest.config.js +0 -5
- package/src/CodamaEventDecoder.ts +0 -151
- package/src/addressLookupTableUtil.ts +0 -110
- package/src/client/clmm/accounts/lpPosition.ts +0 -143
- package/src/client/clmm/accounts/marketThree.ts +0 -274
- package/src/client/clmm/accounts/vault.ts +0 -234
- package/src/client/clmm/eventRegistry.ts +0 -92
- package/src/client/clmm/index.ts +0 -82
- package/src/client/clmm/instructions/addFarm.ts +0 -57
- package/src/client/clmm/instructions/addLiquidity.ts +0 -78
- package/src/client/clmm/instructions/addMarketEmission.ts +0 -50
- package/src/client/clmm/instructions/buyPt.ts +0 -73
- package/src/client/clmm/instructions/buyYt.ts +0 -80
- package/src/client/clmm/instructions/claimFarmEmission.ts +0 -56
- package/src/client/clmm/instructions/closeMarket.ts +0 -47
- package/src/client/clmm/instructions/depositLiquidity.ts +0 -71
- package/src/client/clmm/instructions/initializeMarket.ts +0 -127
- package/src/client/clmm/instructions/marketAccrueEmission.ts +0 -39
- package/src/client/clmm/instructions/marketCollectEmission.ts +0 -57
- package/src/client/clmm/instructions/modifyFarm.ts +0 -55
- package/src/client/clmm/instructions/modifyMarketSetting.ts +0 -45
- package/src/client/clmm/instructions/sellPt.ts +0 -73
- package/src/client/clmm/instructions/sellYt.ts +0 -80
- package/src/client/clmm/instructions/tradePt.ts +0 -73
- package/src/client/clmm/instructions/tradePtExactOut.ts +0 -75
- package/src/client/clmm/instructions/withdrawLiquidity.ts +0 -67
- package/src/client/clmm/instructions/wrapperBuyYt.ts +0 -85
- package/src/client/clmm/instructions/wrapperProvideLiquidity.ts +0 -100
- package/src/client/clmm/instructions/wrapperProvideLiquidityBase.ts +0 -98
- package/src/client/clmm/instructions/wrapperProvideLiquidityClassic.ts +0 -86
- package/src/client/clmm/instructions/wrapperSellYt.ts +0 -83
- package/src/client/clmm/instructions/wrapperWithdrawLiquidity.ts +0 -75
- package/src/client/clmm/instructions/wrapperWithdrawLiquidityClassic.ts +0 -69
- package/src/client/clmm/types/addFarmEvent.ts +0 -51
- package/src/client/clmm/types/amount.ts +0 -51
- package/src/client/clmm/types/buyPtEvent.ts +0 -36
- package/src/client/clmm/types/buyYtEvent.ts +0 -74
- package/src/client/clmm/types/claimFarmEmissionsEvent.ts +0 -94
- package/src/client/clmm/types/claimLimits.ts +0 -15
- package/src/client/clmm/types/closeMarketEvent.ts +0 -36
- package/src/client/clmm/types/configurationOptions.ts +0 -29
- package/src/client/clmm/types/cpiAccounts.ts +0 -21
- package/src/client/clmm/types/cpiCoreAccounts.ts +0 -15
- package/src/client/clmm/types/cpiInterfaceContext.ts +0 -13
- package/src/client/clmm/types/crossingSplit.ts +0 -40
- package/src/client/clmm/types/depositLiquidityEvent.ts +0 -93
- package/src/client/clmm/types/depositLiquidityReturnData.ts +0 -81
- package/src/client/clmm/types/emissionInfo.ts +0 -44
- package/src/client/clmm/types/farmEmission.ts +0 -31
- package/src/client/clmm/types/index.ts +0 -48
- package/src/client/clmm/types/liquidityNetBalanceLimits.ts +0 -22
- package/src/client/clmm/types/lpFarm.ts +0 -12
- package/src/client/clmm/types/marketAccrueEmissionEvent.ts +0 -69
- package/src/client/clmm/types/marketAdminAction.ts +0 -239
- package/src/client/clmm/types/marketCollectEmissionEvent.ts +0 -83
- package/src/client/clmm/types/marketEmission.ts +0 -28
- package/src/client/clmm/types/marketEmissions.ts +0 -10
- package/src/client/clmm/types/marketFinancials.ts +0 -17
- package/src/client/clmm/types/marketThreeInitEvent.ts +0 -92
- package/src/client/clmm/types/mergeEvent.ts +0 -118
- package/src/client/clmm/types/modifiedTick.ts +0 -13
- package/src/client/clmm/types/modifiedTicks.ts +0 -18
- package/src/client/clmm/types/modifyFarmEvent.ts +0 -56
- package/src/client/clmm/types/number.ts +0 -7
- package/src/client/clmm/types/personalYieldTracker.ts +0 -12
- package/src/client/clmm/types/personalYieldTrackers.ts +0 -13
- package/src/client/clmm/types/principalShare.ts +0 -22
- package/src/client/clmm/types/principalShareTrackers.ts +0 -10
- package/src/client/clmm/types/sellPtEvent.ts +0 -36
- package/src/client/clmm/types/sellYtEvent.ts +0 -69
- package/src/client/clmm/types/stripEvent.ts +0 -124
- package/src/client/clmm/types/swapDirection.ts +0 -8
- package/src/client/clmm/types/tradePtEvent.ts +0 -76
- package/src/client/clmm/types/withdrawLiquidityEvent.ts +0 -99
- package/src/client/clmm/types/withdrawLiquidityReturnData.ts +0 -27
- package/src/client/clmm/types/wrapperBuyYtEvent.ts +0 -36
- package/src/client/clmm/types/wrapperProvideLiquidityBaseEvent.ts +0 -60
- package/src/client/clmm/types/wrapperProvideLiquidityClassicEvent.ts +0 -58
- package/src/client/clmm/types/wrapperProvideLiquidityEvent.ts +0 -60
- package/src/client/clmm/types/wrapperSellYtEvent.ts +0 -36
- package/src/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.ts +0 -62
- package/src/client/clmm/types/wrapperWithdrawLiquidityEvent.ts +0 -62
- package/src/client/core/accounts/admin.ts +0 -112
- package/src/client/core/accounts/lpPosition.ts +0 -122
- package/src/client/core/accounts/marketTwo.ts +0 -234
- package/src/client/core/accounts/vault.ts +0 -234
- package/src/client/core/accounts/yieldTokenPosition.ts +0 -126
- package/src/client/core/eventRegistry.ts +0 -134
- package/src/client/core/index.ts +0 -113
- package/src/client/core/instructions/addEmission.ts +0 -62
- package/src/client/core/instructions/addFarm.ts +0 -53
- package/src/client/core/instructions/addLpTokensMetadata.ts +0 -62
- package/src/client/core/instructions/addMarketEmission.ts +0 -52
- package/src/client/core/instructions/buyYt.ts +0 -79
- package/src/client/core/instructions/claimFarmEmissions.ts +0 -54
- package/src/client/core/instructions/collectEmission.ts +0 -66
- package/src/client/core/instructions/collectInterest.ts +0 -64
- package/src/client/core/instructions/collectTreasuryEmission.ts +0 -64
- package/src/client/core/instructions/collectTreasuryInterest.ts +0 -62
- package/src/client/core/instructions/depositYt.ts +0 -59
- package/src/client/core/instructions/initLpPosition.ts +0 -35
- package/src/client/core/instructions/initMarketTwo.ts +0 -103
- package/src/client/core/instructions/initializeVault.ts +0 -107
- package/src/client/core/instructions/initializeYieldPosition.ts +0 -33
- package/src/client/core/instructions/marketCollectEmission.ts +0 -55
- package/src/client/core/instructions/marketDepositLp.ts +0 -59
- package/src/client/core/instructions/marketTwoDepositLiquidity.ts +0 -65
- package/src/client/core/instructions/marketTwoWithdrawLiquidity.ts +0 -65
- package/src/client/core/instructions/marketWithdrawLp.ts +0 -59
- package/src/client/core/instructions/merge.ts +0 -61
- package/src/client/core/instructions/modifyFarm.ts +0 -51
- package/src/client/core/instructions/modifyMarketSetting.ts +0 -47
- package/src/client/core/instructions/modifyVaultSetting.ts +0 -44
- package/src/client/core/instructions/reallocMarket.ts +0 -45
- package/src/client/core/instructions/sellYt.ts +0 -79
- package/src/client/core/instructions/stageYtYield.ts +0 -39
- package/src/client/core/instructions/strip.ts +0 -61
- package/src/client/core/instructions/tradePt.ts +0 -59
- package/src/client/core/instructions/withdrawYt.ts +0 -61
- package/src/client/core/instructions/wrapperBuyPt.ts +0 -63
- package/src/client/core/instructions/wrapperBuyYt.ts +0 -93
- package/src/client/core/instructions/wrapperCollectInterest.ts +0 -63
- package/src/client/core/instructions/wrapperMerge.ts +0 -77
- package/src/client/core/instructions/wrapperProvideLiquidity.ts +0 -103
- package/src/client/core/instructions/wrapperProvideLiquidityBase.ts +0 -81
- package/src/client/core/instructions/wrapperProvideLiquidityClassic.ts +0 -77
- package/src/client/core/instructions/wrapperSellPt.ts +0 -63
- package/src/client/core/instructions/wrapperSellYt.ts +0 -87
- package/src/client/core/instructions/wrapperStrip.ts +0 -81
- package/src/client/core/instructions/wrapperWithdrawLiquidity.ts +0 -77
- package/src/client/core/instructions/wrapperWithdrawLiquidityClassic.ts +0 -73
- package/src/client/core/types/adminAction.ts +0 -255
- package/src/client/core/types/amount.ts +0 -51
- package/src/client/core/types/buyPtEvent.ts +0 -39
- package/src/client/core/types/buyYtEvent.ts +0 -95
- package/src/client/core/types/claimFarmEmissionsEvent.ts +0 -75
- package/src/client/core/types/claimFarmEmissionsEventV2.ts +0 -83
- package/src/client/core/types/claimLimits.ts +0 -15
- package/src/client/core/types/collectEmissionEvent.ts +0 -51
- package/src/client/core/types/collectEmissionEventV2.ts +0 -60
- package/src/client/core/types/collectInterestEvent.ts +0 -48
- package/src/client/core/types/collectInterestEventV2.ts +0 -57
- package/src/client/core/types/collectTreasuryEmissionKind.ts +0 -8
- package/src/client/core/types/collectTreasuryInterestKind.ts +0 -8
- package/src/client/core/types/cpiAccounts.ts +0 -21
- package/src/client/core/types/cpiInterfaceContext.ts +0 -13
- package/src/client/core/types/depositLiquidityEvent.ts +0 -101
- package/src/client/core/types/depositLpEvent.ts +0 -75
- package/src/client/core/types/depositLpEventV2.ts +0 -83
- package/src/client/core/types/depositYtEvent.ts +0 -82
- package/src/client/core/types/depositYtEventV2.ts +0 -91
- package/src/client/core/types/emissionInfo.ts +0 -44
- package/src/client/core/types/farmEmission.ts +0 -31
- package/src/client/core/types/index.ts +0 -60
- package/src/client/core/types/initLpPositionEvent.ts +0 -57
- package/src/client/core/types/initializeYieldPositionEvent.ts +0 -43
- package/src/client/core/types/liquidityNetBalanceLimits.ts +0 -22
- package/src/client/core/types/lpFarm.ts +0 -12
- package/src/client/core/types/marketAdminAction.ts +0 -212
- package/src/client/core/types/marketCollectEmissionEvent.ts +0 -67
- package/src/client/core/types/marketCollectEmissionEventV2.ts +0 -75
- package/src/client/core/types/marketEmission.ts +0 -28
- package/src/client/core/types/marketEmissions.ts +0 -10
- package/src/client/core/types/marketFinancials.ts +0 -19
- package/src/client/core/types/mergeEvent.ts +0 -118
- package/src/client/core/types/number.ts +0 -7
- package/src/client/core/types/personalYieldTracker.ts +0 -12
- package/src/client/core/types/personalYieldTrackers.ts +0 -13
- package/src/client/core/types/principleDetails.ts +0 -25
- package/src/client/core/types/principles.ts +0 -23
- package/src/client/core/types/sellPtEvent.ts +0 -39
- package/src/client/core/types/sellYtEvent.ts +0 -90
- package/src/client/core/types/stageYieldEvent.ts +0 -63
- package/src/client/core/types/stageYieldEventV2.ts +0 -69
- package/src/client/core/types/stripEvent.ts +0 -124
- package/src/client/core/types/tradePtEvent.ts +0 -80
- package/src/client/core/types/withdrawLiquidityEvent.ts +0 -97
- package/src/client/core/types/withdrawLpEvent.ts +0 -75
- package/src/client/core/types/withdrawLpEventV2.ts +0 -83
- package/src/client/core/types/withdrawYtEvent.ts +0 -82
- package/src/client/core/types/withdrawYtEventV2.ts +0 -91
- package/src/client/core/types/wrapperBuyYtEvent.ts +0 -39
- package/src/client/core/types/wrapperCollectInterestEvent.ts +0 -37
- package/src/client/core/types/wrapperMergeEvent.ts +0 -38
- package/src/client/core/types/wrapperProvideLiquidityBaseEvent.ts +0 -43
- package/src/client/core/types/wrapperProvideLiquidityClassicEvent.ts +0 -41
- package/src/client/core/types/wrapperProvideLiquidityEvent.ts +0 -41
- package/src/client/core/types/wrapperSellYtEvent.ts +0 -39
- package/src/client/core/types/wrapperStripEvent.ts +0 -38
- package/src/client/core/types/wrapperWithdrawLiquidityClassicEvent.ts +0 -41
- package/src/client/core/types/wrapperWithdrawLiquidityEvent.ts +0 -39
- package/src/client/core/types/yieldTokenTracker.ts +0 -12
- package/src/client/orderbook/accounts/cpiAccountsOrderbook.ts +0 -101
- package/src/client/orderbook/accounts/vault.ts +0 -234
- package/src/client/orderbook/eventRegistry.ts +0 -71
- package/src/client/orderbook/index.ts +0 -55
- package/src/client/orderbook/instructions/collectAdminEmission.ts +0 -48
- package/src/client/orderbook/instructions/collectAdminFee.ts +0 -59
- package/src/client/orderbook/instructions/collectInterest.ts +0 -66
- package/src/client/orderbook/instructions/initializeOrderbook.ts +0 -104
- package/src/client/orderbook/instructions/marketOffer.ts +0 -89
- package/src/client/orderbook/instructions/postOffer.ts +0 -96
- package/src/client/orderbook/instructions/reallocOrderbookAccount.ts +0 -45
- package/src/client/orderbook/instructions/removeExpiredOffers.ts +0 -37
- package/src/client/orderbook/instructions/removeOffer.ts +0 -73
- package/src/client/orderbook/instructions/setConfigurationOptions.ts +0 -43
- package/src/client/orderbook/instructions/withdrawFunds.ts +0 -78
- package/src/client/orderbook/instructions/wrapperCollectAdminFee.ts +0 -73
- package/src/client/orderbook/instructions/wrapperCollectInterest.ts +0 -65
- package/src/client/orderbook/instructions/wrapperMarketOffer.ts +0 -94
- package/src/client/orderbook/instructions/wrapperPostOffer.ts +0 -99
- package/src/client/orderbook/instructions/wrapperRemoveOffer.ts +0 -75
- package/src/client/orderbook/instructions/wrapperWithdrawFunds.ts +0 -80
- package/src/client/orderbook/types/amount.ts +0 -51
- package/src/client/orderbook/types/claimLimits.ts +0 -15
- package/src/client/orderbook/types/collectAdminEmissionEvent.ts +0 -39
- package/src/client/orderbook/types/collectAdminFeeEvent.ts +0 -17
- package/src/client/orderbook/types/collectEmissionEventV2.ts +0 -60
- package/src/client/orderbook/types/collectInterestEventV2.ts +0 -57
- package/src/client/orderbook/types/collectUserInterestEvent.ts +0 -36
- package/src/client/orderbook/types/cpiAccounts.ts +0 -21
- package/src/client/orderbook/types/cpiInterfaceContext.ts +0 -13
- package/src/client/orderbook/types/emissionInfo.ts +0 -44
- package/src/client/orderbook/types/exponentCoreCpiAccounts.ts +0 -21
- package/src/client/orderbook/types/filledOffersEvent.ts +0 -19
- package/src/client/orderbook/types/index.ts +0 -30
- package/src/client/orderbook/types/marketOfferEvent.ts +0 -72
- package/src/client/orderbook/types/mergeEvent.ts +0 -118
- package/src/client/orderbook/types/number.ts +0 -7
- package/src/client/orderbook/types/offerOptions.ts +0 -56
- package/src/client/orderbook/types/offerType.ts +0 -8
- package/src/client/orderbook/types/orderbookInitEvent.ts +0 -54
- package/src/client/orderbook/types/postOfferEvent.ts +0 -78
- package/src/client/orderbook/types/removeOfferEvent.ts +0 -67
- package/src/client/orderbook/types/setConfigurationOptionsEnum.ts +0 -116
- package/src/client/orderbook/types/stripEvent.ts +0 -124
- package/src/client/orderbook/types/withdrawFundsEvent.ts +0 -65
- package/src/client/orderbook/types/wrapperCollectAdminFeeEvent.ts +0 -13
- package/src/client/orderbook/types/wrapperCollectInterestEvent.ts +0 -25
- package/src/client/orderbook/types/wrapperMarketOfferEvent.ts +0 -27
- package/src/client/orderbook/types/wrapperPostOfferEvent.ts +0 -72
- package/src/client/orderbook/types/wrapperRemoveOfferEvent.ts +0 -25
- package/src/client/orderbook/types/wrapperWithdrawFundsEvent.ts +0 -38
- package/src/client/orderbook/types/yieldTokenTracker.ts +0 -12
- package/src/client/vaults/accounts/actionProposal.ts +0 -144
- package/src/client/vaults/accounts/exponentStrategyVault.ts +0 -211
- package/src/client/vaults/accounts/programConfig.ts +0 -123
- package/src/client/vaults/accounts/voteAccount.ts +0 -132
- package/src/client/vaults/accounts/withdrawalAccount.ts +0 -132
- package/src/client/vaults/eventRegistry.ts +0 -45
- package/src/client/vaults/index.ts +0 -113
- package/src/client/vaults/instructions/activateProposal.ts +0 -46
- package/src/client/vaults/instructions/addPolicy.ts +0 -57
- package/src/client/vaults/instructions/appendProposalActions.ts +0 -47
- package/src/client/vaults/instructions/cancelProposal.ts +0 -28
- package/src/client/vaults/instructions/cancelWithdrawal.ts +0 -34
- package/src/client/vaults/instructions/collectManagementFee.ts +0 -32
- package/src/client/vaults/instructions/depositLiquidity.ts +0 -62
- package/src/client/vaults/instructions/executeProposal.ts +0 -36
- package/src/client/vaults/instructions/executeWithdrawal.ts +0 -58
- package/src/client/vaults/instructions/executeWithdrawalFromReserves.ts +0 -66
- package/src/client/vaults/instructions/fillWithdrawal.ts +0 -59
- package/src/client/vaults/instructions/finalizeProposal.ts +0 -28
- package/src/client/vaults/instructions/initProposal.ts +0 -46
- package/src/client/vaults/instructions/initializePrices.ts +0 -28
- package/src/client/vaults/instructions/initializeVault.ts +0 -148
- package/src/client/vaults/instructions/makeSentienelManager.ts +0 -28
- package/src/client/vaults/instructions/managePrices.ts +0 -46
- package/src/client/vaults/instructions/manageVaultSettings.ts +0 -48
- package/src/client/vaults/instructions/managerUpdatePosition.ts +0 -45
- package/src/client/vaults/instructions/queueWithdrawal.ts +0 -50
- package/src/client/vaults/instructions/removePolicy.ts +0 -44
- package/src/client/vaults/instructions/sentinelSetVaultFlags.ts +0 -44
- package/src/client/vaults/instructions/stakeVote.ts +0 -57
- package/src/client/vaults/instructions/unstakeVote.ts +0 -42
- package/src/client/vaults/instructions/updatePolicy.ts +0 -59
- package/src/client/vaults/instructions/updatePolicyManager.ts +0 -44
- package/src/client/vaults/instructions/updatePrice.ts +0 -42
- package/src/client/vaults/instructions/validateInteractionHook.ts +0 -60
- package/src/client/vaults/instructions/wrapperAddPolicy.ts +0 -57
- package/src/client/vaults/instructions/wrapperExecuteWithdrawal.ts +0 -76
- package/src/client/vaults/instructions/wrapperManageVaultSettings.ts +0 -48
- package/src/client/vaults/instructions/wrapperManagerUpdatePosition.ts +0 -45
- package/src/client/vaults/instructions/wrapperRemovePolicy.ts +0 -44
- package/src/client/vaults/instructions/wrapperUpdatePolicy.ts +0 -59
- package/src/client/vaults/types/accountConstraint.ts +0 -35
- package/src/client/vaults/types/accountConstraintType.ts +0 -93
- package/src/client/vaults/types/allowedSettingsChange.ts +0 -136
- package/src/client/vaults/types/cancelProposalEvent.ts +0 -47
- package/src/client/vaults/types/clmmPositionEntry.ts +0 -37
- package/src/client/vaults/types/dataConstraint.ts +0 -16
- package/src/client/vaults/types/dataOperator.ts +0 -13
- package/src/client/vaults/types/dataValue.ts +0 -119
- package/src/client/vaults/types/depositLiquidityEvent.ts +0 -89
- package/src/client/vaults/types/executeProposalEvent.ts +0 -47
- package/src/client/vaults/types/executeWithdrawalEvent.ts +0 -12
- package/src/client/vaults/types/fillParam.ts +0 -12
- package/src/client/vaults/types/finalizeProposalEvent.ts +0 -51
- package/src/client/vaults/types/hook.ts +0 -40
- package/src/client/vaults/types/hookCompiledInstruction.ts +0 -20
- package/src/client/vaults/types/index.ts +0 -68
- package/src/client/vaults/types/instructionConstraint.ts +0 -33
- package/src/client/vaults/types/internalFundTransferPolicyCreationPayload.ts +0 -35
- package/src/client/vaults/types/kaminoFarmEntry.ts +0 -32
- package/src/client/vaults/types/kaminoObligationEntry.ts +0 -51
- package/src/client/vaults/types/limitedQuantityConstraints.ts +0 -10
- package/src/client/vaults/types/limitedSpendingLimit.ts +0 -35
- package/src/client/vaults/types/limitedTimeConstraints.ts +0 -15
- package/src/client/vaults/types/loopscaleLoanEntry.ts +0 -23
- package/src/client/vaults/types/loopscaleStrategyEntry.ts +0 -23
- package/src/client/vaults/types/number.ts +0 -8
- package/src/client/vaults/types/obligationType.ts +0 -63
- package/src/client/vaults/types/orderbookEntry.ts +0 -50
- package/src/client/vaults/types/periodV2.ts +0 -76
- package/src/client/vaults/types/permissions.ts +0 -8
- package/src/client/vaults/types/policyAction.ts +0 -74
- package/src/client/vaults/types/policyConfig.ts +0 -32
- package/src/client/vaults/types/policyCreationPayload.ts +0 -147
- package/src/client/vaults/types/policyExpirationArgs.ts +0 -67
- package/src/client/vaults/types/positionUpdate.ts +0 -313
- package/src/client/vaults/types/priceId.ts +0 -57
- package/src/client/vaults/types/priceType.ts +0 -23
- package/src/client/vaults/types/programInteractionPolicyCreationPayload.ts +0 -32
- package/src/client/vaults/types/proposalAction.ts +0 -97
- package/src/client/vaults/types/proposalActionKind.ts +0 -11
- package/src/client/vaults/types/proposalStatus.ts +0 -13
- package/src/client/vaults/types/proposalVoteConfig.ts +0 -36
- package/src/client/vaults/types/proposeActionEvent.ts +0 -62
- package/src/client/vaults/types/quantityConstraints.ts +0 -14
- package/src/client/vaults/types/reserveFarmMapping.ts +0 -35
- package/src/client/vaults/types/reservePriceMapping.ts +0 -26
- package/src/client/vaults/types/settingsChangePolicyCreationPayload.ts +0 -14
- package/src/client/vaults/types/spendingLimitPolicyCreationPayload.ts +0 -54
- package/src/client/vaults/types/stakeVoteEvent.ts +0 -54
- package/src/client/vaults/types/strategyPosition.ts +0 -178
- package/src/client/vaults/types/timeConstraints.ts +0 -22
- package/src/client/vaults/types/tokenAccountBalance.ts +0 -35
- package/src/client/vaults/types/tokenAccountEntry.ts +0 -30
- package/src/client/vaults/types/tokenEntry.ts +0 -48
- package/src/client/vaults/types/unstakeVoteEvent.ts +0 -53
- package/src/client/vaults/types/updatePriceAction.ts +0 -268
- package/src/client/vaults/types/updatePriceInput.ts +0 -12
- package/src/client/vaults/types/usageState.ts +0 -12
- package/src/client/vaults/types/vaultConfig.ts +0 -38
- package/src/client/vaults/types/vaultFinancials.ts +0 -40
- package/src/client/vaults/types/vaultFlagAction.ts +0 -75
- package/src/client/vaults/types/vaultFlagsUpdatedEvent.ts +0 -37
- package/src/client/vaults/types/vaultRoleKind.ts +0 -11
- package/src/client/vaults/types/vaultRoles.ts +0 -59
- package/src/client/vaults/types/vaultSettingsAction.ts +0 -533
- package/src/client/vaults/types/voteChoice.ts +0 -9
- package/src/client/vaults/types/withdrawalPeriodSettings.ts +0 -83
- package/src/client/vaults/types/withdrawalTokenFill.ts +0 -35
- package/src/client/vaults/types/yieldPositionEntry.ts +0 -35
- package/src/clmm/codamaEvents.ts +0 -34
- package/src/clmm/index.ts +0 -1
- package/src/codamaEvents.ts +0 -27
- package/src/environment.ts +0 -21
- package/src/exponentVaults/aumCalculator.ts +0 -1350
- package/src/exponentVaults/events.ts +0 -15
- package/src/exponentVaults/fetcher.ts +0 -257
- package/src/exponentVaults/index.ts +0 -323
- package/src/exponentVaults/kamino-farms.ts +0 -538
- package/src/exponentVaults/kamino-markets.ts +0 -363
- package/src/exponentVaults/loopscale/client.ts +0 -808
- package/src/exponentVaults/loopscale/helpers.ts +0 -172
- package/src/exponentVaults/loopscale/index.ts +0 -57
- package/src/exponentVaults/loopscale/prepared-transactions.ts +0 -435
- package/src/exponentVaults/loopscale/prepared-types.ts +0 -73
- package/src/exponentVaults/loopscale/types.ts +0 -466
- package/src/exponentVaults/policyBuilders.ts +0 -1729
- package/src/exponentVaults/policyMatcher.ts +0 -895
- package/src/exponentVaults/pricePathResolver.test.ts +0 -466
- package/src/exponentVaults/pricePathResolver.ts +0 -273
- package/src/exponentVaults/scope-refresh.ts +0 -169
- package/src/exponentVaults/squadsVaultTxnResolver/constants.ts +0 -59
- package/src/exponentVaults/squadsVaultTxnResolver/helpers.ts +0 -355
- package/src/exponentVaults/squadsVaultTxnResolver/index.ts +0 -16
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.ts +0 -472
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.ts +0 -33
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/index.ts +0 -38
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.ts +0 -83
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.ts +0 -94
- package/src/exponentVaults/squadsVaultTxnResolver/resolvers/titan.ts +0 -41
- package/src/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.ts +0 -91
- package/src/exponentVaults/squadsVaultTxnResolver/types.ts +0 -171
- package/src/exponentVaults/squadsVaultTxnResolver/utils.ts +0 -3
- package/src/exponentVaults/syncTransaction.ts +0 -500
- package/src/exponentVaults/titan-quote.ts +0 -446
- package/src/exponentVaults/vault-instruction-types.ts +0 -493
- package/src/exponentVaults/vault-interaction.kamino-vault.test.ts +0 -149
- package/src/exponentVaults/vault-interaction.ts +0 -5498
- package/src/exponentVaults/vault.ts +0 -2667
- package/src/exponentVaults/vaultTransactionBuilder.test.ts +0 -349
- package/src/exponentVaults/vaultTransactionBuilder.ts +0 -933
- package/src/flavors.ts +0 -841
- package/src/index.ts +0 -26
- package/src/lpPosition.ts +0 -155
- package/src/market.ts +0 -2432
- package/src/marketThree.test.ts +0 -210
- package/src/marketThree.ts +0 -2861
- package/src/orderbook/codamaEvents.ts +0 -28
- package/src/orderbook/index.ts +0 -13
- package/src/orderbook/math.ts +0 -138
- package/src/orderbook/orderbook.ts +0 -1354
- package/src/orderbook/types.ts +0 -40
- package/src/orderbook/utils.ts +0 -66
- package/src/router.ts +0 -810
- package/src/syPosition.ts +0 -182
- package/src/tokenUtil.ts +0 -23
- package/src/utils/altUtil.ts +0 -52
- package/src/utils/binSolver.test.ts +0 -17
- package/src/utils/binSolver.ts +0 -44
- package/src/utils/index.ts +0 -33
- package/src/utils/ix.ts +0 -7
- package/src/vault.ts +0 -1033
- package/src/ytPosition.ts +0 -319
- package/tsconfig.json +0 -46
|
@@ -1,933 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AddressLookupTableProgram,
|
|
3
|
-
Connection,
|
|
4
|
-
PublicKey,
|
|
5
|
-
TransactionInstruction,
|
|
6
|
-
TransactionMessage,
|
|
7
|
-
VersionedTransaction,
|
|
8
|
-
AddressLookupTableAccount,
|
|
9
|
-
ComputeBudgetProgram,
|
|
10
|
-
} from "@solana/web3.js"
|
|
11
|
-
import type * as web3 from "@solana/web3.js"
|
|
12
|
-
import type { ExponentPrices } from "@exponent-labs/exponent-vaults-fetcher"
|
|
13
|
-
import type { ExponentVault } from "./vault"
|
|
14
|
-
import { LoopscaleClient } from "./loopscale"
|
|
15
|
-
import type { LoopscaleTransactionResponse } from "./loopscale"
|
|
16
|
-
import {
|
|
17
|
-
buildSetupStatePriceRefreshInstructions,
|
|
18
|
-
createVaultSyncTransactions,
|
|
19
|
-
createStrategySetupContext,
|
|
20
|
-
type VaultInstruction,
|
|
21
|
-
} from "./vault-interaction"
|
|
22
|
-
import { SQUADS_PROGRAM_ID } from "./syncTransaction"
|
|
23
|
-
import { LOCAL_ENV } from "../environment"
|
|
24
|
-
|
|
25
|
-
const SCOPE_PROGRAM_ID = new PublicKey("HFn8GnPADiny6XqUoWE8uRPPxb29ikn4yTuPa9MF2fWJ")
|
|
26
|
-
|
|
27
|
-
// ============================================================================
|
|
28
|
-
// Types
|
|
29
|
-
// ============================================================================
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Per-step compute budget overrides.
|
|
33
|
-
*
|
|
34
|
-
* Each step in the builder can have its own compute settings. When not
|
|
35
|
-
* provided, the global defaults from {@link VaultTransactionBuilderConfig}
|
|
36
|
-
* are used instead.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```ts
|
|
40
|
-
* builder.addActions([clmmAction.buyPt(...)], {
|
|
41
|
-
* computeUnitLimit: 1_200_000,
|
|
42
|
-
* priorityFee: 500,
|
|
43
|
-
* })
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
export interface StepOptions {
|
|
47
|
-
/** Human-readable label for this step. Auto-generated if omitted. */
|
|
48
|
-
label?: string
|
|
49
|
-
/** Compute unit limit for this step's transaction. */
|
|
50
|
-
computeUnitLimit?: number
|
|
51
|
-
/** Heap frame allocation in bytes for this step's transaction. */
|
|
52
|
-
heapFrameBytes?: number
|
|
53
|
-
/** Priority fee in microLamports per compute unit. Adds a `setComputeUnitPrice` instruction when > 0. */
|
|
54
|
-
priorityFee?: number
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Label-only options for raw Loopscale response steps. */
|
|
58
|
-
export interface LoopscaleStepOptions {
|
|
59
|
-
/** Human-readable label for this Loopscale step. Auto-generated if omitted. */
|
|
60
|
-
label?: string
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** Optional Loopscale client config used by the builder for preparation and MPC co-signing. */
|
|
64
|
-
export interface VaultTransactionBuilderLoopscaleConfig {
|
|
65
|
-
/** Override the Loopscale API base URL. */
|
|
66
|
-
baseUrl?: string
|
|
67
|
-
/** Enable verbose Loopscale request/response logging. */
|
|
68
|
-
debug?: boolean
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Configuration for creating a {@link VaultTransactionBuilder}.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* const builder = VaultTransactionBuilder.create({
|
|
77
|
-
* vault, // loaded ExponentVault instance
|
|
78
|
-
* connection, // Solana RPC connection
|
|
79
|
-
* signer: manager.publicKey, // strategy manager's public key
|
|
80
|
-
* autoManagePositions: true, // optional, defaults to true
|
|
81
|
-
* pricesAccount, // optional prefetched ExponentPrices snapshot
|
|
82
|
-
* })
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
export interface VaultTransactionBuilderConfig {
|
|
86
|
-
/** Loaded ExponentVault instance. Provides on-chain state, price IDs, and the vault's address lookup table. */
|
|
87
|
-
vault: ExponentVault
|
|
88
|
-
/** Solana RPC connection used for all on-chain reads and transaction sending. */
|
|
89
|
-
connection: Connection
|
|
90
|
-
/** The strategy manager's public key. Used as the signer for policy matching and as the fee payer. */
|
|
91
|
-
signer: PublicKey
|
|
92
|
-
/** Optional vault PDA override. Defaults to `vault.state.squadsVault`. */
|
|
93
|
-
vaultPda?: PublicKey
|
|
94
|
-
/** Optional extra lookup tables to include alongside the vault-managed tables. */
|
|
95
|
-
lookupTableAddresses?: PublicKey[]
|
|
96
|
-
/**
|
|
97
|
-
* Fetched `ExponentPrices` account snapshot (optional).
|
|
98
|
-
*
|
|
99
|
-
* When provided, the builder reuses this snapshot to assemble same-transaction
|
|
100
|
-
* `UpdatePrice` instructions for any setup or sync transaction that can hit
|
|
101
|
-
* AUM recalculation. When omitted, the builder fetches the current prices
|
|
102
|
-
* account automatically.
|
|
103
|
-
*/
|
|
104
|
-
pricesAccount?: ExponentPrices
|
|
105
|
-
/** Default compute unit limit for all steps (default: 1,400,000). Override per-step via {@link StepOptions}. */
|
|
106
|
-
computeUnitLimit?: number
|
|
107
|
-
/** Default heap frame allocation in bytes for all steps (default: 262,144 = 256 KB). Override per-step via {@link StepOptions}. */
|
|
108
|
-
heapFrameBytes?: number
|
|
109
|
-
/** Automatically manage new Kamino/CLMM/yield position tracking for manager flows. Defaults to `true`. */
|
|
110
|
-
autoManagePositions?: boolean
|
|
111
|
-
/** Squads program ID override. Defaults to the standard Squads V4 program. */
|
|
112
|
-
squadsProgram?: PublicKey
|
|
113
|
-
/** Optional Loopscale client config used when preparing and co-signing Loopscale transactions. */
|
|
114
|
-
loopscale?: VaultTransactionBuilderLoopscaleConfig
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
type StepConfig =
|
|
118
|
-
| {
|
|
119
|
-
kind: "instructions"
|
|
120
|
-
label: string
|
|
121
|
-
instructions: VaultInstruction[]
|
|
122
|
-
options: StepOptions
|
|
123
|
-
}
|
|
124
|
-
| {
|
|
125
|
-
kind: "loopscale-response"
|
|
126
|
-
label: string
|
|
127
|
-
response: LoopscaleTransactionResponse
|
|
128
|
-
options: LoopscaleStepOptions
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* A group of instructions that will be assembled into a single VersionedTransaction.
|
|
133
|
-
*
|
|
134
|
-
* The builder produces an ordered array of TransactionSets: optional setup
|
|
135
|
-
* transactions, then one sync transaction per step. Same-transaction Exponent
|
|
136
|
-
* price refreshes are injected directly into any set that can hit AUM
|
|
137
|
-
* recalculation.
|
|
138
|
-
*/
|
|
139
|
-
export interface TransactionSet {
|
|
140
|
-
/** Human-readable label identifying this transaction (e.g. "step-1", "step-1-setup"). */
|
|
141
|
-
label: string
|
|
142
|
-
/** All instructions in execution order, including compute budget instructions. */
|
|
143
|
-
instructions: TransactionInstruction[]
|
|
144
|
-
/** Extra signers required by this transaction (e.g. a newly generated LP position keypair from CLMM deposits). */
|
|
145
|
-
signers: web3.Signer[]
|
|
146
|
-
/** Address lookup table addresses that should be loaded for this transaction's V0 message. */
|
|
147
|
-
addressLookupTableAddresses: PublicKey[]
|
|
148
|
-
/** Whether this transaction needs Loopscale MPC co-signing before broadcast. */
|
|
149
|
-
coSignWithLoopscale?: boolean
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Options for {@link VaultTransactionBuildResult.send}.
|
|
154
|
-
*/
|
|
155
|
-
export interface SendOptions {
|
|
156
|
-
/** Keypair signers. The first signer is used as the fee payer. */
|
|
157
|
-
signers: web3.Signer[]
|
|
158
|
-
/** Commitment level for transaction confirmation (default: "confirmed"). */
|
|
159
|
-
commitment?: web3.Commitment
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/** Result from {@link VaultTransactionBuildResult.send}. */
|
|
163
|
-
export interface SendResult {
|
|
164
|
-
/** Transaction signatures in the same order as the TransactionSets. */
|
|
165
|
-
signatures: string[]
|
|
166
|
-
/**
|
|
167
|
-
* Non-null when an ephemeral address lookup table was created to fit all
|
|
168
|
-
* accounts into the transactions. The caller can deactivate and close it
|
|
169
|
-
* to reclaim rent when they no longer need it.
|
|
170
|
-
*
|
|
171
|
-
* Cleanup requires two steps (Solana constraint):
|
|
172
|
-
* 1. `AddressLookupTableProgram.deactivateLookupTable({ lookupTable: address, authority })`
|
|
173
|
-
* 2. After ~one epoch, `AddressLookupTableProgram.closeLookupTable({ lookupTable: address, authority, recipient: authority })`
|
|
174
|
-
*/
|
|
175
|
-
ephemeralAlt: { address: PublicKey; authority: PublicKey } | null
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* The result of calling {@link VaultTransactionBuilder.build}.
|
|
180
|
-
*
|
|
181
|
-
* Contains the assembled TransactionSets and a `send()` method for sequential execution.
|
|
182
|
-
* Loopscale co-signing is handled automatically.
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* ```ts
|
|
186
|
-
* const result = await builder.build()
|
|
187
|
-
*
|
|
188
|
-
* // Inspect
|
|
189
|
-
* console.log(result.labels) // ["step-1", "loopscale-step-2"]
|
|
190
|
-
*
|
|
191
|
-
* // Send sequentially
|
|
192
|
-
* await result.send({ signers: [manager] })
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
export interface VaultTransactionBuildResult {
|
|
196
|
-
/** Ordered TransactionSets: setup + sync per step, with same-tx price refresh injected as needed. */
|
|
197
|
-
transactionSets: TransactionSet[]
|
|
198
|
-
/** Deduplicated address lookup table addresses across all TransactionSets. */
|
|
199
|
-
lookupTableAddresses: PublicKey[]
|
|
200
|
-
/** Labels for each TransactionSet, in order. */
|
|
201
|
-
labels: string[]
|
|
202
|
-
/**
|
|
203
|
-
* Send transactions sequentially via regular RPC.
|
|
204
|
-
*
|
|
205
|
-
* Each transaction is built, signed (and co-signed for Loopscale steps),
|
|
206
|
-
* sent via `connection.sendTransaction()`, and confirmed before proceeding
|
|
207
|
-
* to the next one. Suitable for most operations.
|
|
208
|
-
*
|
|
209
|
-
* **Note:** Does not guarantee atomicity — if a later transaction fails,
|
|
210
|
-
* earlier ones have already landed.
|
|
211
|
-
*/
|
|
212
|
-
send(options: SendOptions): Promise<SendResult>
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// ============================================================================
|
|
216
|
-
// VaultTransactionBuilder
|
|
217
|
-
// ============================================================================
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Orchestrates strategy vault transaction construction.
|
|
221
|
-
*
|
|
222
|
-
* Replaces the per-recipe boilerplate of manually assembling compute budgets,
|
|
223
|
-
* sync transaction wrapping, ALT gathering, setup transaction splitting, and
|
|
224
|
-
* forward-looking Kamino/CLMM/yield position tracking.
|
|
225
|
-
*
|
|
226
|
-
* **Lifecycle:** create → add actions → build → send()
|
|
227
|
-
*
|
|
228
|
-
* @example Single action
|
|
229
|
-
* ```ts
|
|
230
|
-
* const result = await VaultTransactionBuilder
|
|
231
|
-
* .create({ vault, connection, signer: manager.publicKey })
|
|
232
|
-
* .addActions([clmmAction.buyPt({ market, ptOutMin, syInMax })])
|
|
233
|
-
* .build()
|
|
234
|
-
*
|
|
235
|
-
* await result.send({ signers: [manager] })
|
|
236
|
-
* ```
|
|
237
|
-
*
|
|
238
|
-
* @example Multi-step — each addActions() becomes its own sync transaction
|
|
239
|
-
* ```ts
|
|
240
|
-
* const result = await VaultTransactionBuilder
|
|
241
|
-
* .create({ vault, connection, signer: manager.publicKey })
|
|
242
|
-
* .addActions([kaminoAction.deposit("MAIN", "USDC", amount)]) // sync tx 1
|
|
243
|
-
* .addActions([kaminoAction.borrow("MAIN", "SOL", amount)]) // sync tx 2
|
|
244
|
-
* .build()
|
|
245
|
-
*
|
|
246
|
-
* await result.send({ signers: [manager] })
|
|
247
|
-
* ```
|
|
248
|
-
*
|
|
249
|
-
* @example Mixed Kamino + Loopscale — co-signing handled automatically
|
|
250
|
-
* ```ts
|
|
251
|
-
* const loopscaleDeposit = await loopscale.depositStrategy({ ... })
|
|
252
|
-
*
|
|
253
|
-
* const result = await VaultTransactionBuilder
|
|
254
|
-
* .create({ vault, connection, signer: manager.publicKey })
|
|
255
|
-
* .addActions([kaminoAction.deposit(...)]) // signed normally
|
|
256
|
-
* .addLoopscaleResponse(loopscaleDeposit) // co-signed automatically
|
|
257
|
-
* .build()
|
|
258
|
-
*
|
|
259
|
-
* // send() auto-creates a LoopscaleClient for Loopscale co-signing
|
|
260
|
-
* await result.send({ signers: [manager] })
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
export class VaultTransactionBuilder {
|
|
264
|
-
private readonly config: VaultTransactionBuilderConfig
|
|
265
|
-
private steps: StepConfig[] = []
|
|
266
|
-
private stepCounter = 0
|
|
267
|
-
|
|
268
|
-
private constructor(config: VaultTransactionBuilderConfig) {
|
|
269
|
-
this.config = config
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Create a new builder instance.
|
|
274
|
-
*
|
|
275
|
-
* @param config - Builder configuration including the vault, connection, and signer.
|
|
276
|
-
* @returns A new {@link VaultTransactionBuilder} ready for action chaining.
|
|
277
|
-
*/
|
|
278
|
-
static create(config: VaultTransactionBuilderConfig): VaultTransactionBuilder {
|
|
279
|
-
return new VaultTransactionBuilder(config)
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Add vault instructions as a new step.
|
|
284
|
-
*
|
|
285
|
-
* Each call creates a **separate Squads sync transaction** with its own policy matching.
|
|
286
|
-
* This prevents oversized transactions — Solana transactions are limited to 1232 bytes,
|
|
287
|
-
* and most vault actions (Kamino deposit, CLMM trade, etc.) use many accounts.
|
|
288
|
-
*
|
|
289
|
-
* To chain multiple calls, each gets its own sync transaction:
|
|
290
|
-
* ```ts
|
|
291
|
-
* builder
|
|
292
|
-
* .addActions([kaminoAction.deposit(...)]) // sync tx 1
|
|
293
|
-
* .addActions([kaminoAction.borrow(...)]) // sync tx 2
|
|
294
|
-
* ```
|
|
295
|
-
*
|
|
296
|
-
* **Warning:** Passing multiple actions in a single array packs them into one sync
|
|
297
|
-
* transaction. This can easily exceed the 1232-byte Solana packet limit — the builder
|
|
298
|
-
* will throw an error at build time if the resulting transaction is oversized.
|
|
299
|
-
* Only combine actions in one array when you know they fit (e.g., two small instructions).
|
|
300
|
-
*
|
|
301
|
-
* @param instructions - Array of VaultInstruction descriptors (from kaminoAction, clmmAction, etc.).
|
|
302
|
-
* @param options - Optional per-step compute budget overrides and label.
|
|
303
|
-
* @returns `this` for chaining.
|
|
304
|
-
*/
|
|
305
|
-
addActions(instructions: VaultInstruction[], options?: StepOptions): this {
|
|
306
|
-
this.stepCounter++
|
|
307
|
-
const label = options?.label ?? `step-${this.stepCounter}`
|
|
308
|
-
this.steps.push({ kind: "instructions", label, instructions: [...instructions], options: options ?? {} })
|
|
309
|
-
return this
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Add a raw Loopscale response as a new step.
|
|
314
|
-
*
|
|
315
|
-
* The builder will flatten the response into manager-facing transactions,
|
|
316
|
-
* preserving Loopscale-signed segments while keeping local setup/top-level
|
|
317
|
-
* transactions outside the Loopscale signing domain.
|
|
318
|
-
*
|
|
319
|
-
* @param response - Raw Loopscale response returned by {@link LoopscaleClient}.
|
|
320
|
-
* Only `label` is supported for Loopscale steps. Compute overrides are
|
|
321
|
-
* preserved on the raw Loopscale response and are not applied by the
|
|
322
|
-
* builder.
|
|
323
|
-
*
|
|
324
|
-
* @param options - Optional step label.
|
|
325
|
-
* @returns `this` for chaining.
|
|
326
|
-
*/
|
|
327
|
-
addLoopscaleResponse(response: LoopscaleTransactionResponse, options?: LoopscaleStepOptions): this {
|
|
328
|
-
this.stepCounter++
|
|
329
|
-
const label = options?.label ?? `loopscale-step-${this.stepCounter}`
|
|
330
|
-
this.steps.push({ kind: "loopscale-response", label, response, options: options ?? {} })
|
|
331
|
-
return this
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Build TransactionSets from the configured steps.
|
|
336
|
-
*
|
|
337
|
-
* Produces an ordered array of TransactionSets:
|
|
338
|
-
* 1. **Setup transactions** — token account creation / builder-managed setup (only if needed)
|
|
339
|
-
* 2. **Sync transactions** — one per step, wrapped in Squads sync transaction
|
|
340
|
-
*
|
|
341
|
-
* Same-transaction `UpdatePrice` instructions are injected directly into any
|
|
342
|
-
* setup or sync set that can hit AUM recalculation.
|
|
343
|
-
*
|
|
344
|
-
* Use `result.send()` for sequential execution.
|
|
345
|
-
*
|
|
346
|
-
* @returns A {@link VaultTransactionBuildResult} with TransactionSets and a send method.
|
|
347
|
-
* @throws If no steps have been configured (call addActions first).
|
|
348
|
-
* @throws If any assembled transaction exceeds the 1232-byte Solana packet limit.
|
|
349
|
-
*/
|
|
350
|
-
async build(): Promise<VaultTransactionBuildResult> {
|
|
351
|
-
if (this.steps.length === 0) {
|
|
352
|
-
throw new Error("No steps configured. Call addActions() or addLoopscaleResponse() before build().")
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
const { vault, connection, signer, pricesAccount } = this.config
|
|
356
|
-
const vaultPda = this.config.vaultPda ?? vault.state.squadsVault
|
|
357
|
-
const extraLookupTableAddresses = this.config.lookupTableAddresses ?? []
|
|
358
|
-
const autoManagePositions = this.config.autoManagePositions ?? true
|
|
359
|
-
const squadsProgram = this.config.squadsProgram ?? SQUADS_PROGRAM_ID
|
|
360
|
-
const defaultCU = this.config.computeUnitLimit ?? 1_400_000
|
|
361
|
-
const defaultHeap = this.config.heapFrameBytes ?? 256 * 1024
|
|
362
|
-
|
|
363
|
-
const transactionSets: TransactionSet[] = []
|
|
364
|
-
const allAltAddresses = new Set<string>(
|
|
365
|
-
[
|
|
366
|
-
...(vault.state.addressLookupTable ? [vault.state.addressLookupTable.toBase58()] : []),
|
|
367
|
-
...extraLookupTableAddresses.map((address) => address.toBase58()),
|
|
368
|
-
],
|
|
369
|
-
)
|
|
370
|
-
|
|
371
|
-
// Share a single setup context across all steps so that tracked accounts,
|
|
372
|
-
// positions, and orderbooks carry over — preventing duplicate setup txs.
|
|
373
|
-
const sharedSetupContext = createStrategySetupContext({
|
|
374
|
-
connection,
|
|
375
|
-
env: LOCAL_ENV,
|
|
376
|
-
owner: vaultPda,
|
|
377
|
-
signer,
|
|
378
|
-
vaultAddress: vault.selfAddress,
|
|
379
|
-
vaultPda,
|
|
380
|
-
accountIndex: 0,
|
|
381
|
-
squadsProgram,
|
|
382
|
-
autoManagePositions,
|
|
383
|
-
pricesAccount,
|
|
384
|
-
})
|
|
385
|
-
let loopscaleClient: LoopscaleClient | undefined
|
|
386
|
-
|
|
387
|
-
for (const step of this.steps) {
|
|
388
|
-
if (step.kind === "loopscale-response") {
|
|
389
|
-
loopscaleClient ??= createBuilderLoopscaleClient({
|
|
390
|
-
connection,
|
|
391
|
-
vaultPda,
|
|
392
|
-
loopscale: this.config.loopscale,
|
|
393
|
-
})
|
|
394
|
-
|
|
395
|
-
const preparedTransactions = await loopscaleClient.prepareVaultTransactions({
|
|
396
|
-
response: step.response,
|
|
397
|
-
context: {
|
|
398
|
-
connection,
|
|
399
|
-
signer,
|
|
400
|
-
vaultPda,
|
|
401
|
-
vaultAddress: vault.selfAddress,
|
|
402
|
-
squadsProgram,
|
|
403
|
-
},
|
|
404
|
-
})
|
|
405
|
-
const stepPriceRefreshIxs = await buildSetupStatePriceRefreshInstructions(sharedSetupContext)
|
|
406
|
-
|
|
407
|
-
for (const [preparedIndex, preparedTransaction] of preparedTransactions.entries()) {
|
|
408
|
-
const txLabel = preparedTransactions.length === 1
|
|
409
|
-
? step.label
|
|
410
|
-
: `${step.label}-${preparedIndex + 1}`
|
|
411
|
-
|
|
412
|
-
if (preparedTransaction.setupInstructions.length > 0) {
|
|
413
|
-
const setupAltAddresses = mergeAddressLookupTableAddresses(
|
|
414
|
-
extraLookupTableAddresses,
|
|
415
|
-
vault.state.addressLookupTable ? [vault.state.addressLookupTable] : [],
|
|
416
|
-
)
|
|
417
|
-
const setupSet: TransactionSet = {
|
|
418
|
-
label: `${txLabel}-setup`,
|
|
419
|
-
instructions: [
|
|
420
|
-
ComputeBudgetProgram.setComputeUnitLimit({ units: defaultCU }),
|
|
421
|
-
...preparedTransaction.setupInstructions,
|
|
422
|
-
],
|
|
423
|
-
signers: [],
|
|
424
|
-
addressLookupTableAddresses: setupAltAddresses,
|
|
425
|
-
coSignWithLoopscale: false,
|
|
426
|
-
}
|
|
427
|
-
if (touchesManagedVaultPrograms(setupSet.instructions, vault.programId, squadsProgram)) {
|
|
428
|
-
setupSet.instructions = insertAfterLeadingComputeBudgetAndScopeInstructions(
|
|
429
|
-
setupSet.instructions,
|
|
430
|
-
stepPriceRefreshIxs,
|
|
431
|
-
)
|
|
432
|
-
}
|
|
433
|
-
transactionSets.push(setupSet)
|
|
434
|
-
for (const alt of setupSet.addressLookupTableAddresses) {
|
|
435
|
-
allAltAddresses.add(alt.toBase58())
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
const shouldInjectLocalLoopscalePriceRefresh = (
|
|
440
|
-
!preparedTransaction.requiresLoopscaleCoSign
|
|
441
|
-
&& touchesManagedVaultPrograms(preparedTransaction.instructions, vault.programId, squadsProgram)
|
|
442
|
-
)
|
|
443
|
-
const loopscaleSet: TransactionSet = {
|
|
444
|
-
label: txLabel,
|
|
445
|
-
instructions: preparedTransaction.instructions,
|
|
446
|
-
signers: preparedTransaction.signers,
|
|
447
|
-
addressLookupTableAddresses: shouldInjectLocalLoopscalePriceRefresh
|
|
448
|
-
? mergeAddressLookupTableAddresses(
|
|
449
|
-
preparedTransaction.addressLookupTableAddresses,
|
|
450
|
-
extraLookupTableAddresses,
|
|
451
|
-
vault.state.addressLookupTable ? [vault.state.addressLookupTable] : [],
|
|
452
|
-
)
|
|
453
|
-
: mergeAddressLookupTableAddresses(
|
|
454
|
-
preparedTransaction.addressLookupTableAddresses,
|
|
455
|
-
extraLookupTableAddresses,
|
|
456
|
-
),
|
|
457
|
-
coSignWithLoopscale: preparedTransaction.requiresLoopscaleCoSign,
|
|
458
|
-
}
|
|
459
|
-
if (shouldInjectLocalLoopscalePriceRefresh) {
|
|
460
|
-
loopscaleSet.instructions = insertAfterLeadingComputeBudgetAndScopeInstructions(
|
|
461
|
-
loopscaleSet.instructions,
|
|
462
|
-
stepPriceRefreshIxs,
|
|
463
|
-
)
|
|
464
|
-
}
|
|
465
|
-
transactionSets.push(loopscaleSet)
|
|
466
|
-
|
|
467
|
-
for (const alt of loopscaleSet.addressLookupTableAddresses) {
|
|
468
|
-
allAltAddresses.add(alt.toBase58())
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
continue
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
const stepCU = step.options.computeUnitLimit ?? defaultCU
|
|
475
|
-
const stepHeap = step.options.heapFrameBytes ?? defaultHeap
|
|
476
|
-
const syncResults = await createVaultSyncTransactions({
|
|
477
|
-
instructions: step.instructions,
|
|
478
|
-
owner: vaultPda,
|
|
479
|
-
connection,
|
|
480
|
-
vaultPda,
|
|
481
|
-
signer,
|
|
482
|
-
vaultAddress: vault.selfAddress,
|
|
483
|
-
squadsProgram,
|
|
484
|
-
autoManagePositions,
|
|
485
|
-
setupContext: sharedSetupContext,
|
|
486
|
-
})
|
|
487
|
-
|
|
488
|
-
const stepPriceRefreshIxs = await buildSetupStatePriceRefreshInstructions(sharedSetupContext)
|
|
489
|
-
|
|
490
|
-
for (const [syncIndex, syncResult] of syncResults.entries()) {
|
|
491
|
-
const txLabel = syncResults.length === 1
|
|
492
|
-
? step.label
|
|
493
|
-
: `${step.label}-${syncIndex + 1}`
|
|
494
|
-
|
|
495
|
-
if (syncResult.setupInstructions.length > 0) {
|
|
496
|
-
const setupSet: TransactionSet = {
|
|
497
|
-
label: `${txLabel}-setup`,
|
|
498
|
-
instructions: [
|
|
499
|
-
ComputeBudgetProgram.setComputeUnitLimit({ units: defaultCU }),
|
|
500
|
-
...syncResult.setupInstructions,
|
|
501
|
-
],
|
|
502
|
-
signers: [],
|
|
503
|
-
addressLookupTableAddresses: mergeAddressLookupTableAddresses(
|
|
504
|
-
syncResult.addressLookupTableAddresses,
|
|
505
|
-
extraLookupTableAddresses,
|
|
506
|
-
vault.state.addressLookupTable ? [vault.state.addressLookupTable] : [],
|
|
507
|
-
),
|
|
508
|
-
coSignWithLoopscale: false,
|
|
509
|
-
}
|
|
510
|
-
if (shouldInjectPriceRefresh(setupSet, vault.programId, squadsProgram)) {
|
|
511
|
-
setupSet.instructions = insertAfterLeadingComputeBudgetAndScopeInstructions(
|
|
512
|
-
setupSet.instructions,
|
|
513
|
-
stepPriceRefreshIxs,
|
|
514
|
-
)
|
|
515
|
-
}
|
|
516
|
-
transactionSets.push(setupSet)
|
|
517
|
-
for (const alt of setupSet.addressLookupTableAddresses) {
|
|
518
|
-
allAltAddresses.add(alt.toBase58())
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
const syncSet: TransactionSet = {
|
|
523
|
-
label: txLabel,
|
|
524
|
-
instructions: [
|
|
525
|
-
...buildComputeBudgetIxs(stepCU, stepHeap, step.options.priorityFee),
|
|
526
|
-
...syncResult.preInstructions,
|
|
527
|
-
syncResult.instruction,
|
|
528
|
-
...syncResult.postInstructions,
|
|
529
|
-
],
|
|
530
|
-
signers: syncResult.signers,
|
|
531
|
-
addressLookupTableAddresses: mergeAddressLookupTableAddresses(
|
|
532
|
-
syncResult.addressLookupTableAddresses,
|
|
533
|
-
extraLookupTableAddresses,
|
|
534
|
-
vault.state.addressLookupTable ? [vault.state.addressLookupTable] : [],
|
|
535
|
-
),
|
|
536
|
-
coSignWithLoopscale: false,
|
|
537
|
-
}
|
|
538
|
-
if (shouldInjectPriceRefresh(syncSet, vault.programId, squadsProgram)) {
|
|
539
|
-
syncSet.instructions = insertAfterLeadingComputeBudgetAndScopeInstructions(
|
|
540
|
-
syncSet.instructions,
|
|
541
|
-
stepPriceRefreshIxs,
|
|
542
|
-
)
|
|
543
|
-
}
|
|
544
|
-
transactionSets.push(syncSet)
|
|
545
|
-
|
|
546
|
-
for (const alt of syncSet.addressLookupTableAddresses) {
|
|
547
|
-
allAltAddresses.add(alt.toBase58())
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
const lookupTableAddresses = [...allAltAddresses].map((a) => new PublicKey(a))
|
|
553
|
-
|
|
554
|
-
// Resolve the vault's persistent ALT to determine which account keys it
|
|
555
|
-
// already covers. Any keys NOT covered will need an ephemeral ALT.
|
|
556
|
-
const persistentAltAccounts = await resolveAltAccounts(connection, lookupTableAddresses)
|
|
557
|
-
const persistentAltKeys = new Set<string>()
|
|
558
|
-
for (const alt of persistentAltAccounts) {
|
|
559
|
-
for (const addr of alt.state.addresses) {
|
|
560
|
-
persistentAltKeys.add(addr.toBase58())
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
// Collect every unique account key referenced by any transaction set.
|
|
565
|
-
const allUniqueKeys = collectUniqueAccountKeys(transactionSets, signer)
|
|
566
|
-
const ephemeralAltEntries = allUniqueKeys.filter((k) => !persistentAltKeys.has(k.toBase58()))
|
|
567
|
-
|
|
568
|
-
// Validate transaction sizes. When an ephemeral ALT will be created,
|
|
569
|
-
// skip validation here — send() will validate after ALT activation.
|
|
570
|
-
if (ephemeralAltEntries.length === 0) {
|
|
571
|
-
validateTransactionSizes(transactionSets, persistentAltAccounts, signer)
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
const labels = transactionSets.map((ts) => ts.label)
|
|
575
|
-
|
|
576
|
-
// Capture state for send() closure
|
|
577
|
-
const closedConnection = connection
|
|
578
|
-
const closedSigner = signer
|
|
579
|
-
const closedVaultPda = vaultPda
|
|
580
|
-
const closedLookupTableAddresses = lookupTableAddresses
|
|
581
|
-
const closedLoopscaleConfig = this.config.loopscale
|
|
582
|
-
|
|
583
|
-
return {
|
|
584
|
-
transactionSets,
|
|
585
|
-
lookupTableAddresses,
|
|
586
|
-
labels,
|
|
587
|
-
|
|
588
|
-
async send(options: SendOptions): Promise<SendResult> {
|
|
589
|
-
const commitment = options.commitment ?? "confirmed"
|
|
590
|
-
const payer = options.signers[0]
|
|
591
|
-
|
|
592
|
-
// ── Ephemeral ALT creation ───────────────────────────────────────
|
|
593
|
-
let ephemeralAlt: { address: PublicKey; authority: PublicKey } | null = null
|
|
594
|
-
let ephemeralAltAccount: AddressLookupTableAccount | undefined
|
|
595
|
-
|
|
596
|
-
if (ephemeralAltEntries.length > 0) {
|
|
597
|
-
const slot = await closedConnection.getSlot("processed")
|
|
598
|
-
const recentSlot = Math.max(slot - 1, 0)
|
|
599
|
-
const [createIx, altAddress] = AddressLookupTableProgram.createLookupTable({
|
|
600
|
-
authority: payer.publicKey,
|
|
601
|
-
payer: payer.publicKey,
|
|
602
|
-
recentSlot,
|
|
603
|
-
})
|
|
604
|
-
|
|
605
|
-
// Chunk extend instructions — each can hold ~20 addresses safely
|
|
606
|
-
const extendChunks = chunkArray(ephemeralAltEntries, 20)
|
|
607
|
-
const extendIxs = extendChunks.map((chunk) =>
|
|
608
|
-
AddressLookupTableProgram.extendLookupTable({
|
|
609
|
-
lookupTable: altAddress,
|
|
610
|
-
authority: payer.publicKey,
|
|
611
|
-
payer: payer.publicKey,
|
|
612
|
-
addresses: chunk,
|
|
613
|
-
}),
|
|
614
|
-
)
|
|
615
|
-
|
|
616
|
-
// Send create + first extend in one transaction
|
|
617
|
-
const altSetupIxs: TransactionInstruction[] = [createIx, extendIxs[0]!]
|
|
618
|
-
await sendAndConfirmTransaction(closedConnection, altSetupIxs, [payer], commitment)
|
|
619
|
-
|
|
620
|
-
// Send remaining extend chunks if any
|
|
621
|
-
for (let i = 1; i < extendIxs.length; i++) {
|
|
622
|
-
await sendAndConfirmTransaction(closedConnection, [extendIxs[i]!], [payer], commitment)
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
// Wait for ALT entries to become active (usable in the slot AFTER extension)
|
|
626
|
-
await waitForSlotAdvance(closedConnection, slot, "processed")
|
|
627
|
-
|
|
628
|
-
// Resolve the ephemeral ALT account for use in transactions
|
|
629
|
-
const resolved = await closedConnection.getAddressLookupTable(altAddress)
|
|
630
|
-
if (!resolved.value) {
|
|
631
|
-
throw new Error(`Ephemeral ALT ${altAddress.toBase58()} not found after creation`)
|
|
632
|
-
}
|
|
633
|
-
ephemeralAltAccount = resolved.value
|
|
634
|
-
ephemeralAlt = { address: altAddress, authority: payer.publicKey }
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
// ── Resolve all ALT accounts (persistent + ephemeral) ────────────
|
|
638
|
-
const resolvedAltAccounts = await resolveAltAccounts(closedConnection, closedLookupTableAddresses)
|
|
639
|
-
if (ephemeralAltAccount) {
|
|
640
|
-
resolvedAltAccounts.push(ephemeralAltAccount)
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
// If we skipped build-time validation, validate now with the full ALT set
|
|
644
|
-
if (ephemeralAltEntries.length > 0) {
|
|
645
|
-
validateTransactionSizes(transactionSets, resolvedAltAccounts, closedSigner, ephemeralAltAccount)
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
// ── Auto-create LoopscaleClient if any step needs co-signing ─────
|
|
649
|
-
const hasLoopscale = transactionSets.some((txSet) => txSet.coSignWithLoopscale)
|
|
650
|
-
let loopscaleClient: LoopscaleClient | undefined
|
|
651
|
-
if (hasLoopscale) {
|
|
652
|
-
loopscaleClient = createBuilderLoopscaleClient({
|
|
653
|
-
connection: closedConnection,
|
|
654
|
-
vaultPda: closedVaultPda,
|
|
655
|
-
loopscale: closedLoopscaleConfig,
|
|
656
|
-
})
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
// ── Send transactions ────────────────────────────────────────────
|
|
660
|
-
const signatures: string[] = []
|
|
661
|
-
for (const txSet of transactionSets) {
|
|
662
|
-
const { blockhash, lastValidBlockHeight } = await closedConnection.getLatestBlockhash()
|
|
663
|
-
|
|
664
|
-
// Include the ephemeral ALT for every transaction set
|
|
665
|
-
const txAltAccounts = resolvedAltAccounts.filter((alt) =>
|
|
666
|
-
txSet.addressLookupTableAddresses.some((addr) => addr.equals(alt.key))
|
|
667
|
-
|| (ephemeralAltAccount && alt.key.equals(ephemeralAltAccount.key)),
|
|
668
|
-
)
|
|
669
|
-
|
|
670
|
-
const msg = new TransactionMessage({
|
|
671
|
-
payerKey: payer.publicKey,
|
|
672
|
-
recentBlockhash: blockhash,
|
|
673
|
-
instructions: txSet.instructions,
|
|
674
|
-
}).compileToV0Message(txAltAccounts)
|
|
675
|
-
|
|
676
|
-
let tx = new VersionedTransaction(msg)
|
|
677
|
-
if (txSet.coSignWithLoopscale && loopscaleClient) {
|
|
678
|
-
tx.sign([...options.signers, ...txSet.signers])
|
|
679
|
-
tx = await loopscaleClient.coSign(tx)
|
|
680
|
-
} else {
|
|
681
|
-
tx.sign([...options.signers, ...txSet.signers])
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
const sig = await closedConnection.sendTransaction(tx)
|
|
685
|
-
await closedConnection.confirmTransaction(
|
|
686
|
-
{ signature: sig, blockhash, lastValidBlockHeight },
|
|
687
|
-
commitment,
|
|
688
|
-
)
|
|
689
|
-
signatures.push(sig)
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
return { signatures, ephemeralAlt }
|
|
693
|
-
},
|
|
694
|
-
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
// ============================================================================
|
|
700
|
-
// Internal helpers
|
|
701
|
-
// ============================================================================
|
|
702
|
-
|
|
703
|
-
/** Build compute budget instructions: CU limit + heap frame + optional priority fee. */
|
|
704
|
-
function buildComputeBudgetIxs(
|
|
705
|
-
computeUnitLimit: number,
|
|
706
|
-
heapFrameBytes: number,
|
|
707
|
-
priorityFee?: number,
|
|
708
|
-
): TransactionInstruction[] {
|
|
709
|
-
const ixs = [
|
|
710
|
-
ComputeBudgetProgram.setComputeUnitLimit({ units: computeUnitLimit }),
|
|
711
|
-
ComputeBudgetProgram.requestHeapFrame({ bytes: heapFrameBytes }),
|
|
712
|
-
]
|
|
713
|
-
if (priorityFee !== undefined && priorityFee > 0) {
|
|
714
|
-
ixs.push(ComputeBudgetProgram.setComputeUnitPrice({ microLamports: priorityFee }))
|
|
715
|
-
}
|
|
716
|
-
return ixs
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
function insertAfterLeadingComputeBudgetAndScopeInstructions(
|
|
720
|
-
instructions: TransactionInstruction[],
|
|
721
|
-
extraInstructions: TransactionInstruction[],
|
|
722
|
-
): TransactionInstruction[] {
|
|
723
|
-
if (extraInstructions.length === 0) {
|
|
724
|
-
return instructions
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
let insertIndex = 0
|
|
728
|
-
while (
|
|
729
|
-
insertIndex < instructions.length
|
|
730
|
-
&& instructions[insertIndex]?.programId.equals(ComputeBudgetProgram.programId)
|
|
731
|
-
) {
|
|
732
|
-
insertIndex += 1
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
while (
|
|
736
|
-
insertIndex < instructions.length
|
|
737
|
-
&& instructions[insertIndex]?.programId.equals(SCOPE_PROGRAM_ID)
|
|
738
|
-
) {
|
|
739
|
-
insertIndex += 1
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
return [
|
|
743
|
-
...instructions.slice(0, insertIndex),
|
|
744
|
-
...extraInstructions,
|
|
745
|
-
...instructions.slice(insertIndex),
|
|
746
|
-
]
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
function shouldInjectPriceRefresh(
|
|
750
|
-
txSet: TransactionSet,
|
|
751
|
-
programId: PublicKey,
|
|
752
|
-
squadsProgram: PublicKey,
|
|
753
|
-
): boolean {
|
|
754
|
-
if (!txSet.label.endsWith("-setup")) {
|
|
755
|
-
return true
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
return txSet.instructions.some((instruction) =>
|
|
759
|
-
instruction.programId.equals(programId) || instruction.programId.equals(squadsProgram),
|
|
760
|
-
)
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
function touchesManagedVaultPrograms(
|
|
764
|
-
instructions: TransactionInstruction[],
|
|
765
|
-
programId: PublicKey,
|
|
766
|
-
squadsProgram: PublicKey,
|
|
767
|
-
): boolean {
|
|
768
|
-
return instructions.some((instruction) =>
|
|
769
|
-
instruction.programId.equals(programId) || instruction.programId.equals(squadsProgram),
|
|
770
|
-
)
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
function mergeAddressLookupTableAddresses(
|
|
774
|
-
...addressGroups: Array<readonly PublicKey[]>
|
|
775
|
-
): PublicKey[] {
|
|
776
|
-
const seen = new Set<string>()
|
|
777
|
-
const merged: PublicKey[] = []
|
|
778
|
-
|
|
779
|
-
for (const group of addressGroups) {
|
|
780
|
-
for (const address of group) {
|
|
781
|
-
const key = address.toBase58()
|
|
782
|
-
if (seen.has(key)) continue
|
|
783
|
-
seen.add(key)
|
|
784
|
-
merged.push(address)
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
return merged
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
function createBuilderLoopscaleClient(params: {
|
|
792
|
-
connection: Connection
|
|
793
|
-
vaultPda: PublicKey
|
|
794
|
-
loopscale?: VaultTransactionBuilderLoopscaleConfig
|
|
795
|
-
}): LoopscaleClient {
|
|
796
|
-
return new LoopscaleClient({
|
|
797
|
-
connection: params.connection,
|
|
798
|
-
userWallet: params.vaultPda,
|
|
799
|
-
baseUrl: params.loopscale?.baseUrl,
|
|
800
|
-
debug: params.loopscale?.debug,
|
|
801
|
-
})
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
/** Fetch and resolve AddressLookupTableAccounts from on-chain, filtering nulls. */
|
|
805
|
-
async function resolveAltAccounts(
|
|
806
|
-
connection: Connection,
|
|
807
|
-
addresses: PublicKey[],
|
|
808
|
-
): Promise<AddressLookupTableAccount[]> {
|
|
809
|
-
const results = await Promise.all(
|
|
810
|
-
addresses.map((addr) => connection.getAddressLookupTable(addr)),
|
|
811
|
-
)
|
|
812
|
-
return results
|
|
813
|
-
.map((r) => r.value)
|
|
814
|
-
.filter((v): v is AddressLookupTableAccount => v !== null)
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
/** Collect all unique account keys referenced across all transaction sets. */
|
|
818
|
-
function collectUniqueAccountKeys(
|
|
819
|
-
transactionSets: TransactionSet[],
|
|
820
|
-
signer: PublicKey,
|
|
821
|
-
): PublicKey[] {
|
|
822
|
-
const seen = new Set<string>()
|
|
823
|
-
const keys: PublicKey[] = []
|
|
824
|
-
|
|
825
|
-
const add = (pubkey: PublicKey) => {
|
|
826
|
-
const str = pubkey.toBase58()
|
|
827
|
-
if (!seen.has(str)) {
|
|
828
|
-
seen.add(str)
|
|
829
|
-
keys.push(pubkey)
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
add(signer)
|
|
834
|
-
for (const txSet of transactionSets) {
|
|
835
|
-
for (const ix of txSet.instructions) {
|
|
836
|
-
add(ix.programId)
|
|
837
|
-
for (const key of ix.keys) {
|
|
838
|
-
add(key.pubkey)
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
return keys
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
/** Validate that every transaction set can serialize within the 1232-byte limit. */
|
|
847
|
-
function validateTransactionSizes(
|
|
848
|
-
transactionSets: TransactionSet[],
|
|
849
|
-
altAccounts: AddressLookupTableAccount[],
|
|
850
|
-
signer: PublicKey,
|
|
851
|
-
extraAlt?: AddressLookupTableAccount,
|
|
852
|
-
): void {
|
|
853
|
-
for (const txSet of transactionSets) {
|
|
854
|
-
const txAltAccounts = altAccounts.filter((alt) =>
|
|
855
|
-
txSet.addressLookupTableAddresses.some((addr) => addr.equals(alt.key)),
|
|
856
|
-
)
|
|
857
|
-
if (extraAlt && !txAltAccounts.some((a) => a.key.equals(extraAlt.key))) {
|
|
858
|
-
txAltAccounts.push(extraAlt)
|
|
859
|
-
}
|
|
860
|
-
try {
|
|
861
|
-
const testMsg = new TransactionMessage({
|
|
862
|
-
payerKey: signer,
|
|
863
|
-
recentBlockhash: PublicKey.default.toBase58(),
|
|
864
|
-
instructions: txSet.instructions,
|
|
865
|
-
}).compileToV0Message(txAltAccounts)
|
|
866
|
-
const testTx = new VersionedTransaction(testMsg)
|
|
867
|
-
const serialized = testTx.serialize()
|
|
868
|
-
if (serialized.length > 1232) {
|
|
869
|
-
throw new Error(
|
|
870
|
-
`Transaction "${txSet.label}" is oversized (${serialized.length} bytes, limit 1232). ` +
|
|
871
|
-
`This usually means too many actions were packed into a single addActions() call. ` +
|
|
872
|
-
`Split them into separate addActions() calls so each gets its own sync transaction.`,
|
|
873
|
-
)
|
|
874
|
-
}
|
|
875
|
-
} catch (e) {
|
|
876
|
-
if (e instanceof Error) {
|
|
877
|
-
const ixCount = txSet.instructions.length
|
|
878
|
-
const altCount = txAltAccounts.length
|
|
879
|
-
const accountCount = txSet.instructions.reduce((sum, ix) => sum + ix.keys.length, 0)
|
|
880
|
-
throw new Error(
|
|
881
|
-
`Transaction "${txSet.label}" failed to serialize: ${e.message}. ` +
|
|
882
|
-
`Transaction has ${ixCount} instructions, ${accountCount} account keys, ` +
|
|
883
|
-
`and ${altCount} address lookup table(s). ` +
|
|
884
|
-
`Try splitting actions into separate addActions() calls.`,
|
|
885
|
-
)
|
|
886
|
-
}
|
|
887
|
-
throw e
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
/** Split an array into chunks of the given size. */
|
|
893
|
-
function chunkArray<T>(arr: T[], size: number): T[][] {
|
|
894
|
-
const chunks: T[][] = []
|
|
895
|
-
for (let i = 0; i < arr.length; i += size) {
|
|
896
|
-
chunks.push(arr.slice(i, i + size))
|
|
897
|
-
}
|
|
898
|
-
return chunks
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
/** Build, sign, send, and confirm a simple transaction. */
|
|
902
|
-
async function sendAndConfirmTransaction(
|
|
903
|
-
connection: Connection,
|
|
904
|
-
instructions: TransactionInstruction[],
|
|
905
|
-
signers: web3.Signer[],
|
|
906
|
-
commitment: web3.Commitment,
|
|
907
|
-
): Promise<string> {
|
|
908
|
-
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash(commitment)
|
|
909
|
-
const msg = new TransactionMessage({
|
|
910
|
-
payerKey: signers[0]!.publicKey,
|
|
911
|
-
recentBlockhash: blockhash,
|
|
912
|
-
instructions,
|
|
913
|
-
}).compileToV0Message()
|
|
914
|
-
const tx = new VersionedTransaction(msg)
|
|
915
|
-
tx.sign(signers)
|
|
916
|
-
const sig = await connection.sendTransaction(tx)
|
|
917
|
-
await connection.confirmTransaction({ signature: sig, blockhash, lastValidBlockHeight }, commitment)
|
|
918
|
-
return sig
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
/** Poll until the current slot advances past the target slot. */
|
|
922
|
-
async function waitForSlotAdvance(
|
|
923
|
-
connection: Connection,
|
|
924
|
-
targetSlot: number,
|
|
925
|
-
commitment: web3.Commitment = "processed",
|
|
926
|
-
): Promise<void> {
|
|
927
|
-
for (let i = 0; i < 60; i++) {
|
|
928
|
-
const currentSlot = await connection.getSlot(commitment)
|
|
929
|
-
if (currentSlot > targetSlot) return
|
|
930
|
-
await new Promise((r) => setTimeout(r, 400))
|
|
931
|
-
}
|
|
932
|
-
throw new Error("Timed out waiting for slot to advance after ephemeral ALT creation")
|
|
933
|
-
}
|