@exponent-labs/klend-idl 0.9.25 → 0.9.26
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/build/accounts/GlobalConfig.d.ts +27 -0
- package/build/accounts/GlobalConfig.js +112 -0
- package/build/accounts/GlobalConfig.js.map +1 -0
- package/build/accounts/LendingMarket.d.ts +94 -12
- package/build/accounts/LendingMarket.js +219 -27
- package/build/accounts/LendingMarket.js.map +1 -1
- package/build/accounts/Obligation.d.ts +34 -12
- package/build/accounts/Obligation.js +86 -27
- package/build/accounts/Obligation.js.map +1 -1
- package/build/accounts/ReferrerState.d.ts +1 -3
- package/build/accounts/ReferrerState.js +24 -9
- package/build/accounts/ReferrerState.js.map +1 -1
- package/build/accounts/ReferrerTokenState.d.ts +1 -3
- package/build/accounts/ReferrerTokenState.js +20 -8
- package/build/accounts/ReferrerTokenState.js.map +1 -1
- package/build/accounts/Reserve.d.ts +4 -3
- package/build/accounts/Reserve.js +25 -9
- package/build/accounts/Reserve.js.map +1 -1
- package/build/accounts/ShortUrl.d.ts +1 -3
- package/build/accounts/ShortUrl.js +24 -9
- package/build/accounts/ShortUrl.js.map +1 -1
- package/build/accounts/UserMetadata.d.ts +1 -3
- package/build/accounts/UserMetadata.js +20 -8
- package/build/accounts/UserMetadata.js.map +1 -1
- package/build/accounts/UserState.d.ts +1 -3
- package/build/accounts/UserState.js +20 -8
- package/build/accounts/UserState.js.map +1 -1
- package/build/accounts/WithdrawTicket.d.ts +49 -0
- package/build/accounts/WithdrawTicket.js +158 -0
- package/build/accounts/WithdrawTicket.js.map +1 -0
- package/build/accounts/index.d.ts +4 -0
- package/build/accounts/index.js +5 -1
- package/build/accounts/index.js.map +1 -1
- package/build/errors/anchor.js +2 -2
- package/build/errors/anchor.js.map +1 -1
- package/build/errors/custom.d.ts +605 -13
- package/build/errors/custom.js +1064 -27
- package/build/errors/custom.js.map +1 -1
- package/build/errors/index.js +19 -10
- package/build/errors/index.js.map +1 -1
- package/build/index.d.ts +2 -3
- package/build/index.js +20 -14
- package/build/index.js.map +1 -1
- package/build/instructions/abortObligationOwnershipTransfer.d.ts +7 -0
- package/build/instructions/abortObligationOwnershipTransfer.js +21 -0
- package/build/instructions/abortObligationOwnershipTransfer.js.map +1 -0
- package/build/instructions/acceptObligationOwnership.d.ts +7 -0
- package/build/instructions/acceptObligationOwnership.js +21 -0
- package/build/instructions/acceptObligationOwnership.js.map +1 -0
- package/build/instructions/approveObligationOwnershipTransfer.d.ts +9 -0
- package/build/instructions/approveObligationOwnershipTransfer.js +23 -0
- package/build/instructions/approveObligationOwnershipTransfer.js.map +1 -0
- package/build/instructions/borrowObligationLiquidity.d.ts +1 -1
- package/build/instructions/borrowObligationLiquidity.js +28 -11
- package/build/instructions/borrowObligationLiquidity.js.map +1 -1
- package/build/instructions/borrowObligationLiquidityV2.js +45 -15
- package/build/instructions/borrowObligationLiquidityV2.js.map +1 -1
- package/build/instructions/calculateCtokenExchangeRate.d.ts +5 -0
- package/build/instructions/calculateCtokenExchangeRate.js +15 -0
- package/build/instructions/calculateCtokenExchangeRate.js.map +1 -0
- package/build/instructions/cancelWithdrawTicket.d.ts +19 -0
- package/build/instructions/cancelWithdrawTicket.js +87 -0
- package/build/instructions/cancelWithdrawTicket.js.map +1 -0
- package/build/instructions/cloneReserveConfig.d.ts +14 -0
- package/build/instructions/cloneReserveConfig.js +70 -0
- package/build/instructions/cloneReserveConfig.js.map +1 -0
- package/build/instructions/deleteReferrerStateAndShortUrl.js +1 -2
- package/build/instructions/deleteReferrerStateAndShortUrl.js.map +1 -1
- package/build/instructions/depositAndWithdraw.d.ts +51 -0
- package/build/instructions/depositAndWithdraw.js +202 -0
- package/build/instructions/depositAndWithdraw.js.map +1 -0
- package/build/instructions/depositObligationCollateral.js +19 -9
- package/build/instructions/depositObligationCollateral.js.map +1 -1
- package/build/instructions/depositObligationCollateralV2.d.ts +25 -0
- package/build/instructions/depositObligationCollateralV2.js +109 -0
- package/build/instructions/depositObligationCollateralV2.js.map +1 -0
- package/build/instructions/depositReserveLiquidity.js +20 -10
- package/build/instructions/depositReserveLiquidity.js.map +1 -1
- package/build/instructions/depositReserveLiquidityAndObligationCollateral.d.ts +1 -1
- package/build/instructions/depositReserveLiquidityAndObligationCollateral.js +28 -15
- package/build/instructions/depositReserveLiquidityAndObligationCollateral.js.map +1 -1
- package/build/instructions/depositReserveLiquidityAndObligationCollateralV2.js +45 -15
- package/build/instructions/depositReserveLiquidityAndObligationCollateralV2.js.map +1 -1
- package/build/instructions/enqueueToWithdraw.d.ts +26 -0
- package/build/instructions/enqueueToWithdraw.js +113 -0
- package/build/instructions/enqueueToWithdraw.js.map +1 -0
- package/build/instructions/fillBorrowOrder.d.ts +25 -0
- package/build/instructions/fillBorrowOrder.js +82 -0
- package/build/instructions/fillBorrowOrder.js.map +1 -0
- package/build/instructions/fillBorrowOrderV2.d.ts +29 -0
- package/build/instructions/fillBorrowOrderV2.js +122 -0
- package/build/instructions/fillBorrowOrderV2.js.map +1 -0
- package/build/instructions/flashBorrowReserveLiquidity.d.ts +2 -2
- package/build/instructions/flashBorrowReserveLiquidity.js +28 -11
- package/build/instructions/flashBorrowReserveLiquidity.js.map +1 -1
- package/build/instructions/flashRepayReserveLiquidity.d.ts +2 -2
- package/build/instructions/flashRepayReserveLiquidity.js +32 -12
- package/build/instructions/flashRepayReserveLiquidity.js.map +1 -1
- package/build/instructions/idlMissingTypes.d.ts +3 -2
- package/build/instructions/idlMissingTypes.js +26 -12
- package/build/instructions/idlMissingTypes.js.map +1 -1
- package/build/instructions/index.d.ts +61 -3
- package/build/instructions/index.js +62 -3
- package/build/instructions/index.js.map +1 -1
- package/build/instructions/initFarmsForReserve.d.ts +1 -0
- package/build/instructions/initFarmsForReserve.js +25 -10
- package/build/instructions/initFarmsForReserve.js.map +1 -1
- package/build/instructions/initGlobalConfig.d.ts +10 -0
- package/build/instructions/initGlobalConfig.js +24 -0
- package/build/instructions/initGlobalConfig.js.map +1 -0
- package/build/instructions/initLendingMarket.d.ts +1 -0
- package/build/instructions/initLendingMarket.js +27 -10
- package/build/instructions/initLendingMarket.js.map +1 -1
- package/build/instructions/initObligation.js +19 -9
- package/build/instructions/initObligation.js.map +1 -1
- package/build/instructions/initObligationFarmsForReserve.js +20 -10
- package/build/instructions/initObligationFarmsForReserve.js.map +1 -1
- package/build/instructions/initReferrerStateAndShortUrl.js +19 -9
- package/build/instructions/initReferrerStateAndShortUrl.js.map +1 -1
- package/build/instructions/initReferrerTokenState.d.ts +2 -5
- package/build/instructions/initReferrerTokenState.js +4 -33
- package/build/instructions/initReferrerTokenState.js.map +1 -1
- package/build/instructions/initReserve.d.ts +3 -1
- package/build/instructions/initReserve.js +12 -3
- package/build/instructions/initReserve.js.map +1 -1
- package/build/instructions/initUserMetadata.d.ts +1 -1
- package/build/instructions/initUserMetadata.js +27 -14
- package/build/instructions/initUserMetadata.js.map +1 -1
- package/build/instructions/initiateObligationOwnershipTransfer.d.ts +11 -0
- package/build/instructions/initiateObligationOwnershipTransfer.js +61 -0
- package/build/instructions/initiateObligationOwnershipTransfer.js.map +1 -0
- package/build/instructions/liquidateObligationAndRedeemReserveCollateral.js +21 -11
- package/build/instructions/liquidateObligationAndRedeemReserveCollateral.js.map +1 -1
- package/build/instructions/liquidateObligationAndRedeemReserveCollateralV2.d.ts +42 -0
- package/build/instructions/liquidateObligationAndRedeemReserveCollateralV2.js +172 -0
- package/build/instructions/liquidateObligationAndRedeemReserveCollateralV2.js.map +1 -0
- package/build/instructions/markObligationForDeleveraging.d.ts +12 -0
- package/build/instructions/markObligationForDeleveraging.js +62 -0
- package/build/instructions/markObligationForDeleveraging.js.map +1 -0
- package/build/instructions/recoverInvalidTicketCollateral.d.ts +20 -0
- package/build/instructions/recoverInvalidTicketCollateral.js +89 -0
- package/build/instructions/recoverInvalidTicketCollateral.js.map +1 -0
- package/build/instructions/redeemFees.js +2 -3
- package/build/instructions/redeemFees.js.map +1 -1
- package/build/instructions/redeemReserveCollateral.js +20 -10
- package/build/instructions/redeemReserveCollateral.js.map +1 -1
- package/build/instructions/refreshObligation.js +1 -2
- package/build/instructions/refreshObligation.js.map +1 -1
- package/build/instructions/refreshObligationFarmsForReserve.d.ts +8 -6
- package/build/instructions/refreshObligationFarmsForReserve.js +42 -16
- package/build/instructions/refreshObligationFarmsForReserve.js.map +1 -1
- package/build/instructions/refreshReserve.d.ts +4 -4
- package/build/instructions/refreshReserve.js +12 -14
- package/build/instructions/refreshReserve.js.map +1 -1
- package/build/instructions/refreshReservesBatch.js +19 -9
- package/build/instructions/refreshReservesBatch.js.map +1 -1
- package/build/instructions/repayAndWithdrawAndRedeem.d.ts +46 -0
- package/build/instructions/repayAndWithdrawAndRedeem.js +177 -0
- package/build/instructions/repayAndWithdrawAndRedeem.js.map +1 -0
- package/build/instructions/repayObligationLiquidity.js +20 -10
- package/build/instructions/repayObligationLiquidity.js.map +1 -1
- package/build/instructions/repayObligationLiquidityV2.js +50 -16
- package/build/instructions/repayObligationLiquidityV2.js.map +1 -1
- package/build/instructions/requestElevationGroup.js +19 -9
- package/build/instructions/requestElevationGroup.js.map +1 -1
- package/build/instructions/rolloverFixedTermBorrow.d.ts +25 -0
- package/build/instructions/rolloverFixedTermBorrow.js +76 -0
- package/build/instructions/rolloverFixedTermBorrow.js.map +1 -0
- package/build/instructions/seedDepositOnInitReserve.d.ts +11 -0
- package/build/instructions/seedDepositOnInitReserve.js +37 -0
- package/build/instructions/seedDepositOnInitReserve.js.map +1 -0
- package/build/instructions/setBorrowOrder.d.ts +20 -0
- package/build/instructions/setBorrowOrder.js +76 -0
- package/build/instructions/setBorrowOrder.js.map +1 -0
- package/build/instructions/setBorrowOrderV2.d.ts +21 -0
- package/build/instructions/setBorrowOrderV2.js +78 -0
- package/build/instructions/setBorrowOrderV2.js.map +1 -0
- package/build/instructions/setObligationOrder.d.ts +13 -0
- package/build/instructions/setObligationOrder.js +62 -0
- package/build/instructions/setObligationOrder.js.map +1 -0
- package/build/instructions/socializeLoss.d.ts +1 -1
- package/build/instructions/socializeLoss.js +20 -10
- package/build/instructions/socializeLoss.js.map +1 -1
- package/build/instructions/socializeLossV2.d.ts +22 -0
- package/build/instructions/socializeLossV2.js +94 -0
- package/build/instructions/socializeLossV2.js.map +1 -0
- package/build/instructions/topupReserveRewards.d.ts +16 -0
- package/build/instructions/topupReserveRewards.js +73 -0
- package/build/instructions/topupReserveRewards.js.map +1 -0
- package/build/instructions/updateGlobalConfig.d.ts +13 -0
- package/build/instructions/updateGlobalConfig.js +66 -0
- package/build/instructions/updateGlobalConfig.js.map +1 -0
- package/build/instructions/updateGlobalConfigAdmin.d.ts +7 -0
- package/build/instructions/updateGlobalConfigAdmin.js +21 -0
- package/build/instructions/updateGlobalConfigAdmin.js.map +1 -0
- package/build/instructions/updateLendingMarket.d.ts +2 -1
- package/build/instructions/updateLendingMarket.js +29 -11
- package/build/instructions/updateLendingMarket.js.map +1 -1
- package/build/instructions/updateLendingMarketOwner.d.ts +1 -0
- package/build/instructions/updateLendingMarketOwner.js +6 -2
- package/build/instructions/updateLendingMarketOwner.js.map +1 -1
- package/build/instructions/updateObligationConfig.d.ts +15 -0
- package/build/instructions/updateObligationConfig.js +71 -0
- package/build/instructions/updateObligationConfig.js.map +1 -0
- package/build/instructions/updateReserveConfig.d.ts +6 -4
- package/build/instructions/updateReserveConfig.js +34 -13
- package/build/instructions/updateReserveConfig.js.map +1 -1
- package/build/instructions/withdrawObligationCollateral.js +20 -10
- package/build/instructions/withdrawObligationCollateral.js.map +1 -1
- package/build/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts +1 -1
- package/build/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js +28 -15
- package/build/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js.map +1 -1
- package/build/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.js +40 -14
- package/build/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.js.map +1 -1
- package/build/instructions/withdrawObligationCollateralV2.d.ts +25 -0
- package/build/instructions/withdrawObligationCollateralV2.js +109 -0
- package/build/instructions/withdrawObligationCollateralV2.js.map +1 -0
- package/build/instructions/withdrawProtocolFee.d.ts +3 -2
- package/build/instructions/withdrawProtocolFee.js +25 -14
- package/build/instructions/withdrawProtocolFee.js.map +1 -1
- package/build/instructions/withdrawQueuedLiquidity.d.ts +23 -0
- package/build/instructions/withdrawQueuedLiquidity.js +80 -0
- package/build/instructions/withdrawQueuedLiquidity.js.map +1 -0
- package/build/instructions/withdrawReferrerFees.js +2 -3
- package/build/instructions/withdrawReferrerFees.js.map +1 -1
- package/build/kamino_lending.d.ts +5753 -2295
- package/build/kamino_lending.js +5 -3936
- package/build/kamino_lending.js.map +1 -1
- package/build/kamino_lending.json +1856 -645
- package/build/types/AssetTier.js +21 -11
- package/build/types/AssetTier.js.map +1 -1
- package/build/types/BigFractionBytes.d.ts +2 -1
- package/build/types/BigFractionBytes.js +21 -8
- package/build/types/BigFractionBytes.js.map +1 -1
- package/build/types/BorrowOrder.d.ts +83 -0
- package/build/types/BorrowOrder.js +164 -0
- package/build/types/BorrowOrder.js.map +1 -0
- package/build/types/BorrowOrderConfigArgs.d.ts +42 -0
- package/build/types/BorrowOrderConfigArgs.js +107 -0
- package/build/types/BorrowOrderConfigArgs.js.map +1 -0
- package/build/types/BorrowRateCurve.js +17 -7
- package/build/types/BorrowRateCurve.js.map +1 -1
- package/build/types/CurvePoint.d.ts +2 -1
- package/build/types/CurvePoint.js +17 -7
- package/build/types/CurvePoint.js.map +1 -1
- package/build/types/ElevationGroup.d.ts +2 -1
- package/build/types/ElevationGroup.js +17 -7
- package/build/types/ElevationGroup.js.map +1 -1
- package/build/types/ExchangeRateWithDecimals.d.ts +27 -0
- package/build/types/ExchangeRateWithDecimals.js +82 -0
- package/build/types/ExchangeRateWithDecimals.js.map +1 -0
- package/build/types/FeeCalculation.js +25 -12
- package/build/types/FeeCalculation.js.map +1 -1
- package/build/types/FixedTermBorrowRolloverConfig.d.ts +47 -0
- package/build/types/FixedTermBorrowRolloverConfig.js +114 -0
- package/build/types/FixedTermBorrowRolloverConfig.js.map +1 -0
- package/build/types/InitObligationArgs.d.ts +2 -1
- package/build/types/InitObligationArgs.js +17 -7
- package/build/types/InitObligationArgs.js.map +1 -1
- package/build/types/LastUpdate.d.ts +12 -6
- package/build/types/LastUpdate.js +36 -14
- package/build/types/LastUpdate.js.map +1 -1
- package/build/types/ObligationCollateral.js +17 -7
- package/build/types/ObligationCollateral.js.map +1 -1
- package/build/types/ObligationLiquidity.d.ts +29 -5
- package/build/types/ObligationLiquidity.js +42 -15
- package/build/types/ObligationLiquidity.js.map +1 -1
- package/build/types/ObligationOrder.d.ts +57 -0
- package/build/types/ObligationOrder.js +127 -0
- package/build/types/ObligationOrder.js.map +1 -0
- package/build/types/PriceHeuristic.js +17 -7
- package/build/types/PriceHeuristic.js.map +1 -1
- package/build/types/ProgressCallbackType.d.ts +31 -0
- package/build/types/ProgressCallbackType.js +108 -0
- package/build/types/ProgressCallbackType.js.map +1 -0
- package/build/types/PythConfiguration.js +17 -7
- package/build/types/PythConfiguration.js.map +1 -1
- package/build/types/ReserveCollateral.js +17 -7
- package/build/types/ReserveCollateral.js.map +1 -1
- package/build/types/ReserveConfig.d.ts +87 -32
- package/build/types/ReserveConfig.js +139 -51
- package/build/types/ReserveConfig.js.map +1 -1
- package/build/types/ReserveConfigCustomizationArgs.d.ts +42 -0
- package/build/types/ReserveConfigCustomizationArgs.js +106 -0
- package/build/types/ReserveConfigCustomizationArgs.js.map +1 -0
- package/build/types/ReserveFarmKind.js +21 -11
- package/build/types/ReserveFarmKind.js.map +1 -1
- package/build/types/ReserveFees.d.ts +5 -5
- package/build/types/ReserveFees.js +24 -14
- package/build/types/ReserveFees.js.map +1 -1
- package/build/types/ReserveLiquidity.d.ts +20 -15
- package/build/types/ReserveLiquidity.js +46 -29
- package/build/types/ReserveLiquidity.js.map +1 -1
- package/build/types/ReserveStatus.js +21 -11
- package/build/types/ReserveStatus.js.map +1 -1
- package/build/types/ScopeConfiguration.js +17 -7
- package/build/types/ScopeConfiguration.js.map +1 -1
- package/build/types/SwitchboardConfiguration.js +17 -7
- package/build/types/SwitchboardConfiguration.js.map +1 -1
- package/build/types/TokenInfo.js +17 -7
- package/build/types/TokenInfo.js.map +1 -1
- package/build/types/UpdateConfigMode.d.ts +232 -63
- package/build/types/UpdateConfigMode.js +433 -110
- package/build/types/UpdateConfigMode.js.map +1 -1
- package/build/types/UpdateGlobalConfigMode.d.ts +31 -0
- package/build/types/UpdateGlobalConfigMode.js +108 -0
- package/build/types/UpdateGlobalConfigMode.js.map +1 -0
- package/build/types/UpdateLendingMarketConfigValue.d.ts +20 -0
- package/build/types/UpdateLendingMarketConfigValue.js +53 -11
- package/build/types/UpdateLendingMarketConfigValue.js.map +1 -1
- package/build/types/UpdateLendingMarketMode.d.ts +400 -23
- package/build/types/UpdateLendingMarketMode.js +752 -46
- package/build/types/UpdateLendingMarketMode.js.map +1 -1
- package/build/types/UpdateObligationConfigMode.d.ts +83 -0
- package/build/types/UpdateObligationConfigMode.js +204 -0
- package/build/types/UpdateObligationConfigMode.js.map +1 -0
- package/build/types/WithdrawQueue.d.ts +32 -0
- package/build/types/WithdrawQueue.js +93 -0
- package/build/types/WithdrawQueue.js.map +1 -0
- package/build/types/WithdrawalCaps.js +17 -7
- package/build/types/WithdrawalCaps.js.map +1 -1
- package/build/types/index.d.ts +32 -10
- package/build/types/index.js +38 -10
- package/build/types/index.js.map +1 -1
- package/package.json +3 -2
- package/scripts/generate-idl-module.mjs +18 -0
- package/scripts/patch-optional-accounts.mjs +98 -0
- package/scripts/verify-idl-provenance.mjs +16 -0
- package/src/accounts/GlobalConfig.ts +113 -0
- package/src/accounts/LendingMarket.ts +300 -29
- package/src/accounts/Obligation.ts +111 -26
- package/src/accounts/ReferrerState.ts +11 -4
- package/src/accounts/ReferrerTokenState.ts +6 -3
- package/src/accounts/Reserve.ts +10 -2
- package/src/accounts/ShortUrl.ts +15 -4
- package/src/accounts/UserMetadata.ts +6 -3
- package/src/accounts/UserState.ts +24 -8
- package/src/accounts/WithdrawTicket.ts +173 -0
- package/src/accounts/index.ts +4 -0
- package/src/errors/custom.ts +1177 -24
- package/src/index.ts +2 -4
- package/src/instructions/abortObligationOwnershipTransfer.ts +30 -0
- package/src/instructions/acceptObligationOwnership.ts +30 -0
- package/src/instructions/approveObligationOwnershipTransfer.ts +34 -0
- package/src/instructions/borrowObligationLiquidity.ts +18 -5
- package/src/instructions/borrowObligationLiquidityV2.ts +30 -9
- package/src/instructions/calculateCtokenExchangeRate.ts +22 -0
- package/src/instructions/cancelWithdrawTicket.ts +77 -0
- package/src/instructions/cloneReserveConfig.ts +56 -0
- package/src/instructions/deleteReferrerStateAndShortUrl.ts +4 -1
- package/src/instructions/depositAndWithdraw.ts +229 -0
- package/src/instructions/depositObligationCollateral.ts +3 -2
- package/src/instructions/depositObligationCollateralV2.ts +110 -0
- package/src/instructions/depositReserveLiquidity.ts +4 -3
- package/src/instructions/depositReserveLiquidityAndObligationCollateral.ts +18 -9
- package/src/instructions/depositReserveLiquidityAndObligationCollateralV2.ts +31 -14
- package/src/instructions/enqueueToWithdraw.ts +113 -0
- package/src/instructions/fillBorrowOrder.ts +114 -0
- package/src/instructions/fillBorrowOrderV2.ts +128 -0
- package/src/instructions/flashBorrowReserveLiquidity.ts +19 -6
- package/src/instructions/flashRepayReserveLiquidity.ts +23 -7
- package/src/instructions/idlMissingTypes.ts +17 -9
- package/src/instructions/index.ts +118 -6
- package/src/instructions/initFarmsForReserve.ts +11 -3
- package/src/instructions/initGlobalConfig.ts +36 -0
- package/src/instructions/initLendingMarket.ts +13 -3
- package/src/instructions/initObligation.ts +3 -2
- package/src/instructions/initObligationFarmsForReserve.ts +5 -3
- package/src/instructions/initReferrerStateAndShortUrl.ts +4 -2
- package/src/instructions/initReferrerTokenState.ts +6 -16
- package/src/instructions/initReserve.ts +21 -3
- package/src/instructions/initUserMetadata.ts +18 -8
- package/src/instructions/initiateObligationOwnershipTransfer.ts +44 -0
- package/src/instructions/liquidateObligationAndRedeemReserveCollateral.ts +7 -5
- package/src/instructions/liquidateObligationAndRedeemReserveCollateralV2.ts +191 -0
- package/src/instructions/markObligationForDeleveraging.ts +46 -0
- package/src/instructions/recoverInvalidTicketCollateral.ts +80 -0
- package/src/instructions/redeemFees.ts +8 -2
- package/src/instructions/redeemReserveCollateral.ts +4 -3
- package/src/instructions/refreshObligation.ts +7 -1
- package/src/instructions/refreshObligationFarmsForReserve.ts +35 -15
- package/src/instructions/refreshReserve.ts +27 -17
- package/src/instructions/refreshReservesBatch.ts +7 -2
- package/src/instructions/repayAndWithdrawAndRedeem.ts +199 -0
- package/src/instructions/repayObligationLiquidity.ts +4 -3
- package/src/instructions/repayObligationLiquidityV2.ts +35 -10
- package/src/instructions/requestElevationGroup.ts +4 -2
- package/src/instructions/rolloverFixedTermBorrow.ts +108 -0
- package/src/instructions/seedDepositOnInitReserve.ts +50 -0
- package/src/instructions/setBorrowOrder.ts +66 -0
- package/src/instructions/setBorrowOrderV2.ts +69 -0
- package/src/instructions/setObligationOrder.ts +45 -0
- package/src/instructions/socializeLoss.ts +5 -4
- package/src/instructions/socializeLossV2.ts +92 -0
- package/src/instructions/topupReserveRewards.ts +60 -0
- package/src/instructions/updateGlobalConfig.ts +53 -0
- package/src/instructions/updateGlobalConfigAdmin.ts +30 -0
- package/src/instructions/updateLendingMarket.ts +15 -5
- package/src/instructions/updateLendingMarketOwner.ts +10 -1
- package/src/instructions/updateObligationConfig.ts +65 -0
- package/src/instructions/updateReserveConfig.ts +27 -10
- package/src/instructions/withdrawObligationCollateral.ts +4 -3
- package/src/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.ts +18 -9
- package/src/instructions/withdrawObligationCollateralAndRedeemReserveCollateralV2.ts +26 -13
- package/src/instructions/withdrawObligationCollateralV2.ts +110 -0
- package/src/instructions/withdrawProtocolFee.ts +12 -9
- package/src/instructions/withdrawQueuedLiquidity.ts +110 -0
- package/src/instructions/withdrawReferrerFees.ts +8 -2
- package/src/kamino_lending.json +1856 -645
- package/src/kamino_lending.ts +5558 -6034
- package/src/types/BigFractionBytes.ts +9 -1
- package/src/types/BorrowOrder.ts +168 -0
- package/src/types/BorrowOrderConfigArgs.ts +96 -0
- package/src/types/BorrowRateCurve.ts +10 -3
- package/src/types/CurvePoint.ts +7 -1
- package/src/types/ElevationGroup.ts +2 -1
- package/src/types/ExchangeRateWithDecimals.ts +64 -0
- package/src/types/FeeCalculation.ts +9 -2
- package/src/types/FixedTermBorrowRolloverConfig.ts +110 -0
- package/src/types/InitObligationArgs.ts +3 -0
- package/src/types/LastUpdate.ts +26 -10
- package/src/types/ObligationLiquidity.ts +43 -10
- package/src/types/ObligationOrder.ts +121 -0
- package/src/types/ProgressCallbackType.ts +90 -0
- package/src/types/ReserveConfig.ts +169 -62
- package/src/types/ReserveConfigCustomizationArgs.ts +96 -0
- package/src/types/ReserveFees.ts +9 -9
- package/src/types/ReserveLiquidity.ts +38 -28
- package/src/types/UpdateConfigMode.ts +507 -117
- package/src/types/UpdateGlobalConfigMode.ts +90 -0
- package/src/types/UpdateLendingMarketConfigValue.ts +43 -0
- package/src/types/UpdateLendingMarketMode.ts +912 -41
- package/src/types/UpdateObligationConfigMode.ts +210 -0
- package/src/types/WithdrawQueue.ts +85 -0
- package/src/types/index.ts +175 -34
- package/src/types/AssetTier.ts +0 -116
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
1
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
|
|
2
4
|
import * as borsh from "@coral-xyz/borsh"
|
|
3
5
|
|
|
4
6
|
export interface BigFractionBytesFields {
|
|
@@ -21,7 +23,13 @@ export class BigFractionBytes {
|
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
static layout(property?: string) {
|
|
24
|
-
return borsh.struct(
|
|
26
|
+
return borsh.struct(
|
|
27
|
+
[
|
|
28
|
+
borsh.array(borsh.u64(), 4, "value"),
|
|
29
|
+
borsh.array(borsh.u64(), 2, "padding"),
|
|
30
|
+
],
|
|
31
|
+
property
|
|
32
|
+
)
|
|
25
33
|
}
|
|
26
34
|
|
|
27
35
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -0,0 +1,168 @@
|
|
|
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 BorrowOrderFields {
|
|
7
|
+
debtLiquidityMint: PublicKey
|
|
8
|
+
remainingDebtAmount: BN
|
|
9
|
+
filledDebtDestination: PublicKey
|
|
10
|
+
minDebtTermSeconds: BN
|
|
11
|
+
fillableUntilTimestamp: BN
|
|
12
|
+
placedAtTimestamp: BN
|
|
13
|
+
lastUpdatedAtTimestamp: BN
|
|
14
|
+
requestedDebtAmount: BN
|
|
15
|
+
maxBorrowRateBps: number
|
|
16
|
+
active: number
|
|
17
|
+
enableAutoRolloverOnFilledBorrows: number
|
|
18
|
+
padding1: Array<number>
|
|
19
|
+
endPadding: Array<BN>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface BorrowOrderJSON {
|
|
23
|
+
debtLiquidityMint: string
|
|
24
|
+
remainingDebtAmount: string
|
|
25
|
+
filledDebtDestination: string
|
|
26
|
+
minDebtTermSeconds: string
|
|
27
|
+
fillableUntilTimestamp: string
|
|
28
|
+
placedAtTimestamp: string
|
|
29
|
+
lastUpdatedAtTimestamp: string
|
|
30
|
+
requestedDebtAmount: string
|
|
31
|
+
maxBorrowRateBps: number
|
|
32
|
+
active: number
|
|
33
|
+
enableAutoRolloverOnFilledBorrows: number
|
|
34
|
+
padding1: Array<number>
|
|
35
|
+
endPadding: Array<string>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class BorrowOrder {
|
|
39
|
+
readonly debtLiquidityMint: PublicKey
|
|
40
|
+
readonly remainingDebtAmount: BN
|
|
41
|
+
readonly filledDebtDestination: PublicKey
|
|
42
|
+
readonly minDebtTermSeconds: BN
|
|
43
|
+
readonly fillableUntilTimestamp: BN
|
|
44
|
+
readonly placedAtTimestamp: BN
|
|
45
|
+
readonly lastUpdatedAtTimestamp: BN
|
|
46
|
+
readonly requestedDebtAmount: BN
|
|
47
|
+
readonly maxBorrowRateBps: number
|
|
48
|
+
readonly active: number
|
|
49
|
+
readonly enableAutoRolloverOnFilledBorrows: number
|
|
50
|
+
readonly padding1: Array<number>
|
|
51
|
+
readonly endPadding: Array<BN>
|
|
52
|
+
|
|
53
|
+
constructor(fields: BorrowOrderFields) {
|
|
54
|
+
this.debtLiquidityMint = fields.debtLiquidityMint
|
|
55
|
+
this.remainingDebtAmount = fields.remainingDebtAmount
|
|
56
|
+
this.filledDebtDestination = fields.filledDebtDestination
|
|
57
|
+
this.minDebtTermSeconds = fields.minDebtTermSeconds
|
|
58
|
+
this.fillableUntilTimestamp = fields.fillableUntilTimestamp
|
|
59
|
+
this.placedAtTimestamp = fields.placedAtTimestamp
|
|
60
|
+
this.lastUpdatedAtTimestamp = fields.lastUpdatedAtTimestamp
|
|
61
|
+
this.requestedDebtAmount = fields.requestedDebtAmount
|
|
62
|
+
this.maxBorrowRateBps = fields.maxBorrowRateBps
|
|
63
|
+
this.active = fields.active
|
|
64
|
+
this.enableAutoRolloverOnFilledBorrows =
|
|
65
|
+
fields.enableAutoRolloverOnFilledBorrows
|
|
66
|
+
this.padding1 = fields.padding1
|
|
67
|
+
this.endPadding = fields.endPadding
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static layout(property?: string) {
|
|
71
|
+
return borsh.struct(
|
|
72
|
+
[
|
|
73
|
+
borsh.publicKey("debtLiquidityMint"),
|
|
74
|
+
borsh.u64("remainingDebtAmount"),
|
|
75
|
+
borsh.publicKey("filledDebtDestination"),
|
|
76
|
+
borsh.u64("minDebtTermSeconds"),
|
|
77
|
+
borsh.u64("fillableUntilTimestamp"),
|
|
78
|
+
borsh.u64("placedAtTimestamp"),
|
|
79
|
+
borsh.u64("lastUpdatedAtTimestamp"),
|
|
80
|
+
borsh.u64("requestedDebtAmount"),
|
|
81
|
+
borsh.u32("maxBorrowRateBps"),
|
|
82
|
+
borsh.u8("active"),
|
|
83
|
+
borsh.u8("enableAutoRolloverOnFilledBorrows"),
|
|
84
|
+
borsh.array(borsh.u8(), 2, "padding1"),
|
|
85
|
+
borsh.array(borsh.u64(), 5, "endPadding"),
|
|
86
|
+
],
|
|
87
|
+
property
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
+
static fromDecoded(obj: any) {
|
|
93
|
+
return new BorrowOrder({
|
|
94
|
+
debtLiquidityMint: obj.debtLiquidityMint,
|
|
95
|
+
remainingDebtAmount: obj.remainingDebtAmount,
|
|
96
|
+
filledDebtDestination: obj.filledDebtDestination,
|
|
97
|
+
minDebtTermSeconds: obj.minDebtTermSeconds,
|
|
98
|
+
fillableUntilTimestamp: obj.fillableUntilTimestamp,
|
|
99
|
+
placedAtTimestamp: obj.placedAtTimestamp,
|
|
100
|
+
lastUpdatedAtTimestamp: obj.lastUpdatedAtTimestamp,
|
|
101
|
+
requestedDebtAmount: obj.requestedDebtAmount,
|
|
102
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
103
|
+
active: obj.active,
|
|
104
|
+
enableAutoRolloverOnFilledBorrows: obj.enableAutoRolloverOnFilledBorrows,
|
|
105
|
+
padding1: obj.padding1,
|
|
106
|
+
endPadding: obj.endPadding,
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static toEncodable(fields: BorrowOrderFields) {
|
|
111
|
+
return {
|
|
112
|
+
debtLiquidityMint: fields.debtLiquidityMint,
|
|
113
|
+
remainingDebtAmount: fields.remainingDebtAmount,
|
|
114
|
+
filledDebtDestination: fields.filledDebtDestination,
|
|
115
|
+
minDebtTermSeconds: fields.minDebtTermSeconds,
|
|
116
|
+
fillableUntilTimestamp: fields.fillableUntilTimestamp,
|
|
117
|
+
placedAtTimestamp: fields.placedAtTimestamp,
|
|
118
|
+
lastUpdatedAtTimestamp: fields.lastUpdatedAtTimestamp,
|
|
119
|
+
requestedDebtAmount: fields.requestedDebtAmount,
|
|
120
|
+
maxBorrowRateBps: fields.maxBorrowRateBps,
|
|
121
|
+
active: fields.active,
|
|
122
|
+
enableAutoRolloverOnFilledBorrows:
|
|
123
|
+
fields.enableAutoRolloverOnFilledBorrows,
|
|
124
|
+
padding1: fields.padding1,
|
|
125
|
+
endPadding: fields.endPadding,
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
toJSON(): BorrowOrderJSON {
|
|
130
|
+
return {
|
|
131
|
+
debtLiquidityMint: this.debtLiquidityMint.toString(),
|
|
132
|
+
remainingDebtAmount: this.remainingDebtAmount.toString(),
|
|
133
|
+
filledDebtDestination: this.filledDebtDestination.toString(),
|
|
134
|
+
minDebtTermSeconds: this.minDebtTermSeconds.toString(),
|
|
135
|
+
fillableUntilTimestamp: this.fillableUntilTimestamp.toString(),
|
|
136
|
+
placedAtTimestamp: this.placedAtTimestamp.toString(),
|
|
137
|
+
lastUpdatedAtTimestamp: this.lastUpdatedAtTimestamp.toString(),
|
|
138
|
+
requestedDebtAmount: this.requestedDebtAmount.toString(),
|
|
139
|
+
maxBorrowRateBps: this.maxBorrowRateBps,
|
|
140
|
+
active: this.active,
|
|
141
|
+
enableAutoRolloverOnFilledBorrows: this.enableAutoRolloverOnFilledBorrows,
|
|
142
|
+
padding1: this.padding1,
|
|
143
|
+
endPadding: this.endPadding.map((item) => item.toString()),
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static fromJSON(obj: BorrowOrderJSON): BorrowOrder {
|
|
148
|
+
return new BorrowOrder({
|
|
149
|
+
debtLiquidityMint: new PublicKey(obj.debtLiquidityMint),
|
|
150
|
+
remainingDebtAmount: new BN(obj.remainingDebtAmount),
|
|
151
|
+
filledDebtDestination: new PublicKey(obj.filledDebtDestination),
|
|
152
|
+
minDebtTermSeconds: new BN(obj.minDebtTermSeconds),
|
|
153
|
+
fillableUntilTimestamp: new BN(obj.fillableUntilTimestamp),
|
|
154
|
+
placedAtTimestamp: new BN(obj.placedAtTimestamp),
|
|
155
|
+
lastUpdatedAtTimestamp: new BN(obj.lastUpdatedAtTimestamp),
|
|
156
|
+
requestedDebtAmount: new BN(obj.requestedDebtAmount),
|
|
157
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
158
|
+
active: obj.active,
|
|
159
|
+
enableAutoRolloverOnFilledBorrows: obj.enableAutoRolloverOnFilledBorrows,
|
|
160
|
+
padding1: obj.padding1,
|
|
161
|
+
endPadding: obj.endPadding.map((item) => new BN(item)),
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
toEncodable() {
|
|
166
|
+
return BorrowOrder.toEncodable(this)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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 BorrowOrderConfigArgsFields {
|
|
7
|
+
remainingDebtAmount: BN
|
|
8
|
+
maxBorrowRateBps: number
|
|
9
|
+
minDebtTermSeconds: BN
|
|
10
|
+
fillableUntilTimestamp: BN
|
|
11
|
+
enableAutoRolloverOnFilledBorrows: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface BorrowOrderConfigArgsJSON {
|
|
15
|
+
remainingDebtAmount: string
|
|
16
|
+
maxBorrowRateBps: number
|
|
17
|
+
minDebtTermSeconds: string
|
|
18
|
+
fillableUntilTimestamp: string
|
|
19
|
+
enableAutoRolloverOnFilledBorrows: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class BorrowOrderConfigArgs {
|
|
23
|
+
readonly remainingDebtAmount: BN
|
|
24
|
+
readonly maxBorrowRateBps: number
|
|
25
|
+
readonly minDebtTermSeconds: BN
|
|
26
|
+
readonly fillableUntilTimestamp: BN
|
|
27
|
+
readonly enableAutoRolloverOnFilledBorrows: boolean
|
|
28
|
+
|
|
29
|
+
constructor(fields: BorrowOrderConfigArgsFields) {
|
|
30
|
+
this.remainingDebtAmount = fields.remainingDebtAmount
|
|
31
|
+
this.maxBorrowRateBps = fields.maxBorrowRateBps
|
|
32
|
+
this.minDebtTermSeconds = fields.minDebtTermSeconds
|
|
33
|
+
this.fillableUntilTimestamp = fields.fillableUntilTimestamp
|
|
34
|
+
this.enableAutoRolloverOnFilledBorrows =
|
|
35
|
+
fields.enableAutoRolloverOnFilledBorrows
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static layout(property?: string) {
|
|
39
|
+
return borsh.struct(
|
|
40
|
+
[
|
|
41
|
+
borsh.u64("remainingDebtAmount"),
|
|
42
|
+
borsh.u32("maxBorrowRateBps"),
|
|
43
|
+
borsh.u64("minDebtTermSeconds"),
|
|
44
|
+
borsh.u64("fillableUntilTimestamp"),
|
|
45
|
+
borsh.bool("enableAutoRolloverOnFilledBorrows"),
|
|
46
|
+
],
|
|
47
|
+
property
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
static fromDecoded(obj: any) {
|
|
53
|
+
return new BorrowOrderConfigArgs({
|
|
54
|
+
remainingDebtAmount: obj.remainingDebtAmount,
|
|
55
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
56
|
+
minDebtTermSeconds: obj.minDebtTermSeconds,
|
|
57
|
+
fillableUntilTimestamp: obj.fillableUntilTimestamp,
|
|
58
|
+
enableAutoRolloverOnFilledBorrows: obj.enableAutoRolloverOnFilledBorrows,
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static toEncodable(fields: BorrowOrderConfigArgsFields) {
|
|
63
|
+
return {
|
|
64
|
+
remainingDebtAmount: fields.remainingDebtAmount,
|
|
65
|
+
maxBorrowRateBps: fields.maxBorrowRateBps,
|
|
66
|
+
minDebtTermSeconds: fields.minDebtTermSeconds,
|
|
67
|
+
fillableUntilTimestamp: fields.fillableUntilTimestamp,
|
|
68
|
+
enableAutoRolloverOnFilledBorrows:
|
|
69
|
+
fields.enableAutoRolloverOnFilledBorrows,
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
toJSON(): BorrowOrderConfigArgsJSON {
|
|
74
|
+
return {
|
|
75
|
+
remainingDebtAmount: this.remainingDebtAmount.toString(),
|
|
76
|
+
maxBorrowRateBps: this.maxBorrowRateBps,
|
|
77
|
+
minDebtTermSeconds: this.minDebtTermSeconds.toString(),
|
|
78
|
+
fillableUntilTimestamp: this.fillableUntilTimestamp.toString(),
|
|
79
|
+
enableAutoRolloverOnFilledBorrows: this.enableAutoRolloverOnFilledBorrows,
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static fromJSON(obj: BorrowOrderConfigArgsJSON): BorrowOrderConfigArgs {
|
|
84
|
+
return new BorrowOrderConfigArgs({
|
|
85
|
+
remainingDebtAmount: new BN(obj.remainingDebtAmount),
|
|
86
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
87
|
+
minDebtTermSeconds: new BN(obj.minDebtTermSeconds),
|
|
88
|
+
fillableUntilTimestamp: new BN(obj.fillableUntilTimestamp),
|
|
89
|
+
enableAutoRolloverOnFilledBorrows: obj.enableAutoRolloverOnFilledBorrows,
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
toEncodable() {
|
|
94
|
+
return BorrowOrderConfigArgs.toEncodable(this)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
|
1
3
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
4
|
import * as borsh from "@coral-xyz/borsh"
|
|
3
5
|
|
|
@@ -17,14 +19,19 @@ export class BorrowRateCurve {
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
static layout(property?: string) {
|
|
20
|
-
return borsh.struct(
|
|
22
|
+
return borsh.struct(
|
|
23
|
+
[borsh.array(types.CurvePoint.layout(), 11, "points")],
|
|
24
|
+
property
|
|
25
|
+
)
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
29
|
static fromDecoded(obj: any) {
|
|
25
30
|
return new BorrowRateCurve({
|
|
26
|
-
points: obj.points.map(
|
|
27
|
-
|
|
31
|
+
points: obj.points.map(
|
|
32
|
+
(
|
|
33
|
+
item: any /* eslint-disable-line @typescript-eslint/no-explicit-any */
|
|
34
|
+
) => types.CurvePoint.fromDecoded(item)
|
|
28
35
|
),
|
|
29
36
|
})
|
|
30
37
|
}
|
package/src/types/CurvePoint.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
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
|
|
1
4
|
import * as borsh from "@coral-xyz/borsh"
|
|
2
5
|
|
|
3
6
|
export interface CurvePointFields {
|
|
@@ -20,7 +23,10 @@ export class CurvePoint {
|
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
static layout(property?: string) {
|
|
23
|
-
return borsh.struct(
|
|
26
|
+
return borsh.struct(
|
|
27
|
+
[borsh.u32("utilizationRateBps"), borsh.u32("borrowRateBps")],
|
|
28
|
+
property
|
|
29
|
+
)
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
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
|
|
3
4
|
import * as borsh from "@coral-xyz/borsh"
|
|
4
5
|
|
|
5
6
|
export interface ElevationGroupFields {
|
|
@@ -62,7 +63,7 @@ export class ElevationGroup {
|
|
|
62
63
|
borsh.publicKey("debtReserve"),
|
|
63
64
|
borsh.array(borsh.u64(), 4, "padding1"),
|
|
64
65
|
],
|
|
65
|
-
property
|
|
66
|
+
property
|
|
66
67
|
)
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -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 ExchangeRateWithDecimalsFields {
|
|
7
|
+
exchangeRateSf: BN
|
|
8
|
+
mintDecimals: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ExchangeRateWithDecimalsJSON {
|
|
12
|
+
exchangeRateSf: string
|
|
13
|
+
mintDecimals: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class ExchangeRateWithDecimals {
|
|
17
|
+
readonly exchangeRateSf: BN
|
|
18
|
+
readonly mintDecimals: number
|
|
19
|
+
|
|
20
|
+
constructor(fields: ExchangeRateWithDecimalsFields) {
|
|
21
|
+
this.exchangeRateSf = fields.exchangeRateSf
|
|
22
|
+
this.mintDecimals = fields.mintDecimals
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static layout(property?: string) {
|
|
26
|
+
return borsh.struct(
|
|
27
|
+
[borsh.u128("exchangeRateSf"), borsh.u8("mintDecimals")],
|
|
28
|
+
property
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
static fromDecoded(obj: any) {
|
|
34
|
+
return new ExchangeRateWithDecimals({
|
|
35
|
+
exchangeRateSf: obj.exchangeRateSf,
|
|
36
|
+
mintDecimals: obj.mintDecimals,
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static toEncodable(fields: ExchangeRateWithDecimalsFields) {
|
|
41
|
+
return {
|
|
42
|
+
exchangeRateSf: fields.exchangeRateSf,
|
|
43
|
+
mintDecimals: fields.mintDecimals,
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
toJSON(): ExchangeRateWithDecimalsJSON {
|
|
48
|
+
return {
|
|
49
|
+
exchangeRateSf: this.exchangeRateSf.toString(),
|
|
50
|
+
mintDecimals: this.mintDecimals,
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static fromJSON(obj: ExchangeRateWithDecimalsJSON): ExchangeRateWithDecimals {
|
|
55
|
+
return new ExchangeRateWithDecimals({
|
|
56
|
+
exchangeRateSf: new BN(obj.exchangeRateSf),
|
|
57
|
+
mintDecimals: obj.mintDecimals,
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
toEncodable() {
|
|
62
|
+
return ExchangeRateWithDecimals.toEncodable(this)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
|
1
3
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
4
|
import * as borsh from "@coral-xyz/borsh"
|
|
3
5
|
|
|
@@ -63,7 +65,9 @@ export function fromDecoded(obj: any): types.FeeCalculationKind {
|
|
|
63
65
|
throw new Error("Invalid enum object")
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
export function fromJSON(
|
|
68
|
+
export function fromJSON(
|
|
69
|
+
obj: types.FeeCalculationJSON
|
|
70
|
+
): types.FeeCalculationKind {
|
|
67
71
|
switch (obj.kind) {
|
|
68
72
|
case "Exclusive": {
|
|
69
73
|
return new Exclusive()
|
|
@@ -75,7 +79,10 @@ export function fromJSON(obj: types.FeeCalculationJSON): types.FeeCalculationKin
|
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
export function layout(property?: string) {
|
|
78
|
-
const ret = borsh.rustEnum([
|
|
82
|
+
const ret = borsh.rustEnum([
|
|
83
|
+
borsh.struct([], "Exclusive"),
|
|
84
|
+
borsh.struct([], "Inclusive"),
|
|
85
|
+
])
|
|
79
86
|
if (property !== undefined) {
|
|
80
87
|
return ret.replicate(property)
|
|
81
88
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 FixedTermBorrowRolloverConfigFields {
|
|
7
|
+
autoRolloverEnabled: number
|
|
8
|
+
openTermAllowed: number
|
|
9
|
+
migrationToFixedEnabled: number
|
|
10
|
+
fixedTermRolloverWindowDurationDays: number
|
|
11
|
+
maxBorrowRateBps: number
|
|
12
|
+
minDebtTermSeconds: BN
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface FixedTermBorrowRolloverConfigJSON {
|
|
16
|
+
autoRolloverEnabled: number
|
|
17
|
+
openTermAllowed: number
|
|
18
|
+
migrationToFixedEnabled: number
|
|
19
|
+
fixedTermRolloverWindowDurationDays: number
|
|
20
|
+
maxBorrowRateBps: number
|
|
21
|
+
minDebtTermSeconds: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class FixedTermBorrowRolloverConfig {
|
|
25
|
+
readonly autoRolloverEnabled: number
|
|
26
|
+
readonly openTermAllowed: number
|
|
27
|
+
readonly migrationToFixedEnabled: number
|
|
28
|
+
readonly fixedTermRolloverWindowDurationDays: number
|
|
29
|
+
readonly maxBorrowRateBps: number
|
|
30
|
+
readonly minDebtTermSeconds: BN
|
|
31
|
+
|
|
32
|
+
constructor(fields: FixedTermBorrowRolloverConfigFields) {
|
|
33
|
+
this.autoRolloverEnabled = fields.autoRolloverEnabled
|
|
34
|
+
this.openTermAllowed = fields.openTermAllowed
|
|
35
|
+
this.migrationToFixedEnabled = fields.migrationToFixedEnabled
|
|
36
|
+
this.fixedTermRolloverWindowDurationDays =
|
|
37
|
+
fields.fixedTermRolloverWindowDurationDays
|
|
38
|
+
this.maxBorrowRateBps = fields.maxBorrowRateBps
|
|
39
|
+
this.minDebtTermSeconds = fields.minDebtTermSeconds
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static layout(property?: string) {
|
|
43
|
+
return borsh.struct(
|
|
44
|
+
[
|
|
45
|
+
borsh.u8("autoRolloverEnabled"),
|
|
46
|
+
borsh.u8("openTermAllowed"),
|
|
47
|
+
borsh.u8("migrationToFixedEnabled"),
|
|
48
|
+
borsh.u8("fixedTermRolloverWindowDurationDays"),
|
|
49
|
+
borsh.u32("maxBorrowRateBps"),
|
|
50
|
+
borsh.u64("minDebtTermSeconds"),
|
|
51
|
+
],
|
|
52
|
+
property
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
static fromDecoded(obj: any) {
|
|
58
|
+
return new FixedTermBorrowRolloverConfig({
|
|
59
|
+
autoRolloverEnabled: obj.autoRolloverEnabled,
|
|
60
|
+
openTermAllowed: obj.openTermAllowed,
|
|
61
|
+
migrationToFixedEnabled: obj.migrationToFixedEnabled,
|
|
62
|
+
fixedTermRolloverWindowDurationDays:
|
|
63
|
+
obj.fixedTermRolloverWindowDurationDays,
|
|
64
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
65
|
+
minDebtTermSeconds: obj.minDebtTermSeconds,
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static toEncodable(fields: FixedTermBorrowRolloverConfigFields) {
|
|
70
|
+
return {
|
|
71
|
+
autoRolloverEnabled: fields.autoRolloverEnabled,
|
|
72
|
+
openTermAllowed: fields.openTermAllowed,
|
|
73
|
+
migrationToFixedEnabled: fields.migrationToFixedEnabled,
|
|
74
|
+
fixedTermRolloverWindowDurationDays:
|
|
75
|
+
fields.fixedTermRolloverWindowDurationDays,
|
|
76
|
+
maxBorrowRateBps: fields.maxBorrowRateBps,
|
|
77
|
+
minDebtTermSeconds: fields.minDebtTermSeconds,
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
toJSON(): FixedTermBorrowRolloverConfigJSON {
|
|
82
|
+
return {
|
|
83
|
+
autoRolloverEnabled: this.autoRolloverEnabled,
|
|
84
|
+
openTermAllowed: this.openTermAllowed,
|
|
85
|
+
migrationToFixedEnabled: this.migrationToFixedEnabled,
|
|
86
|
+
fixedTermRolloverWindowDurationDays:
|
|
87
|
+
this.fixedTermRolloverWindowDurationDays,
|
|
88
|
+
maxBorrowRateBps: this.maxBorrowRateBps,
|
|
89
|
+
minDebtTermSeconds: this.minDebtTermSeconds.toString(),
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
static fromJSON(
|
|
94
|
+
obj: FixedTermBorrowRolloverConfigJSON
|
|
95
|
+
): FixedTermBorrowRolloverConfig {
|
|
96
|
+
return new FixedTermBorrowRolloverConfig({
|
|
97
|
+
autoRolloverEnabled: obj.autoRolloverEnabled,
|
|
98
|
+
openTermAllowed: obj.openTermAllowed,
|
|
99
|
+
migrationToFixedEnabled: obj.migrationToFixedEnabled,
|
|
100
|
+
fixedTermRolloverWindowDurationDays:
|
|
101
|
+
obj.fixedTermRolloverWindowDurationDays,
|
|
102
|
+
maxBorrowRateBps: obj.maxBorrowRateBps,
|
|
103
|
+
minDebtTermSeconds: new BN(obj.minDebtTermSeconds),
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
toEncodable() {
|
|
108
|
+
return FixedTermBorrowRolloverConfig.toEncodable(this)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
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
|
|
1
4
|
import * as borsh from "@coral-xyz/borsh"
|
|
2
5
|
|
|
3
6
|
export interface InitObligationArgsFields {
|
package/src/types/LastUpdate.ts
CHANGED
|
@@ -1,37 +1,49 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
1
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
|
|
2
4
|
import * as borsh from "@coral-xyz/borsh"
|
|
3
5
|
|
|
4
6
|
export interface LastUpdateFields {
|
|
5
7
|
slot: BN
|
|
6
8
|
stale: number
|
|
7
9
|
priceStatus: number
|
|
8
|
-
|
|
10
|
+
alignmentPadding: Array<number>
|
|
11
|
+
timestamp: number
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export interface LastUpdateJSON {
|
|
12
15
|
slot: string
|
|
13
16
|
stale: number
|
|
14
17
|
priceStatus: number
|
|
15
|
-
|
|
18
|
+
alignmentPadding: Array<number>
|
|
19
|
+
timestamp: number
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
export class LastUpdate {
|
|
19
23
|
readonly slot: BN
|
|
20
24
|
readonly stale: number
|
|
21
25
|
readonly priceStatus: number
|
|
22
|
-
readonly
|
|
26
|
+
readonly alignmentPadding: Array<number>
|
|
27
|
+
readonly timestamp: number
|
|
23
28
|
|
|
24
29
|
constructor(fields: LastUpdateFields) {
|
|
25
30
|
this.slot = fields.slot
|
|
26
31
|
this.stale = fields.stale
|
|
27
32
|
this.priceStatus = fields.priceStatus
|
|
28
|
-
this.
|
|
33
|
+
this.alignmentPadding = fields.alignmentPadding
|
|
34
|
+
this.timestamp = fields.timestamp
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
static layout(property?: string) {
|
|
32
38
|
return borsh.struct(
|
|
33
|
-
[
|
|
34
|
-
|
|
39
|
+
[
|
|
40
|
+
borsh.u64("slot"),
|
|
41
|
+
borsh.u8("stale"),
|
|
42
|
+
borsh.u8("priceStatus"),
|
|
43
|
+
borsh.array(borsh.u8(), 2, "alignmentPadding"),
|
|
44
|
+
borsh.u32("timestamp"),
|
|
45
|
+
],
|
|
46
|
+
property
|
|
35
47
|
)
|
|
36
48
|
}
|
|
37
49
|
|
|
@@ -41,7 +53,8 @@ export class LastUpdate {
|
|
|
41
53
|
slot: obj.slot,
|
|
42
54
|
stale: obj.stale,
|
|
43
55
|
priceStatus: obj.priceStatus,
|
|
44
|
-
|
|
56
|
+
alignmentPadding: obj.alignmentPadding,
|
|
57
|
+
timestamp: obj.timestamp,
|
|
45
58
|
})
|
|
46
59
|
}
|
|
47
60
|
|
|
@@ -50,7 +63,8 @@ export class LastUpdate {
|
|
|
50
63
|
slot: fields.slot,
|
|
51
64
|
stale: fields.stale,
|
|
52
65
|
priceStatus: fields.priceStatus,
|
|
53
|
-
|
|
66
|
+
alignmentPadding: fields.alignmentPadding,
|
|
67
|
+
timestamp: fields.timestamp,
|
|
54
68
|
}
|
|
55
69
|
}
|
|
56
70
|
|
|
@@ -59,7 +73,8 @@ export class LastUpdate {
|
|
|
59
73
|
slot: this.slot.toString(),
|
|
60
74
|
stale: this.stale,
|
|
61
75
|
priceStatus: this.priceStatus,
|
|
62
|
-
|
|
76
|
+
alignmentPadding: this.alignmentPadding,
|
|
77
|
+
timestamp: this.timestamp,
|
|
63
78
|
}
|
|
64
79
|
}
|
|
65
80
|
|
|
@@ -68,7 +83,8 @@ export class LastUpdate {
|
|
|
68
83
|
slot: new BN(obj.slot),
|
|
69
84
|
stale: obj.stale,
|
|
70
85
|
priceStatus: obj.priceStatus,
|
|
71
|
-
|
|
86
|
+
alignmentPadding: obj.alignmentPadding,
|
|
87
|
+
timestamp: obj.timestamp,
|
|
72
88
|
})
|
|
73
89
|
}
|
|
74
90
|
|