@kamino-finance/klend-sdk 3.2.25 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/action.d.ts +1 -0
- package/dist/classes/action.d.ts.map +1 -0
- package/dist/classes/action.js +1130 -1186
- 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 +131 -158
- package/dist/classes/manager.js.map +1 -1
- package/dist/classes/market.d.ts +1 -0
- package/dist/classes/market.d.ts.map +1 -0
- package/dist/classes/market.js +620 -714
- 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 +135 -138
- package/dist/classes/reserve.js.map +1 -1
- package/dist/classes/shared.d.ts +1 -0
- 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 +31 -2
- package/dist/utils/managerTypes.js.map +1 -1
- package/dist/utils/oracle.d.ts +1 -0
- package/dist/utils/oracle.d.ts.map +1 -0
- package/dist/utils/oracle.js +70 -83
- 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 +40 -52
- package/dist/utils/userMetadata.js.map +1 -1
- package/package.json +9 -3
- 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 +338 -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,28 @@
|
|
|
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 UpdateLendingMarketOwnerAccounts {
|
|
8
|
+
lendingMarketOwnerCached: PublicKey
|
|
9
|
+
lendingMarket: PublicKey
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function updateLendingMarketOwner(
|
|
13
|
+
accounts: UpdateLendingMarketOwnerAccounts,
|
|
14
|
+
programId: PublicKey = PROGRAM_ID
|
|
15
|
+
) {
|
|
16
|
+
const keys: Array<AccountMeta> = [
|
|
17
|
+
{
|
|
18
|
+
pubkey: accounts.lendingMarketOwnerCached,
|
|
19
|
+
isSigner: true,
|
|
20
|
+
isWritable: false,
|
|
21
|
+
},
|
|
22
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: true },
|
|
23
|
+
]
|
|
24
|
+
const identifier = Buffer.from([118, 224, 10, 62, 196, 230, 184, 89])
|
|
25
|
+
const data = identifier
|
|
26
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
27
|
+
return ix
|
|
28
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 UpdateReserveConfigArgs {
|
|
8
|
+
mode: BN
|
|
9
|
+
value: Uint8Array
|
|
10
|
+
skipValidation: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface UpdateReserveConfigAccounts {
|
|
14
|
+
lendingMarketOwner: PublicKey
|
|
15
|
+
lendingMarket: PublicKey
|
|
16
|
+
reserve: PublicKey
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const layout = borsh.struct([
|
|
20
|
+
borsh.u64("mode"),
|
|
21
|
+
borsh.vecU8("value"),
|
|
22
|
+
borsh.bool("skipValidation"),
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
export function updateReserveConfig(
|
|
26
|
+
args: UpdateReserveConfigArgs,
|
|
27
|
+
accounts: UpdateReserveConfigAccounts,
|
|
28
|
+
programId: PublicKey = PROGRAM_ID
|
|
29
|
+
) {
|
|
30
|
+
const keys: Array<AccountMeta> = [
|
|
31
|
+
{ pubkey: accounts.lendingMarketOwner, isSigner: true, isWritable: false },
|
|
32
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
33
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
34
|
+
]
|
|
35
|
+
const identifier = Buffer.from([61, 148, 100, 70, 143, 107, 17, 13])
|
|
36
|
+
const buffer = Buffer.alloc(1000)
|
|
37
|
+
const len = layout.encode(
|
|
38
|
+
{
|
|
39
|
+
mode: args.mode,
|
|
40
|
+
value: Buffer.from(
|
|
41
|
+
args.value.buffer,
|
|
42
|
+
args.value.byteOffset,
|
|
43
|
+
args.value.length
|
|
44
|
+
),
|
|
45
|
+
skipValidation: args.skipValidation,
|
|
46
|
+
},
|
|
47
|
+
buffer
|
|
48
|
+
)
|
|
49
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
50
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
51
|
+
return ix
|
|
52
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 UpdateSingleReserveConfigArgs {
|
|
8
|
+
mode: BN
|
|
9
|
+
value: Array<number>
|
|
10
|
+
skipValidation: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface UpdateSingleReserveConfigAccounts {
|
|
14
|
+
lendingMarketOwner: PublicKey
|
|
15
|
+
lendingMarket: PublicKey
|
|
16
|
+
reserve: PublicKey
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const layout = borsh.struct([
|
|
20
|
+
borsh.u64("mode"),
|
|
21
|
+
borsh.array(borsh.u8(), 32, "value"),
|
|
22
|
+
borsh.bool("skipValidation"),
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
export function updateSingleReserveConfig(
|
|
26
|
+
args: UpdateSingleReserveConfigArgs,
|
|
27
|
+
accounts: UpdateSingleReserveConfigAccounts,
|
|
28
|
+
programId: PublicKey = PROGRAM_ID
|
|
29
|
+
) {
|
|
30
|
+
const keys: Array<AccountMeta> = [
|
|
31
|
+
{ pubkey: accounts.lendingMarketOwner, isSigner: true, isWritable: false },
|
|
32
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
33
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
34
|
+
]
|
|
35
|
+
const identifier = Buffer.from([248, 195, 192, 90, 204, 42, 162, 233])
|
|
36
|
+
const buffer = Buffer.alloc(1000)
|
|
37
|
+
const len = layout.encode(
|
|
38
|
+
{
|
|
39
|
+
mode: args.mode,
|
|
40
|
+
value: args.value,
|
|
41
|
+
skipValidation: args.skipValidation,
|
|
42
|
+
},
|
|
43
|
+
buffer
|
|
44
|
+
)
|
|
45
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
46
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
47
|
+
return ix
|
|
48
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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 WithdrawObligationCollateralArgs {
|
|
8
|
+
collateralAmount: BN
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface WithdrawObligationCollateralAccounts {
|
|
12
|
+
owner: PublicKey
|
|
13
|
+
obligation: PublicKey
|
|
14
|
+
lendingMarket: PublicKey
|
|
15
|
+
lendingMarketAuthority: PublicKey
|
|
16
|
+
withdrawReserve: PublicKey
|
|
17
|
+
reserveSourceCollateral: PublicKey
|
|
18
|
+
userDestinationCollateral: PublicKey
|
|
19
|
+
tokenProgram: PublicKey
|
|
20
|
+
instructionSysvarAccount: PublicKey
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const layout = borsh.struct([borsh.u64("collateralAmount")])
|
|
24
|
+
|
|
25
|
+
export function withdrawObligationCollateral(
|
|
26
|
+
args: WithdrawObligationCollateralArgs,
|
|
27
|
+
accounts: WithdrawObligationCollateralAccounts,
|
|
28
|
+
programId: PublicKey = PROGRAM_ID
|
|
29
|
+
) {
|
|
30
|
+
const keys: Array<AccountMeta> = [
|
|
31
|
+
{ pubkey: accounts.owner, isSigner: true, isWritable: false },
|
|
32
|
+
{ pubkey: accounts.obligation, isSigner: false, isWritable: true },
|
|
33
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
34
|
+
{
|
|
35
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
36
|
+
isSigner: false,
|
|
37
|
+
isWritable: false,
|
|
38
|
+
},
|
|
39
|
+
{ pubkey: accounts.withdrawReserve, isSigner: false, isWritable: true },
|
|
40
|
+
{
|
|
41
|
+
pubkey: accounts.reserveSourceCollateral,
|
|
42
|
+
isSigner: false,
|
|
43
|
+
isWritable: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
pubkey: accounts.userDestinationCollateral,
|
|
47
|
+
isSigner: false,
|
|
48
|
+
isWritable: true,
|
|
49
|
+
},
|
|
50
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
51
|
+
{
|
|
52
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
53
|
+
isSigner: false,
|
|
54
|
+
isWritable: false,
|
|
55
|
+
},
|
|
56
|
+
]
|
|
57
|
+
const identifier = Buffer.from([37, 116, 205, 103, 243, 192, 92, 198])
|
|
58
|
+
const buffer = Buffer.alloc(1000)
|
|
59
|
+
const len = layout.encode(
|
|
60
|
+
{
|
|
61
|
+
collateralAmount: args.collateralAmount,
|
|
62
|
+
},
|
|
63
|
+
buffer
|
|
64
|
+
)
|
|
65
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
66
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
67
|
+
return ix
|
|
68
|
+
}
|
package/src/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
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 WithdrawObligationCollateralAndRedeemReserveCollateralArgs {
|
|
8
|
+
collateralAmount: BN
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface WithdrawObligationCollateralAndRedeemReserveCollateralAccounts {
|
|
12
|
+
owner: PublicKey
|
|
13
|
+
obligation: PublicKey
|
|
14
|
+
lendingMarket: PublicKey
|
|
15
|
+
lendingMarketAuthority: PublicKey
|
|
16
|
+
withdrawReserve: PublicKey
|
|
17
|
+
reserveLiquidityMint: PublicKey
|
|
18
|
+
reserveSourceCollateral: PublicKey
|
|
19
|
+
reserveCollateralMint: PublicKey
|
|
20
|
+
reserveLiquiditySupply: PublicKey
|
|
21
|
+
userDestinationLiquidity: PublicKey
|
|
22
|
+
placeholderUserDestinationCollateral: PublicKey
|
|
23
|
+
collateralTokenProgram: PublicKey
|
|
24
|
+
liquidityTokenProgram: PublicKey
|
|
25
|
+
instructionSysvarAccount: PublicKey
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const layout = borsh.struct([borsh.u64("collateralAmount")])
|
|
29
|
+
|
|
30
|
+
export function withdrawObligationCollateralAndRedeemReserveCollateral(
|
|
31
|
+
args: WithdrawObligationCollateralAndRedeemReserveCollateralArgs,
|
|
32
|
+
accounts: WithdrawObligationCollateralAndRedeemReserveCollateralAccounts,
|
|
33
|
+
programId: PublicKey = PROGRAM_ID
|
|
34
|
+
) {
|
|
35
|
+
const keys: Array<AccountMeta> = [
|
|
36
|
+
{ pubkey: accounts.owner, isSigner: true, isWritable: true },
|
|
37
|
+
{ pubkey: accounts.obligation, isSigner: false, isWritable: true },
|
|
38
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
39
|
+
{
|
|
40
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
41
|
+
isSigner: false,
|
|
42
|
+
isWritable: false,
|
|
43
|
+
},
|
|
44
|
+
{ pubkey: accounts.withdrawReserve, isSigner: false, isWritable: true },
|
|
45
|
+
{
|
|
46
|
+
pubkey: accounts.reserveLiquidityMint,
|
|
47
|
+
isSigner: false,
|
|
48
|
+
isWritable: true,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
pubkey: accounts.reserveSourceCollateral,
|
|
52
|
+
isSigner: false,
|
|
53
|
+
isWritable: true,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
pubkey: accounts.reserveCollateralMint,
|
|
57
|
+
isSigner: false,
|
|
58
|
+
isWritable: true,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
pubkey: accounts.reserveLiquiditySupply,
|
|
62
|
+
isSigner: false,
|
|
63
|
+
isWritable: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
pubkey: accounts.userDestinationLiquidity,
|
|
67
|
+
isSigner: false,
|
|
68
|
+
isWritable: true,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
pubkey: accounts.placeholderUserDestinationCollateral,
|
|
72
|
+
isSigner: false,
|
|
73
|
+
isWritable: false,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
pubkey: accounts.collateralTokenProgram,
|
|
77
|
+
isSigner: false,
|
|
78
|
+
isWritable: false,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
pubkey: accounts.liquidityTokenProgram,
|
|
82
|
+
isSigner: false,
|
|
83
|
+
isWritable: false,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
87
|
+
isSigner: false,
|
|
88
|
+
isWritable: false,
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
const identifier = Buffer.from([75, 93, 93, 220, 34, 150, 218, 196])
|
|
92
|
+
const buffer = Buffer.alloc(1000)
|
|
93
|
+
const len = layout.encode(
|
|
94
|
+
{
|
|
95
|
+
collateralAmount: args.collateralAmount,
|
|
96
|
+
},
|
|
97
|
+
buffer
|
|
98
|
+
)
|
|
99
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
100
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
101
|
+
return ix
|
|
102
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 WithdrawProtocolFeeArgs {
|
|
8
|
+
amount: BN
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface WithdrawProtocolFeeAccounts {
|
|
12
|
+
lendingMarketOwner: PublicKey
|
|
13
|
+
lendingMarket: PublicKey
|
|
14
|
+
reserve: PublicKey
|
|
15
|
+
reserveLiquidityMint: PublicKey
|
|
16
|
+
lendingMarketAuthority: PublicKey
|
|
17
|
+
feeVault: PublicKey
|
|
18
|
+
lendingMarketOwnerAta: PublicKey
|
|
19
|
+
tokenProgram: PublicKey
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const layout = borsh.struct([borsh.u64("amount")])
|
|
23
|
+
|
|
24
|
+
export function withdrawProtocolFee(
|
|
25
|
+
args: WithdrawProtocolFeeArgs,
|
|
26
|
+
accounts: WithdrawProtocolFeeAccounts,
|
|
27
|
+
programId: PublicKey = PROGRAM_ID
|
|
28
|
+
) {
|
|
29
|
+
const keys: Array<AccountMeta> = [
|
|
30
|
+
{ pubkey: accounts.lendingMarketOwner, isSigner: true, isWritable: false },
|
|
31
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
32
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: false },
|
|
33
|
+
{
|
|
34
|
+
pubkey: accounts.reserveLiquidityMint,
|
|
35
|
+
isSigner: false,
|
|
36
|
+
isWritable: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
40
|
+
isSigner: false,
|
|
41
|
+
isWritable: false,
|
|
42
|
+
},
|
|
43
|
+
{ pubkey: accounts.feeVault, isSigner: false, isWritable: true },
|
|
44
|
+
{
|
|
45
|
+
pubkey: accounts.lendingMarketOwnerAta,
|
|
46
|
+
isSigner: false,
|
|
47
|
+
isWritable: true,
|
|
48
|
+
},
|
|
49
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
50
|
+
]
|
|
51
|
+
const identifier = Buffer.from([158, 201, 158, 189, 33, 93, 162, 103])
|
|
52
|
+
const buffer = Buffer.alloc(1000)
|
|
53
|
+
const len = layout.encode(
|
|
54
|
+
{
|
|
55
|
+
amount: args.amount,
|
|
56
|
+
},
|
|
57
|
+
buffer
|
|
58
|
+
)
|
|
59
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
60
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
61
|
+
return ix
|
|
62
|
+
}
|
|
@@ -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 WithdrawReferrerFeesAccounts {
|
|
8
|
+
referrer: PublicKey
|
|
9
|
+
referrerTokenState: PublicKey
|
|
10
|
+
reserve: PublicKey
|
|
11
|
+
reserveLiquidityMint: PublicKey
|
|
12
|
+
reserveSupplyLiquidity: PublicKey
|
|
13
|
+
referrerTokenAccount: PublicKey
|
|
14
|
+
lendingMarket: PublicKey
|
|
15
|
+
lendingMarketAuthority: PublicKey
|
|
16
|
+
tokenProgram: PublicKey
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function withdrawReferrerFees(
|
|
20
|
+
accounts: WithdrawReferrerFeesAccounts,
|
|
21
|
+
programId: PublicKey = PROGRAM_ID
|
|
22
|
+
) {
|
|
23
|
+
const keys: Array<AccountMeta> = [
|
|
24
|
+
{ pubkey: accounts.referrer, isSigner: true, isWritable: true },
|
|
25
|
+
{ pubkey: accounts.referrerTokenState, isSigner: false, isWritable: true },
|
|
26
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
27
|
+
{
|
|
28
|
+
pubkey: accounts.reserveLiquidityMint,
|
|
29
|
+
isSigner: false,
|
|
30
|
+
isWritable: true,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
pubkey: accounts.reserveSupplyLiquidity,
|
|
34
|
+
isSigner: false,
|
|
35
|
+
isWritable: true,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
pubkey: accounts.referrerTokenAccount,
|
|
39
|
+
isSigner: false,
|
|
40
|
+
isWritable: true,
|
|
41
|
+
},
|
|
42
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
43
|
+
{
|
|
44
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
45
|
+
isSigner: false,
|
|
46
|
+
isWritable: false,
|
|
47
|
+
},
|
|
48
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
49
|
+
]
|
|
50
|
+
const identifier = Buffer.from([171, 118, 121, 201, 233, 140, 23, 228])
|
|
51
|
+
const data = identifier
|
|
52
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
53
|
+
return ix
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js"
|
|
2
|
+
|
|
3
|
+
// Program ID passed with the cli --program-id flag when running the code generator. Do not edit, it will get overwritten.
|
|
4
|
+
export const PROGRAM_ID_CLI = new PublicKey(
|
|
5
|
+
"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
// This constant will not get overwritten on subsequent code generations and it's safe to modify it's value.
|
|
9
|
+
export let PROGRAM_ID: PublicKey = PROGRAM_ID_CLI
|
|
10
|
+
|
|
11
|
+
export const setKLendProgramId = (programId: PublicKey) => {
|
|
12
|
+
PROGRAM_ID = programId;
|
|
13
|
+
};
|
|
@@ -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 RegularJSON {
|
|
7
|
+
kind: "Regular"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class Regular {
|
|
11
|
+
static readonly discriminator = 0
|
|
12
|
+
static readonly kind = "Regular"
|
|
13
|
+
readonly discriminator = 0
|
|
14
|
+
readonly kind = "Regular"
|
|
15
|
+
|
|
16
|
+
toJSON(): RegularJSON {
|
|
17
|
+
return {
|
|
18
|
+
kind: "Regular",
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toEncodable() {
|
|
23
|
+
return {
|
|
24
|
+
Regular: {},
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IsolatedCollateralJSON {
|
|
30
|
+
kind: "IsolatedCollateral"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class IsolatedCollateral {
|
|
34
|
+
static readonly discriminator = 1
|
|
35
|
+
static readonly kind = "IsolatedCollateral"
|
|
36
|
+
readonly discriminator = 1
|
|
37
|
+
readonly kind = "IsolatedCollateral"
|
|
38
|
+
|
|
39
|
+
toJSON(): IsolatedCollateralJSON {
|
|
40
|
+
return {
|
|
41
|
+
kind: "IsolatedCollateral",
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
toEncodable() {
|
|
46
|
+
return {
|
|
47
|
+
IsolatedCollateral: {},
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface IsolatedDebtJSON {
|
|
53
|
+
kind: "IsolatedDebt"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class IsolatedDebt {
|
|
57
|
+
static readonly discriminator = 2
|
|
58
|
+
static readonly kind = "IsolatedDebt"
|
|
59
|
+
readonly discriminator = 2
|
|
60
|
+
readonly kind = "IsolatedDebt"
|
|
61
|
+
|
|
62
|
+
toJSON(): IsolatedDebtJSON {
|
|
63
|
+
return {
|
|
64
|
+
kind: "IsolatedDebt",
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
toEncodable() {
|
|
69
|
+
return {
|
|
70
|
+
IsolatedDebt: {},
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
export function fromDecoded(obj: any): types.AssetTierKind {
|
|
77
|
+
if (typeof obj !== "object") {
|
|
78
|
+
throw new Error("Invalid enum object")
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if ("Regular" in obj) {
|
|
82
|
+
return new Regular()
|
|
83
|
+
}
|
|
84
|
+
if ("IsolatedCollateral" in obj) {
|
|
85
|
+
return new IsolatedCollateral()
|
|
86
|
+
}
|
|
87
|
+
if ("IsolatedDebt" in obj) {
|
|
88
|
+
return new IsolatedDebt()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
throw new Error("Invalid enum object")
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function fromJSON(obj: types.AssetTierJSON): types.AssetTierKind {
|
|
95
|
+
switch (obj.kind) {
|
|
96
|
+
case "Regular": {
|
|
97
|
+
return new Regular()
|
|
98
|
+
}
|
|
99
|
+
case "IsolatedCollateral": {
|
|
100
|
+
return new IsolatedCollateral()
|
|
101
|
+
}
|
|
102
|
+
case "IsolatedDebt": {
|
|
103
|
+
return new IsolatedDebt()
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function layout(property?: string) {
|
|
109
|
+
const ret = borsh.rustEnum([
|
|
110
|
+
borsh.struct([], "Regular"),
|
|
111
|
+
borsh.struct([], "IsolatedCollateral"),
|
|
112
|
+
borsh.struct([], "IsolatedDebt"),
|
|
113
|
+
])
|
|
114
|
+
if (property !== undefined) {
|
|
115
|
+
return ret.replicate(property)
|
|
116
|
+
}
|
|
117
|
+
return ret
|
|
118
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 BigFractionBytesFields {
|
|
7
|
+
value: Array<BN>
|
|
8
|
+
padding: Array<BN>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface BigFractionBytesJSON {
|
|
12
|
+
value: Array<string>
|
|
13
|
+
padding: Array<string>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class BigFractionBytes {
|
|
17
|
+
readonly value: Array<BN>
|
|
18
|
+
readonly padding: Array<BN>
|
|
19
|
+
|
|
20
|
+
constructor(fields: BigFractionBytesFields) {
|
|
21
|
+
this.value = fields.value
|
|
22
|
+
this.padding = fields.padding
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static layout(property?: string) {
|
|
26
|
+
return borsh.struct(
|
|
27
|
+
[
|
|
28
|
+
borsh.array(borsh.u64(), 4, "value"),
|
|
29
|
+
borsh.array(borsh.u64(), 2, "padding"),
|
|
30
|
+
],
|
|
31
|
+
property
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
static fromDecoded(obj: any) {
|
|
37
|
+
return new BigFractionBytes({
|
|
38
|
+
value: obj.value,
|
|
39
|
+
padding: obj.padding,
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static toEncodable(fields: BigFractionBytesFields) {
|
|
44
|
+
return {
|
|
45
|
+
value: fields.value,
|
|
46
|
+
padding: fields.padding,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
toJSON(): BigFractionBytesJSON {
|
|
51
|
+
return {
|
|
52
|
+
value: this.value.map((item) => item.toString()),
|
|
53
|
+
padding: this.padding.map((item) => item.toString()),
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static fromJSON(obj: BigFractionBytesJSON): BigFractionBytes {
|
|
58
|
+
return new BigFractionBytes({
|
|
59
|
+
value: obj.value.map((item) => new BN(item)),
|
|
60
|
+
padding: obj.padding.map((item) => new BN(item)),
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
toEncodable() {
|
|
65
|
+
return BigFractionBytes.toEncodable(this)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 BorrowRateCurveFields {
|
|
7
|
+
points: Array<types.CurvePointFields>
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface BorrowRateCurveJSON {
|
|
11
|
+
points: Array<types.CurvePointJSON>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class BorrowRateCurve {
|
|
15
|
+
readonly points: Array<types.CurvePoint>
|
|
16
|
+
|
|
17
|
+
constructor(fields: BorrowRateCurveFields) {
|
|
18
|
+
this.points = fields.points.map((item) => new types.CurvePoint({ ...item }))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static layout(property?: string) {
|
|
22
|
+
return borsh.struct(
|
|
23
|
+
[borsh.array(types.CurvePoint.layout(), 11, "points")],
|
|
24
|
+
property
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
static fromDecoded(obj: any) {
|
|
30
|
+
return new BorrowRateCurve({
|
|
31
|
+
points: obj.points.map(
|
|
32
|
+
(
|
|
33
|
+
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
|
34
|
+
) => types.CurvePoint.fromDecoded(item)
|
|
35
|
+
),
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static toEncodable(fields: BorrowRateCurveFields) {
|
|
40
|
+
return {
|
|
41
|
+
points: fields.points.map((item) => types.CurvePoint.toEncodable(item)),
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
toJSON(): BorrowRateCurveJSON {
|
|
46
|
+
return {
|
|
47
|
+
points: this.points.map((item) => item.toJSON()),
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static fromJSON(obj: BorrowRateCurveJSON): BorrowRateCurve {
|
|
52
|
+
return new BorrowRateCurve({
|
|
53
|
+
points: obj.points.map((item) => types.CurvePoint.fromJSON(item)),
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
toEncodable() {
|
|
58
|
+
return BorrowRateCurve.toEncodable(this)
|
|
59
|
+
}
|
|
60
|
+
}
|