@kamino-finance/klend-sdk 7.0.12 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@codegen/jupiter_perps/accounts/Custody.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/Custody.js +2 -2
- package/dist/@codegen/jupiter_perps/accounts/Custody.js.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/Perpetuals.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/Perpetuals.js +2 -2
- package/dist/@codegen/jupiter_perps/accounts/Perpetuals.js.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/Pool.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/Pool.js +2 -2
- package/dist/@codegen/jupiter_perps/accounts/Pool.js.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/Position.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/Position.js +2 -2
- package/dist/@codegen/jupiter_perps/accounts/Position.js.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/PositionRequest.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/PositionRequest.js +2 -2
- package/dist/@codegen/jupiter_perps/accounts/PositionRequest.js.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/TestOracle.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/accounts/TestOracle.js +2 -2
- package/dist/@codegen/jupiter_perps/accounts/TestOracle.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/addCustody.d.ts +3 -2
- package/dist/@codegen/jupiter_perps/instructions/addCustody.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/addCustody.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/addCustody.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/addLiquidity.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/addLiquidity.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/addLiquidity.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/addLiquidity.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/addPool.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/addPool.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/addPool.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/addPool.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/closePositionRequest.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/closePositionRequest.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/closePositionRequest.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/closePositionRequest.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/createDecreasePositionRequest.d.ts +3 -2
- package/dist/@codegen/jupiter_perps/instructions/createDecreasePositionRequest.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/createDecreasePositionRequest.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/createDecreasePositionRequest.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/createIncreasePositionRequest.d.ts +3 -2
- package/dist/@codegen/jupiter_perps/instructions/createIncreasePositionRequest.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/createIncreasePositionRequest.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/createIncreasePositionRequest.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/decreasePosition.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/decreasePosition.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/decreasePosition.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/decreasePosition.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/decreasePositionPostSwap.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/decreasePositionPostSwap.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/decreasePositionPostSwap.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/decreasePositionPostSwap.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getAddLiquidityAmountAndFee.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/getAddLiquidityAmountAndFee.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getAddLiquidityAmountAndFee.js +7 -4
- package/dist/@codegen/jupiter_perps/instructions/getAddLiquidityAmountAndFee.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getDecreasePosition.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/getDecreasePosition.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getDecreasePosition.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/getDecreasePosition.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getExactOutSwapAmountAndFees.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/getExactOutSwapAmountAndFees.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getExactOutSwapAmountAndFees.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/getExactOutSwapAmountAndFees.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getIncreasePosition.d.ts +3 -2
- package/dist/@codegen/jupiter_perps/instructions/getIncreasePosition.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getIncreasePosition.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/getIncreasePosition.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getLiquidationState.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/getLiquidationState.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getLiquidationState.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/getLiquidationState.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getOraclePrice.d.ts +3 -2
- package/dist/@codegen/jupiter_perps/instructions/getOraclePrice.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getOraclePrice.js +5 -3
- package/dist/@codegen/jupiter_perps/instructions/getOraclePrice.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getPnl.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/getPnl.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getPnl.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/getPnl.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getRemoveLiquidityAmountAndFee.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/getRemoveLiquidityAmountAndFee.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getRemoveLiquidityAmountAndFee.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/getRemoveLiquidityAmountAndFee.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getSwapAmountAndFees.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/getSwapAmountAndFees.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/getSwapAmountAndFees.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/getSwapAmountAndFees.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/increasePosition.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/increasePosition.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/increasePosition.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/increasePosition.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/increasePositionPreSwap.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/increasePositionPreSwap.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/increasePositionPreSwap.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/increasePositionPreSwap.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/init.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/init.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/init.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/init.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/liquidatePosition.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/liquidatePosition.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/liquidatePosition.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/liquidatePosition.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/removeLiquidity.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/removeLiquidity.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/removeLiquidity.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/removeLiquidity.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setCustodyConfig.d.ts +3 -2
- package/dist/@codegen/jupiter_perps/instructions/setCustodyConfig.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setCustodyConfig.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/setCustodyConfig.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setCustodyGlobalLimit.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/setCustodyGlobalLimit.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setCustodyGlobalLimit.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/setCustodyGlobalLimit.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setPerpetualsConfig.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/setPerpetualsConfig.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setPerpetualsConfig.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/setPerpetualsConfig.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setPoolConfig.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/setPoolConfig.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setPoolConfig.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/setPoolConfig.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setTestOraclePrice.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/setTestOraclePrice.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setTestOraclePrice.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/setTestOraclePrice.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setTestTime.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/setTestTime.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/setTestTime.js +10 -5
- package/dist/@codegen/jupiter_perps/instructions/setTestTime.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/swap.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/swap.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/swap.js +10 -5
- package/dist/@codegen/jupiter_perps/instructions/swap.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/swapExactOut.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/swapExactOut.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/swapExactOut.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/swapExactOut.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/testInit.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/testInit.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/testInit.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/testInit.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/transferAdmin.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/transferAdmin.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/transferAdmin.js +8 -5
- package/dist/@codegen/jupiter_perps/instructions/transferAdmin.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/updateDecreasePositionRequest.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/updateDecreasePositionRequest.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/updateDecreasePositionRequest.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/updateDecreasePositionRequest.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/updateIncreasePositionRequest.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/updateIncreasePositionRequest.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/updateIncreasePositionRequest.js +5 -4
- package/dist/@codegen/jupiter_perps/instructions/updateIncreasePositionRequest.js.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/withdrawFees.d.ts +4 -3
- package/dist/@codegen/jupiter_perps/instructions/withdrawFees.d.ts.map +1 -1
- package/dist/@codegen/jupiter_perps/instructions/withdrawFees.js +10 -5
- package/dist/@codegen/jupiter_perps/instructions/withdrawFees.js.map +1 -1
- package/dist/@codegen/klend/accounts/GlobalConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/GlobalConfig.js +2 -2
- package/dist/@codegen/klend/accounts/GlobalConfig.js.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/LendingMarket.js +2 -2
- package/dist/@codegen/klend/accounts/LendingMarket.js.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Obligation.js +2 -2
- package/dist/@codegen/klend/accounts/Obligation.js.map +1 -1
- package/dist/@codegen/klend/accounts/ReferrerState.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/ReferrerState.js +2 -2
- package/dist/@codegen/klend/accounts/ReferrerState.js.map +1 -1
- package/dist/@codegen/klend/accounts/ReferrerTokenState.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/ReferrerTokenState.js +2 -2
- package/dist/@codegen/klend/accounts/ReferrerTokenState.js.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/Reserve.js +2 -2
- package/dist/@codegen/klend/accounts/Reserve.js.map +1 -1
- package/dist/@codegen/klend/accounts/ShortUrl.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/ShortUrl.js +2 -2
- package/dist/@codegen/klend/accounts/ShortUrl.js.map +1 -1
- package/dist/@codegen/klend/accounts/UserMetadata.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/UserMetadata.js +2 -2
- package/dist/@codegen/klend/accounts/UserMetadata.js.map +1 -1
- package/dist/@codegen/klend/accounts/UserState.d.ts.map +1 -1
- package/dist/@codegen/klend/accounts/UserState.js +2 -2
- package/dist/@codegen/klend/accounts/UserState.js.map +1 -1
- package/dist/@codegen/klend/instructions/borrowObligationLiquidity.d.ts +4 -3
- package/dist/@codegen/klend/instructions/borrowObligationLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/borrowObligationLiquidity.js +8 -5
- package/dist/@codegen/klend/instructions/borrowObligationLiquidity.js.map +1 -1
- package/dist/@codegen/klend/instructions/borrowObligationLiquidityV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/borrowObligationLiquidityV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/borrowObligationLiquidityV2.js +8 -5
- package/dist/@codegen/klend/instructions/borrowObligationLiquidityV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/deleteReferrerStateAndShortUrl.d.ts +3 -2
- package/dist/@codegen/klend/instructions/deleteReferrerStateAndShortUrl.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/deleteReferrerStateAndShortUrl.js +5 -3
- package/dist/@codegen/klend/instructions/deleteReferrerStateAndShortUrl.js.map +1 -1
- package/dist/@codegen/klend/instructions/depositAndWithdraw.d.ts +4 -3
- package/dist/@codegen/klend/instructions/depositAndWithdraw.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/depositAndWithdraw.js +5 -4
- package/dist/@codegen/klend/instructions/depositAndWithdraw.js.map +1 -1
- package/dist/@codegen/klend/instructions/depositObligationCollateral.d.ts +4 -3
- package/dist/@codegen/klend/instructions/depositObligationCollateral.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/depositObligationCollateral.js +8 -5
- package/dist/@codegen/klend/instructions/depositObligationCollateral.js.map +1 -1
- package/dist/@codegen/klend/instructions/depositObligationCollateralV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/depositObligationCollateralV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/depositObligationCollateralV2.js +8 -5
- package/dist/@codegen/klend/instructions/depositObligationCollateralV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/depositReserveLiquidity.d.ts +4 -3
- package/dist/@codegen/klend/instructions/depositReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/depositReserveLiquidity.js +8 -5
- package/dist/@codegen/klend/instructions/depositReserveLiquidity.js.map +1 -1
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateral.d.ts +4 -3
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateral.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateral.js +8 -5
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateral.js.map +1 -1
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateralV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateralV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateralV2.js +10 -5
- package/dist/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateralV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/flashBorrowReserveLiquidity.d.ts +4 -3
- package/dist/@codegen/klend/instructions/flashBorrowReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/flashBorrowReserveLiquidity.js +8 -5
- package/dist/@codegen/klend/instructions/flashBorrowReserveLiquidity.js.map +1 -1
- package/dist/@codegen/klend/instructions/flashRepayReserveLiquidity.d.ts +4 -3
- package/dist/@codegen/klend/instructions/flashRepayReserveLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/flashRepayReserveLiquidity.js +5 -4
- package/dist/@codegen/klend/instructions/flashRepayReserveLiquidity.js.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts +3 -2
- package/dist/@codegen/klend/instructions/idlMissingTypes.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/idlMissingTypes.js +5 -4
- package/dist/@codegen/klend/instructions/idlMissingTypes.js.map +1 -1
- package/dist/@codegen/klend/instructions/initFarmsForReserve.d.ts +4 -3
- package/dist/@codegen/klend/instructions/initFarmsForReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initFarmsForReserve.js +5 -4
- package/dist/@codegen/klend/instructions/initFarmsForReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/initGlobalConfig.d.ts +3 -2
- package/dist/@codegen/klend/instructions/initGlobalConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initGlobalConfig.js +5 -3
- package/dist/@codegen/klend/instructions/initGlobalConfig.js.map +1 -1
- package/dist/@codegen/klend/instructions/initLendingMarket.d.ts +4 -3
- package/dist/@codegen/klend/instructions/initLendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initLendingMarket.js +5 -4
- package/dist/@codegen/klend/instructions/initLendingMarket.js.map +1 -1
- package/dist/@codegen/klend/instructions/initObligation.d.ts +4 -3
- package/dist/@codegen/klend/instructions/initObligation.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initObligation.js +8 -5
- package/dist/@codegen/klend/instructions/initObligation.js.map +1 -1
- package/dist/@codegen/klend/instructions/initObligationFarmsForReserve.d.ts +4 -3
- package/dist/@codegen/klend/instructions/initObligationFarmsForReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initObligationFarmsForReserve.js +8 -5
- package/dist/@codegen/klend/instructions/initObligationFarmsForReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/initReferrerStateAndShortUrl.d.ts +4 -3
- package/dist/@codegen/klend/instructions/initReferrerStateAndShortUrl.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initReferrerStateAndShortUrl.js +8 -5
- package/dist/@codegen/klend/instructions/initReferrerStateAndShortUrl.js.map +1 -1
- package/dist/@codegen/klend/instructions/initReferrerTokenState.d.ts +3 -2
- package/dist/@codegen/klend/instructions/initReferrerTokenState.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initReferrerTokenState.js +5 -3
- package/dist/@codegen/klend/instructions/initReferrerTokenState.js.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.d.ts +3 -2
- package/dist/@codegen/klend/instructions/initReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initReserve.js +5 -3
- package/dist/@codegen/klend/instructions/initReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/initUserMetadata.d.ts +4 -3
- package/dist/@codegen/klend/instructions/initUserMetadata.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/initUserMetadata.js +8 -5
- package/dist/@codegen/klend/instructions/initUserMetadata.js.map +1 -1
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts +4 -3
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.js +5 -4
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.js.map +1 -1
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.js +5 -4
- package/dist/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/markObligationForDeleveraging.d.ts +4 -3
- package/dist/@codegen/klend/instructions/markObligationForDeleveraging.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/markObligationForDeleveraging.js +8 -5
- package/dist/@codegen/klend/instructions/markObligationForDeleveraging.js.map +1 -1
- package/dist/@codegen/klend/instructions/redeemFees.d.ts +3 -2
- package/dist/@codegen/klend/instructions/redeemFees.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/redeemFees.js +5 -3
- package/dist/@codegen/klend/instructions/redeemFees.js.map +1 -1
- package/dist/@codegen/klend/instructions/redeemReserveCollateral.d.ts +4 -3
- package/dist/@codegen/klend/instructions/redeemReserveCollateral.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/redeemReserveCollateral.js +10 -5
- package/dist/@codegen/klend/instructions/redeemReserveCollateral.js.map +1 -1
- package/dist/@codegen/klend/instructions/refreshObligation.d.ts +3 -2
- package/dist/@codegen/klend/instructions/refreshObligation.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/refreshObligation.js +5 -3
- package/dist/@codegen/klend/instructions/refreshObligation.js.map +1 -1
- package/dist/@codegen/klend/instructions/refreshObligationFarmsForReserve.d.ts +4 -3
- package/dist/@codegen/klend/instructions/refreshObligationFarmsForReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/refreshObligationFarmsForReserve.js +8 -5
- package/dist/@codegen/klend/instructions/refreshObligationFarmsForReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/refreshReserve.d.ts +3 -2
- package/dist/@codegen/klend/instructions/refreshReserve.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/refreshReserve.js +5 -3
- package/dist/@codegen/klend/instructions/refreshReserve.js.map +1 -1
- package/dist/@codegen/klend/instructions/refreshReservesBatch.d.ts +4 -3
- package/dist/@codegen/klend/instructions/refreshReservesBatch.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/refreshReservesBatch.js +10 -6
- package/dist/@codegen/klend/instructions/refreshReservesBatch.js.map +1 -1
- package/dist/@codegen/klend/instructions/repayAndWithdrawAndRedeem.d.ts +4 -3
- package/dist/@codegen/klend/instructions/repayAndWithdrawAndRedeem.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/repayAndWithdrawAndRedeem.js +5 -4
- package/dist/@codegen/klend/instructions/repayAndWithdrawAndRedeem.js.map +1 -1
- package/dist/@codegen/klend/instructions/repayObligationLiquidity.d.ts +4 -3
- package/dist/@codegen/klend/instructions/repayObligationLiquidity.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/repayObligationLiquidity.js +8 -5
- package/dist/@codegen/klend/instructions/repayObligationLiquidity.js.map +1 -1
- package/dist/@codegen/klend/instructions/repayObligationLiquidityV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/repayObligationLiquidityV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/repayObligationLiquidityV2.js +8 -5
- package/dist/@codegen/klend/instructions/repayObligationLiquidityV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/requestElevationGroup.d.ts +4 -3
- package/dist/@codegen/klend/instructions/requestElevationGroup.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/requestElevationGroup.js +8 -5
- package/dist/@codegen/klend/instructions/requestElevationGroup.js.map +1 -1
- package/dist/@codegen/klend/instructions/setObligationOrder.d.ts +4 -3
- package/dist/@codegen/klend/instructions/setObligationOrder.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/setObligationOrder.js +5 -4
- package/dist/@codegen/klend/instructions/setObligationOrder.js.map +1 -1
- package/dist/@codegen/klend/instructions/socializeLoss.d.ts +4 -3
- package/dist/@codegen/klend/instructions/socializeLoss.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/socializeLoss.js +8 -5
- package/dist/@codegen/klend/instructions/socializeLoss.js.map +1 -1
- package/dist/@codegen/klend/instructions/socializeLossV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/socializeLossV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/socializeLossV2.js +8 -5
- package/dist/@codegen/klend/instructions/socializeLossV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts +3 -2
- package/dist/@codegen/klend/instructions/updateGlobalConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfig.js +5 -4
- package/dist/@codegen/klend/instructions/updateGlobalConfig.js.map +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfigAdmin.d.ts +3 -2
- package/dist/@codegen/klend/instructions/updateGlobalConfigAdmin.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateGlobalConfigAdmin.js +5 -3
- package/dist/@codegen/klend/instructions/updateGlobalConfigAdmin.js.map +1 -1
- package/dist/@codegen/klend/instructions/updateLendingMarket.d.ts +4 -3
- package/dist/@codegen/klend/instructions/updateLendingMarket.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateLendingMarket.js +5 -4
- package/dist/@codegen/klend/instructions/updateLendingMarket.js.map +1 -1
- package/dist/@codegen/klend/instructions/updateLendingMarketOwner.d.ts +3 -2
- package/dist/@codegen/klend/instructions/updateLendingMarketOwner.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateLendingMarketOwner.js +5 -3
- package/dist/@codegen/klend/instructions/updateLendingMarketOwner.js.map +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts +3 -2
- package/dist/@codegen/klend/instructions/updateReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/updateReserveConfig.js +5 -4
- package/dist/@codegen/klend/instructions/updateReserveConfig.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateral.d.ts +4 -3
- package/dist/@codegen/klend/instructions/withdrawObligationCollateral.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js +8 -5
- package/dist/@codegen/klend/instructions/withdrawObligationCollateral.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts +4 -3
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js +8 -5
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.js +8 -5
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.d.ts +4 -3
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js +10 -5
- package/dist/@codegen/klend/instructions/withdrawObligationCollateralV2.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawProtocolFee.d.ts +4 -3
- package/dist/@codegen/klend/instructions/withdrawProtocolFee.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawProtocolFee.js +8 -5
- package/dist/@codegen/klend/instructions/withdrawProtocolFee.js.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawReferrerFees.d.ts +3 -2
- package/dist/@codegen/klend/instructions/withdrawReferrerFees.d.ts.map +1 -1
- package/dist/@codegen/klend/instructions/withdrawReferrerFees.js +7 -3
- package/dist/@codegen/klend/instructions/withdrawReferrerFees.js.map +1 -1
- package/dist/@codegen/kvault/accounts/Reserve.d.ts.map +1 -1
- package/dist/@codegen/kvault/accounts/Reserve.js +2 -2
- package/dist/@codegen/kvault/accounts/Reserve.js.map +1 -1
- package/dist/@codegen/kvault/accounts/VaultState.d.ts.map +1 -1
- package/dist/@codegen/kvault/accounts/VaultState.js +2 -2
- package/dist/@codegen/kvault/accounts/VaultState.js.map +1 -1
- package/dist/@codegen/kvault/instructions/deposit.d.ts +4 -3
- package/dist/@codegen/kvault/instructions/deposit.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/deposit.js +5 -4
- package/dist/@codegen/kvault/instructions/deposit.js.map +1 -1
- package/dist/@codegen/kvault/instructions/giveUpPendingFees.d.ts +4 -3
- package/dist/@codegen/kvault/instructions/giveUpPendingFees.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/giveUpPendingFees.js +10 -5
- package/dist/@codegen/kvault/instructions/giveUpPendingFees.js.map +1 -1
- package/dist/@codegen/kvault/instructions/initVault.d.ts +3 -2
- package/dist/@codegen/kvault/instructions/initVault.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/initVault.js +5 -3
- package/dist/@codegen/kvault/instructions/initVault.js.map +1 -1
- package/dist/@codegen/kvault/instructions/initializeSharesMetadata.d.ts +4 -3
- package/dist/@codegen/kvault/instructions/initializeSharesMetadata.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/initializeSharesMetadata.js +5 -4
- package/dist/@codegen/kvault/instructions/initializeSharesMetadata.js.map +1 -1
- package/dist/@codegen/kvault/instructions/invest.d.ts +3 -2
- package/dist/@codegen/kvault/instructions/invest.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/invest.js +5 -3
- package/dist/@codegen/kvault/instructions/invest.js.map +1 -1
- package/dist/@codegen/kvault/instructions/removeAllocation.d.ts +3 -2
- package/dist/@codegen/kvault/instructions/removeAllocation.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/removeAllocation.js +5 -3
- package/dist/@codegen/kvault/instructions/removeAllocation.js.map +1 -1
- package/dist/@codegen/kvault/instructions/updateAdmin.d.ts +3 -2
- package/dist/@codegen/kvault/instructions/updateAdmin.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/updateAdmin.js +5 -3
- package/dist/@codegen/kvault/instructions/updateAdmin.js.map +1 -1
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.d.ts +4 -3
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.js +9 -5
- package/dist/@codegen/kvault/instructions/updateReserveAllocation.js.map +1 -1
- package/dist/@codegen/kvault/instructions/updateSharesMetadata.d.ts +4 -3
- package/dist/@codegen/kvault/instructions/updateSharesMetadata.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/updateSharesMetadata.js +7 -4
- package/dist/@codegen/kvault/instructions/updateSharesMetadata.js.map +1 -1
- package/dist/@codegen/kvault/instructions/updateVaultConfig.d.ts +3 -2
- package/dist/@codegen/kvault/instructions/updateVaultConfig.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/updateVaultConfig.js +5 -4
- package/dist/@codegen/kvault/instructions/updateVaultConfig.js.map +1 -1
- package/dist/@codegen/kvault/instructions/withdraw.d.ts +4 -3
- package/dist/@codegen/kvault/instructions/withdraw.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/withdraw.js +5 -4
- package/dist/@codegen/kvault/instructions/withdraw.js.map +1 -1
- package/dist/@codegen/kvault/instructions/withdrawFromAvailable.d.ts +4 -3
- package/dist/@codegen/kvault/instructions/withdrawFromAvailable.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/withdrawFromAvailable.js +8 -5
- package/dist/@codegen/kvault/instructions/withdrawFromAvailable.js.map +1 -1
- package/dist/@codegen/kvault/instructions/withdrawPendingFees.d.ts +3 -2
- package/dist/@codegen/kvault/instructions/withdrawPendingFees.d.ts.map +1 -1
- package/dist/@codegen/kvault/instructions/withdrawPendingFees.js +7 -3
- package/dist/@codegen/kvault/instructions/withdrawPendingFees.js.map +1 -1
- package/dist/@codegen/kvault/types/ReserveConfig.d.ts +51 -10
- package/dist/@codegen/kvault/types/ReserveConfig.d.ts.map +1 -1
- package/dist/@codegen/kvault/types/ReserveConfig.js +33 -14
- package/dist/@codegen/kvault/types/ReserveConfig.js.map +1 -1
- package/dist/@codegen/pyth_rec/accounts/Config.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/accounts/Config.js +2 -2
- package/dist/@codegen/pyth_rec/accounts/Config.js.map +1 -1
- package/dist/@codegen/pyth_rec/accounts/priceUpdateV2.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/accounts/priceUpdateV2.js +2 -2
- package/dist/@codegen/pyth_rec/accounts/priceUpdateV2.js.map +1 -1
- package/dist/@codegen/pyth_rec/accounts/twapUpdate.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/accounts/twapUpdate.js +2 -2
- package/dist/@codegen/pyth_rec/accounts/twapUpdate.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/acceptGovernanceAuthorityTransfer.d.ts +3 -2
- package/dist/@codegen/pyth_rec/instructions/acceptGovernanceAuthorityTransfer.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/acceptGovernanceAuthorityTransfer.js +5 -3
- package/dist/@codegen/pyth_rec/instructions/acceptGovernanceAuthorityTransfer.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/reclaimRent.d.ts +3 -2
- package/dist/@codegen/pyth_rec/instructions/reclaimRent.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/reclaimRent.js +5 -3
- package/dist/@codegen/pyth_rec/instructions/reclaimRent.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/reclaimTwapRent.d.ts +3 -2
- package/dist/@codegen/pyth_rec/instructions/reclaimTwapRent.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/reclaimTwapRent.js +5 -3
- package/dist/@codegen/pyth_rec/instructions/reclaimTwapRent.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/requestGovernanceAuthorityTransfer.d.ts +4 -3
- package/dist/@codegen/pyth_rec/instructions/requestGovernanceAuthorityTransfer.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/requestGovernanceAuthorityTransfer.js +8 -5
- package/dist/@codegen/pyth_rec/instructions/requestGovernanceAuthorityTransfer.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setDataSources.d.ts +4 -3
- package/dist/@codegen/pyth_rec/instructions/setDataSources.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setDataSources.js +5 -4
- package/dist/@codegen/pyth_rec/instructions/setDataSources.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setFee.d.ts +4 -3
- package/dist/@codegen/pyth_rec/instructions/setFee.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setFee.js +8 -5
- package/dist/@codegen/pyth_rec/instructions/setFee.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setMinimumSignatures.d.ts +4 -3
- package/dist/@codegen/pyth_rec/instructions/setMinimumSignatures.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setMinimumSignatures.js +8 -5
- package/dist/@codegen/pyth_rec/instructions/setMinimumSignatures.js.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setWormholeAddress.d.ts +4 -3
- package/dist/@codegen/pyth_rec/instructions/setWormholeAddress.d.ts.map +1 -1
- package/dist/@codegen/pyth_rec/instructions/setWormholeAddress.js +10 -5
- package/dist/@codegen/pyth_rec/instructions/setWormholeAddress.js.map +1 -1
- package/dist/classes/action.d.ts +12 -12
- package/dist/classes/action.d.ts.map +1 -1
- package/dist/classes/action.js +35 -35
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/farm_utils.d.ts +8 -8
- package/dist/classes/farm_utils.d.ts.map +1 -1
- package/dist/classes/farm_utils.js.map +1 -1
- package/dist/classes/manager.d.ts +18 -18
- package/dist/classes/manager.d.ts.map +1 -1
- package/dist/classes/manager.js +3 -3
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts.map +1 -1
- package/dist/classes/market.js +5 -5
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/reserve.d.ts +5 -5
- package/dist/classes/reserve.d.ts.map +1 -1
- package/dist/classes/reserve.js +3 -3
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/vault.d.ts +10 -10
- package/dist/classes/vault.d.ts.map +1 -1
- package/dist/classes/vault.js +13 -13
- package/dist/classes/vault.js.map +1 -1
- package/dist/classes/vault_types.d.ts +25 -25
- package/dist/classes/vault_types.d.ts.map +1 -1
- package/dist/client/tx/multisig.d.ts +2 -2
- package/dist/client/tx/multisig.d.ts.map +1 -1
- package/dist/client/tx/multisig.js.map +1 -1
- package/dist/client/tx/priorityFee.d.ts +3 -3
- package/dist/client/tx/priorityFee.d.ts.map +1 -1
- package/dist/client/tx/priorityFee.js.map +1 -1
- package/dist/client/tx/processor.d.ts +2 -2
- package/dist/client/tx/processor.d.ts.map +1 -1
- package/dist/client/tx/processor.js.map +1 -1
- package/dist/client/tx/simulate.d.ts +2 -2
- package/dist/client/tx/simulate.d.ts.map +1 -1
- package/dist/client/tx/simulate.js.map +1 -1
- package/dist/client/tx/tx.d.ts +2 -2
- package/dist/client/tx/tx.d.ts.map +1 -1
- package/dist/client/tx/tx.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.d.ts +3 -3
- package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.d.ts +3 -3
- package/dist/lending_operations/swap_collateral_operations.d.ts.map +1 -1
- package/dist/lending_operations/swap_collateral_operations.js.map +1 -1
- package/dist/leverage/instructions.d.ts +4 -4
- package/dist/leverage/instructions.d.ts.map +1 -1
- package/dist/leverage/instructions.js +2 -2
- package/dist/leverage/instructions.js.map +1 -1
- package/dist/leverage/operations.d.ts +7 -7
- package/dist/leverage/operations.d.ts.map +1 -1
- package/dist/leverage/operations.js.map +1 -1
- package/dist/leverage/types.d.ts +6 -6
- package/dist/leverage/types.d.ts.map +1 -1
- package/dist/leverage/utils.d.ts +2 -2
- package/dist/leverage/utils.d.ts.map +1 -1
- package/dist/leverage/utils.js.map +1 -1
- package/dist/manager/client_kamino_manager.js +1 -0
- package/dist/manager/client_kamino_manager.js.map +1 -1
- package/dist/manager/tx/multisig.d.ts +2 -2
- package/dist/manager/tx/multisig.d.ts.map +1 -1
- package/dist/manager/tx/multisig.js.map +1 -1
- package/dist/manager/tx/priorityFee.d.ts +3 -3
- package/dist/manager/tx/priorityFee.d.ts.map +1 -1
- package/dist/manager/tx/priorityFee.js.map +1 -1
- package/dist/manager/tx/processor.d.ts +2 -2
- package/dist/manager/tx/processor.d.ts.map +1 -1
- package/dist/manager/tx/processor.js.map +1 -1
- package/dist/manager/tx/simulate.d.ts +2 -2
- package/dist/manager/tx/simulate.d.ts.map +1 -1
- package/dist/manager/tx/simulate.js.map +1 -1
- package/dist/manager/tx/tx.d.ts +2 -2
- package/dist/manager/tx/tx.d.ts.map +1 -1
- package/dist/manager/tx/tx.js.map +1 -1
- package/dist/referrals/instructions.d.ts +4 -4
- package/dist/referrals/instructions.d.ts.map +1 -1
- package/dist/referrals/instructions.js +3 -3
- package/dist/referrals/instructions.js.map +1 -1
- package/dist/utils/ata.d.ts +7 -7
- package/dist/utils/ata.d.ts.map +1 -1
- package/dist/utils/ata.js.map +1 -1
- package/dist/utils/instruction.d.ts +5 -5
- package/dist/utils/instruction.d.ts.map +1 -1
- package/dist/utils/instruction.js.map +1 -1
- package/dist/utils/lookupTable.d.ts +7 -7
- package/dist/utils/lookupTable.d.ts.map +1 -1
- package/dist/utils/lookupTable.js.map +1 -1
- package/dist/utils/metadata.d.ts +3 -3
- package/dist/utils/metadata.d.ts.map +1 -1
- package/dist/utils/userMetadata.d.ts +2 -2
- package/dist/utils/userMetadata.d.ts.map +1 -1
- package/dist/utils/userMetadata.js +1 -1
- package/dist/utils/userMetadata.js.map +1 -1
- package/package.json +9 -9
- package/src/@codegen/jupiter_perps/accounts/Custody.ts +6 -2
- package/src/@codegen/jupiter_perps/accounts/Perpetuals.ts +6 -2
- package/src/@codegen/jupiter_perps/accounts/Pool.ts +6 -2
- package/src/@codegen/jupiter_perps/accounts/Position.ts +6 -2
- package/src/@codegen/jupiter_perps/accounts/PositionRequest.ts +6 -2
- package/src/@codegen/jupiter_perps/accounts/TestOracle.ts +6 -2
- package/src/@codegen/jupiter_perps/instructions/addCustody.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/addLiquidity.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/addPool.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/closePositionRequest.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/createDecreasePositionRequest.ts +10 -7
- package/src/@codegen/jupiter_perps/instructions/createIncreasePositionRequest.ts +10 -7
- package/src/@codegen/jupiter_perps/instructions/decreasePosition.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/decreasePositionPostSwap.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/getAddLiquidityAmountAndFee.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/getDecreasePosition.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/getExactOutSwapAmountAndFees.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/getIncreasePosition.ts +10 -7
- package/src/@codegen/jupiter_perps/instructions/getLiquidationState.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/getOraclePrice.ts +10 -7
- package/src/@codegen/jupiter_perps/instructions/getPnl.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/getRemoveLiquidityAmountAndFee.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/getSwapAmountAndFees.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/increasePosition.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/increasePositionPreSwap.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/init.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/liquidatePosition.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/removeLiquidity.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/setCustodyConfig.ts +10 -7
- package/src/@codegen/jupiter_perps/instructions/setCustodyGlobalLimit.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/setPerpetualsConfig.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/setPoolConfig.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/setTestOraclePrice.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/setTestTime.ts +15 -8
- package/src/@codegen/jupiter_perps/instructions/swap.ts +15 -8
- package/src/@codegen/jupiter_perps/instructions/swapExactOut.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/testInit.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/transferAdmin.ts +13 -8
- package/src/@codegen/jupiter_perps/instructions/updateDecreasePositionRequest.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/updateIncreasePositionRequest.ts +11 -8
- package/src/@codegen/jupiter_perps/instructions/withdrawFees.ts +15 -8
- package/src/@codegen/klend/accounts/GlobalConfig.ts +6 -2
- package/src/@codegen/klend/accounts/LendingMarket.ts +6 -2
- package/src/@codegen/klend/accounts/Obligation.ts +6 -2
- package/src/@codegen/klend/accounts/ReferrerState.ts +6 -2
- package/src/@codegen/klend/accounts/ReferrerTokenState.ts +6 -2
- package/src/@codegen/klend/accounts/Reserve.ts +6 -2
- package/src/@codegen/klend/accounts/ShortUrl.ts +6 -2
- package/src/@codegen/klend/accounts/UserMetadata.ts +6 -2
- package/src/@codegen/klend/accounts/UserState.ts +6 -2
- package/src/@codegen/klend/instructions/borrowObligationLiquidity.ts +13 -8
- package/src/@codegen/klend/instructions/borrowObligationLiquidityV2.ts +13 -8
- package/src/@codegen/klend/instructions/deleteReferrerStateAndShortUrl.ts +10 -7
- package/src/@codegen/klend/instructions/depositAndWithdraw.ts +11 -8
- package/src/@codegen/klend/instructions/depositObligationCollateral.ts +13 -8
- package/src/@codegen/klend/instructions/depositObligationCollateralV2.ts +13 -8
- package/src/@codegen/klend/instructions/depositReserveLiquidity.ts +13 -8
- package/src/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateral.ts +14 -8
- package/src/@codegen/klend/instructions/depositReserveLiquidityAndObligationCollateralV2.ts +16 -8
- package/src/@codegen/klend/instructions/flashBorrowReserveLiquidity.ts +13 -8
- package/src/@codegen/klend/instructions/flashRepayReserveLiquidity.ts +11 -8
- package/src/@codegen/klend/instructions/idlMissingTypes.ts +10 -7
- package/src/@codegen/klend/instructions/initFarmsForReserve.ts +11 -8
- package/src/@codegen/klend/instructions/initGlobalConfig.ts +10 -7
- package/src/@codegen/klend/instructions/initLendingMarket.ts +11 -8
- package/src/@codegen/klend/instructions/initObligation.ts +13 -8
- package/src/@codegen/klend/instructions/initObligationFarmsForReserve.ts +13 -8
- package/src/@codegen/klend/instructions/initReferrerStateAndShortUrl.ts +13 -8
- package/src/@codegen/klend/instructions/initReferrerTokenState.ts +10 -7
- package/src/@codegen/klend/instructions/initReserve.ts +10 -7
- package/src/@codegen/klend/instructions/initUserMetadata.ts +13 -8
- package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateral.ts +16 -12
- package/src/@codegen/klend/instructions/liquidateObligationAndRedeemReserveCollateralV2.ts +16 -12
- package/src/@codegen/klend/instructions/markObligationForDeleveraging.ts +13 -8
- package/src/@codegen/klend/instructions/redeemFees.ts +10 -7
- package/src/@codegen/klend/instructions/redeemReserveCollateral.ts +15 -8
- package/src/@codegen/klend/instructions/refreshObligation.ts +10 -7
- package/src/@codegen/klend/instructions/refreshObligationFarmsForReserve.ts +13 -8
- package/src/@codegen/klend/instructions/refreshReserve.ts +10 -7
- package/src/@codegen/klend/instructions/refreshReservesBatch.ts +14 -8
- package/src/@codegen/klend/instructions/repayAndWithdrawAndRedeem.ts +11 -8
- package/src/@codegen/klend/instructions/repayObligationLiquidity.ts +13 -8
- package/src/@codegen/klend/instructions/repayObligationLiquidityV2.ts +13 -8
- package/src/@codegen/klend/instructions/requestElevationGroup.ts +13 -8
- package/src/@codegen/klend/instructions/setObligationOrder.ts +11 -8
- package/src/@codegen/klend/instructions/socializeLoss.ts +13 -8
- package/src/@codegen/klend/instructions/socializeLossV2.ts +13 -8
- package/src/@codegen/klend/instructions/updateGlobalConfig.ts +10 -7
- package/src/@codegen/klend/instructions/updateGlobalConfigAdmin.ts +10 -7
- package/src/@codegen/klend/instructions/updateLendingMarket.ts +11 -8
- package/src/@codegen/klend/instructions/updateLendingMarketOwner.ts +10 -7
- package/src/@codegen/klend/instructions/updateReserveConfig.ts +10 -7
- package/src/@codegen/klend/instructions/withdrawObligationCollateral.ts +13 -8
- package/src/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.ts +14 -8
- package/src/@codegen/klend/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.ts +14 -8
- package/src/@codegen/klend/instructions/withdrawObligationCollateralV2.ts +15 -8
- package/src/@codegen/klend/instructions/withdrawProtocolFee.ts +13 -8
- package/src/@codegen/klend/instructions/withdrawReferrerFees.ts +12 -7
- package/src/@codegen/kvault/accounts/Reserve.ts +6 -2
- package/src/@codegen/kvault/accounts/VaultState.ts +6 -2
- package/src/@codegen/kvault/instructions/deposit.ts +11 -8
- package/src/@codegen/kvault/instructions/giveUpPendingFees.ts +15 -8
- package/src/@codegen/kvault/instructions/initVault.ts +10 -7
- package/src/@codegen/kvault/instructions/initializeSharesMetadata.ts +11 -8
- package/src/@codegen/kvault/instructions/invest.ts +10 -7
- package/src/@codegen/kvault/instructions/removeAllocation.ts +10 -7
- package/src/@codegen/kvault/instructions/updateAdmin.ts +10 -7
- package/src/@codegen/kvault/instructions/updateReserveAllocation.ts +14 -8
- package/src/@codegen/kvault/instructions/updateSharesMetadata.ts +13 -8
- package/src/@codegen/kvault/instructions/updateVaultConfig.ts +10 -7
- package/src/@codegen/kvault/instructions/withdraw.ts +11 -8
- package/src/@codegen/kvault/instructions/withdrawFromAvailable.ts +13 -8
- package/src/@codegen/kvault/instructions/withdrawPendingFees.ts +12 -7
- package/src/@codegen/kvault/types/ReserveConfig.ts +63 -18
- package/src/@codegen/pyth_rec/accounts/Config.ts +6 -2
- package/src/@codegen/pyth_rec/accounts/priceUpdateV2.ts +6 -2
- package/src/@codegen/pyth_rec/accounts/twapUpdate.ts +6 -2
- package/src/@codegen/pyth_rec/instructions/acceptGovernanceAuthorityTransfer.ts +10 -7
- package/src/@codegen/pyth_rec/instructions/reclaimRent.ts +10 -7
- package/src/@codegen/pyth_rec/instructions/reclaimTwapRent.ts +10 -7
- package/src/@codegen/pyth_rec/instructions/requestGovernanceAuthorityTransfer.ts +13 -8
- package/src/@codegen/pyth_rec/instructions/setDataSources.ts +11 -8
- package/src/@codegen/pyth_rec/instructions/setFee.ts +13 -8
- package/src/@codegen/pyth_rec/instructions/setMinimumSignatures.ts +13 -8
- package/src/@codegen/pyth_rec/instructions/setWormholeAddress.ts +15 -8
- package/src/classes/action.ts +73 -41
- package/src/classes/farm_utils.ts +9 -9
- package/src/classes/manager.ts +25 -25
- package/src/classes/market.ts +17 -5
- package/src/classes/reserve.ts +8 -8
- package/src/classes/vault.ts +51 -44
- package/src/classes/vault_types.ts +25 -25
- package/src/client/tx/multisig.ts +2 -2
- package/src/client/tx/priorityFee.ts +3 -3
- package/src/client/tx/processor.ts +2 -2
- package/src/client/tx/simulate.ts +2 -2
- package/src/client/tx/tx.ts +2 -2
- package/src/lending_operations/repay_with_collateral_operations.ts +4 -4
- package/src/lending_operations/swap_collateral_operations.ts +16 -16
- package/src/leverage/instructions.ts +2 -2
- package/src/leverage/operations.ts +13 -13
- package/src/leverage/types.ts +6 -6
- package/src/leverage/utils.ts +3 -3
- package/src/manager/client_kamino_manager.ts +5 -3
- package/src/manager/tx/multisig.ts +2 -2
- package/src/manager/tx/priorityFee.ts +3 -3
- package/src/manager/tx/processor.ts +2 -2
- package/src/manager/tx/simulate.ts +2 -2
- package/src/manager/tx/tx.ts +2 -2
- package/src/referrals/instructions.ts +6 -3
- package/src/utils/ata.ts +11 -11
- package/src/utils/instruction.ts +6 -6
- package/src/utils/lookupTable.ts +8 -8
- package/src/utils/metadata.ts +3 -3
- package/src/utils/userMetadata.ts +4 -3
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
uniqueAccountsWithProgramIds,
|
|
24
24
|
WRAPPED_SOL_MINT,
|
|
25
25
|
} from '../utils';
|
|
26
|
-
import { Account, Address,
|
|
26
|
+
import { Account, Address, Instruction, isSome, none, Option, Slot, TransactionSigner } from '@solana/kit';
|
|
27
27
|
import Decimal from 'decimal.js';
|
|
28
28
|
import { TOKEN_PROGRAM_ADDRESS } from '@solana-program/token';
|
|
29
29
|
import { AddressLookupTable } from '@solana-program/address-lookup-table';
|
|
@@ -69,7 +69,7 @@ export interface SwapCollIxsInputs<QuoteResponse> {
|
|
|
69
69
|
obligation: KaminoObligation;
|
|
70
70
|
referrer: Option<Address>;
|
|
71
71
|
currentSlot: Slot;
|
|
72
|
-
budgetAndPriorityFeeIxs?:
|
|
72
|
+
budgetAndPriorityFeeIxs?: Instruction[];
|
|
73
73
|
scopeRefreshConfig?: ScopePriceRefreshConfig;
|
|
74
74
|
useV2Ixs: boolean;
|
|
75
75
|
quoter: SwapQuoteProvider<QuoteResponse>;
|
|
@@ -84,7 +84,7 @@ export interface SwapCollIxsOutputs<QuoteResponse> {
|
|
|
84
84
|
/**
|
|
85
85
|
* Instructions for on-chain execution.
|
|
86
86
|
*/
|
|
87
|
-
ixs:
|
|
87
|
+
ixs: Instruction[];
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Required LUTs.
|
|
@@ -217,7 +217,7 @@ type SwapCollArgs = {
|
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
type SwapCollContext<QuoteResponse> = {
|
|
220
|
-
budgetAndPriorityFeeIxs:
|
|
220
|
+
budgetAndPriorityFeeIxs: Instruction[];
|
|
221
221
|
market: KaminoMarket;
|
|
222
222
|
sourceCollReserve: KaminoReserve;
|
|
223
223
|
targetCollReserve: KaminoReserve;
|
|
@@ -269,12 +269,12 @@ function extractArgsAndContext<QuoteResponse>(
|
|
|
269
269
|
const FAKE_TARGET_COLL_SWAP_OUT_AMOUNT = new Decimal(1); // see the lengthy `getSwapCollIxs()` impl comment
|
|
270
270
|
|
|
271
271
|
type SwapCollKlendIxs = {
|
|
272
|
-
setupIxs:
|
|
273
|
-
targetCollFlashBorrowIx:
|
|
274
|
-
depositTargetCollIxs:
|
|
275
|
-
withdrawSourceCollIxs:
|
|
276
|
-
targetCollFlashRepayIx:
|
|
277
|
-
cleanupIxs:
|
|
272
|
+
setupIxs: Instruction[];
|
|
273
|
+
targetCollFlashBorrowIx: Instruction;
|
|
274
|
+
depositTargetCollIxs: Instruction[];
|
|
275
|
+
withdrawSourceCollIxs: Instruction[];
|
|
276
|
+
targetCollFlashRepayIx: Instruction;
|
|
277
|
+
cleanupIxs: Instruction[];
|
|
278
278
|
flashLoanInfo: FlashLoanInfo;
|
|
279
279
|
simulationDetails: {
|
|
280
280
|
targetCollFlashBorrowedAmount: Decimal;
|
|
@@ -285,7 +285,7 @@ async function getKlendIxs(
|
|
|
285
285
|
args: SwapCollArgs,
|
|
286
286
|
targetCollSwapOutAmount: Decimal,
|
|
287
287
|
context: SwapCollContext<any>,
|
|
288
|
-
scopeRefreshIx:
|
|
288
|
+
scopeRefreshIx: Instruction[]
|
|
289
289
|
): Promise<SwapCollKlendIxs> {
|
|
290
290
|
const { ataCreationIxs, targetCollAta } = await getAtaCreationIxs(context);
|
|
291
291
|
const setupIxs = [...context.budgetAndPriorityFeeIxs, ...ataCreationIxs];
|
|
@@ -361,7 +361,7 @@ async function getAtaCreationIxs(context: SwapCollContext<any>) {
|
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
async function getAtaCloseIxs(context: SwapCollContext<any>) {
|
|
364
|
-
const ataCloseIxs:
|
|
364
|
+
const ataCloseIxs: Instruction[] = [];
|
|
365
365
|
if (
|
|
366
366
|
context.sourceCollReserve.getLiquidityMint() === WRAPPED_SOL_MINT ||
|
|
367
367
|
context.targetCollReserve.getLiquidityMint() === WRAPPED_SOL_MINT
|
|
@@ -402,7 +402,7 @@ async function getTargetCollFlashLoanIxs(
|
|
|
402
402
|
|
|
403
403
|
type DepositTargetCollIxs = {
|
|
404
404
|
removesElevationGroup: boolean;
|
|
405
|
-
ixs:
|
|
405
|
+
ixs: Instruction[];
|
|
406
406
|
};
|
|
407
407
|
|
|
408
408
|
async function getDepositTargetCollIxs(
|
|
@@ -454,7 +454,7 @@ async function getWithdrawSourceCollIxs(
|
|
|
454
454
|
args: SwapCollArgs,
|
|
455
455
|
depositRemovedElevationGroup: boolean,
|
|
456
456
|
context: SwapCollContext<any>
|
|
457
|
-
): Promise<
|
|
457
|
+
): Promise<Instruction[]> {
|
|
458
458
|
const withdrawnSourceCollLamports = args.isClosingSourceColl
|
|
459
459
|
? U64_MAX
|
|
460
460
|
: args.sourceCollSwapAmount.mul(context.sourceCollReserve.getMintFactor()).toString();
|
|
@@ -513,7 +513,7 @@ function elevationGroupIdToRequestAfterWithdraw(
|
|
|
513
513
|
|
|
514
514
|
type ExternalSwapIxs<QuoteResponse> = {
|
|
515
515
|
swapOutAmount: Decimal;
|
|
516
|
-
ixs:
|
|
516
|
+
ixs: Instruction[];
|
|
517
517
|
luts: Account<AddressLookupTable>[];
|
|
518
518
|
simulationDetails: {
|
|
519
519
|
quoteResponse?: QuoteResponse;
|
|
@@ -617,7 +617,7 @@ function checkResultingObligationValid(
|
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
-
function listIxs(klendIxs: SwapCollKlendIxs, externalSwapIxs?:
|
|
620
|
+
function listIxs(klendIxs: SwapCollKlendIxs, externalSwapIxs?: Instruction[]): Instruction[] {
|
|
621
621
|
return [
|
|
622
622
|
...klendIxs.setupIxs,
|
|
623
623
|
klendIxs.targetCollFlashBorrowIx,
|
|
@@ -90,7 +90,7 @@ export const getBorrowFlashLoanInstruction = ({
|
|
|
90
90
|
tokenProgram: reserve.getLiquidityTokenProgram(),
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
return flashBorrowReserveLiquidity(args, accounts, programId);
|
|
93
|
+
return flashBorrowReserveLiquidity(args, accounts, undefined, programId);
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
export const getRepayFlashLoanInstruction = ({
|
|
@@ -136,5 +136,5 @@ export const getRepayFlashLoanInstruction = ({
|
|
|
136
136
|
tokenProgram: reserve.getLiquidityTokenProgram(),
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
return flashRepayReserveLiquidity(args, accounts, programId);
|
|
139
|
+
return flashRepayReserveLiquidity(args, accounts, undefined, programId);
|
|
140
140
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address,
|
|
1
|
+
import { Address, Instruction, Slot, Option, none, TransactionSigner, lamports } from '@solana/kit';
|
|
2
2
|
import Decimal from 'decimal.js';
|
|
3
3
|
import {
|
|
4
4
|
KaminoAction,
|
|
@@ -431,7 +431,7 @@ async function buildDepositWithLeverageIxs<QuoteResponse>(
|
|
|
431
431
|
depositTokenIsSol: boolean,
|
|
432
432
|
scopeRefreshConfig: ScopePriceRefreshConfig | undefined,
|
|
433
433
|
calcs: DepositLeverageCalcsResult,
|
|
434
|
-
budgetAndPriorityFeeIxs:
|
|
434
|
+
budgetAndPriorityFeeIxs: Instruction[] | undefined,
|
|
435
435
|
swapQuoteIxsArray: SwapIxs<QuoteResponse>[],
|
|
436
436
|
strategy: StrategyWithAddress | undefined,
|
|
437
437
|
collIsKtoken: boolean,
|
|
@@ -468,7 +468,7 @@ async function buildDepositWithLeverageIxs<QuoteResponse>(
|
|
|
468
468
|
budgetAndPriorityFeeIxs
|
|
469
469
|
);
|
|
470
470
|
|
|
471
|
-
const fillWsolAtaIxs:
|
|
471
|
+
const fillWsolAtaIxs: Instruction[] = [];
|
|
472
472
|
if (depositTokenIsSol) {
|
|
473
473
|
fillWsolAtaIxs.push(
|
|
474
474
|
...getTransferWsolIxs(
|
|
@@ -816,7 +816,7 @@ export async function buildWithdrawWithLeverageIxs<QuoteResponse>(
|
|
|
816
816
|
depositTokenIsSol: boolean,
|
|
817
817
|
scopeRefreshConfig: ScopePriceRefreshConfig | undefined,
|
|
818
818
|
calcs: WithdrawLeverageCalcsResult,
|
|
819
|
-
budgetAndPriorityFeeIxs:
|
|
819
|
+
budgetAndPriorityFeeIxs: Instruction[] | undefined,
|
|
820
820
|
swapQuoteIxsArray: SwapIxs<QuoteResponse>[],
|
|
821
821
|
strategy: StrategyWithAddress | undefined,
|
|
822
822
|
collIsKtoken: boolean,
|
|
@@ -845,7 +845,7 @@ export async function buildWithdrawWithLeverageIxs<QuoteResponse>(
|
|
|
845
845
|
budgetAndPriorityFeeIxs
|
|
846
846
|
);
|
|
847
847
|
|
|
848
|
-
const closeWsolAtaIxs:
|
|
848
|
+
const closeWsolAtaIxs: Instruction[] = [];
|
|
849
849
|
if (depositTokenIsSol || debtTokenMint === WRAPPED_SOL_MINT) {
|
|
850
850
|
const wsolAta = await getAssociatedTokenAddress(WRAPPED_SOL_MINT, owner.address);
|
|
851
851
|
closeWsolAtaIxs.push(
|
|
@@ -862,7 +862,7 @@ export async function buildWithdrawWithLeverageIxs<QuoteResponse>(
|
|
|
862
862
|
|
|
863
863
|
// TODO: Mihai/Marius check if we can improve this logic and not convert any SOL
|
|
864
864
|
// This is here so that we have enough wsol to repay in case the kAB swapped to sol after estimates is not enough
|
|
865
|
-
const fillWsolAtaIxs:
|
|
865
|
+
const fillWsolAtaIxs: Instruction[] = [];
|
|
866
866
|
if (debtTokenMint === WRAPPED_SOL_MINT) {
|
|
867
867
|
const halfSolBalance =
|
|
868
868
|
Number.parseInt((await market.getRpc().getBalance(owner.address).send()).value.toString()) / LAMPORTS_PER_SOL / 2;
|
|
@@ -1390,7 +1390,7 @@ async function buildIncreaseLeverageIxs<QuoteResponse>(
|
|
|
1390
1390
|
scopeRefreshConfig: ScopePriceRefreshConfig | undefined,
|
|
1391
1391
|
collIsKtoken: boolean,
|
|
1392
1392
|
swapQuoteIxsArray: SwapIxs<QuoteResponse>[],
|
|
1393
|
-
budgetAndPriorityFeeIxs:
|
|
1393
|
+
budgetAndPriorityFeeIxs: Instruction[] | undefined,
|
|
1394
1394
|
useV2Ixs: boolean
|
|
1395
1395
|
): Promise<LeverageIxsOutput[]> {
|
|
1396
1396
|
const collReserve = kaminoMarket.getExistingReserveByMint(collTokenMint);
|
|
@@ -1510,7 +1510,7 @@ async function buildDecreaseLeverageIxs<QuoteResponse>(
|
|
|
1510
1510
|
scopeRefreshConfig: ScopePriceRefreshConfig | undefined,
|
|
1511
1511
|
collIsKtoken: boolean,
|
|
1512
1512
|
swapQuoteIxsArray: SwapIxs<QuoteResponse>[],
|
|
1513
|
-
budgetAndPriorityFeeIxs:
|
|
1513
|
+
budgetAndPriorityFeeIxs: Instruction[] | undefined,
|
|
1514
1514
|
useV2Ixs: boolean,
|
|
1515
1515
|
withdrawSlotOffset: number = WITHDRAW_SLOT_OFFSET
|
|
1516
1516
|
): Promise<LeverageIxsOutput[]> {
|
|
@@ -1539,8 +1539,8 @@ async function buildDecreaseLeverageIxs<QuoteResponse>(
|
|
|
1539
1539
|
|
|
1540
1540
|
// TODO: Mihai/Marius check if we can improve this logic and not convert any SOL
|
|
1541
1541
|
// This is here so that we have enough wsol to repay in case the kAB swapped to sol after estimates is not enough
|
|
1542
|
-
const closeWsolAtaIxs:
|
|
1543
|
-
const fillWsolAtaIxs:
|
|
1542
|
+
const closeWsolAtaIxs: Instruction[] = [];
|
|
1543
|
+
const fillWsolAtaIxs: Instruction[] = [];
|
|
1544
1544
|
if (debtTokenMint === WRAPPED_SOL_MINT) {
|
|
1545
1545
|
const wsolAta = await getAssociatedTokenAddress(WRAPPED_SOL_MINT, owner.address);
|
|
1546
1546
|
|
|
@@ -1660,7 +1660,7 @@ export const getSetupIxs = async (
|
|
|
1660
1660
|
debtReserve: KaminoReserve,
|
|
1661
1661
|
strategy: StrategyWithAddress | undefined,
|
|
1662
1662
|
scopeRefreshConfig: ScopePriceRefreshConfig | undefined,
|
|
1663
|
-
budgetAndPriorityFeeIxs:
|
|
1663
|
+
budgetAndPriorityFeeIxs: Instruction[] | undefined
|
|
1664
1664
|
) => {
|
|
1665
1665
|
const budgetIxs = budgetAndPriorityFeeIxs || getComputeBudgetAndPriorityFeeIxs(3000000);
|
|
1666
1666
|
|
|
@@ -1696,7 +1696,7 @@ export const getScopeRefreshIx = async (
|
|
|
1696
1696
|
debtReserve: KaminoReserve,
|
|
1697
1697
|
obligation: KaminoObligation | ObligationType | undefined,
|
|
1698
1698
|
scopeRefreshConfig: ScopePriceRefreshConfig | undefined
|
|
1699
|
-
): Promise<
|
|
1699
|
+
): Promise<Instruction[]> => {
|
|
1700
1700
|
const allReserves =
|
|
1701
1701
|
obligation && isKaminoObligation(obligation)
|
|
1702
1702
|
? [
|
|
@@ -1709,7 +1709,7 @@ export const getScopeRefreshIx = async (
|
|
|
1709
1709
|
]
|
|
1710
1710
|
: [...new Set<Address>([collReserve.address, debtReserve.address])];
|
|
1711
1711
|
|
|
1712
|
-
const scopeRefreshIxs:
|
|
1712
|
+
const scopeRefreshIxs: Instruction[] = [];
|
|
1713
1713
|
const scopeTokensMap = getTokenIdsForScopeRefresh(market, allReserves);
|
|
1714
1714
|
|
|
1715
1715
|
if (scopeTokensMap.size > 0 && scopeRefreshConfig) {
|
package/src/leverage/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, Address,
|
|
1
|
+
import { Account, Address, Instruction, Option, Slot, TransactionSigner } from '@solana/kit';
|
|
2
2
|
import Decimal from 'decimal.js';
|
|
3
3
|
import { KaminoMarket, KaminoObligation } from '../classes';
|
|
4
4
|
import { Kamino, StrategyWithAddress } from '@kamino-finance/kliquidity-sdk';
|
|
@@ -22,8 +22,8 @@ export type SwapQuote<QuoteResponse> = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export type SwapIxs<QuoteResponse> = {
|
|
25
|
-
preActionIxs:
|
|
26
|
-
swapIxs:
|
|
25
|
+
preActionIxs: Instruction[];
|
|
26
|
+
swapIxs: Instruction[];
|
|
27
27
|
lookupTables: Account<AddressLookupTable>[];
|
|
28
28
|
quote: SwapQuote<QuoteResponse>;
|
|
29
29
|
};
|
|
@@ -38,7 +38,7 @@ export type FlashLoanInfo = {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export type LeverageIxsOutput = {
|
|
41
|
-
instructions:
|
|
41
|
+
instructions: Instruction[];
|
|
42
42
|
flashLoanInfo: FlashLoanInfo;
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -51,7 +51,7 @@ export type SwapInputs = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export type BaseLeverageIxsResponse<QuoteResponse> = {
|
|
54
|
-
ixs:
|
|
54
|
+
ixs: Instruction[];
|
|
55
55
|
lookupTables: Account<AddressLookupTable>[];
|
|
56
56
|
swapInputs: SwapInputs;
|
|
57
57
|
flashLoanInfo: FlashLoanInfo;
|
|
@@ -76,7 +76,7 @@ export interface BaseLeverageSwapInputsProps<QuoteResponse> {
|
|
|
76
76
|
referrer: Option<Address>;
|
|
77
77
|
currentSlot: Slot;
|
|
78
78
|
slippagePct: Decimal;
|
|
79
|
-
budgetAndPriorityFeeIxs?:
|
|
79
|
+
budgetAndPriorityFeeIxs?: Instruction[];
|
|
80
80
|
kamino: Kamino | undefined;
|
|
81
81
|
scopeRefreshConfig?: ScopePriceRefreshConfig;
|
|
82
82
|
quoteBufferBps: Decimal;
|
package/src/leverage/utils.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Kamino, StrategyWithAddress } from '@kamino-finance/kliquidity-sdk';
|
|
|
2
2
|
import { KaminoMarket, KaminoReserve, lamportsToNumberDecimal } from '../classes';
|
|
3
3
|
import {
|
|
4
4
|
Address,
|
|
5
|
-
|
|
5
|
+
Instruction,
|
|
6
6
|
GetAccountInfoApi,
|
|
7
7
|
Rpc,
|
|
8
8
|
GetTokenAccountBalanceApi,
|
|
@@ -22,7 +22,7 @@ export interface KaminoSwapperIxBuilder {
|
|
|
22
22
|
owner: TransactionSigner,
|
|
23
23
|
slippage: Decimal,
|
|
24
24
|
allKeys: Address[]
|
|
25
|
-
): Promise<[
|
|
25
|
+
): Promise<[Instruction[], Address[]]>;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface DepositAmountsForSwap {
|
|
@@ -286,7 +286,7 @@ export function swapProviderToKaminoSwapProvider<QuoteResponse>(
|
|
|
286
286
|
_owner: TransactionSigner,
|
|
287
287
|
_slippage: Decimal,
|
|
288
288
|
_allKeys: Address[]
|
|
289
|
-
): Promise<[
|
|
289
|
+
): Promise<[Instruction[], Address[]]> => {
|
|
290
290
|
if (input.tokenBToSwapAmount.lt(0)) {
|
|
291
291
|
const swapperIxsArray = await swapper(
|
|
292
292
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import dotenv from 'dotenv';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import { Address, address,
|
|
3
|
+
import { Address, address, Instruction } from '@solana/kit';
|
|
4
4
|
import {
|
|
5
5
|
AssetReserveConfigCli,
|
|
6
6
|
calculateAPYFromAPR,
|
|
@@ -1184,7 +1184,7 @@ async function main() {
|
|
|
1184
1184
|
const instructions = await kaminoManager.investAllReservesIxs(payer, kaminoVault);
|
|
1185
1185
|
|
|
1186
1186
|
for (let i = 0; i < instructions.length; i++) {
|
|
1187
|
-
const txInstructions:
|
|
1187
|
+
const txInstructions: Instruction[] = [];
|
|
1188
1188
|
txInstructions.push();
|
|
1189
1189
|
await processTx(
|
|
1190
1190
|
env.c,
|
|
@@ -1425,6 +1425,8 @@ async function main() {
|
|
|
1425
1425
|
|
|
1426
1426
|
const walletAddress = address(wallet);
|
|
1427
1427
|
const userShares = await kaminoManager.getUserSharesBalanceAllVaults(walletAddress);
|
|
1428
|
+
|
|
1429
|
+
console.log(`${userShares.size} positions for wallet ${walletAddress}`);
|
|
1428
1430
|
userShares.forEach((userShares, vaultAddress) => {
|
|
1429
1431
|
console.log(
|
|
1430
1432
|
`User shares for vault ${vaultAddress}: staked shares ${userShares.stakedShares} unstaked shares ${userShares.unstakedShares} total shares ${userShares.totalShares}`
|
|
@@ -2168,7 +2170,7 @@ async function createUpdateReserveConfigLutIxs(
|
|
|
2168
2170
|
env: ManagerEnv,
|
|
2169
2171
|
lendingMarketAddress: Address,
|
|
2170
2172
|
reserveAddress: Address
|
|
2171
|
-
): Promise<[Address,
|
|
2173
|
+
): Promise<[Address, Instruction[]]> {
|
|
2172
2174
|
const globalConfigAddress = await globalConfigPda(env.klendProgramId);
|
|
2173
2175
|
const contents = [globalConfigAddress, lendingMarketAddress, reserveAddress];
|
|
2174
2176
|
const signer = await env.getSigner();
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createTransactionMessage,
|
|
7
7
|
getBase58Decoder,
|
|
8
8
|
getCompiledTransactionMessageEncoder,
|
|
9
|
-
|
|
9
|
+
Instruction,
|
|
10
10
|
pipe,
|
|
11
11
|
setTransactionMessageFeePayer,
|
|
12
12
|
setTransactionMessageLifetimeUsingBlockhash,
|
|
@@ -20,7 +20,7 @@ const base58Decoder = getBase58Decoder();
|
|
|
20
20
|
|
|
21
21
|
export async function printMultisigTx(
|
|
22
22
|
payer: TransactionSigner,
|
|
23
|
-
ixs:
|
|
23
|
+
ixs: Instruction[],
|
|
24
24
|
luts: Account<AddressLookupTable>[] = []
|
|
25
25
|
) {
|
|
26
26
|
const lutsByAddress: AddressesByLookupTableAddress = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Instruction } from '@solana/kit';
|
|
2
2
|
import {
|
|
3
3
|
COMPUTE_BUDGET_PROGRAM_ADDRESS,
|
|
4
4
|
getSetComputeUnitLimitInstruction,
|
|
@@ -13,7 +13,7 @@ export function getPriorityFeeAndCuIxs({
|
|
|
13
13
|
}: {
|
|
14
14
|
priorityFeeMultiplier: number;
|
|
15
15
|
computeUnits?: number;
|
|
16
|
-
}):
|
|
16
|
+
}): Instruction[] {
|
|
17
17
|
const microLamportsPrioritizationFee = microLamport / computeUnits;
|
|
18
18
|
return [
|
|
19
19
|
getSetComputeUnitLimitInstruction({ units: computeUnits }),
|
|
@@ -23,7 +23,7 @@ export function getPriorityFeeAndCuIxs({
|
|
|
23
23
|
];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export function removeComputeBudgetProgramInstructions(ixs:
|
|
26
|
+
export function removeComputeBudgetProgramInstructions(ixs: Instruction[]): Instruction[] {
|
|
27
27
|
const filteredIxs = ixs.filter((ix) => {
|
|
28
28
|
if (ix.programAddress === COMPUTE_BUDGET_PROGRAM_ADDRESS) {
|
|
29
29
|
return false;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ManagerConnectionPool } from './ManagerConnectionPool';
|
|
2
|
-
import { Account,
|
|
2
|
+
import { Account, Instruction, TransactionSigner } from '@solana/kit';
|
|
3
3
|
import { sendAndConfirmTx } from './tx';
|
|
4
4
|
import { printSimulateTx } from './simulate';
|
|
5
5
|
import { printMultisigTx } from './multisig';
|
|
@@ -9,7 +9,7 @@ import { AddressLookupTable } from '@solana-program/address-lookup-table';
|
|
|
9
9
|
export async function processTx(
|
|
10
10
|
c: ManagerConnectionPool,
|
|
11
11
|
payer: TransactionSigner,
|
|
12
|
-
ixs:
|
|
12
|
+
ixs: Instruction[],
|
|
13
13
|
mode: SendTxMode,
|
|
14
14
|
luts: Account<AddressLookupTable>[] = []
|
|
15
15
|
): Promise<void> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
Instruction,
|
|
3
3
|
pipe,
|
|
4
4
|
createTransactionMessage,
|
|
5
5
|
setTransactionMessageFeePayer,
|
|
@@ -28,7 +28,7 @@ export const INVALID_BUT_SUFFICIENT_FOR_COMPILATION_BLOCKHASH: BlockhashWithHeig
|
|
|
28
28
|
export async function printSimulateTx(
|
|
29
29
|
c: ManagerConnectionPool,
|
|
30
30
|
payer: TransactionSigner,
|
|
31
|
-
ixs:
|
|
31
|
+
ixs: Instruction[],
|
|
32
32
|
luts: Account<AddressLookupTable>[] = []
|
|
33
33
|
) {
|
|
34
34
|
const lutsByAddress: AddressesByLookupTableAddress = {};
|
package/src/manager/tx/tx.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
GetLatestBlockhashApi,
|
|
12
12
|
getSignatureFromTransaction,
|
|
13
13
|
GetSignatureStatusesApi,
|
|
14
|
-
|
|
14
|
+
Instruction,
|
|
15
15
|
pipe,
|
|
16
16
|
RpcSubscriptions,
|
|
17
17
|
sendAndConfirmTransactionFactory,
|
|
@@ -32,7 +32,7 @@ import { ManagerConnectionPool } from './ManagerConnectionPool';
|
|
|
32
32
|
export async function sendAndConfirmTx(
|
|
33
33
|
c: ManagerConnectionPool,
|
|
34
34
|
payer: TransactionSigner,
|
|
35
|
-
ixs:
|
|
35
|
+
ixs: Instruction[],
|
|
36
36
|
luts: Account<AddressLookupTable>[] = []
|
|
37
37
|
): Promise<Signature> {
|
|
38
38
|
const blockhash = await fetchBlockhash(c.rpc);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address,
|
|
1
|
+
import { Address, Instruction, Rpc, SolanaRpcApi, TransactionSigner } from '@solana/kit';
|
|
2
2
|
import { KaminoMarket } from '../classes';
|
|
3
3
|
import { DEFAULT_PUBLIC_KEY, referrerStatePda, referrerTokenStatePda, shortUrlPda, userMetadataPda } from '../utils';
|
|
4
4
|
import {
|
|
@@ -26,7 +26,7 @@ export const getInitAllReferrerTokenStateIxs = async ({
|
|
|
26
26
|
|
|
27
27
|
await kaminoMarket.loadReserves();
|
|
28
28
|
|
|
29
|
-
const initReferrerTokenStateIxs:
|
|
29
|
+
const initReferrerTokenStateIxs: Instruction[] = [];
|
|
30
30
|
|
|
31
31
|
const tokenStatesToCreate: [Address, Address][] = [];
|
|
32
32
|
const reserves = kaminoMarket.getReserves();
|
|
@@ -54,6 +54,7 @@ export const getInitAllReferrerTokenStateIxs = async ({
|
|
|
54
54
|
rent: SYSVAR_RENT_ADDRESS,
|
|
55
55
|
systemProgram: SYSTEM_PROGRAM_ADDRESS,
|
|
56
56
|
},
|
|
57
|
+
undefined,
|
|
57
58
|
kaminoMarket.programId
|
|
58
59
|
);
|
|
59
60
|
|
|
@@ -90,6 +91,7 @@ export const getInitReferrerStateAndShortUrlIxs = async ({
|
|
|
90
91
|
rent: SYSVAR_RENT_ADDRESS,
|
|
91
92
|
systemProgram: SYSTEM_PROGRAM_ADDRESS,
|
|
92
93
|
},
|
|
94
|
+
undefined,
|
|
93
95
|
programId
|
|
94
96
|
);
|
|
95
97
|
|
|
@@ -105,7 +107,7 @@ export const getDeleteReferrerStateAndShortUrlIxs = async ({
|
|
|
105
107
|
referrer: TransactionSigner;
|
|
106
108
|
rpc: Rpc<SolanaRpcApi>;
|
|
107
109
|
programId: Address;
|
|
108
|
-
}): Promise<
|
|
110
|
+
}): Promise<Instruction> => {
|
|
109
111
|
const [referrerStateAddress] = await referrerStatePda(referrer.address, programId);
|
|
110
112
|
const referrerState = await ReferrerState.fetch(rpc, referrerStateAddress, programId);
|
|
111
113
|
|
|
@@ -117,6 +119,7 @@ export const getDeleteReferrerStateAndShortUrlIxs = async ({
|
|
|
117
119
|
rent: SYSVAR_RENT_ADDRESS,
|
|
118
120
|
systemProgram: SYSTEM_PROGRAM_ADDRESS,
|
|
119
121
|
},
|
|
122
|
+
undefined,
|
|
120
123
|
programId
|
|
121
124
|
);
|
|
122
125
|
};
|
package/src/utils/ata.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
GetAccountInfoApi,
|
|
5
5
|
GetMultipleAccountsApi,
|
|
6
6
|
GetTokenAccountBalanceApi,
|
|
7
|
-
|
|
7
|
+
Instruction,
|
|
8
8
|
Lamports,
|
|
9
9
|
MaybeAccount,
|
|
10
10
|
Rpc,
|
|
@@ -41,7 +41,7 @@ export async function createAssociatedTokenAccountIdempotentInstruction(
|
|
|
41
41
|
owner: Address = payer.address,
|
|
42
42
|
tokenProgram: Address = TOKEN_PROGRAM_ADDRESS,
|
|
43
43
|
ata?: Address
|
|
44
|
-
): Promise<[Address,
|
|
44
|
+
): Promise<[Address, Instruction]> {
|
|
45
45
|
let ataAddress = ata;
|
|
46
46
|
if (!ataAddress) {
|
|
47
47
|
ataAddress = await getAssociatedTokenAddress(mint, owner, tokenProgram, ASSOCIATED_TOKEN_PROGRAM_ADDRESS);
|
|
@@ -82,12 +82,12 @@ export const getAtasWithCreateIxsIfMissing = async (
|
|
|
82
82
|
rpc: Rpc<GetMultipleAccountsApi>,
|
|
83
83
|
user: TransactionSigner,
|
|
84
84
|
mints: Array<{ mint: Address; tokenProgram: Address }>
|
|
85
|
-
): Promise<{ atas: Address[]; createAtaIxs:
|
|
85
|
+
): Promise<{ atas: Address[]; createAtaIxs: Instruction[] }> => {
|
|
86
86
|
const atas: Array<Address> = await Promise.all(
|
|
87
87
|
mints.map(async (x) => getAssociatedTokenAddress(x.mint, user.address, x.tokenProgram))
|
|
88
88
|
);
|
|
89
89
|
const accountInfos = await rpc.getMultipleAccounts(atas).send();
|
|
90
|
-
const createAtaIxs:
|
|
90
|
+
const createAtaIxs: Instruction[] = [];
|
|
91
91
|
for (let i = 0; i < atas.length; i++) {
|
|
92
92
|
if (accountInfos.value[i] === null) {
|
|
93
93
|
const { mint, tokenProgram } = mints[i];
|
|
@@ -110,8 +110,8 @@ export const getAtasWithCreateIxsIfMissing = async (
|
|
|
110
110
|
export async function createAtasIdempotent(
|
|
111
111
|
user: TransactionSigner,
|
|
112
112
|
mints: Array<{ mint: Address; tokenProgram: Address }>
|
|
113
|
-
): Promise<Array<{ ata: Address; createAtaIx:
|
|
114
|
-
const res: Array<{ ata: Address; createAtaIx:
|
|
113
|
+
): Promise<Array<{ ata: Address; createAtaIx: Instruction }>> {
|
|
114
|
+
const res: Array<{ ata: Address; createAtaIx: Instruction }> = [];
|
|
115
115
|
for (const mint of mints) {
|
|
116
116
|
const [ata, createAtaIx] = await createAssociatedTokenAccountIdempotentInstruction(
|
|
117
117
|
user,
|
|
@@ -128,7 +128,7 @@ export async function createAtasIdempotent(
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
export function getTransferWsolIxs(owner: TransactionSigner, ata: Address, amountLamports: Lamports) {
|
|
131
|
-
const ixs:
|
|
131
|
+
const ixs: Instruction[] = [];
|
|
132
132
|
|
|
133
133
|
ixs.push(
|
|
134
134
|
getTransferSolInstruction({
|
|
@@ -177,8 +177,8 @@ export async function getTokenAccountBalanceDecimal(
|
|
|
177
177
|
|
|
178
178
|
export type CreateWsolAtaIxs = {
|
|
179
179
|
wsolAta: Address;
|
|
180
|
-
createAtaIxs:
|
|
181
|
-
closeAtaIxs:
|
|
180
|
+
createAtaIxs: Instruction[];
|
|
181
|
+
closeAtaIxs: Instruction[];
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
/**
|
|
@@ -193,8 +193,8 @@ export const createWsolAtaIfMissing = async (
|
|
|
193
193
|
amount: Decimal,
|
|
194
194
|
owner: TransactionSigner
|
|
195
195
|
): Promise<CreateWsolAtaIxs> => {
|
|
196
|
-
const createIxs:
|
|
197
|
-
const closeIxs:
|
|
196
|
+
const createIxs: Instruction[] = [];
|
|
197
|
+
const closeIxs: Instruction[] = [];
|
|
198
198
|
|
|
199
199
|
const wsolAta: Address = await getAssociatedTokenAddress(WRAPPED_SOL_MINT, owner.address, TOKEN_PROGRAM_ADDRESS);
|
|
200
200
|
|
package/src/utils/instruction.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import Decimal from 'decimal.js';
|
|
2
2
|
|
|
3
|
-
import { Address,
|
|
3
|
+
import { Address, Instruction, Rpc, GetMultipleAccountsApi, Account, isAddress } from '@solana/kit';
|
|
4
4
|
import { batchFetch } from '@kamino-finance/kliquidity-sdk';
|
|
5
5
|
import { getSetComputeUnitLimitInstruction, getSetComputeUnitPriceInstruction } from '@solana-program/compute-budget';
|
|
6
6
|
import { AddressLookupTable, fetchAllAddressLookupTable } from '@solana-program/address-lookup-table';
|
|
7
7
|
import { COMPUTE_BUDGET_PROGRAM_ID } from './pubkey';
|
|
8
8
|
|
|
9
|
-
export function buildComputeBudgetIx(units: number):
|
|
9
|
+
export function buildComputeBudgetIx(units: number): Instruction {
|
|
10
10
|
return getSetComputeUnitLimitInstruction({ units });
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -17,8 +17,8 @@ export async function getLookupTableAccounts(
|
|
|
17
17
|
return batchFetch(addresses, (batch) => fetchAllAddressLookupTable(rpc, batch));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export const getComputeBudgetAndPriorityFeeIxs = (units: number, priorityFeeLamports?: Decimal):
|
|
21
|
-
const ixs:
|
|
20
|
+
export const getComputeBudgetAndPriorityFeeIxs = (units: number, priorityFeeLamports?: Decimal): Instruction[] => {
|
|
21
|
+
const ixs: Instruction[] = [];
|
|
22
22
|
ixs.push(getSetComputeUnitLimitInstruction({ units }));
|
|
23
23
|
|
|
24
24
|
if (priorityFeeLamports && priorityFeeLamports.gt(0)) {
|
|
@@ -41,7 +41,7 @@ export function notEmpty<TValue>(value: TValue | null | undefined): value is TVa
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export function uniqueAccountsWithProgramIds(
|
|
44
|
-
ixs:
|
|
44
|
+
ixs: Instruction[],
|
|
45
45
|
addressLookupTables: Address[] | Account<AddressLookupTable>[] = []
|
|
46
46
|
): Array<Address> {
|
|
47
47
|
let luts: Address[];
|
|
@@ -66,7 +66,7 @@ export function uniqueAccountsWithProgramIds(
|
|
|
66
66
|
return [...uniqueAccounts];
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export function removeBudgetIxs(ixs:
|
|
69
|
+
export function removeBudgetIxs(ixs: Instruction[]): Instruction[] {
|
|
70
70
|
return ixs.filter(({ programAddress }) => {
|
|
71
71
|
return programAddress !== COMPUTE_BUDGET_PROGRAM_ID;
|
|
72
72
|
});
|
package/src/utils/lookupTable.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, GetAccountInfoApi, GetSlotApi,
|
|
1
|
+
import { Address, GetAccountInfoApi, GetSlotApi, Instruction, Rpc, Slot, TransactionSigner } from '@solana/kit';
|
|
2
2
|
import {
|
|
3
3
|
fetchAddressLookupTable,
|
|
4
4
|
findAddressLookupTablePda,
|
|
@@ -22,7 +22,7 @@ export async function printAddressLookupTable(rpc: Rpc<GetAccountInfoApi>, looku
|
|
|
22
22
|
export async function createLookupTableIx(
|
|
23
23
|
connection: Rpc<GetSlotApi>,
|
|
24
24
|
authority: TransactionSigner
|
|
25
|
-
): Promise<[
|
|
25
|
+
): Promise<[Instruction, Address]> {
|
|
26
26
|
const recentSlot = await connection.getSlot({ commitment: 'finalized' }).send();
|
|
27
27
|
return initLookupTableIx(authority, recentSlot);
|
|
28
28
|
}
|
|
@@ -32,7 +32,7 @@ export function extendLookupTableChunkIx(
|
|
|
32
32
|
lookupTablePk: Address,
|
|
33
33
|
keys: Address[],
|
|
34
34
|
payer: TransactionSigner = authority
|
|
35
|
-
):
|
|
35
|
+
): Instruction {
|
|
36
36
|
return getExtendLookupTableInstruction({
|
|
37
37
|
authority,
|
|
38
38
|
payer,
|
|
@@ -46,9 +46,9 @@ export const extendLookupTableIxs = (
|
|
|
46
46
|
table: Address,
|
|
47
47
|
keys: Address[],
|
|
48
48
|
payer: TransactionSigner = authority
|
|
49
|
-
):
|
|
49
|
+
): Instruction[] => {
|
|
50
50
|
const chunkSize = 25;
|
|
51
|
-
const extendLookupIxs:
|
|
51
|
+
const extendLookupIxs: Instruction[] = [];
|
|
52
52
|
for (let i = 0; i < keys.length; i += chunkSize) {
|
|
53
53
|
const chunk = keys.slice(i, i + chunkSize);
|
|
54
54
|
extendLookupIxs.push(extendLookupTableChunkIx(authority, table, chunk, payer));
|
|
@@ -65,7 +65,7 @@ export const extendLookupTableIxs = (
|
|
|
65
65
|
export async function initLookupTableIx(
|
|
66
66
|
authority: TransactionSigner,
|
|
67
67
|
recentSlot: Slot
|
|
68
|
-
): Promise<[
|
|
68
|
+
): Promise<[Instruction, Address]> {
|
|
69
69
|
const address = await findAddressLookupTablePda({ authority: authority.address, recentSlot });
|
|
70
70
|
const createLookupTableIx = getCreateLookupTableInstruction({
|
|
71
71
|
authority,
|
|
@@ -82,7 +82,7 @@ export async function initLookupTableIx(
|
|
|
82
82
|
* @param lookupTable - the lookup table to deactivate
|
|
83
83
|
* @returns - the instruction to deactivate the lookup table
|
|
84
84
|
*/
|
|
85
|
-
export function deactivateLookupTableIx(authority: TransactionSigner, lookupTable: Address):
|
|
85
|
+
export function deactivateLookupTableIx(authority: TransactionSigner, lookupTable: Address): Instruction {
|
|
86
86
|
return getDeactivateLookupTableInstruction({
|
|
87
87
|
authority,
|
|
88
88
|
address: lookupTable,
|
|
@@ -96,7 +96,7 @@ export function deactivateLookupTableIx(authority: TransactionSigner, lookupTabl
|
|
|
96
96
|
* @returns - the instruction to close the lookup table
|
|
97
97
|
*/
|
|
98
98
|
/// this require the LUT to be deactivated at least 500 blocks before
|
|
99
|
-
export function closeLookupTableIx(authority: TransactionSigner, lookupTable: Address):
|
|
99
|
+
export function closeLookupTableIx(authority: TransactionSigner, lookupTable: Address): Instruction {
|
|
100
100
|
return getCloseLookupTableInstruction({
|
|
101
101
|
authority,
|
|
102
102
|
address: lookupTable,
|