@kamino-finance/klend-sdk 3.2.26 → 4.0.1
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/classes/action.d.ts +1 -0
- package/dist/classes/action.d.ts.map +1 -0
- package/dist/classes/action.js +1132 -1188
- package/dist/classes/action.js.map +1 -1
- package/dist/classes/curve.d.ts +1 -0
- package/dist/classes/curve.d.ts.map +1 -0
- package/dist/classes/curve.js +1 -1
- package/dist/classes/curve.js.map +1 -1
- package/dist/classes/fraction.d.ts +1 -0
- package/dist/classes/fraction.d.ts.map +1 -0
- package/dist/classes/fraction.js +7 -6
- package/dist/classes/fraction.js.map +1 -1
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.d.ts.map +1 -0
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/jupiterPerps.d.ts +1 -0
- package/dist/classes/jupiterPerps.d.ts.map +1 -0
- package/dist/classes/jupiterPerps.js +7 -18
- package/dist/classes/jupiterPerps.js.map +1 -1
- package/dist/classes/manager.d.ts +1 -0
- package/dist/classes/manager.d.ts.map +1 -0
- package/dist/classes/manager.js +132 -159
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +2 -1
- package/dist/classes/market.d.ts.map +1 -0
- package/dist/classes/market.js +622 -716
- package/dist/classes/market.js.map +1 -1
- package/dist/classes/obligation.d.ts +1 -0
- package/dist/classes/obligation.d.ts.map +1 -0
- package/dist/classes/obligation.js +60 -62
- package/dist/classes/obligation.js.map +1 -1
- package/dist/classes/reserve.d.ts +1 -0
- package/dist/classes/reserve.d.ts.map +1 -0
- package/dist/classes/reserve.js +121 -130
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/shared.d.ts +2 -1
- package/dist/classes/shared.d.ts.map +1 -0
- package/dist/classes/shared.js.map +1 -1
- package/dist/classes/utils.d.ts +1 -0
- package/dist/classes/utils.d.ts.map +1 -0
- package/dist/classes/utils.js +3 -3
- package/dist/classes/utils.js.map +1 -1
- package/dist/classes/vault.d.ts +1 -0
- package/dist/classes/vault.d.ts.map +1 -0
- package/dist/classes/vault.js +334 -354
- package/dist/classes/vault.js.map +1 -1
- package/dist/client_kamino_manager.d.ts +1 -0
- package/dist/client_kamino_manager.d.ts.map +1 -0
- package/dist/client_kamino_manager.js +323 -326
- package/dist/client_kamino_manager.js.map +1 -1
- package/dist/idl_codegen/accounts/LendingMarket.d.ts +1 -0
- package/dist/idl_codegen/accounts/LendingMarket.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/LendingMarket.js +89 -55
- package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -1
- package/dist/idl_codegen/accounts/Obligation.d.ts +1 -0
- package/dist/idl_codegen/accounts/Obligation.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/Obligation.js +87 -56
- package/dist/idl_codegen/accounts/Obligation.js.map +1 -1
- package/dist/idl_codegen/accounts/ReferrerState.d.ts +1 -0
- package/dist/idl_codegen/accounts/ReferrerState.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/ReferrerState.js +22 -33
- package/dist/idl_codegen/accounts/ReferrerState.js.map +1 -1
- package/dist/idl_codegen/accounts/ReferrerTokenState.d.ts +1 -0
- package/dist/idl_codegen/accounts/ReferrerTokenState.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/ReferrerTokenState.js +35 -37
- package/dist/idl_codegen/accounts/ReferrerTokenState.js.map +1 -1
- package/dist/idl_codegen/accounts/Reserve.d.ts +1 -0
- package/dist/idl_codegen/accounts/Reserve.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/Reserve.js +60 -49
- package/dist/idl_codegen/accounts/Reserve.js.map +1 -1
- package/dist/idl_codegen/accounts/ShortUrl.d.ts +1 -0
- package/dist/idl_codegen/accounts/ShortUrl.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/ShortUrl.js +22 -33
- package/dist/idl_codegen/accounts/ShortUrl.js.map +1 -1
- package/dist/idl_codegen/accounts/UserMetadata.d.ts +1 -0
- package/dist/idl_codegen/accounts/UserMetadata.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/UserMetadata.js +34 -37
- package/dist/idl_codegen/accounts/UserMetadata.js.map +1 -1
- package/dist/idl_codegen/accounts/UserState.d.ts +1 -0
- package/dist/idl_codegen/accounts/UserState.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/UserState.js +77 -48
- package/dist/idl_codegen/accounts/UserState.js.map +1 -1
- package/dist/idl_codegen/accounts/index.d.ts +1 -0
- package/dist/idl_codegen/accounts/index.d.ts.map +1 -0
- package/dist/idl_codegen/accounts/index.js.map +1 -1
- package/dist/idl_codegen/errors/anchor.d.ts +1 -0
- package/dist/idl_codegen/errors/anchor.d.ts.map +1 -0
- package/dist/idl_codegen/errors/anchor.js +270 -216
- package/dist/idl_codegen/errors/anchor.js.map +1 -1
- package/dist/idl_codegen/errors/custom.d.ts +1 -0
- package/dist/idl_codegen/errors/custom.d.ts.map +1 -0
- package/dist/idl_codegen/errors/custom.js +560 -448
- package/dist/idl_codegen/errors/custom.js.map +1 -1
- package/dist/idl_codegen/errors/index.d.ts +1 -0
- package/dist/idl_codegen/errors/index.d.ts.map +1 -0
- package/dist/idl_codegen/errors/index.js.map +1 -1
- package/dist/idl_codegen/instructions/borrowObligationLiquidity.d.ts +1 -0
- package/dist/idl_codegen/instructions/borrowObligationLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/borrowObligationLiquidity.js.map +1 -1
- package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.d.ts +1 -0
- package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.js.map +1 -1
- package/dist/idl_codegen/instructions/depositObligationCollateral.d.ts +1 -0
- package/dist/idl_codegen/instructions/depositObligationCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/depositObligationCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/depositReserveLiquidity.d.ts +1 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.d.ts +1 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts +1 -0
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts +1 -0
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen/instructions/idlMissingTypes.d.ts +1 -0
- package/dist/idl_codegen/instructions/idlMissingTypes.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/idlMissingTypes.js.map +1 -1
- package/dist/idl_codegen/instructions/index.d.ts +1 -0
- package/dist/idl_codegen/instructions/index.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/index.js.map +1 -1
- package/dist/idl_codegen/instructions/initFarmsForReserve.d.ts +1 -0
- package/dist/idl_codegen/instructions/initFarmsForReserve.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initFarmsForReserve.js.map +1 -1
- package/dist/idl_codegen/instructions/initLendingMarket.d.ts +1 -0
- package/dist/idl_codegen/instructions/initLendingMarket.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initLendingMarket.js.map +1 -1
- package/dist/idl_codegen/instructions/initObligation.d.ts +1 -0
- package/dist/idl_codegen/instructions/initObligation.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initObligation.js.map +1 -1
- package/dist/idl_codegen/instructions/initObligationFarmsForReserve.d.ts +1 -0
- package/dist/idl_codegen/instructions/initObligationFarmsForReserve.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initObligationFarmsForReserve.js.map +1 -1
- package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.d.ts +1 -0
- package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.js.map +1 -1
- package/dist/idl_codegen/instructions/initReferrerTokenState.d.ts +1 -0
- package/dist/idl_codegen/instructions/initReferrerTokenState.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initReferrerTokenState.js.map +1 -1
- package/dist/idl_codegen/instructions/initReserve.d.ts +1 -0
- package/dist/idl_codegen/instructions/initReserve.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initReserve.js.map +1 -1
- package/dist/idl_codegen/instructions/initUserMetadata.d.ts +1 -0
- package/dist/idl_codegen/instructions/initUserMetadata.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/initUserMetadata.js.map +1 -1
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts +1 -0
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/redeemFees.d.ts +1 -0
- package/dist/idl_codegen/instructions/redeemFees.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/redeemFees.js.map +1 -1
- package/dist/idl_codegen/instructions/redeemReserveCollateral.d.ts +1 -0
- package/dist/idl_codegen/instructions/redeemReserveCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/redeemReserveCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/refreshObligation.d.ts +1 -0
- package/dist/idl_codegen/instructions/refreshObligation.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/refreshObligation.js.map +1 -1
- package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.d.ts +1 -0
- package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.js.map +1 -1
- package/dist/idl_codegen/instructions/refreshReserve.d.ts +1 -0
- package/dist/idl_codegen/instructions/refreshReserve.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/refreshReserve.js.map +1 -1
- package/dist/idl_codegen/instructions/refreshReservesBatch.d.ts +1 -0
- package/dist/idl_codegen/instructions/refreshReservesBatch.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/refreshReservesBatch.js.map +1 -1
- package/dist/idl_codegen/instructions/repayObligationLiquidity.d.ts +1 -0
- package/dist/idl_codegen/instructions/repayObligationLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/repayObligationLiquidity.js.map +1 -1
- package/dist/idl_codegen/instructions/requestElevationGroup.d.ts +1 -0
- package/dist/idl_codegen/instructions/requestElevationGroup.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/requestElevationGroup.js.map +1 -1
- package/dist/idl_codegen/instructions/socializeLoss.d.ts +1 -0
- package/dist/idl_codegen/instructions/socializeLoss.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/socializeLoss.js.map +1 -1
- package/dist/idl_codegen/instructions/updateEntireReserveConfig.d.ts +1 -0
- package/dist/idl_codegen/instructions/updateEntireReserveConfig.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/updateEntireReserveConfig.js.map +1 -1
- package/dist/idl_codegen/instructions/updateLendingMarket.d.ts +1 -0
- package/dist/idl_codegen/instructions/updateLendingMarket.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/updateLendingMarket.js.map +1 -1
- package/dist/idl_codegen/instructions/updateLendingMarketOwner.d.ts +1 -0
- package/dist/idl_codegen/instructions/updateLendingMarketOwner.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/updateLendingMarketOwner.js.map +1 -1
- package/dist/idl_codegen/instructions/updateReserveConfig.d.ts +1 -0
- package/dist/idl_codegen/instructions/updateReserveConfig.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/updateReserveConfig.js.map +1 -1
- package/dist/idl_codegen/instructions/updateSingleReserveConfig.d.ts +1 -0
- package/dist/idl_codegen/instructions/updateSingleReserveConfig.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/updateSingleReserveConfig.js.map +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.d.ts +1 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts +1 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js.map +1 -1
- package/dist/idl_codegen/instructions/withdrawProtocolFee.d.ts +1 -0
- package/dist/idl_codegen/instructions/withdrawProtocolFee.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/withdrawProtocolFee.js.map +1 -1
- package/dist/idl_codegen/instructions/withdrawReferrerFees.d.ts +1 -0
- package/dist/idl_codegen/instructions/withdrawReferrerFees.d.ts.map +1 -0
- package/dist/idl_codegen/instructions/withdrawReferrerFees.js.map +1 -1
- package/dist/idl_codegen/programId.d.ts +1 -0
- package/dist/idl_codegen/programId.d.ts.map +1 -0
- package/dist/idl_codegen/programId.js.map +1 -1
- package/dist/idl_codegen/types/AssetTier.d.ts +1 -0
- package/dist/idl_codegen/types/AssetTier.d.ts.map +1 -0
- package/dist/idl_codegen/types/AssetTier.js +12 -18
- package/dist/idl_codegen/types/AssetTier.js.map +1 -1
- package/dist/idl_codegen/types/BigFractionBytes.d.ts +1 -0
- package/dist/idl_codegen/types/BigFractionBytes.d.ts.map +1 -0
- package/dist/idl_codegen/types/BigFractionBytes.js +2 -0
- package/dist/idl_codegen/types/BigFractionBytes.js.map +1 -1
- package/dist/idl_codegen/types/BorrowRateCurve.d.ts +1 -0
- package/dist/idl_codegen/types/BorrowRateCurve.d.ts.map +1 -0
- package/dist/idl_codegen/types/BorrowRateCurve.js +2 -1
- package/dist/idl_codegen/types/BorrowRateCurve.js.map +1 -1
- package/dist/idl_codegen/types/CurvePoint.d.ts +1 -0
- package/dist/idl_codegen/types/CurvePoint.d.ts.map +1 -0
- package/dist/idl_codegen/types/CurvePoint.js +2 -0
- package/dist/idl_codegen/types/CurvePoint.js.map +1 -1
- package/dist/idl_codegen/types/ElevationGroup.d.ts +1 -0
- package/dist/idl_codegen/types/ElevationGroup.d.ts.map +1 -0
- package/dist/idl_codegen/types/ElevationGroup.js +10 -0
- package/dist/idl_codegen/types/ElevationGroup.js.map +1 -1
- package/dist/idl_codegen/types/FeeCalculation.d.ts +1 -0
- package/dist/idl_codegen/types/FeeCalculation.d.ts.map +1 -0
- package/dist/idl_codegen/types/FeeCalculation.js +8 -12
- package/dist/idl_codegen/types/FeeCalculation.js.map +1 -1
- package/dist/idl_codegen/types/InitObligationArgs.d.ts +1 -0
- package/dist/idl_codegen/types/InitObligationArgs.d.ts.map +1 -0
- package/dist/idl_codegen/types/InitObligationArgs.js +2 -0
- package/dist/idl_codegen/types/InitObligationArgs.js.map +1 -1
- package/dist/idl_codegen/types/LastUpdate.d.ts +1 -0
- package/dist/idl_codegen/types/LastUpdate.d.ts.map +1 -0
- package/dist/idl_codegen/types/LastUpdate.js +7 -0
- package/dist/idl_codegen/types/LastUpdate.js.map +1 -1
- package/dist/idl_codegen/types/ObligationCollateral.d.ts +1 -0
- package/dist/idl_codegen/types/ObligationCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/types/ObligationCollateral.js +14 -0
- package/dist/idl_codegen/types/ObligationCollateral.js.map +1 -1
- package/dist/idl_codegen/types/ObligationLiquidity.d.ts +1 -0
- package/dist/idl_codegen/types/ObligationLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen/types/ObligationLiquidity.js +17 -1
- package/dist/idl_codegen/types/ObligationLiquidity.js.map +1 -1
- package/dist/idl_codegen/types/PriceHeuristic.d.ts +1 -0
- package/dist/idl_codegen/types/PriceHeuristic.d.ts.map +1 -0
- package/dist/idl_codegen/types/PriceHeuristic.js +6 -0
- package/dist/idl_codegen/types/PriceHeuristic.js.map +1 -1
- package/dist/idl_codegen/types/PythConfiguration.d.ts +1 -0
- package/dist/idl_codegen/types/PythConfiguration.d.ts.map +1 -0
- package/dist/idl_codegen/types/PythConfiguration.js +2 -0
- package/dist/idl_codegen/types/PythConfiguration.js.map +1 -1
- package/dist/idl_codegen/types/ReserveCollateral.d.ts +1 -0
- package/dist/idl_codegen/types/ReserveCollateral.d.ts.map +1 -0
- package/dist/idl_codegen/types/ReserveCollateral.js +8 -0
- package/dist/idl_codegen/types/ReserveCollateral.js.map +1 -1
- package/dist/idl_codegen/types/ReserveConfig.d.ts +1 -0
- package/dist/idl_codegen/types/ReserveConfig.d.ts.map +1 -0
- package/dist/idl_codegen/types/ReserveConfig.js +78 -5
- package/dist/idl_codegen/types/ReserveConfig.js.map +1 -1
- package/dist/idl_codegen/types/ReserveFarmKind.d.ts +1 -0
- package/dist/idl_codegen/types/ReserveFarmKind.d.ts.map +1 -0
- package/dist/idl_codegen/types/ReserveFarmKind.js +8 -12
- package/dist/idl_codegen/types/ReserveFarmKind.js.map +1 -1
- package/dist/idl_codegen/types/ReserveFees.d.ts +1 -0
- package/dist/idl_codegen/types/ReserveFees.d.ts.map +1 -0
- package/dist/idl_codegen/types/ReserveFees.js +16 -0
- package/dist/idl_codegen/types/ReserveFees.js.map +1 -1
- package/dist/idl_codegen/types/ReserveLiquidity.d.ts +1 -0
- package/dist/idl_codegen/types/ReserveLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen/types/ReserveLiquidity.js +43 -1
- package/dist/idl_codegen/types/ReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen/types/ReserveStatus.d.ts +1 -0
- package/dist/idl_codegen/types/ReserveStatus.d.ts.map +1 -0
- package/dist/idl_codegen/types/ReserveStatus.js +12 -18
- package/dist/idl_codegen/types/ReserveStatus.js.map +1 -1
- package/dist/idl_codegen/types/ScopeConfiguration.d.ts +1 -0
- package/dist/idl_codegen/types/ScopeConfiguration.d.ts.map +1 -0
- package/dist/idl_codegen/types/ScopeConfiguration.js +6 -0
- package/dist/idl_codegen/types/ScopeConfiguration.js.map +1 -1
- package/dist/idl_codegen/types/SwitchboardConfiguration.d.ts +1 -0
- package/dist/idl_codegen/types/SwitchboardConfiguration.d.ts.map +1 -0
- package/dist/idl_codegen/types/SwitchboardConfiguration.js +3 -0
- package/dist/idl_codegen/types/SwitchboardConfiguration.js.map +1 -1
- package/dist/idl_codegen/types/TokenInfo.d.ts +1 -0
- package/dist/idl_codegen/types/TokenInfo.d.ts.map +1 -0
- package/dist/idl_codegen/types/TokenInfo.js +27 -4
- package/dist/idl_codegen/types/TokenInfo.js.map +1 -1
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts +1 -0
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts.map +1 -0
- package/dist/idl_codegen/types/UpdateConfigMode.js +188 -282
- package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -1
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.d.ts +1 -0
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.d.ts.map +1 -0
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js +41 -33
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js.map +1 -1
- package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +1 -0
- package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts.map +1 -0
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js +72 -108
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -1
- package/dist/idl_codegen/types/WithdrawalCaps.d.ts +1 -0
- package/dist/idl_codegen/types/WithdrawalCaps.d.ts.map +1 -0
- package/dist/idl_codegen/types/WithdrawalCaps.js +4 -0
- package/dist/idl_codegen/types/WithdrawalCaps.js.map +1 -1
- package/dist/idl_codegen/types/index.d.ts +1 -0
- package/dist/idl_codegen/types/index.d.ts.map +1 -0
- package/dist/idl_codegen/types/index.js.map +1 -1
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts +1 -0
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts.map +1 -0
- package/dist/idl_codegen/zero_padding/ObligationZP.js +83 -54
- package/dist/idl_codegen/zero_padding/ObligationZP.js.map +1 -1
- package/dist/idl_codegen/zero_padding/index.d.ts +1 -0
- package/dist/idl_codegen/zero_padding/index.d.ts.map +1 -0
- package/dist/idl_codegen/zero_padding/index.js.map +1 -1
- package/dist/idl_codegen_jupiter_perps/accounts/Pool.d.ts +1 -0
- package/dist/idl_codegen_jupiter_perps/accounts/Pool.d.ts.map +1 -0
- package/dist/idl_codegen_jupiter_perps/accounts/Pool.js +39 -42
- package/dist/idl_codegen_jupiter_perps/accounts/Pool.js.map +1 -1
- package/dist/idl_codegen_jupiter_perps/accounts/index.d.ts +1 -0
- package/dist/idl_codegen_jupiter_perps/accounts/index.d.ts.map +1 -0
- package/dist/idl_codegen_jupiter_perps/accounts/index.js.map +1 -1
- package/dist/idl_codegen_jupiter_perps/programId.d.ts +1 -0
- package/dist/idl_codegen_jupiter_perps/programId.d.ts.map +1 -0
- package/dist/idl_codegen_jupiter_perps/programId.js.map +1 -1
- package/dist/idl_codegen_jupiter_perps/types/Fees.d.ts +1 -0
- package/dist/idl_codegen_jupiter_perps/types/Fees.d.ts.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/Fees.js +9 -0
- package/dist/idl_codegen_jupiter_perps/types/Fees.js.map +1 -1
- package/dist/idl_codegen_jupiter_perps/types/Limit.d.ts +1 -0
- package/dist/idl_codegen_jupiter_perps/types/Limit.d.ts.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/Limit.js +3 -0
- package/dist/idl_codegen_jupiter_perps/types/Limit.js.map +1 -1
- package/dist/idl_codegen_jupiter_perps/types/PoolApr.d.ts +1 -0
- package/dist/idl_codegen_jupiter_perps/types/PoolApr.d.ts.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/PoolApr.js +3 -0
- package/dist/idl_codegen_jupiter_perps/types/PoolApr.js.map +1 -1
- package/dist/idl_codegen_jupiter_perps/types/index.d.ts +1 -0
- package/dist/idl_codegen_jupiter_perps/types/index.d.ts.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.js +58 -47
- package/dist/idl_codegen_kamino_vault/accounts/Reserve.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.js +51 -47
- package/dist/idl_codegen_kamino_vault/accounts/VaultState.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/accounts/index.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/accounts/index.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/accounts/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/anchor.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/errors/anchor.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/errors/anchor.js +270 -216
- package/dist/idl_codegen_kamino_vault/errors/anchor.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/custom.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/errors/custom.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/errors/custom.js +120 -96
- package/dist/idl_codegen_kamino_vault/errors/custom.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/errors/index.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/errors/index.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/errors/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/index.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/index.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/index.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/initVault.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/invest.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/programId.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/programId.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/programId.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js +2 -0
- package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js +2 -1
- package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.js +2 -0
- package/dist/idl_codegen_kamino_vault/types/CurvePoint.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.js +7 -0
- package/dist/idl_codegen_kamino_vault/types/LastUpdate.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js +6 -0
- package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js +2 -0
- package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js +8 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js +77 -5
- package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.js +16 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveFees.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js +41 -1
- package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js +6 -0
- package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js +3 -0
- package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.js +27 -4
- package/dist/idl_codegen_kamino_vault/types/TokenInfo.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js +8 -0
- package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.js +4 -0
- package/dist/idl_codegen_kamino_vault/types/WithdrawalCaps.js.map +1 -1
- package/dist/idl_codegen_kamino_vault/types/index.d.ts +1 -0
- package/dist/idl_codegen_kamino_vault/types/index.d.ts.map +1 -0
- package/dist/idl_codegen_kamino_vault/types/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lending_operations/index.d.ts +1 -0
- package/dist/lending_operations/index.d.ts.map +1 -0
- package/dist/lending_operations/index.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.d.ts +1 -0
- package/dist/lending_operations/repay_with_collateral_calcs.d.ts.map +1 -0
- package/dist/lending_operations/repay_with_collateral_calcs.js +1 -1
- package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -1
- package/dist/lending_operations/repay_with_collateral_operations.d.ts +1 -0
- package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -0
- package/dist/lending_operations/repay_with_collateral_operations.js +15 -24
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
- package/dist/leverage/calcs.d.ts +1 -0
- package/dist/leverage/calcs.d.ts.map +1 -0
- package/dist/leverage/calcs.js +119 -132
- package/dist/leverage/calcs.js.map +1 -1
- package/dist/leverage/index.d.ts +1 -0
- package/dist/leverage/index.d.ts.map +1 -0
- package/dist/leverage/index.js.map +1 -1
- package/dist/leverage/instructions.d.ts +1 -0
- package/dist/leverage/instructions.d.ts.map +1 -0
- package/dist/leverage/instructions.js.map +1 -1
- package/dist/leverage/operations.d.ts +1 -0
- package/dist/leverage/operations.d.ts.map +1 -0
- package/dist/leverage/operations.js +75 -84
- package/dist/leverage/operations.js.map +1 -1
- package/dist/leverage/utils.d.ts +1 -0
- package/dist/leverage/utils.d.ts.map +1 -0
- package/dist/leverage/utils.js +73 -88
- package/dist/leverage/utils.js.map +1 -1
- package/dist/lib.d.ts +1 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js.map +1 -1
- package/dist/referrals/index.d.ts +1 -0
- package/dist/referrals/index.d.ts.map +1 -0
- package/dist/referrals/index.js.map +1 -1
- package/dist/referrals/instructions.d.ts +1 -0
- package/dist/referrals/instructions.d.ts.map +1 -0
- package/dist/referrals/instructions.js +8 -17
- package/dist/referrals/instructions.js.map +1 -1
- package/dist/referrals/operations.d.ts +2 -1
- package/dist/referrals/operations.d.ts.map +1 -0
- package/dist/referrals/operations.js +119 -143
- package/dist/referrals/operations.js.map +1 -1
- package/dist/utils/ObligationType.d.ts +1 -0
- package/dist/utils/ObligationType.d.ts.map +1 -0
- package/dist/utils/ObligationType.js +16 -7
- package/dist/utils/ObligationType.js.map +1 -1
- package/dist/utils/api.d.ts +1 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/api.js +10 -21
- package/dist/utils/api.js.map +1 -1
- package/dist/utils/ata.d.ts +1 -0
- package/dist/utils/ata.d.ts.map +1 -0
- package/dist/utils/ata.js +25 -38
- package/dist/utils/ata.js.map +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/idl.d.ts +1 -0
- package/dist/utils/idl.d.ts.map +1 -0
- package/dist/utils/idl.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/instruction.d.ts +1 -0
- package/dist/utils/instruction.d.ts.map +1 -0
- package/dist/utils/instruction.js +116 -143
- package/dist/utils/instruction.js.map +1 -1
- package/dist/utils/kamino.d.ts +1 -0
- package/dist/utils/kamino.d.ts.map +1 -0
- package/dist/utils/kamino.js +4 -15
- package/dist/utils/kamino.js.map +1 -1
- package/dist/utils/layout.d.ts +1 -0
- package/dist/utils/layout.d.ts.map +1 -0
- package/dist/utils/layout.js.map +1 -1
- package/dist/utils/lookupTable.d.ts +1 -0
- package/dist/utils/lookupTable.d.ts.map +1 -0
- package/dist/utils/lookupTable.js +14 -27
- package/dist/utils/lookupTable.js.map +1 -1
- package/dist/utils/managerTypes.d.ts +1 -0
- package/dist/utils/managerTypes.d.ts.map +1 -0
- package/dist/utils/managerTypes.js +32 -3
- package/dist/utils/managerTypes.js.map +1 -1
- package/dist/utils/oracle.d.ts +2 -1
- package/dist/utils/oracle.d.ts.map +1 -0
- package/dist/utils/oracle.js +71 -85
- package/dist/utils/oracle.js.map +1 -1
- package/dist/utils/pubkey.d.ts +1 -0
- package/dist/utils/pubkey.d.ts.map +1 -0
- package/dist/utils/pubkey.js +7 -9
- package/dist/utils/pubkey.js.map +1 -1
- package/dist/utils/rpc.d.ts +1 -0
- package/dist/utils/rpc.d.ts.map +1 -0
- package/dist/utils/rpc.js +48 -70
- package/dist/utils/rpc.js.map +1 -1
- package/dist/utils/seeds.d.ts +1 -0
- package/dist/utils/seeds.d.ts.map +1 -0
- package/dist/utils/seeds.js.map +1 -1
- package/dist/utils/sendTransactionsUtils.d.ts +1 -0
- package/dist/utils/sendTransactionsUtils.d.ts.map +1 -0
- package/dist/utils/sendTransactionsUtils.js +82 -82
- package/dist/utils/sendTransactionsUtils.js.map +1 -1
- package/dist/utils/slots.d.ts +1 -0
- package/dist/utils/slots.d.ts.map +1 -0
- package/dist/utils/slots.js.map +1 -1
- package/dist/utils/syncNative.d.ts +1 -0
- package/dist/utils/syncNative.d.ts.map +1 -0
- package/dist/utils/syncNative.js.map +1 -1
- package/dist/utils/userMetadata.d.ts +1 -0
- package/dist/utils/userMetadata.d.ts.map +1 -0
- package/dist/utils/userMetadata.js +41 -53
- package/dist/utils/userMetadata.js.map +1 -1
- package/package.json +14 -8
- package/src/classes/action.ts +2884 -0
- package/src/classes/curve.ts +29 -0
- package/src/classes/fraction.ts +65 -0
- package/src/classes/index.ts +10 -0
- package/src/classes/jupiterPerps.ts +14 -0
- package/src/classes/manager.ts +746 -0
- package/src/classes/market.ts +1459 -0
- package/src/classes/obligation.ts +1315 -0
- package/src/classes/reserve.ts +1980 -0
- package/src/classes/shared.ts +57 -0
- package/src/classes/utils.ts +192 -0
- package/src/classes/vault.ts +808 -0
- package/src/client.ts +446 -0
- package/src/client_kamino_manager.ts +791 -0
- package/src/global.d.ts +1 -0
- package/src/idl_codegen/accounts/LendingMarket.ts +364 -0
- package/src/idl_codegen/accounts/Obligation.ts +349 -0
- package/src/idl_codegen/accounts/ReferrerState.ts +97 -0
- package/src/idl_codegen/accounts/ReferrerTokenState.ts +145 -0
- package/src/idl_codegen/accounts/Reserve.ts +248 -0
- package/src/idl_codegen/accounts/ShortUrl.ts +97 -0
- package/src/idl_codegen/accounts/UserMetadata.ts +142 -0
- package/src/idl_codegen/accounts/UserState.ts +301 -0
- package/src/idl_codegen/accounts/index.ts +19 -0
- package/src/idl_codegen/errors/anchor.ts +773 -0
- package/src/idl_codegen/errors/custom.ts +1633 -0
- package/src/idl_codegen/errors/index.ts +62 -0
- package/src/idl_codegen/instructions/borrowObligationLiquidity.ts +82 -0
- package/src/idl_codegen/instructions/deleteReferrerStateAndShortUrl.ts +30 -0
- package/src/idl_codegen/instructions/depositObligationCollateral.ts +62 -0
- package/src/idl_codegen/instructions/depositReserveLiquidity.ts +90 -0
- package/src/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.ts +98 -0
- package/src/idl_codegen/instructions/flashBorrowReserveLiquidity.ts +82 -0
- package/src/idl_codegen/instructions/flashRepayReserveLiquidity.ts +83 -0
- package/src/idl_codegen/instructions/idlMissingTypes.ts +62 -0
- package/src/idl_codegen/instructions/index.ts +138 -0
- package/src/idl_codegen/instructions/initFarmsForReserve.ts +62 -0
- package/src/idl_codegen/instructions/initLendingMarket.ts +50 -0
- package/src/idl_codegen/instructions/initObligation.ts +52 -0
- package/src/idl_codegen/instructions/initObligationFarmsForReserve.ts +60 -0
- package/src/idl_codegen/instructions/initReferrerStateAndShortUrl.ts +50 -0
- package/src/idl_codegen/instructions/initReferrerTokenState.ts +46 -0
- package/src/idl_codegen/instructions/initReserve.ts +74 -0
- package/src/idl_codegen/instructions/initUserMetadata.ts +50 -0
- package/src/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.ts +139 -0
- package/src/idl_codegen/instructions/redeemFees.ts +50 -0
- package/src/idl_codegen/instructions/redeemReserveCollateral.ts +94 -0
- package/src/idl_codegen/instructions/refreshObligation.ts +24 -0
- package/src/idl_codegen/instructions/refreshObligationFarmsForReserve.ts +62 -0
- package/src/idl_codegen/instructions/refreshReserve.ts +40 -0
- package/src/idl_codegen/instructions/refreshReservesBatch.ts +29 -0
- package/src/idl_codegen/instructions/repayObligationLiquidity.ts +64 -0
- package/src/idl_codegen/instructions/requestElevationGroup.ts +40 -0
- package/src/idl_codegen/instructions/socializeLoss.ts +48 -0
- package/src/idl_codegen/instructions/updateEntireReserveConfig.ts +45 -0
- package/src/idl_codegen/instructions/updateLendingMarket.ts +43 -0
- package/src/idl_codegen/instructions/updateLendingMarketOwner.ts +28 -0
- package/src/idl_codegen/instructions/updateReserveConfig.ts +52 -0
- package/src/idl_codegen/instructions/updateSingleReserveConfig.ts +48 -0
- package/src/idl_codegen/instructions/withdrawObligationCollateral.ts +68 -0
- package/src/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.ts +102 -0
- package/src/idl_codegen/instructions/withdrawProtocolFee.ts +62 -0
- package/src/idl_codegen/instructions/withdrawReferrerFees.ts +54 -0
- package/src/idl_codegen/programId.ts +13 -0
- package/src/idl_codegen/types/AssetTier.ts +118 -0
- package/src/idl_codegen/types/BigFractionBytes.ts +67 -0
- package/src/idl_codegen/types/BorrowRateCurve.ts +60 -0
- package/src/idl_codegen/types/CurvePoint.ts +64 -0
- package/src/idl_codegen/types/ElevationGroup.ts +133 -0
- package/src/idl_codegen/types/FeeCalculation.ts +90 -0
- package/src/idl_codegen/types/InitObligationArgs.ts +61 -0
- package/src/idl_codegen/types/LastUpdate.ts +95 -0
- package/src/idl_codegen/types/ObligationCollateral.ts +128 -0
- package/src/idl_codegen/types/ObligationLiquidity.ts +159 -0
- package/src/idl_codegen/types/PriceHeuristic.ts +81 -0
- package/src/idl_codegen/types/PythConfiguration.ts +56 -0
- package/src/idl_codegen/types/ReserveCollateral.ts +104 -0
- package/src/idl_codegen/types/ReserveConfig.ts +467 -0
- package/src/idl_codegen/types/ReserveFarmKind.ts +90 -0
- package/src/idl_codegen/types/ReserveFees.ts +122 -0
- package/src/idl_codegen/types/ReserveLiquidity.ts +286 -0
- package/src/idl_codegen/types/ReserveStatus.ts +120 -0
- package/src/idl_codegen/types/ScopeConfiguration.ts +85 -0
- package/src/idl_codegen/types/SwitchboardConfiguration.ts +67 -0
- package/src/idl_codegen/types/TokenInfo.ts +190 -0
- package/src/idl_codegen/types/UpdateConfigMode.ts +1440 -0
- package/src/idl_codegen/types/UpdateLendingMarketConfigValue.ts +376 -0
- package/src/idl_codegen/types/UpdateLendingMarketMode.ts +570 -0
- package/src/idl_codegen/types/WithdrawalCaps.ts +86 -0
- package/src/idl_codegen/types/index.ts +276 -0
- package/src/idl_codegen/zero_padding/ObligationZP.ts +186 -0
- package/src/idl_codegen/zero_padding/index.ts +1 -0
- package/src/idl_codegen_jupiter_perps/accounts/Pool.ts +155 -0
- package/src/idl_codegen_jupiter_perps/accounts/index.ts +2 -0
- package/src/idl_codegen_jupiter_perps/programId.ts +7 -0
- package/src/idl_codegen_jupiter_perps/types/Fees.ts +130 -0
- package/src/idl_codegen_jupiter_perps/types/Limit.ts +72 -0
- package/src/idl_codegen_jupiter_perps/types/PoolApr.ts +69 -0
- package/src/idl_codegen_jupiter_perps/types/index.ts +6 -0
- package/src/idl_codegen_kamino_vault/accounts/Reserve.ts +221 -0
- package/src/idl_codegen_kamino_vault/accounts/VaultState.ts +214 -0
- package/src/idl_codegen_kamino_vault/accounts/index.ts +4 -0
- package/src/idl_codegen_kamino_vault/errors/anchor.ts +764 -0
- package/src/idl_codegen_kamino_vault/errors/custom.ts +344 -0
- package/src/idl_codegen_kamino_vault/errors/index.ts +49 -0
- package/src/idl_codegen_kamino_vault/instructions/deposit.ts +54 -0
- package/src/idl_codegen_kamino_vault/instructions/index.ts +10 -0
- package/src/idl_codegen_kamino_vault/instructions/initVault.ts +35 -0
- package/src/idl_codegen_kamino_vault/instructions/invest.ts +60 -0
- package/src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts +58 -0
- package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +81 -0
- package/src/idl_codegen_kamino_vault/programId.ts +7 -0
- package/src/idl_codegen_kamino_vault/types/BigFractionBytes.ts +61 -0
- package/src/idl_codegen_kamino_vault/types/BorrowRateCurve.ts +55 -0
- package/src/idl_codegen_kamino_vault/types/CurvePoint.ts +61 -0
- package/src/idl_codegen_kamino_vault/types/LastUpdate.ts +90 -0
- package/src/idl_codegen_kamino_vault/types/PriceHeuristic.ts +78 -0
- package/src/idl_codegen_kamino_vault/types/PythConfiguration.ts +56 -0
- package/src/idl_codegen_kamino_vault/types/ReserveCollateral.ts +104 -0
- package/src/idl_codegen_kamino_vault/types/ReserveConfig.ts +426 -0
- package/src/idl_codegen_kamino_vault/types/ReserveFees.ts +118 -0
- package/src/idl_codegen_kamino_vault/types/ReserveLiquidity.ts +268 -0
- package/src/idl_codegen_kamino_vault/types/ScopeConfiguration.ts +85 -0
- package/src/idl_codegen_kamino_vault/types/SwitchboardConfiguration.ts +64 -0
- package/src/idl_codegen_kamino_vault/types/TokenInfo.ts +172 -0
- package/src/idl_codegen_kamino_vault/types/VaultAllocation.ts +115 -0
- package/src/idl_codegen_kamino_vault/types/WithdrawalCaps.ts +86 -0
- package/src/idl_codegen_kamino_vault/types/index.ts +30 -0
- package/src/index.ts +1 -0
- package/src/lending_operations/index.ts +2 -0
- package/src/lending_operations/repay_with_collateral_calcs.ts +71 -0
- package/src/lending_operations/repay_with_collateral_operations.ts +318 -0
- package/src/leverage/calcs.ts +465 -0
- package/src/leverage/index.ts +4 -0
- package/src/leverage/instructions.ts +144 -0
- package/src/leverage/operations.ts +1814 -0
- package/src/leverage/utils.ts +273 -0
- package/src/lib.ts +9 -0
- package/src/referrals/index.ts +2 -0
- package/src/referrals/instructions.ts +114 -0
- package/src/referrals/operations.ts +325 -0
- package/src/utils/ObligationType.ts +171 -0
- package/src/utils/api.ts +59 -0
- package/src/utils/ata.ts +195 -0
- package/src/utils/constants.ts +81 -0
- package/src/utils/idl.ts +4 -0
- package/src/utils/index.ts +16 -0
- package/src/utils/instruction.ts +258 -0
- package/src/utils/kamino.ts +12 -0
- package/src/utils/layout.ts +118 -0
- package/src/utils/lookupTable.ts +55 -0
- package/src/utils/managerTypes.ts +456 -0
- package/src/utils/oracle.ts +337 -0
- package/src/utils/pubkey.ts +261 -0
- package/src/utils/rpc.ts +108 -0
- package/src/utils/seeds.ts +183 -0
- package/src/utils/sendTransactionsUtils.ts +207 -0
- package/src/utils/slots.ts +28 -0
- package/src/utils/syncNative.ts +22 -0
- package/src/utils/userMetadata.ts +401 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
export type CustomError =
|
|
2
|
+
| DepositAmountsZero
|
|
3
|
+
| SharesIssuedAmountDoesNotMatch
|
|
4
|
+
| MathOverflow
|
|
5
|
+
| IntegerOverflow
|
|
6
|
+
| CannotWithdrawZeroAmount
|
|
7
|
+
| TooMuchLiquidityToWithdraw
|
|
8
|
+
| ReserveAlreadyExists
|
|
9
|
+
| ReserveNotPartOfAllocations
|
|
10
|
+
| CouldNotDeserializeAccountAsReserve
|
|
11
|
+
| ReserveNotProvidedInTheAccounts
|
|
12
|
+
| ReserveAccountAndKeyMismatch
|
|
13
|
+
| OutOfRangeOfReserveIndex
|
|
14
|
+
| CannotFindReserveInAllocations
|
|
15
|
+
| CannotInvestZeroAmount
|
|
16
|
+
| SlotDecreased
|
|
17
|
+
| AdminAuthorityIncorrect
|
|
18
|
+
| BaseVaultAuthorityIncorrect
|
|
19
|
+
| BaseVaultAuthorityBumpIncorrect
|
|
20
|
+
| TokenMintIncorrect
|
|
21
|
+
| TokenMintDecimalsIncorrect
|
|
22
|
+
| TokenVaultIncorrect
|
|
23
|
+
| SharesMintDecimalsIncorrect
|
|
24
|
+
| SharesMintIncorrect
|
|
25
|
+
| InitialAccountintIncorrect;
|
|
26
|
+
|
|
27
|
+
export class DepositAmountsZero extends Error {
|
|
28
|
+
static readonly code = 6000;
|
|
29
|
+
readonly code = 6000;
|
|
30
|
+
readonly name = 'DepositAmountsZero';
|
|
31
|
+
readonly msg = 'DepositAmountsZero';
|
|
32
|
+
|
|
33
|
+
constructor(readonly logs?: string[]) {
|
|
34
|
+
super('6000: DepositAmountsZero');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class SharesIssuedAmountDoesNotMatch extends Error {
|
|
39
|
+
static readonly code = 6001;
|
|
40
|
+
readonly code = 6001;
|
|
41
|
+
readonly name = 'SharesIssuedAmountDoesNotMatch';
|
|
42
|
+
readonly msg = 'SharesIssuedAmountDoesNotMatch';
|
|
43
|
+
|
|
44
|
+
constructor(readonly logs?: string[]) {
|
|
45
|
+
super('6001: SharesIssuedAmountDoesNotMatch');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class MathOverflow extends Error {
|
|
50
|
+
static readonly code = 6002;
|
|
51
|
+
readonly code = 6002;
|
|
52
|
+
readonly name = 'MathOverflow';
|
|
53
|
+
readonly msg = 'MathOverflow';
|
|
54
|
+
|
|
55
|
+
constructor(readonly logs?: string[]) {
|
|
56
|
+
super('6002: MathOverflow');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class IntegerOverflow extends Error {
|
|
61
|
+
static readonly code = 6003;
|
|
62
|
+
readonly code = 6003;
|
|
63
|
+
readonly name = 'IntegerOverflow';
|
|
64
|
+
readonly msg = 'IntegerOverflow';
|
|
65
|
+
|
|
66
|
+
constructor(readonly logs?: string[]) {
|
|
67
|
+
super('6003: IntegerOverflow');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class CannotWithdrawZeroAmount extends Error {
|
|
72
|
+
static readonly code = 6004;
|
|
73
|
+
readonly code = 6004;
|
|
74
|
+
readonly name = 'CannotWithdrawZeroAmount';
|
|
75
|
+
readonly msg = 'CannotWithdrawZeroAmount';
|
|
76
|
+
|
|
77
|
+
constructor(readonly logs?: string[]) {
|
|
78
|
+
super('6004: CannotWithdrawZeroAmount');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class TooMuchLiquidityToWithdraw extends Error {
|
|
83
|
+
static readonly code = 6005;
|
|
84
|
+
readonly code = 6005;
|
|
85
|
+
readonly name = 'TooMuchLiquidityToWithdraw';
|
|
86
|
+
readonly msg = 'TooMuchLiquidityToWithdraw';
|
|
87
|
+
|
|
88
|
+
constructor(readonly logs?: string[]) {
|
|
89
|
+
super('6005: TooMuchLiquidityToWithdraw');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class ReserveAlreadyExists extends Error {
|
|
94
|
+
static readonly code = 6006;
|
|
95
|
+
readonly code = 6006;
|
|
96
|
+
readonly name = 'ReserveAlreadyExists';
|
|
97
|
+
readonly msg = 'ReserveAlreadyExists';
|
|
98
|
+
|
|
99
|
+
constructor(readonly logs?: string[]) {
|
|
100
|
+
super('6006: ReserveAlreadyExists');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export class ReserveNotPartOfAllocations extends Error {
|
|
105
|
+
static readonly code = 6007;
|
|
106
|
+
readonly code = 6007;
|
|
107
|
+
readonly name = 'ReserveNotPartOfAllocations';
|
|
108
|
+
readonly msg = 'ReserveNotPartOfAllocations';
|
|
109
|
+
|
|
110
|
+
constructor(readonly logs?: string[]) {
|
|
111
|
+
super('6007: ReserveNotPartOfAllocations');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export class CouldNotDeserializeAccountAsReserve extends Error {
|
|
116
|
+
static readonly code = 6008;
|
|
117
|
+
readonly code = 6008;
|
|
118
|
+
readonly name = 'CouldNotDeserializeAccountAsReserve';
|
|
119
|
+
readonly msg = 'CouldNotDeserializeAccountAsReserve';
|
|
120
|
+
|
|
121
|
+
constructor(readonly logs?: string[]) {
|
|
122
|
+
super('6008: CouldNotDeserializeAccountAsReserve');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export class ReserveNotProvidedInTheAccounts extends Error {
|
|
127
|
+
static readonly code = 6009;
|
|
128
|
+
readonly code = 6009;
|
|
129
|
+
readonly name = 'ReserveNotProvidedInTheAccounts';
|
|
130
|
+
readonly msg = 'ReserveNotProvidedInTheAccounts';
|
|
131
|
+
|
|
132
|
+
constructor(readonly logs?: string[]) {
|
|
133
|
+
super('6009: ReserveNotProvidedInTheAccounts');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export class ReserveAccountAndKeyMismatch extends Error {
|
|
138
|
+
static readonly code = 6010;
|
|
139
|
+
readonly code = 6010;
|
|
140
|
+
readonly name = 'ReserveAccountAndKeyMismatch';
|
|
141
|
+
readonly msg = 'ReserveAccountAndKeyMismatch';
|
|
142
|
+
|
|
143
|
+
constructor(readonly logs?: string[]) {
|
|
144
|
+
super('6010: ReserveAccountAndKeyMismatch');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class OutOfRangeOfReserveIndex extends Error {
|
|
149
|
+
static readonly code = 6011;
|
|
150
|
+
readonly code = 6011;
|
|
151
|
+
readonly name = 'OutOfRangeOfReserveIndex';
|
|
152
|
+
readonly msg = 'OutOfRangeOfReserveIndex';
|
|
153
|
+
|
|
154
|
+
constructor(readonly logs?: string[]) {
|
|
155
|
+
super('6011: OutOfRangeOfReserveIndex');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export class CannotFindReserveInAllocations extends Error {
|
|
160
|
+
static readonly code = 6012;
|
|
161
|
+
readonly code = 6012;
|
|
162
|
+
readonly name = 'CannotFindReserveInAllocations';
|
|
163
|
+
readonly msg = 'OutOfRangeOfReserveIndex';
|
|
164
|
+
|
|
165
|
+
constructor(readonly logs?: string[]) {
|
|
166
|
+
super('6012: OutOfRangeOfReserveIndex');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export class CannotInvestZeroAmount extends Error {
|
|
171
|
+
static readonly code = 6013;
|
|
172
|
+
readonly code = 6013;
|
|
173
|
+
readonly name = 'CannotInvestZeroAmount';
|
|
174
|
+
readonly msg = 'CannotInvestZeroAmount';
|
|
175
|
+
|
|
176
|
+
constructor(readonly logs?: string[]) {
|
|
177
|
+
super('6013: CannotInvestZeroAmount');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export class SlotDecreased extends Error {
|
|
182
|
+
static readonly code = 6014;
|
|
183
|
+
readonly code = 6014;
|
|
184
|
+
readonly name = 'SlotDecreased';
|
|
185
|
+
readonly msg = 'SlotDecreased';
|
|
186
|
+
|
|
187
|
+
constructor(readonly logs?: string[]) {
|
|
188
|
+
super('6014: SlotDecreased');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export class AdminAuthorityIncorrect extends Error {
|
|
193
|
+
static readonly code = 6015;
|
|
194
|
+
readonly code = 6015;
|
|
195
|
+
readonly name = 'AdminAuthorityIncorrect';
|
|
196
|
+
readonly msg = 'AdminAuthorityIncorrect';
|
|
197
|
+
|
|
198
|
+
constructor(readonly logs?: string[]) {
|
|
199
|
+
super('6015: AdminAuthorityIncorrect');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export class BaseVaultAuthorityIncorrect extends Error {
|
|
204
|
+
static readonly code = 6016;
|
|
205
|
+
readonly code = 6016;
|
|
206
|
+
readonly name = 'BaseVaultAuthorityIncorrect';
|
|
207
|
+
readonly msg = 'BaseVaultAuthorityIncorrect';
|
|
208
|
+
|
|
209
|
+
constructor(readonly logs?: string[]) {
|
|
210
|
+
super('6016: BaseVaultAuthorityIncorrect');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export class BaseVaultAuthorityBumpIncorrect extends Error {
|
|
215
|
+
static readonly code = 6017;
|
|
216
|
+
readonly code = 6017;
|
|
217
|
+
readonly name = 'BaseVaultAuthorityBumpIncorrect';
|
|
218
|
+
readonly msg = 'BaseVaultAuthorityBumpIncorrect';
|
|
219
|
+
|
|
220
|
+
constructor(readonly logs?: string[]) {
|
|
221
|
+
super('6017: BaseVaultAuthorityBumpIncorrect');
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export class TokenMintIncorrect extends Error {
|
|
226
|
+
static readonly code = 6018;
|
|
227
|
+
readonly code = 6018;
|
|
228
|
+
readonly name = 'TokenMintIncorrect';
|
|
229
|
+
readonly msg = 'TokenMintIncorrect';
|
|
230
|
+
|
|
231
|
+
constructor(readonly logs?: string[]) {
|
|
232
|
+
super('6018: TokenMintIncorrect');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export class TokenMintDecimalsIncorrect extends Error {
|
|
237
|
+
static readonly code = 6019;
|
|
238
|
+
readonly code = 6019;
|
|
239
|
+
readonly name = 'TokenMintDecimalsIncorrect';
|
|
240
|
+
readonly msg = 'TokenMintDecimalsIncorrect';
|
|
241
|
+
|
|
242
|
+
constructor(readonly logs?: string[]) {
|
|
243
|
+
super('6019: TokenMintDecimalsIncorrect');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export class TokenVaultIncorrect extends Error {
|
|
248
|
+
static readonly code = 6020;
|
|
249
|
+
readonly code = 6020;
|
|
250
|
+
readonly name = 'TokenVaultIncorrect';
|
|
251
|
+
readonly msg = 'TokenVaultIncorrect';
|
|
252
|
+
|
|
253
|
+
constructor(readonly logs?: string[]) {
|
|
254
|
+
super('6020: TokenVaultIncorrect');
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export class SharesMintDecimalsIncorrect extends Error {
|
|
259
|
+
static readonly code = 6021;
|
|
260
|
+
readonly code = 6021;
|
|
261
|
+
readonly name = 'SharesMintDecimalsIncorrect';
|
|
262
|
+
readonly msg = 'SharesMintDecimalsIncorrect';
|
|
263
|
+
|
|
264
|
+
constructor(readonly logs?: string[]) {
|
|
265
|
+
super('6021: SharesMintDecimalsIncorrect');
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export class SharesMintIncorrect extends Error {
|
|
270
|
+
static readonly code = 6022;
|
|
271
|
+
readonly code = 6022;
|
|
272
|
+
readonly name = 'SharesMintIncorrect';
|
|
273
|
+
readonly msg = 'SharesMintIncorrect';
|
|
274
|
+
|
|
275
|
+
constructor(readonly logs?: string[]) {
|
|
276
|
+
super('6022: SharesMintIncorrect');
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export class InitialAccountintIncorrect extends Error {
|
|
281
|
+
static readonly code = 6023;
|
|
282
|
+
readonly code = 6023;
|
|
283
|
+
readonly name = 'InitialAccountintIncorrect';
|
|
284
|
+
readonly msg = 'InitialAccountintIncorrect';
|
|
285
|
+
|
|
286
|
+
constructor(readonly logs?: string[]) {
|
|
287
|
+
super('6023: InitialAccountintIncorrect');
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export function fromCode(code: number, logs?: string[]): CustomError | null {
|
|
292
|
+
switch (code) {
|
|
293
|
+
case 6000:
|
|
294
|
+
return new DepositAmountsZero(logs);
|
|
295
|
+
case 6001:
|
|
296
|
+
return new SharesIssuedAmountDoesNotMatch(logs);
|
|
297
|
+
case 6002:
|
|
298
|
+
return new MathOverflow(logs);
|
|
299
|
+
case 6003:
|
|
300
|
+
return new IntegerOverflow(logs);
|
|
301
|
+
case 6004:
|
|
302
|
+
return new CannotWithdrawZeroAmount(logs);
|
|
303
|
+
case 6005:
|
|
304
|
+
return new TooMuchLiquidityToWithdraw(logs);
|
|
305
|
+
case 6006:
|
|
306
|
+
return new ReserveAlreadyExists(logs);
|
|
307
|
+
case 6007:
|
|
308
|
+
return new ReserveNotPartOfAllocations(logs);
|
|
309
|
+
case 6008:
|
|
310
|
+
return new CouldNotDeserializeAccountAsReserve(logs);
|
|
311
|
+
case 6009:
|
|
312
|
+
return new ReserveNotProvidedInTheAccounts(logs);
|
|
313
|
+
case 6010:
|
|
314
|
+
return new ReserveAccountAndKeyMismatch(logs);
|
|
315
|
+
case 6011:
|
|
316
|
+
return new OutOfRangeOfReserveIndex(logs);
|
|
317
|
+
case 6012:
|
|
318
|
+
return new CannotFindReserveInAllocations(logs);
|
|
319
|
+
case 6013:
|
|
320
|
+
return new CannotInvestZeroAmount(logs);
|
|
321
|
+
case 6014:
|
|
322
|
+
return new SlotDecreased(logs);
|
|
323
|
+
case 6015:
|
|
324
|
+
return new AdminAuthorityIncorrect(logs);
|
|
325
|
+
case 6016:
|
|
326
|
+
return new BaseVaultAuthorityIncorrect(logs);
|
|
327
|
+
case 6017:
|
|
328
|
+
return new BaseVaultAuthorityBumpIncorrect(logs);
|
|
329
|
+
case 6018:
|
|
330
|
+
return new TokenMintIncorrect(logs);
|
|
331
|
+
case 6019:
|
|
332
|
+
return new TokenMintDecimalsIncorrect(logs);
|
|
333
|
+
case 6020:
|
|
334
|
+
return new TokenVaultIncorrect(logs);
|
|
335
|
+
case 6021:
|
|
336
|
+
return new SharesMintDecimalsIncorrect(logs);
|
|
337
|
+
case 6022:
|
|
338
|
+
return new SharesMintIncorrect(logs);
|
|
339
|
+
case 6023:
|
|
340
|
+
return new InitialAccountintIncorrect(logs);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
|
+
import { PROGRAM_ID } from '../programId';
|
|
3
|
+
import * as anchor from './anchor';
|
|
4
|
+
import * as custom from './custom';
|
|
5
|
+
|
|
6
|
+
export function fromCode(code: number, logs?: string[]): custom.CustomError | anchor.AnchorError | null {
|
|
7
|
+
return code >= 6000 ? custom.fromCode(code, logs) : anchor.fromCode(code, logs);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function hasOwnProperty<X extends object, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown> {
|
|
11
|
+
return Object.hasOwnProperty.call(obj, prop);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const errorRe = /Program (\w+) failed: custom program error: (\w+)/;
|
|
15
|
+
|
|
16
|
+
export function fromTxError(
|
|
17
|
+
err: unknown,
|
|
18
|
+
programId: PublicKey = PROGRAM_ID
|
|
19
|
+
): custom.CustomError | anchor.AnchorError | null {
|
|
20
|
+
if (typeof err !== 'object' || err === null || !hasOwnProperty(err, 'logs') || !Array.isArray(err.logs)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let firstMatch: RegExpExecArray | null = null;
|
|
25
|
+
for (const logLine of err.logs) {
|
|
26
|
+
firstMatch = errorRe.exec(logLine);
|
|
27
|
+
if (firstMatch !== null) {
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (firstMatch === null) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const [programIdRaw, codeRaw] = firstMatch.slice(1);
|
|
37
|
+
if (programIdRaw !== programId.toString()) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let errorCode: number;
|
|
42
|
+
try {
|
|
43
|
+
errorCode = parseInt(codeRaw, 16);
|
|
44
|
+
} catch (parseErr) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return fromCode(errorCode, err.logs);
|
|
49
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as borsh from '@coral-xyz/borsh'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
import { PROGRAM_ID } from '../programId';
|
|
6
|
+
|
|
7
|
+
export interface DepositArgs {
|
|
8
|
+
maxAmount: BN;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface DepositAccounts {
|
|
12
|
+
user: PublicKey;
|
|
13
|
+
vaultState: PublicKey;
|
|
14
|
+
tokenVault: PublicKey;
|
|
15
|
+
tokenMint: PublicKey;
|
|
16
|
+
baseVaultAuthority: PublicKey;
|
|
17
|
+
sharesMint: PublicKey;
|
|
18
|
+
tokenAta: PublicKey;
|
|
19
|
+
userSharesAta: PublicKey;
|
|
20
|
+
tokenProgram: PublicKey;
|
|
21
|
+
instructionSysvarAccount: PublicKey;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const layout = borsh.struct([borsh.u64('maxAmount')]);
|
|
25
|
+
|
|
26
|
+
export function deposit(args: DepositArgs, accounts: DepositAccounts, programId: PublicKey = PROGRAM_ID) {
|
|
27
|
+
const keys: Array<AccountMeta> = [
|
|
28
|
+
{ pubkey: accounts.user, isSigner: true, isWritable: true },
|
|
29
|
+
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
30
|
+
{ pubkey: accounts.tokenVault, isSigner: false, isWritable: true },
|
|
31
|
+
{ pubkey: accounts.tokenMint, isSigner: false, isWritable: false },
|
|
32
|
+
{ pubkey: accounts.baseVaultAuthority, isSigner: false, isWritable: false },
|
|
33
|
+
{ pubkey: accounts.sharesMint, isSigner: false, isWritable: true },
|
|
34
|
+
{ pubkey: accounts.tokenAta, isSigner: false, isWritable: true },
|
|
35
|
+
{ pubkey: accounts.userSharesAta, isSigner: false, isWritable: true },
|
|
36
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
37
|
+
{
|
|
38
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
39
|
+
isSigner: false,
|
|
40
|
+
isWritable: false,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
const identifier = Buffer.from([242, 35, 198, 137, 82, 225, 242, 182]);
|
|
44
|
+
const buffer = Buffer.alloc(1000);
|
|
45
|
+
const len = layout.encode(
|
|
46
|
+
{
|
|
47
|
+
maxAmount: args.maxAmount,
|
|
48
|
+
},
|
|
49
|
+
buffer
|
|
50
|
+
);
|
|
51
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
52
|
+
const ix = new TransactionInstruction({ keys, programId, data });
|
|
53
|
+
return ix;
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { initVault } from './initVault';
|
|
2
|
+
export type { InitVaultAccounts } from './initVault';
|
|
3
|
+
export { updateReserveAllocation } from './updateReserveAllocation';
|
|
4
|
+
export type { UpdateReserveAllocationArgs, UpdateReserveAllocationAccounts } from './updateReserveAllocation';
|
|
5
|
+
export { deposit } from './deposit';
|
|
6
|
+
export type { DepositArgs, DepositAccounts } from './deposit';
|
|
7
|
+
export { withdraw } from './withdraw';
|
|
8
|
+
export type { WithdrawArgs, WithdrawAccounts } from './withdraw';
|
|
9
|
+
export { invest } from './invest';
|
|
10
|
+
export type { InvestAccounts } from './invest';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as borsh from '@coral-xyz/borsh'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
import { PROGRAM_ID } from '../programId';
|
|
6
|
+
|
|
7
|
+
export interface InitVaultAccounts {
|
|
8
|
+
adminAuthority: PublicKey;
|
|
9
|
+
vaultState: PublicKey;
|
|
10
|
+
tokenMint: PublicKey;
|
|
11
|
+
tokenVault: PublicKey;
|
|
12
|
+
baseVaultAuthority: PublicKey;
|
|
13
|
+
sharesMint: PublicKey;
|
|
14
|
+
systemProgram: PublicKey;
|
|
15
|
+
rent: PublicKey;
|
|
16
|
+
tokenProgram: PublicKey;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function initVault(accounts: InitVaultAccounts, programId: PublicKey = PROGRAM_ID) {
|
|
20
|
+
const keys: Array<AccountMeta> = [
|
|
21
|
+
{ pubkey: accounts.adminAuthority, isSigner: true, isWritable: true },
|
|
22
|
+
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
23
|
+
{ pubkey: accounts.tokenMint, isSigner: false, isWritable: false },
|
|
24
|
+
{ pubkey: accounts.tokenVault, isSigner: false, isWritable: true },
|
|
25
|
+
{ pubkey: accounts.baseVaultAuthority, isSigner: false, isWritable: true },
|
|
26
|
+
{ pubkey: accounts.sharesMint, isSigner: false, isWritable: true },
|
|
27
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
28
|
+
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
29
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
30
|
+
];
|
|
31
|
+
const identifier = Buffer.from([77, 79, 85, 150, 33, 217, 52, 106]);
|
|
32
|
+
const data = identifier;
|
|
33
|
+
const ix = new TransactionInstruction({ keys, programId, data });
|
|
34
|
+
return ix;
|
|
35
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as borsh from '@coral-xyz/borsh'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
import { PROGRAM_ID } from '../programId';
|
|
6
|
+
|
|
7
|
+
export interface InvestAccounts {
|
|
8
|
+
adminAuthority: PublicKey;
|
|
9
|
+
vaultState: PublicKey;
|
|
10
|
+
tokenVault: PublicKey;
|
|
11
|
+
baseVaultAuthority: PublicKey;
|
|
12
|
+
ctokenVault: PublicKey;
|
|
13
|
+
reserve: PublicKey;
|
|
14
|
+
/** CPI accounts */
|
|
15
|
+
lendingMarket: PublicKey;
|
|
16
|
+
lendingMarketAuthority: PublicKey;
|
|
17
|
+
reserveLiquiditySupply: PublicKey;
|
|
18
|
+
reserveCollateralMint: PublicKey;
|
|
19
|
+
klendProgram: PublicKey;
|
|
20
|
+
instructionSysvarAccount: PublicKey;
|
|
21
|
+
tokenProgram: PublicKey;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function invest(accounts: InvestAccounts, programId: PublicKey = PROGRAM_ID) {
|
|
25
|
+
const keys: Array<AccountMeta> = [
|
|
26
|
+
{ pubkey: accounts.adminAuthority, isSigner: true, isWritable: true },
|
|
27
|
+
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
28
|
+
{ pubkey: accounts.tokenVault, isSigner: false, isWritable: true },
|
|
29
|
+
{ pubkey: accounts.baseVaultAuthority, isSigner: false, isWritable: true },
|
|
30
|
+
{ pubkey: accounts.ctokenVault, isSigner: false, isWritable: true },
|
|
31
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
32
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
33
|
+
{
|
|
34
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
35
|
+
isSigner: false,
|
|
36
|
+
isWritable: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
pubkey: accounts.reserveLiquiditySupply,
|
|
40
|
+
isSigner: false,
|
|
41
|
+
isWritable: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
pubkey: accounts.reserveCollateralMint,
|
|
45
|
+
isSigner: false,
|
|
46
|
+
isWritable: true,
|
|
47
|
+
},
|
|
48
|
+
{ pubkey: accounts.klendProgram, isSigner: false, isWritable: false },
|
|
49
|
+
{
|
|
50
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
51
|
+
isSigner: false,
|
|
52
|
+
isWritable: false,
|
|
53
|
+
},
|
|
54
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
55
|
+
];
|
|
56
|
+
const identifier = Buffer.from([13, 245, 180, 103, 254, 182, 121, 4]);
|
|
57
|
+
const data = identifier;
|
|
58
|
+
const ix = new TransactionInstruction({ keys, programId, data });
|
|
59
|
+
return ix;
|
|
60
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as borsh from '@coral-xyz/borsh'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
import { PROGRAM_ID } from '../programId';
|
|
6
|
+
|
|
7
|
+
export interface UpdateReserveAllocationArgs {
|
|
8
|
+
weight: BN;
|
|
9
|
+
cap: BN;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface UpdateReserveAllocationAccounts {
|
|
13
|
+
adminAuthority: PublicKey;
|
|
14
|
+
vaultState: PublicKey;
|
|
15
|
+
baseVaultAuthority: PublicKey;
|
|
16
|
+
reserveCollateralMint: PublicKey;
|
|
17
|
+
reserve: PublicKey;
|
|
18
|
+
ctokenVault: PublicKey;
|
|
19
|
+
systemProgram: PublicKey;
|
|
20
|
+
rent: PublicKey;
|
|
21
|
+
tokenProgram: PublicKey;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const layout = borsh.struct([borsh.u64('weight'), borsh.u64('cap')]);
|
|
25
|
+
|
|
26
|
+
export function updateReserveAllocation(
|
|
27
|
+
args: UpdateReserveAllocationArgs,
|
|
28
|
+
accounts: UpdateReserveAllocationAccounts,
|
|
29
|
+
programId: PublicKey = PROGRAM_ID
|
|
30
|
+
) {
|
|
31
|
+
const keys: Array<AccountMeta> = [
|
|
32
|
+
{ pubkey: accounts.adminAuthority, isSigner: true, isWritable: true },
|
|
33
|
+
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
34
|
+
{ pubkey: accounts.baseVaultAuthority, isSigner: false, isWritable: false },
|
|
35
|
+
{
|
|
36
|
+
pubkey: accounts.reserveCollateralMint,
|
|
37
|
+
isSigner: false,
|
|
38
|
+
isWritable: true,
|
|
39
|
+
},
|
|
40
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: false },
|
|
41
|
+
{ pubkey: accounts.ctokenVault, isSigner: false, isWritable: true },
|
|
42
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
43
|
+
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
44
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
45
|
+
];
|
|
46
|
+
const identifier = Buffer.from([5, 54, 213, 112, 75, 232, 117, 37]);
|
|
47
|
+
const buffer = Buffer.alloc(1000);
|
|
48
|
+
const len = layout.encode(
|
|
49
|
+
{
|
|
50
|
+
weight: args.weight,
|
|
51
|
+
cap: args.cap,
|
|
52
|
+
},
|
|
53
|
+
buffer
|
|
54
|
+
);
|
|
55
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
56
|
+
const ix = new TransactionInstruction({ keys, programId, data });
|
|
57
|
+
return ix;
|
|
58
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as borsh from '@coral-xyz/borsh'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
import { PROGRAM_ID } from '../programId';
|
|
6
|
+
|
|
7
|
+
export interface WithdrawArgs {
|
|
8
|
+
sharesAmount: BN;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface WithdrawAccounts {
|
|
12
|
+
user: PublicKey;
|
|
13
|
+
vaultState: PublicKey;
|
|
14
|
+
reserve: PublicKey;
|
|
15
|
+
tokenVault: PublicKey;
|
|
16
|
+
ctokenVault: PublicKey;
|
|
17
|
+
baseVaultAuthority: PublicKey;
|
|
18
|
+
tokenAta: PublicKey;
|
|
19
|
+
tokenMint: PublicKey;
|
|
20
|
+
userSharesAta: PublicKey;
|
|
21
|
+
sharesMint: PublicKey;
|
|
22
|
+
tokenProgram: PublicKey;
|
|
23
|
+
/** CPI accounts */
|
|
24
|
+
lendingMarket: PublicKey;
|
|
25
|
+
lendingMarketAuthority: PublicKey;
|
|
26
|
+
reserveLiquiditySupply: PublicKey;
|
|
27
|
+
reserveCollateralMint: PublicKey;
|
|
28
|
+
klendProgram: PublicKey;
|
|
29
|
+
instructionSysvarAccount: PublicKey;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const layout = borsh.struct([borsh.u64('sharesAmount')]);
|
|
33
|
+
|
|
34
|
+
export function withdraw(args: WithdrawArgs, accounts: WithdrawAccounts, programId: PublicKey = PROGRAM_ID) {
|
|
35
|
+
const keys: Array<AccountMeta> = [
|
|
36
|
+
{ pubkey: accounts.user, isSigner: true, isWritable: true },
|
|
37
|
+
{ pubkey: accounts.vaultState, isSigner: false, isWritable: true },
|
|
38
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
39
|
+
{ pubkey: accounts.tokenVault, isSigner: false, isWritable: true },
|
|
40
|
+
{ pubkey: accounts.ctokenVault, isSigner: false, isWritable: true },
|
|
41
|
+
{ pubkey: accounts.baseVaultAuthority, isSigner: false, isWritable: true },
|
|
42
|
+
{ pubkey: accounts.tokenAta, isSigner: false, isWritable: true },
|
|
43
|
+
{ pubkey: accounts.tokenMint, isSigner: false, isWritable: false },
|
|
44
|
+
{ pubkey: accounts.userSharesAta, isSigner: false, isWritable: true },
|
|
45
|
+
{ pubkey: accounts.sharesMint, isSigner: false, isWritable: true },
|
|
46
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
47
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
48
|
+
{
|
|
49
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
50
|
+
isSigner: false,
|
|
51
|
+
isWritable: false,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
pubkey: accounts.reserveLiquiditySupply,
|
|
55
|
+
isSigner: false,
|
|
56
|
+
isWritable: true,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
pubkey: accounts.reserveCollateralMint,
|
|
60
|
+
isSigner: false,
|
|
61
|
+
isWritable: true,
|
|
62
|
+
},
|
|
63
|
+
{ pubkey: accounts.klendProgram, isSigner: false, isWritable: false },
|
|
64
|
+
{
|
|
65
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
66
|
+
isSigner: false,
|
|
67
|
+
isWritable: false,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
const identifier = Buffer.from([183, 18, 70, 156, 148, 109, 161, 34]);
|
|
71
|
+
const buffer = Buffer.alloc(1000);
|
|
72
|
+
const len = layout.encode(
|
|
73
|
+
{
|
|
74
|
+
sharesAmount: args.sharesAmount,
|
|
75
|
+
},
|
|
76
|
+
buffer
|
|
77
|
+
);
|
|
78
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
79
|
+
const ix = new TransactionInstruction({ keys, programId, data });
|
|
80
|
+
return ix;
|
|
81
|
+
}
|