@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,426 @@
|
|
|
1
|
+
import { PublicKey } 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 types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as borsh from '@coral-xyz/borsh';
|
|
5
|
+
|
|
6
|
+
export interface ReserveConfigFields {
|
|
7
|
+
/** Status of the reserve Active/Obsolete/Hidden */
|
|
8
|
+
status: number;
|
|
9
|
+
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
10
|
+
assetTier: number;
|
|
11
|
+
reserved0: Array<number>;
|
|
12
|
+
/** Boost for side (debt or collateral) */
|
|
13
|
+
multiplierSideBoost: Array<number>;
|
|
14
|
+
/** Reward points multiplier per obligation type */
|
|
15
|
+
multiplierTagBoost: Array<number>;
|
|
16
|
+
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
17
|
+
protocolTakeRatePct: number;
|
|
18
|
+
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
19
|
+
protocolLiquidationFeePct: number;
|
|
20
|
+
/**
|
|
21
|
+
* Target ratio of the value of borrows to deposits, as a percentage
|
|
22
|
+
* 0 if use as collateral is disabled
|
|
23
|
+
*/
|
|
24
|
+
loanToValuePct: number;
|
|
25
|
+
/** Loan to value ratio at which an obligation can be liquidated, as percentage */
|
|
26
|
+
liquidationThresholdPct: number;
|
|
27
|
+
/** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
28
|
+
minLiquidationBonusBps: number;
|
|
29
|
+
/** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
30
|
+
maxLiquidationBonusBps: number;
|
|
31
|
+
/** Bad debt liquidation bonus for an undercollateralized obligation, as bps */
|
|
32
|
+
badDebtLiquidationBonusBps: number;
|
|
33
|
+
/** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */
|
|
34
|
+
deleveragingMarginCallPeriodSecs: BN;
|
|
35
|
+
/**
|
|
36
|
+
* The rate at which the deleveraging threshold decreases in slots per bps
|
|
37
|
+
* e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)
|
|
38
|
+
*/
|
|
39
|
+
deleveragingThresholdSlotsPerBps: BN;
|
|
40
|
+
/** Program owner fees assessed, separate from gains due to interest accrual */
|
|
41
|
+
fees: types.ReserveFeesFields;
|
|
42
|
+
/** Borrow rate curve based on utilization */
|
|
43
|
+
borrowRateCurve: types.BorrowRateCurveFields;
|
|
44
|
+
/** Borrow factor in percentage - used for risk adjustment */
|
|
45
|
+
borrowFactorPct: BN;
|
|
46
|
+
/** Maximum deposit limit of liquidity in native units, u64::MAX for inf */
|
|
47
|
+
depositLimit: BN;
|
|
48
|
+
/** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */
|
|
49
|
+
borrowLimit: BN;
|
|
50
|
+
/** Token id from TokenInfos struct */
|
|
51
|
+
tokenInfo: types.TokenInfoFields;
|
|
52
|
+
/** Deposit withdrawl caps - deposit & redeem */
|
|
53
|
+
depositWithdrawalCap: types.WithdrawalCapsFields;
|
|
54
|
+
/** Debt withdrawl caps - borrow & repay */
|
|
55
|
+
debtWithdrawalCap: types.WithdrawalCapsFields;
|
|
56
|
+
elevationGroups: Array<number>;
|
|
57
|
+
disableUsageAsCollOutsideEmode: number;
|
|
58
|
+
utilizationLimitBlockBorrowingAbove: number;
|
|
59
|
+
reserved1: Array<number>;
|
|
60
|
+
/**
|
|
61
|
+
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
62
|
+
* - u64::MAX for inf
|
|
63
|
+
* - 0 to disable borrows outside elevation groups
|
|
64
|
+
*/
|
|
65
|
+
borrowLimitOutsideElevationGroup: BN;
|
|
66
|
+
/**
|
|
67
|
+
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
68
|
+
* that can be borrowed when this reserve is used as collateral.
|
|
69
|
+
* - u64::MAX for inf
|
|
70
|
+
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
71
|
+
*/
|
|
72
|
+
borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ReserveConfigJSON {
|
|
76
|
+
/** Status of the reserve Active/Obsolete/Hidden */
|
|
77
|
+
status: number;
|
|
78
|
+
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
79
|
+
assetTier: number;
|
|
80
|
+
reserved0: Array<number>;
|
|
81
|
+
/** Boost for side (debt or collateral) */
|
|
82
|
+
multiplierSideBoost: Array<number>;
|
|
83
|
+
/** Reward points multiplier per obligation type */
|
|
84
|
+
multiplierTagBoost: Array<number>;
|
|
85
|
+
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
86
|
+
protocolTakeRatePct: number;
|
|
87
|
+
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
88
|
+
protocolLiquidationFeePct: number;
|
|
89
|
+
/**
|
|
90
|
+
* Target ratio of the value of borrows to deposits, as a percentage
|
|
91
|
+
* 0 if use as collateral is disabled
|
|
92
|
+
*/
|
|
93
|
+
loanToValuePct: number;
|
|
94
|
+
/** Loan to value ratio at which an obligation can be liquidated, as percentage */
|
|
95
|
+
liquidationThresholdPct: number;
|
|
96
|
+
/** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
97
|
+
minLiquidationBonusBps: number;
|
|
98
|
+
/** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
99
|
+
maxLiquidationBonusBps: number;
|
|
100
|
+
/** Bad debt liquidation bonus for an undercollateralized obligation, as bps */
|
|
101
|
+
badDebtLiquidationBonusBps: number;
|
|
102
|
+
/** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */
|
|
103
|
+
deleveragingMarginCallPeriodSecs: string;
|
|
104
|
+
/**
|
|
105
|
+
* The rate at which the deleveraging threshold decreases in slots per bps
|
|
106
|
+
* e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)
|
|
107
|
+
*/
|
|
108
|
+
deleveragingThresholdSlotsPerBps: string;
|
|
109
|
+
/** Program owner fees assessed, separate from gains due to interest accrual */
|
|
110
|
+
fees: types.ReserveFeesJSON;
|
|
111
|
+
/** Borrow rate curve based on utilization */
|
|
112
|
+
borrowRateCurve: types.BorrowRateCurveJSON;
|
|
113
|
+
/** Borrow factor in percentage - used for risk adjustment */
|
|
114
|
+
borrowFactorPct: string;
|
|
115
|
+
/** Maximum deposit limit of liquidity in native units, u64::MAX for inf */
|
|
116
|
+
depositLimit: string;
|
|
117
|
+
/** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */
|
|
118
|
+
borrowLimit: string;
|
|
119
|
+
/** Token id from TokenInfos struct */
|
|
120
|
+
tokenInfo: types.TokenInfoJSON;
|
|
121
|
+
/** Deposit withdrawl caps - deposit & redeem */
|
|
122
|
+
depositWithdrawalCap: types.WithdrawalCapsJSON;
|
|
123
|
+
/** Debt withdrawl caps - borrow & repay */
|
|
124
|
+
debtWithdrawalCap: types.WithdrawalCapsJSON;
|
|
125
|
+
elevationGroups: Array<number>;
|
|
126
|
+
disableUsageAsCollOutsideEmode: number;
|
|
127
|
+
utilizationLimitBlockBorrowingAbove: number;
|
|
128
|
+
reserved1: Array<number>;
|
|
129
|
+
/**
|
|
130
|
+
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
131
|
+
* - u64::MAX for inf
|
|
132
|
+
* - 0 to disable borrows outside elevation groups
|
|
133
|
+
*/
|
|
134
|
+
borrowLimitOutsideElevationGroup: string;
|
|
135
|
+
/**
|
|
136
|
+
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
137
|
+
* that can be borrowed when this reserve is used as collateral.
|
|
138
|
+
* - u64::MAX for inf
|
|
139
|
+
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
140
|
+
*/
|
|
141
|
+
borrowLimitAgainstThisCollateralInElevationGroup: Array<string>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Reserve configuration values */
|
|
145
|
+
export class ReserveConfig {
|
|
146
|
+
/** Status of the reserve Active/Obsolete/Hidden */
|
|
147
|
+
readonly status: number;
|
|
148
|
+
/** Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt */
|
|
149
|
+
readonly assetTier: number;
|
|
150
|
+
readonly reserved0: Array<number>;
|
|
151
|
+
/** Boost for side (debt or collateral) */
|
|
152
|
+
readonly multiplierSideBoost: Array<number>;
|
|
153
|
+
/** Reward points multiplier per obligation type */
|
|
154
|
+
readonly multiplierTagBoost: Array<number>;
|
|
155
|
+
/** Protocol take rate is the amount borrowed interest protocol receives, as a percentage */
|
|
156
|
+
readonly protocolTakeRatePct: number;
|
|
157
|
+
/** Cut of the liquidation bonus that the protocol receives, as a percentage */
|
|
158
|
+
readonly protocolLiquidationFeePct: number;
|
|
159
|
+
/**
|
|
160
|
+
* Target ratio of the value of borrows to deposits, as a percentage
|
|
161
|
+
* 0 if use as collateral is disabled
|
|
162
|
+
*/
|
|
163
|
+
readonly loanToValuePct: number;
|
|
164
|
+
/** Loan to value ratio at which an obligation can be liquidated, as percentage */
|
|
165
|
+
readonly liquidationThresholdPct: number;
|
|
166
|
+
/** Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
167
|
+
readonly minLiquidationBonusBps: number;
|
|
168
|
+
/** Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps */
|
|
169
|
+
readonly maxLiquidationBonusBps: number;
|
|
170
|
+
/** Bad debt liquidation bonus for an undercollateralized obligation, as bps */
|
|
171
|
+
readonly badDebtLiquidationBonusBps: number;
|
|
172
|
+
/** Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed */
|
|
173
|
+
readonly deleveragingMarginCallPeriodSecs: BN;
|
|
174
|
+
/**
|
|
175
|
+
* The rate at which the deleveraging threshold decreases in slots per bps
|
|
176
|
+
* e.g. 1 bps per hour would be 7200 slots per bps (assuming 2 slots per second)
|
|
177
|
+
*/
|
|
178
|
+
readonly deleveragingThresholdSlotsPerBps: BN;
|
|
179
|
+
/** Program owner fees assessed, separate from gains due to interest accrual */
|
|
180
|
+
readonly fees: types.ReserveFees;
|
|
181
|
+
/** Borrow rate curve based on utilization */
|
|
182
|
+
readonly borrowRateCurve: types.BorrowRateCurve;
|
|
183
|
+
/** Borrow factor in percentage - used for risk adjustment */
|
|
184
|
+
readonly borrowFactorPct: BN;
|
|
185
|
+
/** Maximum deposit limit of liquidity in native units, u64::MAX for inf */
|
|
186
|
+
readonly depositLimit: BN;
|
|
187
|
+
/** Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits) */
|
|
188
|
+
readonly borrowLimit: BN;
|
|
189
|
+
/** Token id from TokenInfos struct */
|
|
190
|
+
readonly tokenInfo: types.TokenInfo;
|
|
191
|
+
/** Deposit withdrawl caps - deposit & redeem */
|
|
192
|
+
readonly depositWithdrawalCap: types.WithdrawalCaps;
|
|
193
|
+
/** Debt withdrawl caps - borrow & repay */
|
|
194
|
+
readonly debtWithdrawalCap: types.WithdrawalCaps;
|
|
195
|
+
readonly elevationGroups: Array<number>;
|
|
196
|
+
readonly disableUsageAsCollOutsideEmode: number;
|
|
197
|
+
readonly utilizationLimitBlockBorrowingAbove: number;
|
|
198
|
+
readonly reserved1: Array<number>;
|
|
199
|
+
/**
|
|
200
|
+
* Maximum amount liquidity of this reserve borrowed outside all elevation groups
|
|
201
|
+
* - u64::MAX for inf
|
|
202
|
+
* - 0 to disable borrows outside elevation groups
|
|
203
|
+
*/
|
|
204
|
+
readonly borrowLimitOutsideElevationGroup: BN;
|
|
205
|
+
/**
|
|
206
|
+
* Defines the maximum amount (in lamports of elevation group debt asset)
|
|
207
|
+
* that can be borrowed when this reserve is used as collateral.
|
|
208
|
+
* - u64::MAX for inf
|
|
209
|
+
* - 0 to disable borrows in this elevation group (expected value for the debt asset)
|
|
210
|
+
*/
|
|
211
|
+
readonly borrowLimitAgainstThisCollateralInElevationGroup: Array<BN>;
|
|
212
|
+
|
|
213
|
+
constructor(fields: ReserveConfigFields) {
|
|
214
|
+
this.status = fields.status;
|
|
215
|
+
this.assetTier = fields.assetTier;
|
|
216
|
+
this.reserved0 = fields.reserved0;
|
|
217
|
+
this.multiplierSideBoost = fields.multiplierSideBoost;
|
|
218
|
+
this.multiplierTagBoost = fields.multiplierTagBoost;
|
|
219
|
+
this.protocolTakeRatePct = fields.protocolTakeRatePct;
|
|
220
|
+
this.protocolLiquidationFeePct = fields.protocolLiquidationFeePct;
|
|
221
|
+
this.loanToValuePct = fields.loanToValuePct;
|
|
222
|
+
this.liquidationThresholdPct = fields.liquidationThresholdPct;
|
|
223
|
+
this.minLiquidationBonusBps = fields.minLiquidationBonusBps;
|
|
224
|
+
this.maxLiquidationBonusBps = fields.maxLiquidationBonusBps;
|
|
225
|
+
this.badDebtLiquidationBonusBps = fields.badDebtLiquidationBonusBps;
|
|
226
|
+
this.deleveragingMarginCallPeriodSecs = fields.deleveragingMarginCallPeriodSecs;
|
|
227
|
+
this.deleveragingThresholdSlotsPerBps = fields.deleveragingThresholdSlotsPerBps;
|
|
228
|
+
this.fees = new types.ReserveFees({ ...fields.fees });
|
|
229
|
+
this.borrowRateCurve = new types.BorrowRateCurve({
|
|
230
|
+
...fields.borrowRateCurve,
|
|
231
|
+
});
|
|
232
|
+
this.borrowFactorPct = fields.borrowFactorPct;
|
|
233
|
+
this.depositLimit = fields.depositLimit;
|
|
234
|
+
this.borrowLimit = fields.borrowLimit;
|
|
235
|
+
this.tokenInfo = new types.TokenInfo({ ...fields.tokenInfo });
|
|
236
|
+
this.depositWithdrawalCap = new types.WithdrawalCaps({
|
|
237
|
+
...fields.depositWithdrawalCap,
|
|
238
|
+
});
|
|
239
|
+
this.debtWithdrawalCap = new types.WithdrawalCaps({
|
|
240
|
+
...fields.debtWithdrawalCap,
|
|
241
|
+
});
|
|
242
|
+
this.elevationGroups = fields.elevationGroups;
|
|
243
|
+
this.disableUsageAsCollOutsideEmode = fields.disableUsageAsCollOutsideEmode;
|
|
244
|
+
this.utilizationLimitBlockBorrowingAbove = fields.utilizationLimitBlockBorrowingAbove;
|
|
245
|
+
this.reserved1 = fields.reserved1;
|
|
246
|
+
this.borrowLimitOutsideElevationGroup = fields.borrowLimitOutsideElevationGroup;
|
|
247
|
+
this.borrowLimitAgainstThisCollateralInElevationGroup = fields.borrowLimitAgainstThisCollateralInElevationGroup;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
static layout(property?: string) {
|
|
251
|
+
return borsh.struct(
|
|
252
|
+
[
|
|
253
|
+
borsh.u8('status'),
|
|
254
|
+
borsh.u8('assetTier'),
|
|
255
|
+
borsh.array(borsh.u8(), 2, 'reserved0'),
|
|
256
|
+
borsh.array(borsh.u8(), 2, 'multiplierSideBoost'),
|
|
257
|
+
borsh.array(borsh.u8(), 8, 'multiplierTagBoost'),
|
|
258
|
+
borsh.u8('protocolTakeRatePct'),
|
|
259
|
+
borsh.u8('protocolLiquidationFeePct'),
|
|
260
|
+
borsh.u8('loanToValuePct'),
|
|
261
|
+
borsh.u8('liquidationThresholdPct'),
|
|
262
|
+
borsh.u16('minLiquidationBonusBps'),
|
|
263
|
+
borsh.u16('maxLiquidationBonusBps'),
|
|
264
|
+
borsh.u16('badDebtLiquidationBonusBps'),
|
|
265
|
+
borsh.u64('deleveragingMarginCallPeriodSecs'),
|
|
266
|
+
borsh.u64('deleveragingThresholdSlotsPerBps'),
|
|
267
|
+
types.ReserveFees.layout('fees'),
|
|
268
|
+
types.BorrowRateCurve.layout('borrowRateCurve'),
|
|
269
|
+
borsh.u64('borrowFactorPct'),
|
|
270
|
+
borsh.u64('depositLimit'),
|
|
271
|
+
borsh.u64('borrowLimit'),
|
|
272
|
+
types.TokenInfo.layout('tokenInfo'),
|
|
273
|
+
types.WithdrawalCaps.layout('depositWithdrawalCap'),
|
|
274
|
+
types.WithdrawalCaps.layout('debtWithdrawalCap'),
|
|
275
|
+
borsh.array(borsh.u8(), 20, 'elevationGroups'),
|
|
276
|
+
borsh.u8('disableUsageAsCollOutsideEmode'),
|
|
277
|
+
borsh.u8('utilizationLimitBlockBorrowingAbove'),
|
|
278
|
+
borsh.array(borsh.u8(), 2, 'reserved1'),
|
|
279
|
+
borsh.u64('borrowLimitOutsideElevationGroup'),
|
|
280
|
+
borsh.array(borsh.u64(), 32, 'borrowLimitAgainstThisCollateralInElevationGroup'),
|
|
281
|
+
],
|
|
282
|
+
property
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
287
|
+
static fromDecoded(obj: any) {
|
|
288
|
+
return new ReserveConfig({
|
|
289
|
+
status: obj.status,
|
|
290
|
+
assetTier: obj.assetTier,
|
|
291
|
+
reserved0: obj.reserved0,
|
|
292
|
+
multiplierSideBoost: obj.multiplierSideBoost,
|
|
293
|
+
multiplierTagBoost: obj.multiplierTagBoost,
|
|
294
|
+
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
295
|
+
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
296
|
+
loanToValuePct: obj.loanToValuePct,
|
|
297
|
+
liquidationThresholdPct: obj.liquidationThresholdPct,
|
|
298
|
+
minLiquidationBonusBps: obj.minLiquidationBonusBps,
|
|
299
|
+
maxLiquidationBonusBps: obj.maxLiquidationBonusBps,
|
|
300
|
+
badDebtLiquidationBonusBps: obj.badDebtLiquidationBonusBps,
|
|
301
|
+
deleveragingMarginCallPeriodSecs: obj.deleveragingMarginCallPeriodSecs,
|
|
302
|
+
deleveragingThresholdSlotsPerBps: obj.deleveragingThresholdSlotsPerBps,
|
|
303
|
+
fees: types.ReserveFees.fromDecoded(obj.fees),
|
|
304
|
+
borrowRateCurve: types.BorrowRateCurve.fromDecoded(obj.borrowRateCurve),
|
|
305
|
+
borrowFactorPct: obj.borrowFactorPct,
|
|
306
|
+
depositLimit: obj.depositLimit,
|
|
307
|
+
borrowLimit: obj.borrowLimit,
|
|
308
|
+
tokenInfo: types.TokenInfo.fromDecoded(obj.tokenInfo),
|
|
309
|
+
depositWithdrawalCap: types.WithdrawalCaps.fromDecoded(obj.depositWithdrawalCap),
|
|
310
|
+
debtWithdrawalCap: types.WithdrawalCaps.fromDecoded(obj.debtWithdrawalCap),
|
|
311
|
+
elevationGroups: obj.elevationGroups,
|
|
312
|
+
disableUsageAsCollOutsideEmode: obj.disableUsageAsCollOutsideEmode,
|
|
313
|
+
utilizationLimitBlockBorrowingAbove: obj.utilizationLimitBlockBorrowingAbove,
|
|
314
|
+
reserved1: obj.reserved1,
|
|
315
|
+
borrowLimitOutsideElevationGroup: obj.borrowLimitOutsideElevationGroup,
|
|
316
|
+
borrowLimitAgainstThisCollateralInElevationGroup: obj.borrowLimitAgainstThisCollateralInElevationGroup,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
static toEncodable(fields: ReserveConfigFields) {
|
|
321
|
+
return {
|
|
322
|
+
status: fields.status,
|
|
323
|
+
assetTier: fields.assetTier,
|
|
324
|
+
reserved0: fields.reserved0,
|
|
325
|
+
multiplierSideBoost: fields.multiplierSideBoost,
|
|
326
|
+
multiplierTagBoost: fields.multiplierTagBoost,
|
|
327
|
+
protocolTakeRatePct: fields.protocolTakeRatePct,
|
|
328
|
+
protocolLiquidationFeePct: fields.protocolLiquidationFeePct,
|
|
329
|
+
loanToValuePct: fields.loanToValuePct,
|
|
330
|
+
liquidationThresholdPct: fields.liquidationThresholdPct,
|
|
331
|
+
minLiquidationBonusBps: fields.minLiquidationBonusBps,
|
|
332
|
+
maxLiquidationBonusBps: fields.maxLiquidationBonusBps,
|
|
333
|
+
badDebtLiquidationBonusBps: fields.badDebtLiquidationBonusBps,
|
|
334
|
+
deleveragingMarginCallPeriodSecs: fields.deleveragingMarginCallPeriodSecs,
|
|
335
|
+
deleveragingThresholdSlotsPerBps: fields.deleveragingThresholdSlotsPerBps,
|
|
336
|
+
fees: types.ReserveFees.toEncodable(fields.fees),
|
|
337
|
+
borrowRateCurve: types.BorrowRateCurve.toEncodable(fields.borrowRateCurve),
|
|
338
|
+
borrowFactorPct: fields.borrowFactorPct,
|
|
339
|
+
depositLimit: fields.depositLimit,
|
|
340
|
+
borrowLimit: fields.borrowLimit,
|
|
341
|
+
tokenInfo: types.TokenInfo.toEncodable(fields.tokenInfo),
|
|
342
|
+
depositWithdrawalCap: types.WithdrawalCaps.toEncodable(fields.depositWithdrawalCap),
|
|
343
|
+
debtWithdrawalCap: types.WithdrawalCaps.toEncodable(fields.debtWithdrawalCap),
|
|
344
|
+
elevationGroups: fields.elevationGroups,
|
|
345
|
+
disableUsageAsCollOutsideEmode: fields.disableUsageAsCollOutsideEmode,
|
|
346
|
+
utilizationLimitBlockBorrowingAbove: fields.utilizationLimitBlockBorrowingAbove,
|
|
347
|
+
reserved1: fields.reserved1,
|
|
348
|
+
borrowLimitOutsideElevationGroup: fields.borrowLimitOutsideElevationGroup,
|
|
349
|
+
borrowLimitAgainstThisCollateralInElevationGroup: fields.borrowLimitAgainstThisCollateralInElevationGroup,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
toJSON(): ReserveConfigJSON {
|
|
354
|
+
return {
|
|
355
|
+
status: this.status,
|
|
356
|
+
assetTier: this.assetTier,
|
|
357
|
+
reserved0: this.reserved0,
|
|
358
|
+
multiplierSideBoost: this.multiplierSideBoost,
|
|
359
|
+
multiplierTagBoost: this.multiplierTagBoost,
|
|
360
|
+
protocolTakeRatePct: this.protocolTakeRatePct,
|
|
361
|
+
protocolLiquidationFeePct: this.protocolLiquidationFeePct,
|
|
362
|
+
loanToValuePct: this.loanToValuePct,
|
|
363
|
+
liquidationThresholdPct: this.liquidationThresholdPct,
|
|
364
|
+
minLiquidationBonusBps: this.minLiquidationBonusBps,
|
|
365
|
+
maxLiquidationBonusBps: this.maxLiquidationBonusBps,
|
|
366
|
+
badDebtLiquidationBonusBps: this.badDebtLiquidationBonusBps,
|
|
367
|
+
deleveragingMarginCallPeriodSecs: this.deleveragingMarginCallPeriodSecs.toString(),
|
|
368
|
+
deleveragingThresholdSlotsPerBps: this.deleveragingThresholdSlotsPerBps.toString(),
|
|
369
|
+
fees: this.fees.toJSON(),
|
|
370
|
+
borrowRateCurve: this.borrowRateCurve.toJSON(),
|
|
371
|
+
borrowFactorPct: this.borrowFactorPct.toString(),
|
|
372
|
+
depositLimit: this.depositLimit.toString(),
|
|
373
|
+
borrowLimit: this.borrowLimit.toString(),
|
|
374
|
+
tokenInfo: this.tokenInfo.toJSON(),
|
|
375
|
+
depositWithdrawalCap: this.depositWithdrawalCap.toJSON(),
|
|
376
|
+
debtWithdrawalCap: this.debtWithdrawalCap.toJSON(),
|
|
377
|
+
elevationGroups: this.elevationGroups,
|
|
378
|
+
disableUsageAsCollOutsideEmode: this.disableUsageAsCollOutsideEmode,
|
|
379
|
+
utilizationLimitBlockBorrowingAbove: this.utilizationLimitBlockBorrowingAbove,
|
|
380
|
+
reserved1: this.reserved1,
|
|
381
|
+
borrowLimitOutsideElevationGroup: this.borrowLimitOutsideElevationGroup.toString(),
|
|
382
|
+
borrowLimitAgainstThisCollateralInElevationGroup: this.borrowLimitAgainstThisCollateralInElevationGroup.map(
|
|
383
|
+
(item) => item.toString()
|
|
384
|
+
),
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
static fromJSON(obj: ReserveConfigJSON): ReserveConfig {
|
|
389
|
+
return new ReserveConfig({
|
|
390
|
+
status: obj.status,
|
|
391
|
+
assetTier: obj.assetTier,
|
|
392
|
+
reserved0: obj.reserved0,
|
|
393
|
+
multiplierSideBoost: obj.multiplierSideBoost,
|
|
394
|
+
multiplierTagBoost: obj.multiplierTagBoost,
|
|
395
|
+
protocolTakeRatePct: obj.protocolTakeRatePct,
|
|
396
|
+
protocolLiquidationFeePct: obj.protocolLiquidationFeePct,
|
|
397
|
+
loanToValuePct: obj.loanToValuePct,
|
|
398
|
+
liquidationThresholdPct: obj.liquidationThresholdPct,
|
|
399
|
+
minLiquidationBonusBps: obj.minLiquidationBonusBps,
|
|
400
|
+
maxLiquidationBonusBps: obj.maxLiquidationBonusBps,
|
|
401
|
+
badDebtLiquidationBonusBps: obj.badDebtLiquidationBonusBps,
|
|
402
|
+
deleveragingMarginCallPeriodSecs: new BN(obj.deleveragingMarginCallPeriodSecs),
|
|
403
|
+
deleveragingThresholdSlotsPerBps: new BN(obj.deleveragingThresholdSlotsPerBps),
|
|
404
|
+
fees: types.ReserveFees.fromJSON(obj.fees),
|
|
405
|
+
borrowRateCurve: types.BorrowRateCurve.fromJSON(obj.borrowRateCurve),
|
|
406
|
+
borrowFactorPct: new BN(obj.borrowFactorPct),
|
|
407
|
+
depositLimit: new BN(obj.depositLimit),
|
|
408
|
+
borrowLimit: new BN(obj.borrowLimit),
|
|
409
|
+
tokenInfo: types.TokenInfo.fromJSON(obj.tokenInfo),
|
|
410
|
+
depositWithdrawalCap: types.WithdrawalCaps.fromJSON(obj.depositWithdrawalCap),
|
|
411
|
+
debtWithdrawalCap: types.WithdrawalCaps.fromJSON(obj.debtWithdrawalCap),
|
|
412
|
+
elevationGroups: obj.elevationGroups,
|
|
413
|
+
disableUsageAsCollOutsideEmode: obj.disableUsageAsCollOutsideEmode,
|
|
414
|
+
utilizationLimitBlockBorrowingAbove: obj.utilizationLimitBlockBorrowingAbove,
|
|
415
|
+
reserved1: obj.reserved1,
|
|
416
|
+
borrowLimitOutsideElevationGroup: new BN(obj.borrowLimitOutsideElevationGroup),
|
|
417
|
+
borrowLimitAgainstThisCollateralInElevationGroup: obj.borrowLimitAgainstThisCollateralInElevationGroup.map(
|
|
418
|
+
(item) => new BN(item)
|
|
419
|
+
),
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
toEncodable() {
|
|
424
|
+
return ReserveConfig.toEncodable(this);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { PublicKey } 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 types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as borsh from '@coral-xyz/borsh';
|
|
5
|
+
|
|
6
|
+
export interface ReserveFeesFields {
|
|
7
|
+
/**
|
|
8
|
+
* Fee assessed on `BorrowObligationLiquidity`, as scaled fraction (60 bits fractional part)
|
|
9
|
+
* Must be between `0` and `2^60`, such that `2^60 = 1`. A few examples for
|
|
10
|
+
* clarity:
|
|
11
|
+
* 1% = (1 << 60) / 100 = 11529215046068470
|
|
12
|
+
* 0.01% (1 basis point) = 115292150460685
|
|
13
|
+
* 0.00001% (Aave borrow fee) = 115292150461
|
|
14
|
+
*/
|
|
15
|
+
borrowFeeSf: BN;
|
|
16
|
+
/**
|
|
17
|
+
* Fee for flash loan, expressed as scaled fraction.
|
|
18
|
+
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
19
|
+
*/
|
|
20
|
+
flashLoanFeeSf: BN;
|
|
21
|
+
/** Used for allignment */
|
|
22
|
+
padding: Array<number>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ReserveFeesJSON {
|
|
26
|
+
/**
|
|
27
|
+
* Fee assessed on `BorrowObligationLiquidity`, as scaled fraction (60 bits fractional part)
|
|
28
|
+
* Must be between `0` and `2^60`, such that `2^60 = 1`. A few examples for
|
|
29
|
+
* clarity:
|
|
30
|
+
* 1% = (1 << 60) / 100 = 11529215046068470
|
|
31
|
+
* 0.01% (1 basis point) = 115292150460685
|
|
32
|
+
* 0.00001% (Aave borrow fee) = 115292150461
|
|
33
|
+
*/
|
|
34
|
+
borrowFeeSf: string;
|
|
35
|
+
/**
|
|
36
|
+
* Fee for flash loan, expressed as scaled fraction.
|
|
37
|
+
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
38
|
+
*/
|
|
39
|
+
flashLoanFeeSf: string;
|
|
40
|
+
/** Used for allignment */
|
|
41
|
+
padding: Array<number>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Additional fee information on a reserve
|
|
46
|
+
*
|
|
47
|
+
* These exist separately from interest accrual fees, and are specifically for the program owner
|
|
48
|
+
* and referral fee. The fees are paid out as a percentage of liquidity token amounts during
|
|
49
|
+
* repayments and liquidations.
|
|
50
|
+
*/
|
|
51
|
+
export class ReserveFees {
|
|
52
|
+
/**
|
|
53
|
+
* Fee assessed on `BorrowObligationLiquidity`, as scaled fraction (60 bits fractional part)
|
|
54
|
+
* Must be between `0` and `2^60`, such that `2^60 = 1`. A few examples for
|
|
55
|
+
* clarity:
|
|
56
|
+
* 1% = (1 << 60) / 100 = 11529215046068470
|
|
57
|
+
* 0.01% (1 basis point) = 115292150460685
|
|
58
|
+
* 0.00001% (Aave borrow fee) = 115292150461
|
|
59
|
+
*/
|
|
60
|
+
readonly borrowFeeSf: BN;
|
|
61
|
+
/**
|
|
62
|
+
* Fee for flash loan, expressed as scaled fraction.
|
|
63
|
+
* 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
|
|
64
|
+
*/
|
|
65
|
+
readonly flashLoanFeeSf: BN;
|
|
66
|
+
/** Used for allignment */
|
|
67
|
+
readonly padding: Array<number>;
|
|
68
|
+
|
|
69
|
+
constructor(fields: ReserveFeesFields) {
|
|
70
|
+
this.borrowFeeSf = fields.borrowFeeSf;
|
|
71
|
+
this.flashLoanFeeSf = fields.flashLoanFeeSf;
|
|
72
|
+
this.padding = fields.padding;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static layout(property?: string) {
|
|
76
|
+
return borsh.struct(
|
|
77
|
+
[borsh.u64('borrowFeeSf'), borsh.u64('flashLoanFeeSf'), borsh.array(borsh.u8(), 8, 'padding')],
|
|
78
|
+
property
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
+
static fromDecoded(obj: any) {
|
|
84
|
+
return new ReserveFees({
|
|
85
|
+
borrowFeeSf: obj.borrowFeeSf,
|
|
86
|
+
flashLoanFeeSf: obj.flashLoanFeeSf,
|
|
87
|
+
padding: obj.padding,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static toEncodable(fields: ReserveFeesFields) {
|
|
92
|
+
return {
|
|
93
|
+
borrowFeeSf: fields.borrowFeeSf,
|
|
94
|
+
flashLoanFeeSf: fields.flashLoanFeeSf,
|
|
95
|
+
padding: fields.padding,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
toJSON(): ReserveFeesJSON {
|
|
100
|
+
return {
|
|
101
|
+
borrowFeeSf: this.borrowFeeSf.toString(),
|
|
102
|
+
flashLoanFeeSf: this.flashLoanFeeSf.toString(),
|
|
103
|
+
padding: this.padding,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
static fromJSON(obj: ReserveFeesJSON): ReserveFees {
|
|
108
|
+
return new ReserveFees({
|
|
109
|
+
borrowFeeSf: new BN(obj.borrowFeeSf),
|
|
110
|
+
flashLoanFeeSf: new BN(obj.flashLoanFeeSf),
|
|
111
|
+
padding: obj.padding,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
toEncodable() {
|
|
116
|
+
return ReserveFees.toEncodable(this);
|
|
117
|
+
}
|
|
118
|
+
}
|