@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,6 +1,7 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } 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
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
5
|
import { PROGRAM_ID } from "../programId"
|
|
5
6
|
|
|
6
7
|
export interface FlashBorrowReserveLiquidityArgs {
|
|
@@ -16,18 +17,30 @@ export interface FlashBorrowReserveLiquidityAccounts {
|
|
|
16
17
|
reserveSourceLiquidity: PublicKey
|
|
17
18
|
userDestinationLiquidity: PublicKey
|
|
18
19
|
reserveLiquidityFeeReceiver: PublicKey
|
|
19
|
-
referrerTokenState
|
|
20
|
-
referrerAccount
|
|
20
|
+
referrerTokenState?: PublicKey | null
|
|
21
|
+
referrerAccount?: PublicKey | null
|
|
21
22
|
sysvarInfo: PublicKey
|
|
22
23
|
tokenProgram: PublicKey
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export const layout = borsh.struct([borsh.u64("liquidityAmount")])
|
|
26
27
|
|
|
28
|
+
function optionalAccountMeta(
|
|
29
|
+
pubkey: PublicKey | null | undefined,
|
|
30
|
+
isWritable: boolean,
|
|
31
|
+
programId: PublicKey
|
|
32
|
+
): AccountMeta {
|
|
33
|
+
return {
|
|
34
|
+
pubkey: pubkey ?? programId,
|
|
35
|
+
isSigner: false,
|
|
36
|
+
isWritable: pubkey === null || pubkey === undefined ? false : isWritable,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
27
40
|
export function flashBorrowReserveLiquidity(
|
|
28
41
|
args: FlashBorrowReserveLiquidityArgs,
|
|
29
42
|
accounts: FlashBorrowReserveLiquidityAccounts,
|
|
30
|
-
programId: PublicKey = PROGRAM_ID
|
|
43
|
+
programId: PublicKey = PROGRAM_ID
|
|
31
44
|
) {
|
|
32
45
|
const keys: Array<AccountMeta> = [
|
|
33
46
|
{
|
|
@@ -62,8 +75,8 @@ export function flashBorrowReserveLiquidity(
|
|
|
62
75
|
isSigner: false,
|
|
63
76
|
isWritable: true,
|
|
64
77
|
},
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
optionalAccountMeta(accounts.referrerTokenState, true, programId),
|
|
79
|
+
optionalAccountMeta(accounts.referrerAccount, true, programId),
|
|
67
80
|
{ pubkey: accounts.sysvarInfo, isSigner: false, isWritable: false },
|
|
68
81
|
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
69
82
|
]
|
|
@@ -73,7 +86,7 @@ export function flashBorrowReserveLiquidity(
|
|
|
73
86
|
{
|
|
74
87
|
liquidityAmount: args.liquidityAmount,
|
|
75
88
|
},
|
|
76
|
-
buffer
|
|
89
|
+
buffer
|
|
77
90
|
)
|
|
78
91
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
79
92
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } 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
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
5
|
import { PROGRAM_ID } from "../programId"
|
|
5
6
|
|
|
6
7
|
export interface FlashRepayReserveLiquidityArgs {
|
|
@@ -17,18 +18,33 @@ export interface FlashRepayReserveLiquidityAccounts {
|
|
|
17
18
|
reserveDestinationLiquidity: PublicKey
|
|
18
19
|
userSourceLiquidity: PublicKey
|
|
19
20
|
reserveLiquidityFeeReceiver: PublicKey
|
|
20
|
-
referrerTokenState
|
|
21
|
-
referrerAccount
|
|
21
|
+
referrerTokenState?: PublicKey | null
|
|
22
|
+
referrerAccount?: PublicKey | null
|
|
22
23
|
sysvarInfo: PublicKey
|
|
23
24
|
tokenProgram: PublicKey
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
export const layout = borsh.struct([
|
|
27
|
+
export const layout = borsh.struct([
|
|
28
|
+
borsh.u64("liquidityAmount"),
|
|
29
|
+
borsh.u8("borrowInstructionIndex"),
|
|
30
|
+
])
|
|
31
|
+
|
|
32
|
+
function optionalAccountMeta(
|
|
33
|
+
pubkey: PublicKey | null | undefined,
|
|
34
|
+
isWritable: boolean,
|
|
35
|
+
programId: PublicKey
|
|
36
|
+
): AccountMeta {
|
|
37
|
+
return {
|
|
38
|
+
pubkey: pubkey ?? programId,
|
|
39
|
+
isSigner: false,
|
|
40
|
+
isWritable: pubkey === null || pubkey === undefined ? false : isWritable,
|
|
41
|
+
}
|
|
42
|
+
}
|
|
27
43
|
|
|
28
44
|
export function flashRepayReserveLiquidity(
|
|
29
45
|
args: FlashRepayReserveLiquidityArgs,
|
|
30
46
|
accounts: FlashRepayReserveLiquidityAccounts,
|
|
31
|
-
programId: PublicKey = PROGRAM_ID
|
|
47
|
+
programId: PublicKey = PROGRAM_ID
|
|
32
48
|
) {
|
|
33
49
|
const keys: Array<AccountMeta> = [
|
|
34
50
|
{
|
|
@@ -59,8 +75,8 @@ export function flashRepayReserveLiquidity(
|
|
|
59
75
|
isSigner: false,
|
|
60
76
|
isWritable: true,
|
|
61
77
|
},
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
optionalAccountMeta(accounts.referrerTokenState, true, programId),
|
|
79
|
+
optionalAccountMeta(accounts.referrerAccount, true, programId),
|
|
64
80
|
{ pubkey: accounts.sysvarInfo, isSigner: false, isWritable: false },
|
|
65
81
|
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
66
82
|
]
|
|
@@ -71,7 +87,7 @@ export function flashRepayReserveLiquidity(
|
|
|
71
87
|
liquidityAmount: args.liquidityAmount,
|
|
72
88
|
borrowInstructionIndex: args.borrowInstructionIndex,
|
|
73
89
|
},
|
|
74
|
-
buffer
|
|
90
|
+
buffer
|
|
75
91
|
)
|
|
76
92
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
77
93
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
5
|
import { PROGRAM_ID } from "../programId"
|
|
5
6
|
|
|
6
7
|
export interface IdlMissingTypesArgs {
|
|
7
8
|
reserveFarmKind: types.ReserveFarmKindKind
|
|
8
|
-
assetTier: types.AssetTierKind
|
|
9
9
|
feeCalculation: types.FeeCalculationKind
|
|
10
10
|
reserveStatus: types.ReserveStatusKind
|
|
11
11
|
updateConfigMode: types.UpdateConfigModeKind
|
|
@@ -14,14 +14,15 @@ export interface IdlMissingTypesArgs {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface IdlMissingTypesAccounts {
|
|
17
|
-
|
|
17
|
+
signer: PublicKey
|
|
18
|
+
globalConfig: PublicKey
|
|
18
19
|
lendingMarket: PublicKey
|
|
19
20
|
reserve: PublicKey
|
|
21
|
+
instructionSysvarAccount: PublicKey
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export const layout = borsh.struct([
|
|
23
25
|
types.ReserveFarmKind.layout("reserveFarmKind"),
|
|
24
|
-
types.AssetTier.layout("assetTier"),
|
|
25
26
|
types.FeeCalculation.layout("feeCalculation"),
|
|
26
27
|
types.ReserveStatus.layout("reserveStatus"),
|
|
27
28
|
types.UpdateConfigMode.layout("updateConfigMode"),
|
|
@@ -32,26 +33,33 @@ export const layout = borsh.struct([
|
|
|
32
33
|
export function idlMissingTypes(
|
|
33
34
|
args: IdlMissingTypesArgs,
|
|
34
35
|
accounts: IdlMissingTypesAccounts,
|
|
35
|
-
programId: PublicKey = PROGRAM_ID
|
|
36
|
+
programId: PublicKey = PROGRAM_ID
|
|
36
37
|
) {
|
|
37
38
|
const keys: Array<AccountMeta> = [
|
|
38
|
-
{ pubkey: accounts.
|
|
39
|
+
{ pubkey: accounts.signer, isSigner: true, isWritable: false },
|
|
40
|
+
{ pubkey: accounts.globalConfig, isSigner: false, isWritable: false },
|
|
39
41
|
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
40
42
|
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
43
|
+
{
|
|
44
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
45
|
+
isSigner: false,
|
|
46
|
+
isWritable: false,
|
|
47
|
+
},
|
|
41
48
|
]
|
|
42
49
|
const identifier = Buffer.from([130, 80, 38, 153, 80, 212, 182, 253])
|
|
43
50
|
const buffer = Buffer.alloc(1000)
|
|
44
51
|
const len = layout.encode(
|
|
45
52
|
{
|
|
46
53
|
reserveFarmKind: args.reserveFarmKind.toEncodable(),
|
|
47
|
-
assetTier: args.assetTier.toEncodable(),
|
|
48
54
|
feeCalculation: args.feeCalculation.toEncodable(),
|
|
49
55
|
reserveStatus: args.reserveStatus.toEncodable(),
|
|
50
56
|
updateConfigMode: args.updateConfigMode.toEncodable(),
|
|
51
|
-
updateLendingMarketConfigValue:
|
|
52
|
-
|
|
57
|
+
updateLendingMarketConfigValue:
|
|
58
|
+
args.updateLendingMarketConfigValue.toEncodable(),
|
|
59
|
+
updateLendingMarketConfigMode:
|
|
60
|
+
args.updateLendingMarketConfigMode.toEncodable(),
|
|
53
61
|
},
|
|
54
|
-
buffer
|
|
62
|
+
buffer
|
|
55
63
|
)
|
|
56
64
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
57
65
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -12,6 +12,11 @@ export { updateLendingMarketOwner } from "./updateLendingMarketOwner"
|
|
|
12
12
|
export type { UpdateLendingMarketOwnerAccounts } from "./updateLendingMarketOwner"
|
|
13
13
|
export { initReserve } from "./initReserve"
|
|
14
14
|
export type { InitReserveAccounts } from "./initReserve"
|
|
15
|
+
export { cloneReserveConfig } from "./cloneReserveConfig"
|
|
16
|
+
export type {
|
|
17
|
+
CloneReserveConfigArgs,
|
|
18
|
+
CloneReserveConfigAccounts,
|
|
19
|
+
} from "./cloneReserveConfig"
|
|
15
20
|
export { initFarmsForReserve } from "./initFarmsForReserve"
|
|
16
21
|
export type {
|
|
17
22
|
InitFarmsForReserveArgs,
|
|
@@ -24,17 +29,36 @@ export type {
|
|
|
24
29
|
} from "./updateReserveConfig"
|
|
25
30
|
export { redeemFees } from "./redeemFees"
|
|
26
31
|
export type { RedeemFeesAccounts } from "./redeemFees"
|
|
27
|
-
export { socializeLoss } from "./socializeLoss"
|
|
28
|
-
export type { SocializeLossArgs, SocializeLossAccounts } from "./socializeLoss"
|
|
29
32
|
export { withdrawProtocolFee } from "./withdrawProtocolFee"
|
|
30
33
|
export type {
|
|
31
34
|
WithdrawProtocolFeeArgs,
|
|
32
35
|
WithdrawProtocolFeeAccounts,
|
|
33
36
|
} from "./withdrawProtocolFee"
|
|
37
|
+
export { seedDepositOnInitReserve } from "./seedDepositOnInitReserve"
|
|
38
|
+
export type { SeedDepositOnInitReserveAccounts } from "./seedDepositOnInitReserve"
|
|
39
|
+
export { topupReserveRewards } from "./topupReserveRewards"
|
|
40
|
+
export type {
|
|
41
|
+
TopupReserveRewardsArgs,
|
|
42
|
+
TopupReserveRewardsAccounts,
|
|
43
|
+
} from "./topupReserveRewards"
|
|
44
|
+
export { socializeLoss } from "./socializeLoss"
|
|
45
|
+
export type { SocializeLossArgs, SocializeLossAccounts } from "./socializeLoss"
|
|
46
|
+
export { socializeLossV2 } from "./socializeLossV2"
|
|
47
|
+
export type {
|
|
48
|
+
SocializeLossV2Args,
|
|
49
|
+
SocializeLossV2Accounts,
|
|
50
|
+
} from "./socializeLossV2"
|
|
51
|
+
export { markObligationForDeleveraging } from "./markObligationForDeleveraging"
|
|
52
|
+
export type {
|
|
53
|
+
MarkObligationForDeleveragingArgs,
|
|
54
|
+
MarkObligationForDeleveragingAccounts,
|
|
55
|
+
} from "./markObligationForDeleveraging"
|
|
34
56
|
export { refreshReserve } from "./refreshReserve"
|
|
35
57
|
export type { RefreshReserveAccounts } from "./refreshReserve"
|
|
36
58
|
export { refreshReservesBatch } from "./refreshReservesBatch"
|
|
37
59
|
export type { RefreshReservesBatchArgs } from "./refreshReservesBatch"
|
|
60
|
+
export { calculateCtokenExchangeRate } from "./calculateCtokenExchangeRate"
|
|
61
|
+
export type { CalculateCtokenExchangeRateAccounts } from "./calculateCtokenExchangeRate"
|
|
38
62
|
export { depositReserveLiquidity } from "./depositReserveLiquidity"
|
|
39
63
|
export type {
|
|
40
64
|
DepositReserveLiquidityArgs,
|
|
@@ -67,11 +91,21 @@ export type {
|
|
|
67
91
|
DepositObligationCollateralArgs,
|
|
68
92
|
DepositObligationCollateralAccounts,
|
|
69
93
|
} from "./depositObligationCollateral"
|
|
94
|
+
export { depositObligationCollateralV2 } from "./depositObligationCollateralV2"
|
|
95
|
+
export type {
|
|
96
|
+
DepositObligationCollateralV2Args,
|
|
97
|
+
DepositObligationCollateralV2Accounts,
|
|
98
|
+
} from "./depositObligationCollateralV2"
|
|
70
99
|
export { withdrawObligationCollateral } from "./withdrawObligationCollateral"
|
|
71
100
|
export type {
|
|
72
101
|
WithdrawObligationCollateralArgs,
|
|
73
102
|
WithdrawObligationCollateralAccounts,
|
|
74
103
|
} from "./withdrawObligationCollateral"
|
|
104
|
+
export { withdrawObligationCollateralV2 } from "./withdrawObligationCollateralV2"
|
|
105
|
+
export type {
|
|
106
|
+
WithdrawObligationCollateralV2Args,
|
|
107
|
+
WithdrawObligationCollateralV2Accounts,
|
|
108
|
+
} from "./withdrawObligationCollateralV2"
|
|
75
109
|
export { borrowObligationLiquidity } from "./borrowObligationLiquidity"
|
|
76
110
|
export type {
|
|
77
111
|
BorrowObligationLiquidityArgs,
|
|
@@ -92,6 +126,16 @@ export type {
|
|
|
92
126
|
RepayObligationLiquidityV2Args,
|
|
93
127
|
RepayObligationLiquidityV2Accounts,
|
|
94
128
|
} from "./repayObligationLiquidityV2"
|
|
129
|
+
export { repayAndWithdrawAndRedeem } from "./repayAndWithdrawAndRedeem"
|
|
130
|
+
export type {
|
|
131
|
+
RepayAndWithdrawAndRedeemArgs,
|
|
132
|
+
RepayAndWithdrawAndRedeemAccounts,
|
|
133
|
+
} from "./repayAndWithdrawAndRedeem"
|
|
134
|
+
export { depositAndWithdraw } from "./depositAndWithdraw"
|
|
135
|
+
export type {
|
|
136
|
+
DepositAndWithdrawArgs,
|
|
137
|
+
DepositAndWithdrawAccounts,
|
|
138
|
+
} from "./depositAndWithdraw"
|
|
95
139
|
export { depositReserveLiquidityAndObligationCollateral } from "./depositReserveLiquidityAndObligationCollateral"
|
|
96
140
|
export type {
|
|
97
141
|
DepositReserveLiquidityAndObligationCollateralArgs,
|
|
@@ -117,6 +161,11 @@ export type {
|
|
|
117
161
|
LiquidateObligationAndRedeemReserveCollateralArgs,
|
|
118
162
|
LiquidateObligationAndRedeemReserveCollateralAccounts,
|
|
119
163
|
} from "./liquidateObligationAndRedeemReserveCollateral"
|
|
164
|
+
export { liquidateObligationAndRedeemReserveCollateralV2 } from "./liquidateObligationAndRedeemReserveCollateralV2"
|
|
165
|
+
export type {
|
|
166
|
+
LiquidateObligationAndRedeemReserveCollateralV2Args,
|
|
167
|
+
LiquidateObligationAndRedeemReserveCollateralV2Accounts,
|
|
168
|
+
} from "./liquidateObligationAndRedeemReserveCollateralV2"
|
|
120
169
|
export { flashRepayReserveLiquidity } from "./flashRepayReserveLiquidity"
|
|
121
170
|
export type {
|
|
122
171
|
FlashRepayReserveLiquidityArgs,
|
|
@@ -133,10 +182,7 @@ export type {
|
|
|
133
182
|
RequestElevationGroupAccounts,
|
|
134
183
|
} from "./requestElevationGroup"
|
|
135
184
|
export { initReferrerTokenState } from "./initReferrerTokenState"
|
|
136
|
-
export type {
|
|
137
|
-
InitReferrerTokenStateArgs,
|
|
138
|
-
InitReferrerTokenStateAccounts,
|
|
139
|
-
} from "./initReferrerTokenState"
|
|
185
|
+
export type { InitReferrerTokenStateAccounts } from "./initReferrerTokenState"
|
|
140
186
|
export { initUserMetadata } from "./initUserMetadata"
|
|
141
187
|
export type {
|
|
142
188
|
InitUserMetadataArgs,
|
|
@@ -151,6 +197,72 @@ export type {
|
|
|
151
197
|
} from "./initReferrerStateAndShortUrl"
|
|
152
198
|
export { deleteReferrerStateAndShortUrl } from "./deleteReferrerStateAndShortUrl"
|
|
153
199
|
export type { DeleteReferrerStateAndShortUrlAccounts } from "./deleteReferrerStateAndShortUrl"
|
|
200
|
+
export { setObligationOrder } from "./setObligationOrder"
|
|
201
|
+
export type {
|
|
202
|
+
SetObligationOrderArgs,
|
|
203
|
+
SetObligationOrderAccounts,
|
|
204
|
+
} from "./setObligationOrder"
|
|
205
|
+
export { setBorrowOrder } from "./setBorrowOrder"
|
|
206
|
+
export type {
|
|
207
|
+
SetBorrowOrderArgs,
|
|
208
|
+
SetBorrowOrderAccounts,
|
|
209
|
+
} from "./setBorrowOrder"
|
|
210
|
+
export { setBorrowOrderV2 } from "./setBorrowOrderV2"
|
|
211
|
+
export type {
|
|
212
|
+
SetBorrowOrderV2Args,
|
|
213
|
+
SetBorrowOrderV2Accounts,
|
|
214
|
+
} from "./setBorrowOrderV2"
|
|
215
|
+
export { updateObligationConfig } from "./updateObligationConfig"
|
|
216
|
+
export type {
|
|
217
|
+
UpdateObligationConfigArgs,
|
|
218
|
+
UpdateObligationConfigAccounts,
|
|
219
|
+
} from "./updateObligationConfig"
|
|
220
|
+
export { rolloverFixedTermBorrow } from "./rolloverFixedTermBorrow"
|
|
221
|
+
export type { RolloverFixedTermBorrowAccounts } from "./rolloverFixedTermBorrow"
|
|
222
|
+
export { fillBorrowOrder } from "./fillBorrowOrder"
|
|
223
|
+
export type { FillBorrowOrderAccounts } from "./fillBorrowOrder"
|
|
224
|
+
export { fillBorrowOrderV2 } from "./fillBorrowOrderV2"
|
|
225
|
+
export type {
|
|
226
|
+
FillBorrowOrderV2Args,
|
|
227
|
+
FillBorrowOrderV2Accounts,
|
|
228
|
+
} from "./fillBorrowOrderV2"
|
|
229
|
+
export { initiateObligationOwnershipTransfer } from "./initiateObligationOwnershipTransfer"
|
|
230
|
+
export type {
|
|
231
|
+
InitiateObligationOwnershipTransferArgs,
|
|
232
|
+
InitiateObligationOwnershipTransferAccounts,
|
|
233
|
+
} from "./initiateObligationOwnershipTransfer"
|
|
234
|
+
export { approveObligationOwnershipTransfer } from "./approveObligationOwnershipTransfer"
|
|
235
|
+
export type { ApproveObligationOwnershipTransferAccounts } from "./approveObligationOwnershipTransfer"
|
|
236
|
+
export { acceptObligationOwnership } from "./acceptObligationOwnership"
|
|
237
|
+
export type { AcceptObligationOwnershipAccounts } from "./acceptObligationOwnership"
|
|
238
|
+
export { abortObligationOwnershipTransfer } from "./abortObligationOwnershipTransfer"
|
|
239
|
+
export type { AbortObligationOwnershipTransferAccounts } from "./abortObligationOwnershipTransfer"
|
|
240
|
+
export { enqueueToWithdraw } from "./enqueueToWithdraw"
|
|
241
|
+
export type {
|
|
242
|
+
EnqueueToWithdrawArgs,
|
|
243
|
+
EnqueueToWithdrawAccounts,
|
|
244
|
+
} from "./enqueueToWithdraw"
|
|
245
|
+
export { withdrawQueuedLiquidity } from "./withdrawQueuedLiquidity"
|
|
246
|
+
export type { WithdrawQueuedLiquidityAccounts } from "./withdrawQueuedLiquidity"
|
|
247
|
+
export { recoverInvalidTicketCollateral } from "./recoverInvalidTicketCollateral"
|
|
248
|
+
export type {
|
|
249
|
+
RecoverInvalidTicketCollateralArgs,
|
|
250
|
+
RecoverInvalidTicketCollateralAccounts,
|
|
251
|
+
} from "./recoverInvalidTicketCollateral"
|
|
252
|
+
export { cancelWithdrawTicket } from "./cancelWithdrawTicket"
|
|
253
|
+
export type {
|
|
254
|
+
CancelWithdrawTicketArgs,
|
|
255
|
+
CancelWithdrawTicketAccounts,
|
|
256
|
+
} from "./cancelWithdrawTicket"
|
|
257
|
+
export { initGlobalConfig } from "./initGlobalConfig"
|
|
258
|
+
export type { InitGlobalConfigAccounts } from "./initGlobalConfig"
|
|
259
|
+
export { updateGlobalConfig } from "./updateGlobalConfig"
|
|
260
|
+
export type {
|
|
261
|
+
UpdateGlobalConfigArgs,
|
|
262
|
+
UpdateGlobalConfigAccounts,
|
|
263
|
+
} from "./updateGlobalConfig"
|
|
264
|
+
export { updateGlobalConfigAdmin } from "./updateGlobalConfigAdmin"
|
|
265
|
+
export type { UpdateGlobalConfigAdminAccounts } from "./updateGlobalConfigAdmin"
|
|
154
266
|
export { idlMissingTypes } from "./idlMissingTypes"
|
|
155
267
|
export type {
|
|
156
268
|
IdlMissingTypesArgs,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
5
|
import { PROGRAM_ID } from "../programId"
|
|
4
6
|
|
|
5
7
|
export interface InitFarmsForReserveArgs {
|
|
@@ -17,6 +19,7 @@ export interface InitFarmsForReserveAccounts {
|
|
|
17
19
|
farmsVaultAuthority: PublicKey
|
|
18
20
|
rent: PublicKey
|
|
19
21
|
systemProgram: PublicKey
|
|
22
|
+
instructionSysvarAccount: PublicKey
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
export const layout = borsh.struct([borsh.u8("mode")])
|
|
@@ -24,7 +27,7 @@ export const layout = borsh.struct([borsh.u8("mode")])
|
|
|
24
27
|
export function initFarmsForReserve(
|
|
25
28
|
args: InitFarmsForReserveArgs,
|
|
26
29
|
accounts: InitFarmsForReserveAccounts,
|
|
27
|
-
programId: PublicKey = PROGRAM_ID
|
|
30
|
+
programId: PublicKey = PROGRAM_ID
|
|
28
31
|
) {
|
|
29
32
|
const keys: Array<AccountMeta> = [
|
|
30
33
|
{ pubkey: accounts.lendingMarketOwner, isSigner: true, isWritable: true },
|
|
@@ -32,7 +35,7 @@ export function initFarmsForReserve(
|
|
|
32
35
|
{
|
|
33
36
|
pubkey: accounts.lendingMarketAuthority,
|
|
34
37
|
isSigner: false,
|
|
35
|
-
isWritable:
|
|
38
|
+
isWritable: false,
|
|
36
39
|
},
|
|
37
40
|
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
38
41
|
{ pubkey: accounts.farmsProgram, isSigner: false, isWritable: false },
|
|
@@ -45,6 +48,11 @@ export function initFarmsForReserve(
|
|
|
45
48
|
},
|
|
46
49
|
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
47
50
|
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
51
|
+
{
|
|
52
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
53
|
+
isSigner: false,
|
|
54
|
+
isWritable: false,
|
|
55
|
+
},
|
|
48
56
|
]
|
|
49
57
|
const identifier = Buffer.from([218, 6, 62, 233, 1, 33, 232, 82])
|
|
50
58
|
const buffer = Buffer.alloc(1000)
|
|
@@ -52,7 +60,7 @@ export function initFarmsForReserve(
|
|
|
52
60
|
{
|
|
53
61
|
mode: args.mode,
|
|
54
62
|
},
|
|
55
|
-
buffer
|
|
63
|
+
buffer
|
|
56
64
|
)
|
|
57
65
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
58
66
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
import { PROGRAM_ID } from "../programId"
|
|
6
|
+
|
|
7
|
+
export interface InitGlobalConfigAccounts {
|
|
8
|
+
payer: PublicKey
|
|
9
|
+
globalConfig: PublicKey
|
|
10
|
+
programData: PublicKey
|
|
11
|
+
systemProgram: PublicKey
|
|
12
|
+
rent: PublicKey
|
|
13
|
+
instructionSysvarAccount: PublicKey
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function initGlobalConfig(
|
|
17
|
+
accounts: InitGlobalConfigAccounts,
|
|
18
|
+
programId: PublicKey = PROGRAM_ID
|
|
19
|
+
) {
|
|
20
|
+
const keys: Array<AccountMeta> = [
|
|
21
|
+
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
|
22
|
+
{ pubkey: accounts.globalConfig, isSigner: false, isWritable: true },
|
|
23
|
+
{ pubkey: accounts.programData, isSigner: false, isWritable: false },
|
|
24
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
25
|
+
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
26
|
+
{
|
|
27
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
28
|
+
isSigner: false,
|
|
29
|
+
isWritable: false,
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
const identifier = Buffer.from([140, 136, 214, 48, 87, 0, 120, 255])
|
|
33
|
+
const data = identifier
|
|
34
|
+
const ix = new TransactionInstruction({ keys, programId, data })
|
|
35
|
+
return ix
|
|
36
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
5
|
import { PROGRAM_ID } from "../programId"
|
|
4
6
|
|
|
5
7
|
export interface InitLendingMarketArgs {
|
|
@@ -12,14 +14,17 @@ export interface InitLendingMarketAccounts {
|
|
|
12
14
|
lendingMarketAuthority: PublicKey
|
|
13
15
|
systemProgram: PublicKey
|
|
14
16
|
rent: PublicKey
|
|
17
|
+
instructionSysvarAccount: PublicKey
|
|
15
18
|
}
|
|
16
19
|
|
|
17
|
-
export const layout = borsh.struct([
|
|
20
|
+
export const layout = borsh.struct([
|
|
21
|
+
borsh.array(borsh.u8(), 32, "quoteCurrency"),
|
|
22
|
+
])
|
|
18
23
|
|
|
19
24
|
export function initLendingMarket(
|
|
20
25
|
args: InitLendingMarketArgs,
|
|
21
26
|
accounts: InitLendingMarketAccounts,
|
|
22
|
-
programId: PublicKey = PROGRAM_ID
|
|
27
|
+
programId: PublicKey = PROGRAM_ID
|
|
23
28
|
) {
|
|
24
29
|
const keys: Array<AccountMeta> = [
|
|
25
30
|
{ pubkey: accounts.lendingMarketOwner, isSigner: true, isWritable: true },
|
|
@@ -31,6 +36,11 @@ export function initLendingMarket(
|
|
|
31
36
|
},
|
|
32
37
|
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
33
38
|
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
39
|
+
{
|
|
40
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
41
|
+
isSigner: false,
|
|
42
|
+
isWritable: false,
|
|
43
|
+
},
|
|
34
44
|
]
|
|
35
45
|
const identifier = Buffer.from([34, 162, 116, 14, 101, 137, 94, 239])
|
|
36
46
|
const buffer = Buffer.alloc(1000)
|
|
@@ -38,7 +48,7 @@ export function initLendingMarket(
|
|
|
38
48
|
{
|
|
39
49
|
quoteCurrency: args.quoteCurrency,
|
|
40
50
|
},
|
|
41
|
-
buffer
|
|
51
|
+
buffer
|
|
42
52
|
)
|
|
43
53
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
44
54
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
4
|
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
5
|
import { PROGRAM_ID } from "../programId"
|
|
@@ -24,7 +25,7 @@ export const layout = borsh.struct([types.InitObligationArgs.layout("args")])
|
|
|
24
25
|
export function initObligation(
|
|
25
26
|
args: InitObligationArgs,
|
|
26
27
|
accounts: InitObligationAccounts,
|
|
27
|
-
programId: PublicKey = PROGRAM_ID
|
|
28
|
+
programId: PublicKey = PROGRAM_ID
|
|
28
29
|
) {
|
|
29
30
|
const keys: Array<AccountMeta> = [
|
|
30
31
|
{ pubkey: accounts.obligationOwner, isSigner: true, isWritable: false },
|
|
@@ -43,7 +44,7 @@ export function initObligation(
|
|
|
43
44
|
{
|
|
44
45
|
args: types.InitObligationArgs.toEncodable(args.args),
|
|
45
46
|
},
|
|
46
|
-
buffer
|
|
47
|
+
buffer
|
|
47
48
|
)
|
|
48
49
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
49
50
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
5
|
import { PROGRAM_ID } from "../programId"
|
|
4
6
|
|
|
5
7
|
export interface InitObligationFarmsForReserveArgs {
|
|
@@ -25,7 +27,7 @@ export const layout = borsh.struct([borsh.u8("mode")])
|
|
|
25
27
|
export function initObligationFarmsForReserve(
|
|
26
28
|
args: InitObligationFarmsForReserveArgs,
|
|
27
29
|
accounts: InitObligationFarmsForReserveAccounts,
|
|
28
|
-
programId: PublicKey = PROGRAM_ID
|
|
30
|
+
programId: PublicKey = PROGRAM_ID
|
|
29
31
|
) {
|
|
30
32
|
const keys: Array<AccountMeta> = [
|
|
31
33
|
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
|
@@ -34,7 +36,7 @@ export function initObligationFarmsForReserve(
|
|
|
34
36
|
{
|
|
35
37
|
pubkey: accounts.lendingMarketAuthority,
|
|
36
38
|
isSigner: false,
|
|
37
|
-
isWritable:
|
|
39
|
+
isWritable: false,
|
|
38
40
|
},
|
|
39
41
|
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
40
42
|
{ pubkey: accounts.reserveFarmState, isSigner: false, isWritable: true },
|
|
@@ -50,7 +52,7 @@ export function initObligationFarmsForReserve(
|
|
|
50
52
|
{
|
|
51
53
|
mode: args.mode,
|
|
52
54
|
},
|
|
53
|
-
buffer
|
|
55
|
+
buffer
|
|
54
56
|
)
|
|
55
57
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
56
58
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
5
|
import { PROGRAM_ID } from "../programId"
|
|
4
6
|
|
|
5
7
|
export interface InitReferrerStateAndShortUrlArgs {
|
|
@@ -20,7 +22,7 @@ export const layout = borsh.struct([borsh.str("shortUrl")])
|
|
|
20
22
|
export function initReferrerStateAndShortUrl(
|
|
21
23
|
args: InitReferrerStateAndShortUrlArgs,
|
|
22
24
|
accounts: InitReferrerStateAndShortUrlAccounts,
|
|
23
|
-
programId: PublicKey = PROGRAM_ID
|
|
25
|
+
programId: PublicKey = PROGRAM_ID
|
|
24
26
|
) {
|
|
25
27
|
const keys: Array<AccountMeta> = [
|
|
26
28
|
{ pubkey: accounts.referrer, isSigner: true, isWritable: true },
|
|
@@ -40,7 +42,7 @@ export function initReferrerStateAndShortUrl(
|
|
|
40
42
|
{
|
|
41
43
|
shortUrl: args.shortUrl,
|
|
42
44
|
},
|
|
43
|
-
buffer
|
|
45
|
+
buffer
|
|
44
46
|
)
|
|
45
47
|
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
46
48
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
@@ -1,44 +1,34 @@
|
|
|
1
1
|
import { TransactionInstruction, PublicKey, AccountMeta } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
3
|
import * as borsh from "@coral-xyz/borsh" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
5
|
import { PROGRAM_ID } from "../programId"
|
|
4
6
|
|
|
5
|
-
export interface InitReferrerTokenStateArgs {
|
|
6
|
-
referrer: PublicKey
|
|
7
|
-
}
|
|
8
|
-
|
|
9
7
|
export interface InitReferrerTokenStateAccounts {
|
|
10
8
|
payer: PublicKey
|
|
11
9
|
lendingMarket: PublicKey
|
|
12
10
|
reserve: PublicKey
|
|
11
|
+
referrer: PublicKey
|
|
13
12
|
referrerTokenState: PublicKey
|
|
14
13
|
rent: PublicKey
|
|
15
14
|
systemProgram: PublicKey
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export const layout = borsh.struct([borsh.publicKey("referrer")])
|
|
19
|
-
|
|
20
17
|
export function initReferrerTokenState(
|
|
21
|
-
args: InitReferrerTokenStateArgs,
|
|
22
18
|
accounts: InitReferrerTokenStateAccounts,
|
|
23
|
-
programId: PublicKey = PROGRAM_ID
|
|
19
|
+
programId: PublicKey = PROGRAM_ID
|
|
24
20
|
) {
|
|
25
21
|
const keys: Array<AccountMeta> = [
|
|
26
22
|
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
|
|
27
23
|
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
28
24
|
{ pubkey: accounts.reserve, isSigner: false, isWritable: false },
|
|
25
|
+
{ pubkey: accounts.referrer, isSigner: false, isWritable: false },
|
|
29
26
|
{ pubkey: accounts.referrerTokenState, isSigner: false, isWritable: true },
|
|
30
27
|
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
31
28
|
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
32
29
|
]
|
|
33
30
|
const identifier = Buffer.from([116, 45, 66, 148, 58, 13, 218, 115])
|
|
34
|
-
const
|
|
35
|
-
const len = layout.encode(
|
|
36
|
-
{
|
|
37
|
-
referrer: args.referrer,
|
|
38
|
-
},
|
|
39
|
-
buffer,
|
|
40
|
-
)
|
|
41
|
-
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)
|
|
31
|
+
const data = identifier
|
|
42
32
|
const ix = new TransactionInstruction({ keys, programId, data })
|
|
43
33
|
return ix
|
|
44
34
|
}
|