@kamino-finance/klend-sdk 3.2.26 → 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 +120 -129
- 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,286 @@
|
|
|
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 ReserveLiquidityFields {
|
|
7
|
+
/** Reserve liquidity mint address */
|
|
8
|
+
mintPubkey: PublicKey
|
|
9
|
+
/** Reserve liquidity supply address */
|
|
10
|
+
supplyVault: PublicKey
|
|
11
|
+
/** Reserve liquidity fee collection address */
|
|
12
|
+
feeVault: PublicKey
|
|
13
|
+
/** Reserve liquidity available */
|
|
14
|
+
availableAmount: BN
|
|
15
|
+
/** Reserve liquidity borrowed (scaled fraction) */
|
|
16
|
+
borrowedAmountSf: BN
|
|
17
|
+
/** Reserve liquidity market price in quote currency (scaled fraction) */
|
|
18
|
+
marketPriceSf: BN
|
|
19
|
+
/** Unix timestamp of the market price (from the oracle) */
|
|
20
|
+
marketPriceLastUpdatedTs: BN
|
|
21
|
+
/** Reserve liquidity mint decimals */
|
|
22
|
+
mintDecimals: BN
|
|
23
|
+
/**
|
|
24
|
+
* Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
25
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
26
|
+
*/
|
|
27
|
+
depositLimitCrossedSlot: BN
|
|
28
|
+
/**
|
|
29
|
+
* Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
30
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
31
|
+
*/
|
|
32
|
+
borrowLimitCrossedSlot: BN
|
|
33
|
+
/** Reserve liquidity cumulative borrow rate (scaled fraction) */
|
|
34
|
+
cumulativeBorrowRateBsf: types.BigFractionBytesFields
|
|
35
|
+
/** Reserve cumulative protocol fees (scaled fraction) */
|
|
36
|
+
accumulatedProtocolFeesSf: BN
|
|
37
|
+
/** Reserve cumulative referrer fees (scaled fraction) */
|
|
38
|
+
accumulatedReferrerFeesSf: BN
|
|
39
|
+
/** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
|
|
40
|
+
pendingReferrerFeesSf: BN
|
|
41
|
+
/** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
|
|
42
|
+
absoluteReferralRateSf: BN
|
|
43
|
+
/** Token program of the liquidity mint */
|
|
44
|
+
tokenProgram: PublicKey
|
|
45
|
+
padding2: Array<BN>
|
|
46
|
+
padding3: Array<BN>
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ReserveLiquidityJSON {
|
|
50
|
+
/** Reserve liquidity mint address */
|
|
51
|
+
mintPubkey: string
|
|
52
|
+
/** Reserve liquidity supply address */
|
|
53
|
+
supplyVault: string
|
|
54
|
+
/** Reserve liquidity fee collection address */
|
|
55
|
+
feeVault: string
|
|
56
|
+
/** Reserve liquidity available */
|
|
57
|
+
availableAmount: string
|
|
58
|
+
/** Reserve liquidity borrowed (scaled fraction) */
|
|
59
|
+
borrowedAmountSf: string
|
|
60
|
+
/** Reserve liquidity market price in quote currency (scaled fraction) */
|
|
61
|
+
marketPriceSf: string
|
|
62
|
+
/** Unix timestamp of the market price (from the oracle) */
|
|
63
|
+
marketPriceLastUpdatedTs: string
|
|
64
|
+
/** Reserve liquidity mint decimals */
|
|
65
|
+
mintDecimals: string
|
|
66
|
+
/**
|
|
67
|
+
* Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
68
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
69
|
+
*/
|
|
70
|
+
depositLimitCrossedSlot: string
|
|
71
|
+
/**
|
|
72
|
+
* Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
73
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
74
|
+
*/
|
|
75
|
+
borrowLimitCrossedSlot: string
|
|
76
|
+
/** Reserve liquidity cumulative borrow rate (scaled fraction) */
|
|
77
|
+
cumulativeBorrowRateBsf: types.BigFractionBytesJSON
|
|
78
|
+
/** Reserve cumulative protocol fees (scaled fraction) */
|
|
79
|
+
accumulatedProtocolFeesSf: string
|
|
80
|
+
/** Reserve cumulative referrer fees (scaled fraction) */
|
|
81
|
+
accumulatedReferrerFeesSf: string
|
|
82
|
+
/** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
|
|
83
|
+
pendingReferrerFeesSf: string
|
|
84
|
+
/** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
|
|
85
|
+
absoluteReferralRateSf: string
|
|
86
|
+
/** Token program of the liquidity mint */
|
|
87
|
+
tokenProgram: string
|
|
88
|
+
padding2: Array<string>
|
|
89
|
+
padding3: Array<string>
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Reserve liquidity */
|
|
93
|
+
export class ReserveLiquidity {
|
|
94
|
+
/** Reserve liquidity mint address */
|
|
95
|
+
readonly mintPubkey: PublicKey
|
|
96
|
+
/** Reserve liquidity supply address */
|
|
97
|
+
readonly supplyVault: PublicKey
|
|
98
|
+
/** Reserve liquidity fee collection address */
|
|
99
|
+
readonly feeVault: PublicKey
|
|
100
|
+
/** Reserve liquidity available */
|
|
101
|
+
readonly availableAmount: BN
|
|
102
|
+
/** Reserve liquidity borrowed (scaled fraction) */
|
|
103
|
+
readonly borrowedAmountSf: BN
|
|
104
|
+
/** Reserve liquidity market price in quote currency (scaled fraction) */
|
|
105
|
+
readonly marketPriceSf: BN
|
|
106
|
+
/** Unix timestamp of the market price (from the oracle) */
|
|
107
|
+
readonly marketPriceLastUpdatedTs: BN
|
|
108
|
+
/** Reserve liquidity mint decimals */
|
|
109
|
+
readonly mintDecimals: BN
|
|
110
|
+
/**
|
|
111
|
+
* Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
112
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
113
|
+
*/
|
|
114
|
+
readonly depositLimitCrossedSlot: BN
|
|
115
|
+
/**
|
|
116
|
+
* Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
|
|
117
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
118
|
+
*/
|
|
119
|
+
readonly borrowLimitCrossedSlot: BN
|
|
120
|
+
/** Reserve liquidity cumulative borrow rate (scaled fraction) */
|
|
121
|
+
readonly cumulativeBorrowRateBsf: types.BigFractionBytes
|
|
122
|
+
/** Reserve cumulative protocol fees (scaled fraction) */
|
|
123
|
+
readonly accumulatedProtocolFeesSf: BN
|
|
124
|
+
/** Reserve cumulative referrer fees (scaled fraction) */
|
|
125
|
+
readonly accumulatedReferrerFeesSf: BN
|
|
126
|
+
/** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
|
|
127
|
+
readonly pendingReferrerFeesSf: BN
|
|
128
|
+
/** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
|
|
129
|
+
readonly absoluteReferralRateSf: BN
|
|
130
|
+
/** Token program of the liquidity mint */
|
|
131
|
+
readonly tokenProgram: PublicKey
|
|
132
|
+
readonly padding2: Array<BN>
|
|
133
|
+
readonly padding3: Array<BN>
|
|
134
|
+
|
|
135
|
+
constructor(fields: ReserveLiquidityFields) {
|
|
136
|
+
this.mintPubkey = fields.mintPubkey
|
|
137
|
+
this.supplyVault = fields.supplyVault
|
|
138
|
+
this.feeVault = fields.feeVault
|
|
139
|
+
this.availableAmount = fields.availableAmount
|
|
140
|
+
this.borrowedAmountSf = fields.borrowedAmountSf
|
|
141
|
+
this.marketPriceSf = fields.marketPriceSf
|
|
142
|
+
this.marketPriceLastUpdatedTs = fields.marketPriceLastUpdatedTs
|
|
143
|
+
this.mintDecimals = fields.mintDecimals
|
|
144
|
+
this.depositLimitCrossedSlot = fields.depositLimitCrossedSlot
|
|
145
|
+
this.borrowLimitCrossedSlot = fields.borrowLimitCrossedSlot
|
|
146
|
+
this.cumulativeBorrowRateBsf = new types.BigFractionBytes({
|
|
147
|
+
...fields.cumulativeBorrowRateBsf,
|
|
148
|
+
})
|
|
149
|
+
this.accumulatedProtocolFeesSf = fields.accumulatedProtocolFeesSf
|
|
150
|
+
this.accumulatedReferrerFeesSf = fields.accumulatedReferrerFeesSf
|
|
151
|
+
this.pendingReferrerFeesSf = fields.pendingReferrerFeesSf
|
|
152
|
+
this.absoluteReferralRateSf = fields.absoluteReferralRateSf
|
|
153
|
+
this.tokenProgram = fields.tokenProgram
|
|
154
|
+
this.padding2 = fields.padding2
|
|
155
|
+
this.padding3 = fields.padding3
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
static layout(property?: string) {
|
|
159
|
+
return borsh.struct(
|
|
160
|
+
[
|
|
161
|
+
borsh.publicKey("mintPubkey"),
|
|
162
|
+
borsh.publicKey("supplyVault"),
|
|
163
|
+
borsh.publicKey("feeVault"),
|
|
164
|
+
borsh.u64("availableAmount"),
|
|
165
|
+
borsh.u128("borrowedAmountSf"),
|
|
166
|
+
borsh.u128("marketPriceSf"),
|
|
167
|
+
borsh.u64("marketPriceLastUpdatedTs"),
|
|
168
|
+
borsh.u64("mintDecimals"),
|
|
169
|
+
borsh.u64("depositLimitCrossedSlot"),
|
|
170
|
+
borsh.u64("borrowLimitCrossedSlot"),
|
|
171
|
+
types.BigFractionBytes.layout("cumulativeBorrowRateBsf"),
|
|
172
|
+
borsh.u128("accumulatedProtocolFeesSf"),
|
|
173
|
+
borsh.u128("accumulatedReferrerFeesSf"),
|
|
174
|
+
borsh.u128("pendingReferrerFeesSf"),
|
|
175
|
+
borsh.u128("absoluteReferralRateSf"),
|
|
176
|
+
borsh.publicKey("tokenProgram"),
|
|
177
|
+
borsh.array(borsh.u64(), 51, "padding2"),
|
|
178
|
+
borsh.array(borsh.u128(), 32, "padding3"),
|
|
179
|
+
],
|
|
180
|
+
property
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
185
|
+
static fromDecoded(obj: any) {
|
|
186
|
+
return new ReserveLiquidity({
|
|
187
|
+
mintPubkey: obj.mintPubkey,
|
|
188
|
+
supplyVault: obj.supplyVault,
|
|
189
|
+
feeVault: obj.feeVault,
|
|
190
|
+
availableAmount: obj.availableAmount,
|
|
191
|
+
borrowedAmountSf: obj.borrowedAmountSf,
|
|
192
|
+
marketPriceSf: obj.marketPriceSf,
|
|
193
|
+
marketPriceLastUpdatedTs: obj.marketPriceLastUpdatedTs,
|
|
194
|
+
mintDecimals: obj.mintDecimals,
|
|
195
|
+
depositLimitCrossedSlot: obj.depositLimitCrossedSlot,
|
|
196
|
+
borrowLimitCrossedSlot: obj.borrowLimitCrossedSlot,
|
|
197
|
+
cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(
|
|
198
|
+
obj.cumulativeBorrowRateBsf
|
|
199
|
+
),
|
|
200
|
+
accumulatedProtocolFeesSf: obj.accumulatedProtocolFeesSf,
|
|
201
|
+
accumulatedReferrerFeesSf: obj.accumulatedReferrerFeesSf,
|
|
202
|
+
pendingReferrerFeesSf: obj.pendingReferrerFeesSf,
|
|
203
|
+
absoluteReferralRateSf: obj.absoluteReferralRateSf,
|
|
204
|
+
tokenProgram: obj.tokenProgram,
|
|
205
|
+
padding2: obj.padding2,
|
|
206
|
+
padding3: obj.padding3,
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
static toEncodable(fields: ReserveLiquidityFields) {
|
|
211
|
+
return {
|
|
212
|
+
mintPubkey: fields.mintPubkey,
|
|
213
|
+
supplyVault: fields.supplyVault,
|
|
214
|
+
feeVault: fields.feeVault,
|
|
215
|
+
availableAmount: fields.availableAmount,
|
|
216
|
+
borrowedAmountSf: fields.borrowedAmountSf,
|
|
217
|
+
marketPriceSf: fields.marketPriceSf,
|
|
218
|
+
marketPriceLastUpdatedTs: fields.marketPriceLastUpdatedTs,
|
|
219
|
+
mintDecimals: fields.mintDecimals,
|
|
220
|
+
depositLimitCrossedSlot: fields.depositLimitCrossedSlot,
|
|
221
|
+
borrowLimitCrossedSlot: fields.borrowLimitCrossedSlot,
|
|
222
|
+
cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(
|
|
223
|
+
fields.cumulativeBorrowRateBsf
|
|
224
|
+
),
|
|
225
|
+
accumulatedProtocolFeesSf: fields.accumulatedProtocolFeesSf,
|
|
226
|
+
accumulatedReferrerFeesSf: fields.accumulatedReferrerFeesSf,
|
|
227
|
+
pendingReferrerFeesSf: fields.pendingReferrerFeesSf,
|
|
228
|
+
absoluteReferralRateSf: fields.absoluteReferralRateSf,
|
|
229
|
+
tokenProgram: fields.tokenProgram,
|
|
230
|
+
padding2: fields.padding2,
|
|
231
|
+
padding3: fields.padding3,
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
toJSON(): ReserveLiquidityJSON {
|
|
236
|
+
return {
|
|
237
|
+
mintPubkey: this.mintPubkey.toString(),
|
|
238
|
+
supplyVault: this.supplyVault.toString(),
|
|
239
|
+
feeVault: this.feeVault.toString(),
|
|
240
|
+
availableAmount: this.availableAmount.toString(),
|
|
241
|
+
borrowedAmountSf: this.borrowedAmountSf.toString(),
|
|
242
|
+
marketPriceSf: this.marketPriceSf.toString(),
|
|
243
|
+
marketPriceLastUpdatedTs: this.marketPriceLastUpdatedTs.toString(),
|
|
244
|
+
mintDecimals: this.mintDecimals.toString(),
|
|
245
|
+
depositLimitCrossedSlot: this.depositLimitCrossedSlot.toString(),
|
|
246
|
+
borrowLimitCrossedSlot: this.borrowLimitCrossedSlot.toString(),
|
|
247
|
+
cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),
|
|
248
|
+
accumulatedProtocolFeesSf: this.accumulatedProtocolFeesSf.toString(),
|
|
249
|
+
accumulatedReferrerFeesSf: this.accumulatedReferrerFeesSf.toString(),
|
|
250
|
+
pendingReferrerFeesSf: this.pendingReferrerFeesSf.toString(),
|
|
251
|
+
absoluteReferralRateSf: this.absoluteReferralRateSf.toString(),
|
|
252
|
+
tokenProgram: this.tokenProgram.toString(),
|
|
253
|
+
padding2: this.padding2.map((item) => item.toString()),
|
|
254
|
+
padding3: this.padding3.map((item) => item.toString()),
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
static fromJSON(obj: ReserveLiquidityJSON): ReserveLiquidity {
|
|
259
|
+
return new ReserveLiquidity({
|
|
260
|
+
mintPubkey: new PublicKey(obj.mintPubkey),
|
|
261
|
+
supplyVault: new PublicKey(obj.supplyVault),
|
|
262
|
+
feeVault: new PublicKey(obj.feeVault),
|
|
263
|
+
availableAmount: new BN(obj.availableAmount),
|
|
264
|
+
borrowedAmountSf: new BN(obj.borrowedAmountSf),
|
|
265
|
+
marketPriceSf: new BN(obj.marketPriceSf),
|
|
266
|
+
marketPriceLastUpdatedTs: new BN(obj.marketPriceLastUpdatedTs),
|
|
267
|
+
mintDecimals: new BN(obj.mintDecimals),
|
|
268
|
+
depositLimitCrossedSlot: new BN(obj.depositLimitCrossedSlot),
|
|
269
|
+
borrowLimitCrossedSlot: new BN(obj.borrowLimitCrossedSlot),
|
|
270
|
+
cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(
|
|
271
|
+
obj.cumulativeBorrowRateBsf
|
|
272
|
+
),
|
|
273
|
+
accumulatedProtocolFeesSf: new BN(obj.accumulatedProtocolFeesSf),
|
|
274
|
+
accumulatedReferrerFeesSf: new BN(obj.accumulatedReferrerFeesSf),
|
|
275
|
+
pendingReferrerFeesSf: new BN(obj.pendingReferrerFeesSf),
|
|
276
|
+
absoluteReferralRateSf: new BN(obj.absoluteReferralRateSf),
|
|
277
|
+
tokenProgram: new PublicKey(obj.tokenProgram),
|
|
278
|
+
padding2: obj.padding2.map((item) => new BN(item)),
|
|
279
|
+
padding3: obj.padding3.map((item) => new BN(item)),
|
|
280
|
+
})
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
toEncodable() {
|
|
284
|
+
return ReserveLiquidity.toEncodable(this)
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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 ActiveJSON {
|
|
7
|
+
kind: "Active"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class Active {
|
|
11
|
+
static readonly discriminator = 0
|
|
12
|
+
static readonly kind = "Active"
|
|
13
|
+
readonly discriminator = 0
|
|
14
|
+
readonly kind = "Active"
|
|
15
|
+
|
|
16
|
+
toJSON(): ActiveJSON {
|
|
17
|
+
return {
|
|
18
|
+
kind: "Active",
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toEncodable() {
|
|
23
|
+
return {
|
|
24
|
+
Active: {},
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ObsoleteJSON {
|
|
30
|
+
kind: "Obsolete"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class Obsolete {
|
|
34
|
+
static readonly discriminator = 1
|
|
35
|
+
static readonly kind = "Obsolete"
|
|
36
|
+
readonly discriminator = 1
|
|
37
|
+
readonly kind = "Obsolete"
|
|
38
|
+
|
|
39
|
+
toJSON(): ObsoleteJSON {
|
|
40
|
+
return {
|
|
41
|
+
kind: "Obsolete",
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
toEncodable() {
|
|
46
|
+
return {
|
|
47
|
+
Obsolete: {},
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface HiddenJSON {
|
|
53
|
+
kind: "Hidden"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class Hidden {
|
|
57
|
+
static readonly discriminator = 2
|
|
58
|
+
static readonly kind = "Hidden"
|
|
59
|
+
readonly discriminator = 2
|
|
60
|
+
readonly kind = "Hidden"
|
|
61
|
+
|
|
62
|
+
toJSON(): HiddenJSON {
|
|
63
|
+
return {
|
|
64
|
+
kind: "Hidden",
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
toEncodable() {
|
|
69
|
+
return {
|
|
70
|
+
Hidden: {},
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
export function fromDecoded(obj: any): types.ReserveStatusKind {
|
|
77
|
+
if (typeof obj !== "object") {
|
|
78
|
+
throw new Error("Invalid enum object")
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if ("Active" in obj) {
|
|
82
|
+
return new Active()
|
|
83
|
+
}
|
|
84
|
+
if ("Obsolete" in obj) {
|
|
85
|
+
return new Obsolete()
|
|
86
|
+
}
|
|
87
|
+
if ("Hidden" in obj) {
|
|
88
|
+
return new Hidden()
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
throw new Error("Invalid enum object")
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function fromJSON(
|
|
95
|
+
obj: types.ReserveStatusJSON
|
|
96
|
+
): types.ReserveStatusKind {
|
|
97
|
+
switch (obj.kind) {
|
|
98
|
+
case "Active": {
|
|
99
|
+
return new Active()
|
|
100
|
+
}
|
|
101
|
+
case "Obsolete": {
|
|
102
|
+
return new Obsolete()
|
|
103
|
+
}
|
|
104
|
+
case "Hidden": {
|
|
105
|
+
return new Hidden()
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function layout(property?: string) {
|
|
111
|
+
const ret = borsh.rustEnum([
|
|
112
|
+
borsh.struct([], "Active"),
|
|
113
|
+
borsh.struct([], "Obsolete"),
|
|
114
|
+
borsh.struct([], "Hidden"),
|
|
115
|
+
])
|
|
116
|
+
if (property !== undefined) {
|
|
117
|
+
return ret.replicate(property)
|
|
118
|
+
}
|
|
119
|
+
return ret
|
|
120
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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 ScopeConfigurationFields {
|
|
7
|
+
/** Pubkey of the scope price feed (disabled if `null` or `default`) */
|
|
8
|
+
priceFeed: PublicKey
|
|
9
|
+
/** This is the scope_id price chain that results in a price for the token */
|
|
10
|
+
priceChain: Array<number>
|
|
11
|
+
/** This is the scope_id price chain for the twap */
|
|
12
|
+
twapChain: Array<number>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ScopeConfigurationJSON {
|
|
16
|
+
/** Pubkey of the scope price feed (disabled if `null` or `default`) */
|
|
17
|
+
priceFeed: string
|
|
18
|
+
/** This is the scope_id price chain that results in a price for the token */
|
|
19
|
+
priceChain: Array<number>
|
|
20
|
+
/** This is the scope_id price chain for the twap */
|
|
21
|
+
twapChain: Array<number>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ScopeConfiguration {
|
|
25
|
+
/** Pubkey of the scope price feed (disabled if `null` or `default`) */
|
|
26
|
+
readonly priceFeed: PublicKey
|
|
27
|
+
/** This is the scope_id price chain that results in a price for the token */
|
|
28
|
+
readonly priceChain: Array<number>
|
|
29
|
+
/** This is the scope_id price chain for the twap */
|
|
30
|
+
readonly twapChain: Array<number>
|
|
31
|
+
|
|
32
|
+
constructor(fields: ScopeConfigurationFields) {
|
|
33
|
+
this.priceFeed = fields.priceFeed
|
|
34
|
+
this.priceChain = fields.priceChain
|
|
35
|
+
this.twapChain = fields.twapChain
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static layout(property?: string) {
|
|
39
|
+
return borsh.struct(
|
|
40
|
+
[
|
|
41
|
+
borsh.publicKey("priceFeed"),
|
|
42
|
+
borsh.array(borsh.u16(), 4, "priceChain"),
|
|
43
|
+
borsh.array(borsh.u16(), 4, "twapChain"),
|
|
44
|
+
],
|
|
45
|
+
property
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
+
static fromDecoded(obj: any) {
|
|
51
|
+
return new ScopeConfiguration({
|
|
52
|
+
priceFeed: obj.priceFeed,
|
|
53
|
+
priceChain: obj.priceChain,
|
|
54
|
+
twapChain: obj.twapChain,
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static toEncodable(fields: ScopeConfigurationFields) {
|
|
59
|
+
return {
|
|
60
|
+
priceFeed: fields.priceFeed,
|
|
61
|
+
priceChain: fields.priceChain,
|
|
62
|
+
twapChain: fields.twapChain,
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
toJSON(): ScopeConfigurationJSON {
|
|
67
|
+
return {
|
|
68
|
+
priceFeed: this.priceFeed.toString(),
|
|
69
|
+
priceChain: this.priceChain,
|
|
70
|
+
twapChain: this.twapChain,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static fromJSON(obj: ScopeConfigurationJSON): ScopeConfiguration {
|
|
75
|
+
return new ScopeConfiguration({
|
|
76
|
+
priceFeed: new PublicKey(obj.priceFeed),
|
|
77
|
+
priceChain: obj.priceChain,
|
|
78
|
+
twapChain: obj.twapChain,
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
toEncodable() {
|
|
83
|
+
return ScopeConfiguration.toEncodable(this)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -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 SwitchboardConfigurationFields {
|
|
7
|
+
/** Pubkey of the base price feed (disabled if `null` or `default`) */
|
|
8
|
+
priceAggregator: PublicKey
|
|
9
|
+
twapAggregator: PublicKey
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SwitchboardConfigurationJSON {
|
|
13
|
+
/** Pubkey of the base price feed (disabled if `null` or `default`) */
|
|
14
|
+
priceAggregator: string
|
|
15
|
+
twapAggregator: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export class SwitchboardConfiguration {
|
|
19
|
+
/** Pubkey of the base price feed (disabled if `null` or `default`) */
|
|
20
|
+
readonly priceAggregator: PublicKey
|
|
21
|
+
readonly twapAggregator: PublicKey
|
|
22
|
+
|
|
23
|
+
constructor(fields: SwitchboardConfigurationFields) {
|
|
24
|
+
this.priceAggregator = fields.priceAggregator
|
|
25
|
+
this.twapAggregator = fields.twapAggregator
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static layout(property?: string) {
|
|
29
|
+
return borsh.struct(
|
|
30
|
+
[borsh.publicKey("priceAggregator"), borsh.publicKey("twapAggregator")],
|
|
31
|
+
property
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
static fromDecoded(obj: any) {
|
|
37
|
+
return new SwitchboardConfiguration({
|
|
38
|
+
priceAggregator: obj.priceAggregator,
|
|
39
|
+
twapAggregator: obj.twapAggregator,
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static toEncodable(fields: SwitchboardConfigurationFields) {
|
|
44
|
+
return {
|
|
45
|
+
priceAggregator: fields.priceAggregator,
|
|
46
|
+
twapAggregator: fields.twapAggregator,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
toJSON(): SwitchboardConfigurationJSON {
|
|
51
|
+
return {
|
|
52
|
+
priceAggregator: this.priceAggregator.toString(),
|
|
53
|
+
twapAggregator: this.twapAggregator.toString(),
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static fromJSON(obj: SwitchboardConfigurationJSON): SwitchboardConfiguration {
|
|
58
|
+
return new SwitchboardConfiguration({
|
|
59
|
+
priceAggregator: new PublicKey(obj.priceAggregator),
|
|
60
|
+
twapAggregator: new PublicKey(obj.twapAggregator),
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
toEncodable() {
|
|
65
|
+
return SwitchboardConfiguration.toEncodable(this)
|
|
66
|
+
}
|
|
67
|
+
}
|