@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,268 @@
|
|
|
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
|
+
padding2: Array<BN>;
|
|
44
|
+
padding3: Array<BN>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ReserveLiquidityJSON {
|
|
48
|
+
/** Reserve liquidity mint address */
|
|
49
|
+
mintPubkey: string;
|
|
50
|
+
/** Reserve liquidity supply address */
|
|
51
|
+
supplyVault: string;
|
|
52
|
+
/** Reserve liquidity fee collection address */
|
|
53
|
+
feeVault: string;
|
|
54
|
+
/** Reserve liquidity available */
|
|
55
|
+
availableAmount: string;
|
|
56
|
+
/** Reserve liquidity borrowed (scaled fraction) */
|
|
57
|
+
borrowedAmountSf: string;
|
|
58
|
+
/** Reserve liquidity market price in quote currency (scaled fraction) */
|
|
59
|
+
marketPriceSf: string;
|
|
60
|
+
/** Unix timestamp of the market price (from the oracle) */
|
|
61
|
+
marketPriceLastUpdatedTs: string;
|
|
62
|
+
/** Reserve liquidity mint decimals */
|
|
63
|
+
mintDecimals: string;
|
|
64
|
+
/**
|
|
65
|
+
* 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.
|
|
66
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
67
|
+
*/
|
|
68
|
+
depositLimitCrossedSlot: string;
|
|
69
|
+
/**
|
|
70
|
+
* 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.
|
|
71
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
72
|
+
*/
|
|
73
|
+
borrowLimitCrossedSlot: string;
|
|
74
|
+
/** Reserve liquidity cumulative borrow rate (scaled fraction) */
|
|
75
|
+
cumulativeBorrowRateBsf: types.BigFractionBytesJSON;
|
|
76
|
+
/** Reserve cumulative protocol fees (scaled fraction) */
|
|
77
|
+
accumulatedProtocolFeesSf: string;
|
|
78
|
+
/** Reserve cumulative referrer fees (scaled fraction) */
|
|
79
|
+
accumulatedReferrerFeesSf: string;
|
|
80
|
+
/** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
|
|
81
|
+
pendingReferrerFeesSf: string;
|
|
82
|
+
/** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
|
|
83
|
+
absoluteReferralRateSf: string;
|
|
84
|
+
padding2: Array<string>;
|
|
85
|
+
padding3: Array<string>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Reserve liquidity */
|
|
89
|
+
export class ReserveLiquidity {
|
|
90
|
+
/** Reserve liquidity mint address */
|
|
91
|
+
readonly mintPubkey: PublicKey;
|
|
92
|
+
/** Reserve liquidity supply address */
|
|
93
|
+
readonly supplyVault: PublicKey;
|
|
94
|
+
/** Reserve liquidity fee collection address */
|
|
95
|
+
readonly feeVault: PublicKey;
|
|
96
|
+
/** Reserve liquidity available */
|
|
97
|
+
readonly availableAmount: BN;
|
|
98
|
+
/** Reserve liquidity borrowed (scaled fraction) */
|
|
99
|
+
readonly borrowedAmountSf: BN;
|
|
100
|
+
/** Reserve liquidity market price in quote currency (scaled fraction) */
|
|
101
|
+
readonly marketPriceSf: BN;
|
|
102
|
+
/** Unix timestamp of the market price (from the oracle) */
|
|
103
|
+
readonly marketPriceLastUpdatedTs: BN;
|
|
104
|
+
/** Reserve liquidity mint decimals */
|
|
105
|
+
readonly mintDecimals: BN;
|
|
106
|
+
/**
|
|
107
|
+
* 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.
|
|
108
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
109
|
+
*/
|
|
110
|
+
readonly depositLimitCrossedSlot: BN;
|
|
111
|
+
/**
|
|
112
|
+
* 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.
|
|
113
|
+
* If the threshold is not crossed, then the timestamp is set to 0
|
|
114
|
+
*/
|
|
115
|
+
readonly borrowLimitCrossedSlot: BN;
|
|
116
|
+
/** Reserve liquidity cumulative borrow rate (scaled fraction) */
|
|
117
|
+
readonly cumulativeBorrowRateBsf: types.BigFractionBytes;
|
|
118
|
+
/** Reserve cumulative protocol fees (scaled fraction) */
|
|
119
|
+
readonly accumulatedProtocolFeesSf: BN;
|
|
120
|
+
/** Reserve cumulative referrer fees (scaled fraction) */
|
|
121
|
+
readonly accumulatedReferrerFeesSf: BN;
|
|
122
|
+
/** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
|
|
123
|
+
readonly pendingReferrerFeesSf: BN;
|
|
124
|
+
/** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
|
|
125
|
+
readonly absoluteReferralRateSf: BN;
|
|
126
|
+
readonly padding2: Array<BN>;
|
|
127
|
+
readonly padding3: Array<BN>;
|
|
128
|
+
|
|
129
|
+
constructor(fields: ReserveLiquidityFields) {
|
|
130
|
+
this.mintPubkey = fields.mintPubkey;
|
|
131
|
+
this.supplyVault = fields.supplyVault;
|
|
132
|
+
this.feeVault = fields.feeVault;
|
|
133
|
+
this.availableAmount = fields.availableAmount;
|
|
134
|
+
this.borrowedAmountSf = fields.borrowedAmountSf;
|
|
135
|
+
this.marketPriceSf = fields.marketPriceSf;
|
|
136
|
+
this.marketPriceLastUpdatedTs = fields.marketPriceLastUpdatedTs;
|
|
137
|
+
this.mintDecimals = fields.mintDecimals;
|
|
138
|
+
this.depositLimitCrossedSlot = fields.depositLimitCrossedSlot;
|
|
139
|
+
this.borrowLimitCrossedSlot = fields.borrowLimitCrossedSlot;
|
|
140
|
+
this.cumulativeBorrowRateBsf = new types.BigFractionBytes({
|
|
141
|
+
...fields.cumulativeBorrowRateBsf,
|
|
142
|
+
});
|
|
143
|
+
this.accumulatedProtocolFeesSf = fields.accumulatedProtocolFeesSf;
|
|
144
|
+
this.accumulatedReferrerFeesSf = fields.accumulatedReferrerFeesSf;
|
|
145
|
+
this.pendingReferrerFeesSf = fields.pendingReferrerFeesSf;
|
|
146
|
+
this.absoluteReferralRateSf = fields.absoluteReferralRateSf;
|
|
147
|
+
this.padding2 = fields.padding2;
|
|
148
|
+
this.padding3 = fields.padding3;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static layout(property?: string) {
|
|
152
|
+
return borsh.struct(
|
|
153
|
+
[
|
|
154
|
+
borsh.publicKey('mintPubkey'),
|
|
155
|
+
borsh.publicKey('supplyVault'),
|
|
156
|
+
borsh.publicKey('feeVault'),
|
|
157
|
+
borsh.u64('availableAmount'),
|
|
158
|
+
borsh.u128('borrowedAmountSf'),
|
|
159
|
+
borsh.u128('marketPriceSf'),
|
|
160
|
+
borsh.u64('marketPriceLastUpdatedTs'),
|
|
161
|
+
borsh.u64('mintDecimals'),
|
|
162
|
+
borsh.u64('depositLimitCrossedSlot'),
|
|
163
|
+
borsh.u64('borrowLimitCrossedSlot'),
|
|
164
|
+
types.BigFractionBytes.layout('cumulativeBorrowRateBsf'),
|
|
165
|
+
borsh.u128('accumulatedProtocolFeesSf'),
|
|
166
|
+
borsh.u128('accumulatedReferrerFeesSf'),
|
|
167
|
+
borsh.u128('pendingReferrerFeesSf'),
|
|
168
|
+
borsh.u128('absoluteReferralRateSf'),
|
|
169
|
+
borsh.array(borsh.u64(), 55, 'padding2'),
|
|
170
|
+
borsh.array(borsh.u128(), 32, 'padding3'),
|
|
171
|
+
],
|
|
172
|
+
property
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
177
|
+
static fromDecoded(obj: any) {
|
|
178
|
+
return new ReserveLiquidity({
|
|
179
|
+
mintPubkey: obj.mintPubkey,
|
|
180
|
+
supplyVault: obj.supplyVault,
|
|
181
|
+
feeVault: obj.feeVault,
|
|
182
|
+
availableAmount: obj.availableAmount,
|
|
183
|
+
borrowedAmountSf: obj.borrowedAmountSf,
|
|
184
|
+
marketPriceSf: obj.marketPriceSf,
|
|
185
|
+
marketPriceLastUpdatedTs: obj.marketPriceLastUpdatedTs,
|
|
186
|
+
mintDecimals: obj.mintDecimals,
|
|
187
|
+
depositLimitCrossedSlot: obj.depositLimitCrossedSlot,
|
|
188
|
+
borrowLimitCrossedSlot: obj.borrowLimitCrossedSlot,
|
|
189
|
+
cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(obj.cumulativeBorrowRateBsf),
|
|
190
|
+
accumulatedProtocolFeesSf: obj.accumulatedProtocolFeesSf,
|
|
191
|
+
accumulatedReferrerFeesSf: obj.accumulatedReferrerFeesSf,
|
|
192
|
+
pendingReferrerFeesSf: obj.pendingReferrerFeesSf,
|
|
193
|
+
absoluteReferralRateSf: obj.absoluteReferralRateSf,
|
|
194
|
+
padding2: obj.padding2,
|
|
195
|
+
padding3: obj.padding3,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static toEncodable(fields: ReserveLiquidityFields) {
|
|
200
|
+
return {
|
|
201
|
+
mintPubkey: fields.mintPubkey,
|
|
202
|
+
supplyVault: fields.supplyVault,
|
|
203
|
+
feeVault: fields.feeVault,
|
|
204
|
+
availableAmount: fields.availableAmount,
|
|
205
|
+
borrowedAmountSf: fields.borrowedAmountSf,
|
|
206
|
+
marketPriceSf: fields.marketPriceSf,
|
|
207
|
+
marketPriceLastUpdatedTs: fields.marketPriceLastUpdatedTs,
|
|
208
|
+
mintDecimals: fields.mintDecimals,
|
|
209
|
+
depositLimitCrossedSlot: fields.depositLimitCrossedSlot,
|
|
210
|
+
borrowLimitCrossedSlot: fields.borrowLimitCrossedSlot,
|
|
211
|
+
cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(fields.cumulativeBorrowRateBsf),
|
|
212
|
+
accumulatedProtocolFeesSf: fields.accumulatedProtocolFeesSf,
|
|
213
|
+
accumulatedReferrerFeesSf: fields.accumulatedReferrerFeesSf,
|
|
214
|
+
pendingReferrerFeesSf: fields.pendingReferrerFeesSf,
|
|
215
|
+
absoluteReferralRateSf: fields.absoluteReferralRateSf,
|
|
216
|
+
padding2: fields.padding2,
|
|
217
|
+
padding3: fields.padding3,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
toJSON(): ReserveLiquidityJSON {
|
|
222
|
+
return {
|
|
223
|
+
mintPubkey: this.mintPubkey.toString(),
|
|
224
|
+
supplyVault: this.supplyVault.toString(),
|
|
225
|
+
feeVault: this.feeVault.toString(),
|
|
226
|
+
availableAmount: this.availableAmount.toString(),
|
|
227
|
+
borrowedAmountSf: this.borrowedAmountSf.toString(),
|
|
228
|
+
marketPriceSf: this.marketPriceSf.toString(),
|
|
229
|
+
marketPriceLastUpdatedTs: this.marketPriceLastUpdatedTs.toString(),
|
|
230
|
+
mintDecimals: this.mintDecimals.toString(),
|
|
231
|
+
depositLimitCrossedSlot: this.depositLimitCrossedSlot.toString(),
|
|
232
|
+
borrowLimitCrossedSlot: this.borrowLimitCrossedSlot.toString(),
|
|
233
|
+
cumulativeBorrowRateBsf: this.cumulativeBorrowRateBsf.toJSON(),
|
|
234
|
+
accumulatedProtocolFeesSf: this.accumulatedProtocolFeesSf.toString(),
|
|
235
|
+
accumulatedReferrerFeesSf: this.accumulatedReferrerFeesSf.toString(),
|
|
236
|
+
pendingReferrerFeesSf: this.pendingReferrerFeesSf.toString(),
|
|
237
|
+
absoluteReferralRateSf: this.absoluteReferralRateSf.toString(),
|
|
238
|
+
padding2: this.padding2.map((item) => item.toString()),
|
|
239
|
+
padding3: this.padding3.map((item) => item.toString()),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
static fromJSON(obj: ReserveLiquidityJSON): ReserveLiquidity {
|
|
244
|
+
return new ReserveLiquidity({
|
|
245
|
+
mintPubkey: new PublicKey(obj.mintPubkey),
|
|
246
|
+
supplyVault: new PublicKey(obj.supplyVault),
|
|
247
|
+
feeVault: new PublicKey(obj.feeVault),
|
|
248
|
+
availableAmount: new BN(obj.availableAmount),
|
|
249
|
+
borrowedAmountSf: new BN(obj.borrowedAmountSf),
|
|
250
|
+
marketPriceSf: new BN(obj.marketPriceSf),
|
|
251
|
+
marketPriceLastUpdatedTs: new BN(obj.marketPriceLastUpdatedTs),
|
|
252
|
+
mintDecimals: new BN(obj.mintDecimals),
|
|
253
|
+
depositLimitCrossedSlot: new BN(obj.depositLimitCrossedSlot),
|
|
254
|
+
borrowLimitCrossedSlot: new BN(obj.borrowLimitCrossedSlot),
|
|
255
|
+
cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(obj.cumulativeBorrowRateBsf),
|
|
256
|
+
accumulatedProtocolFeesSf: new BN(obj.accumulatedProtocolFeesSf),
|
|
257
|
+
accumulatedReferrerFeesSf: new BN(obj.accumulatedReferrerFeesSf),
|
|
258
|
+
pendingReferrerFeesSf: new BN(obj.pendingReferrerFeesSf),
|
|
259
|
+
absoluteReferralRateSf: new BN(obj.absoluteReferralRateSf),
|
|
260
|
+
padding2: obj.padding2.map((item) => new BN(item)),
|
|
261
|
+
padding3: obj.padding3.map((item) => new BN(item)),
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
toEncodable() {
|
|
266
|
+
return ReserveLiquidity.toEncodable(this);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
@@ -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,64 @@
|
|
|
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([borsh.publicKey('priceAggregator'), borsh.publicKey('twapAggregator')], property);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
static fromDecoded(obj: any) {
|
|
34
|
+
return new SwitchboardConfiguration({
|
|
35
|
+
priceAggregator: obj.priceAggregator,
|
|
36
|
+
twapAggregator: obj.twapAggregator,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static toEncodable(fields: SwitchboardConfigurationFields) {
|
|
41
|
+
return {
|
|
42
|
+
priceAggregator: fields.priceAggregator,
|
|
43
|
+
twapAggregator: fields.twapAggregator,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
toJSON(): SwitchboardConfigurationJSON {
|
|
48
|
+
return {
|
|
49
|
+
priceAggregator: this.priceAggregator.toString(),
|
|
50
|
+
twapAggregator: this.twapAggregator.toString(),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static fromJSON(obj: SwitchboardConfigurationJSON): SwitchboardConfiguration {
|
|
55
|
+
return new SwitchboardConfiguration({
|
|
56
|
+
priceAggregator: new PublicKey(obj.priceAggregator),
|
|
57
|
+
twapAggregator: new PublicKey(obj.twapAggregator),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
toEncodable() {
|
|
62
|
+
return SwitchboardConfiguration.toEncodable(this);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
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 TokenInfoFields {
|
|
7
|
+
/** UTF-8 encoded name of the token (null-terminated) */
|
|
8
|
+
name: Array<number>;
|
|
9
|
+
/** Heuristics limits of acceptable price */
|
|
10
|
+
heuristic: types.PriceHeuristicFields;
|
|
11
|
+
/** Max divergence between twap and price in bps */
|
|
12
|
+
maxTwapDivergenceBps: BN;
|
|
13
|
+
maxAgePriceSeconds: BN;
|
|
14
|
+
maxAgeTwapSeconds: BN;
|
|
15
|
+
/** Scope price configuration */
|
|
16
|
+
scopeConfiguration: types.ScopeConfigurationFields;
|
|
17
|
+
/** Switchboard configuration */
|
|
18
|
+
switchboardConfiguration: types.SwitchboardConfigurationFields;
|
|
19
|
+
/** Pyth configuration */
|
|
20
|
+
pythConfiguration: types.PythConfigurationFields;
|
|
21
|
+
blockPriceUsage: number;
|
|
22
|
+
reserved: Array<number>;
|
|
23
|
+
padding: Array<BN>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TokenInfoJSON {
|
|
27
|
+
/** UTF-8 encoded name of the token (null-terminated) */
|
|
28
|
+
name: Array<number>;
|
|
29
|
+
/** Heuristics limits of acceptable price */
|
|
30
|
+
heuristic: types.PriceHeuristicJSON;
|
|
31
|
+
/** Max divergence between twap and price in bps */
|
|
32
|
+
maxTwapDivergenceBps: string;
|
|
33
|
+
maxAgePriceSeconds: string;
|
|
34
|
+
maxAgeTwapSeconds: string;
|
|
35
|
+
/** Scope price configuration */
|
|
36
|
+
scopeConfiguration: types.ScopeConfigurationJSON;
|
|
37
|
+
/** Switchboard configuration */
|
|
38
|
+
switchboardConfiguration: types.SwitchboardConfigurationJSON;
|
|
39
|
+
/** Pyth configuration */
|
|
40
|
+
pythConfiguration: types.PythConfigurationJSON;
|
|
41
|
+
blockPriceUsage: number;
|
|
42
|
+
reserved: Array<number>;
|
|
43
|
+
padding: Array<string>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class TokenInfo {
|
|
47
|
+
/** UTF-8 encoded name of the token (null-terminated) */
|
|
48
|
+
readonly name: Array<number>;
|
|
49
|
+
/** Heuristics limits of acceptable price */
|
|
50
|
+
readonly heuristic: types.PriceHeuristic;
|
|
51
|
+
/** Max divergence between twap and price in bps */
|
|
52
|
+
readonly maxTwapDivergenceBps: BN;
|
|
53
|
+
readonly maxAgePriceSeconds: BN;
|
|
54
|
+
readonly maxAgeTwapSeconds: BN;
|
|
55
|
+
/** Scope price configuration */
|
|
56
|
+
readonly scopeConfiguration: types.ScopeConfiguration;
|
|
57
|
+
/** Switchboard configuration */
|
|
58
|
+
readonly switchboardConfiguration: types.SwitchboardConfiguration;
|
|
59
|
+
/** Pyth configuration */
|
|
60
|
+
readonly pythConfiguration: types.PythConfiguration;
|
|
61
|
+
readonly blockPriceUsage: number;
|
|
62
|
+
readonly reserved: Array<number>;
|
|
63
|
+
readonly padding: Array<BN>;
|
|
64
|
+
|
|
65
|
+
constructor(fields: TokenInfoFields) {
|
|
66
|
+
this.name = fields.name;
|
|
67
|
+
this.heuristic = new types.PriceHeuristic({ ...fields.heuristic });
|
|
68
|
+
this.maxTwapDivergenceBps = fields.maxTwapDivergenceBps;
|
|
69
|
+
this.maxAgePriceSeconds = fields.maxAgePriceSeconds;
|
|
70
|
+
this.maxAgeTwapSeconds = fields.maxAgeTwapSeconds;
|
|
71
|
+
this.scopeConfiguration = new types.ScopeConfiguration({
|
|
72
|
+
...fields.scopeConfiguration,
|
|
73
|
+
});
|
|
74
|
+
this.switchboardConfiguration = new types.SwitchboardConfiguration({
|
|
75
|
+
...fields.switchboardConfiguration,
|
|
76
|
+
});
|
|
77
|
+
this.pythConfiguration = new types.PythConfiguration({
|
|
78
|
+
...fields.pythConfiguration,
|
|
79
|
+
});
|
|
80
|
+
this.blockPriceUsage = fields.blockPriceUsage;
|
|
81
|
+
this.reserved = fields.reserved;
|
|
82
|
+
this.padding = fields.padding;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static layout(property?: string) {
|
|
86
|
+
return borsh.struct(
|
|
87
|
+
[
|
|
88
|
+
borsh.array(borsh.u8(), 32, 'name'),
|
|
89
|
+
types.PriceHeuristic.layout('heuristic'),
|
|
90
|
+
borsh.u64('maxTwapDivergenceBps'),
|
|
91
|
+
borsh.u64('maxAgePriceSeconds'),
|
|
92
|
+
borsh.u64('maxAgeTwapSeconds'),
|
|
93
|
+
types.ScopeConfiguration.layout('scopeConfiguration'),
|
|
94
|
+
types.SwitchboardConfiguration.layout('switchboardConfiguration'),
|
|
95
|
+
types.PythConfiguration.layout('pythConfiguration'),
|
|
96
|
+
borsh.u8('blockPriceUsage'),
|
|
97
|
+
borsh.array(borsh.u8(), 7, 'reserved'),
|
|
98
|
+
borsh.array(borsh.u64(), 19, 'padding'),
|
|
99
|
+
],
|
|
100
|
+
property
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105
|
+
static fromDecoded(obj: any) {
|
|
106
|
+
return new TokenInfo({
|
|
107
|
+
name: obj.name,
|
|
108
|
+
heuristic: types.PriceHeuristic.fromDecoded(obj.heuristic),
|
|
109
|
+
maxTwapDivergenceBps: obj.maxTwapDivergenceBps,
|
|
110
|
+
maxAgePriceSeconds: obj.maxAgePriceSeconds,
|
|
111
|
+
maxAgeTwapSeconds: obj.maxAgeTwapSeconds,
|
|
112
|
+
scopeConfiguration: types.ScopeConfiguration.fromDecoded(obj.scopeConfiguration),
|
|
113
|
+
switchboardConfiguration: types.SwitchboardConfiguration.fromDecoded(obj.switchboardConfiguration),
|
|
114
|
+
pythConfiguration: types.PythConfiguration.fromDecoded(obj.pythConfiguration),
|
|
115
|
+
blockPriceUsage: obj.blockPriceUsage,
|
|
116
|
+
reserved: obj.reserved,
|
|
117
|
+
padding: obj.padding,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
static toEncodable(fields: TokenInfoFields) {
|
|
122
|
+
return {
|
|
123
|
+
name: fields.name,
|
|
124
|
+
heuristic: types.PriceHeuristic.toEncodable(fields.heuristic),
|
|
125
|
+
maxTwapDivergenceBps: fields.maxTwapDivergenceBps,
|
|
126
|
+
maxAgePriceSeconds: fields.maxAgePriceSeconds,
|
|
127
|
+
maxAgeTwapSeconds: fields.maxAgeTwapSeconds,
|
|
128
|
+
scopeConfiguration: types.ScopeConfiguration.toEncodable(fields.scopeConfiguration),
|
|
129
|
+
switchboardConfiguration: types.SwitchboardConfiguration.toEncodable(fields.switchboardConfiguration),
|
|
130
|
+
pythConfiguration: types.PythConfiguration.toEncodable(fields.pythConfiguration),
|
|
131
|
+
blockPriceUsage: fields.blockPriceUsage,
|
|
132
|
+
reserved: fields.reserved,
|
|
133
|
+
padding: fields.padding,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
toJSON(): TokenInfoJSON {
|
|
138
|
+
return {
|
|
139
|
+
name: this.name,
|
|
140
|
+
heuristic: this.heuristic.toJSON(),
|
|
141
|
+
maxTwapDivergenceBps: this.maxTwapDivergenceBps.toString(),
|
|
142
|
+
maxAgePriceSeconds: this.maxAgePriceSeconds.toString(),
|
|
143
|
+
maxAgeTwapSeconds: this.maxAgeTwapSeconds.toString(),
|
|
144
|
+
scopeConfiguration: this.scopeConfiguration.toJSON(),
|
|
145
|
+
switchboardConfiguration: this.switchboardConfiguration.toJSON(),
|
|
146
|
+
pythConfiguration: this.pythConfiguration.toJSON(),
|
|
147
|
+
blockPriceUsage: this.blockPriceUsage,
|
|
148
|
+
reserved: this.reserved,
|
|
149
|
+
padding: this.padding.map((item) => item.toString()),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static fromJSON(obj: TokenInfoJSON): TokenInfo {
|
|
154
|
+
return new TokenInfo({
|
|
155
|
+
name: obj.name,
|
|
156
|
+
heuristic: types.PriceHeuristic.fromJSON(obj.heuristic),
|
|
157
|
+
maxTwapDivergenceBps: new BN(obj.maxTwapDivergenceBps),
|
|
158
|
+
maxAgePriceSeconds: new BN(obj.maxAgePriceSeconds),
|
|
159
|
+
maxAgeTwapSeconds: new BN(obj.maxAgeTwapSeconds),
|
|
160
|
+
scopeConfiguration: types.ScopeConfiguration.fromJSON(obj.scopeConfiguration),
|
|
161
|
+
switchboardConfiguration: types.SwitchboardConfiguration.fromJSON(obj.switchboardConfiguration),
|
|
162
|
+
pythConfiguration: types.PythConfiguration.fromJSON(obj.pythConfiguration),
|
|
163
|
+
blockPriceUsage: obj.blockPriceUsage,
|
|
164
|
+
reserved: obj.reserved,
|
|
165
|
+
padding: obj.padding.map((item) => new BN(item)),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
toEncodable() {
|
|
170
|
+
return TokenInfo.toEncodable(this);
|
|
171
|
+
}
|
|
172
|
+
}
|