@kamino-finance/klend-sdk 2.10.6
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/README.md +85 -0
- package/dist/classes/action.d.ts +154 -0
- package/dist/classes/action.js +1505 -0
- package/dist/classes/action.js.map +1 -0
- package/dist/classes/curve.d.ts +15 -0
- package/dist/classes/curve.js +32 -0
- package/dist/classes/curve.js.map +1 -0
- package/dist/classes/fraction.d.ts +23 -0
- package/dist/classes/fraction.js +60 -0
- package/dist/classes/fraction.js.map +1 -0
- package/dist/classes/index.d.ts +8 -0
- package/dist/classes/index.js +25 -0
- package/dist/classes/index.js.map +1 -0
- package/dist/classes/jupiterPerps.d.ts +2 -0
- package/dist/classes/jupiterPerps.js +25 -0
- package/dist/classes/jupiterPerps.js.map +1 -0
- package/dist/classes/market.d.ts +140 -0
- package/dist/classes/market.js +901 -0
- package/dist/classes/market.js.map +1 -0
- package/dist/classes/obligation.d.ts +170 -0
- package/dist/classes/obligation.js +610 -0
- package/dist/classes/obligation.js.map +1 -0
- package/dist/classes/reserve.d.ts +161 -0
- package/dist/classes/reserve.js +474 -0
- package/dist/classes/reserve.js.map +1 -0
- package/dist/classes/shared.d.ts +41 -0
- package/dist/classes/shared.js +10 -0
- package/dist/classes/shared.js.map +1 -0
- package/dist/classes/utils.d.ts +40 -0
- package/dist/classes/utils.js +129 -0
- package/dist/classes/utils.js.map +1 -0
- package/dist/idl.json +4102 -0
- package/dist/idl_codegen/accounts/LendingMarket.d.ts +153 -0
- package/dist/idl_codegen/accounts/LendingMarket.js +204 -0
- package/dist/idl_codegen/accounts/LendingMarket.js.map +1 -0
- package/dist/idl_codegen/accounts/Obligation.d.ts +139 -0
- package/dist/idl_codegen/accounts/Obligation.js +193 -0
- package/dist/idl_codegen/accounts/Obligation.js.map +1 -0
- package/dist/idl_codegen/accounts/ReferrerState.d.ts +22 -0
- package/dist/idl_codegen/accounts/ReferrerState.js +101 -0
- package/dist/idl_codegen/accounts/ReferrerState.js.map +1 -0
- package/dist/idl_codegen/accounts/ReferrerTokenState.d.ts +51 -0
- package/dist/idl_codegen/accounts/ReferrerTokenState.js +126 -0
- package/dist/idl_codegen/accounts/ReferrerTokenState.js.map +1 -0
- package/dist/idl_codegen/accounts/Reserve.d.ts +72 -0
- package/dist/idl_codegen/accounts/Reserve.js +156 -0
- package/dist/idl_codegen/accounts/Reserve.js.map +1 -0
- package/dist/idl_codegen/accounts/ShortUrl.d.ts +22 -0
- package/dist/idl_codegen/accounts/ShortUrl.js +101 -0
- package/dist/idl_codegen/accounts/ShortUrl.js.map +1 -0
- package/dist/idl_codegen/accounts/UserMetadata.d.ts +48 -0
- package/dist/idl_codegen/accounts/UserMetadata.js +126 -0
- package/dist/idl_codegen/accounts/UserMetadata.js.map +1 -0
- package/dist/idl_codegen/accounts/UserState.d.ts +143 -0
- package/dist/idl_codegen/accounts/UserState.js +180 -0
- package/dist/idl_codegen/accounts/UserState.js.map +1 -0
- package/dist/idl_codegen/accounts/index.d.ts +16 -0
- package/dist/idl_codegen/accounts/index.js +20 -0
- package/dist/idl_codegen/accounts/index.js.map +1 -0
- package/dist/idl_codegen/errors/anchor.d.ts +434 -0
- package/dist/idl_codegen/errors/anchor.js +713 -0
- package/dist/idl_codegen/errors/anchor.js.map +1 -0
- package/dist/idl_codegen/errors/custom.d.ts +730 -0
- package/dist/idl_codegen/errors/custom.js +1194 -0
- package/dist/idl_codegen/errors/custom.js.map +1 -0
- package/dist/idl_codegen/errors/index.d.ts +5 -0
- package/dist/idl_codegen/errors/index.js +71 -0
- package/dist/idl_codegen/errors/index.js.map +1 -0
- package/dist/idl_codegen/instructions/borrowObligationLiquidity.d.ts +20 -0
- package/dist/idl_codegen/instructions/borrowObligationLiquidity.js +75 -0
- package/dist/idl_codegen/instructions/borrowObligationLiquidity.js.map +1 -0
- package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.d.ts +9 -0
- package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.js +20 -0
- package/dist/idl_codegen/instructions/deleteReferrerStateAndShortUrl.js.map +1 -0
- package/dist/idl_codegen/instructions/depositObligationCollateral.d.ts +17 -0
- package/dist/idl_codegen/instructions/depositObligationCollateral.js +64 -0
- package/dist/idl_codegen/instructions/depositObligationCollateral.js.map +1 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidity.d.ts +19 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidity.js +74 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidity.js.map +1 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.d.ts +21 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.js +80 -0
- package/dist/idl_codegen/instructions/depositReserveLiquidityAndObligationCollateral.js.map +1 -0
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.d.ts +20 -0
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js +75 -0
- package/dist/idl_codegen/instructions/flashBorrowReserveLiquidity.js.map +1 -0
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.d.ts +21 -0
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js +75 -0
- package/dist/idl_codegen/instructions/flashRepayReserveLiquidity.js.map +1 -0
- package/dist/idl_codegen/instructions/idlMissingTypes.d.ts +18 -0
- package/dist/idl_codegen/instructions/idlMissingTypes.js +62 -0
- package/dist/idl_codegen/instructions/idlMissingTypes.js.map +1 -0
- package/dist/idl_codegen/instructions/index.d.ts +66 -0
- package/dist/idl_codegen/instructions/index.js +70 -0
- package/dist/idl_codegen/instructions/index.js.map +1 -0
- package/dist/idl_codegen/instructions/initFarmsForReserve.d.ts +19 -0
- package/dist/idl_codegen/instructions/initFarmsForReserve.js +63 -0
- package/dist/idl_codegen/instructions/initFarmsForReserve.js.map +1 -0
- package/dist/idl_codegen/instructions/initLendingMarket.d.ts +13 -0
- package/dist/idl_codegen/instructions/initLendingMarket.js +55 -0
- package/dist/idl_codegen/instructions/initLendingMarket.js.map +1 -0
- package/dist/idl_codegen/instructions/initObligation.d.ts +19 -0
- package/dist/idl_codegen/instructions/initObligation.js +55 -0
- package/dist/idl_codegen/instructions/initObligation.js.map +1 -0
- package/dist/idl_codegen/instructions/initObligationFarmsForReserve.d.ts +20 -0
- package/dist/idl_codegen/instructions/initObligationFarmsForReserve.js +60 -0
- package/dist/idl_codegen/instructions/initObligationFarmsForReserve.js.map +1 -0
- package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.d.ts +14 -0
- package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.js +54 -0
- package/dist/idl_codegen/instructions/initReferrerStateAndShortUrl.js.map +1 -0
- package/dist/idl_codegen/instructions/initReferrerTokenState.d.ts +14 -0
- package/dist/idl_codegen/instructions/initReferrerTokenState.js +50 -0
- package/dist/idl_codegen/instructions/initReferrerTokenState.js.map +1 -0
- package/dist/idl_codegen/instructions/initReserve.d.ts +16 -0
- package/dist/idl_codegen/instructions/initReserve.js +47 -0
- package/dist/idl_codegen/instructions/initReserve.js.map +1 -0
- package/dist/idl_codegen/instructions/initUserMetadata.d.ts +14 -0
- package/dist/idl_codegen/instructions/initUserMetadata.js +54 -0
- package/dist/idl_codegen/instructions/initUserMetadata.js.map +1 -0
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.d.ts +27 -0
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js +102 -0
- package/dist/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.js.map +1 -0
- package/dist/idl_codegen/instructions/redeemFees.d.ts +10 -0
- package/dist/idl_codegen/instructions/redeemFees.js +33 -0
- package/dist/idl_codegen/instructions/redeemFees.js.map +1 -0
- package/dist/idl_codegen/instructions/redeemReserveCollateral.d.ts +19 -0
- package/dist/idl_codegen/instructions/redeemReserveCollateral.js +78 -0
- package/dist/idl_codegen/instructions/redeemReserveCollateral.js.map +1 -0
- package/dist/idl_codegen/instructions/refreshObligation.d.ts +6 -0
- package/dist/idl_codegen/instructions/refreshObligation.js +17 -0
- package/dist/idl_codegen/instructions/refreshObligation.js.map +1 -0
- package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.d.ts +19 -0
- package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.js +63 -0
- package/dist/idl_codegen/instructions/refreshObligationFarmsForReserve.js.map +1 -0
- package/dist/idl_codegen/instructions/refreshReserve.d.ts +10 -0
- package/dist/idl_codegen/instructions/refreshReserve.js +29 -0
- package/dist/idl_codegen/instructions/refreshReserve.js.map +1 -0
- package/dist/idl_codegen/instructions/repayObligationLiquidity.d.ts +17 -0
- package/dist/idl_codegen/instructions/repayObligationLiquidity.js +60 -0
- package/dist/idl_codegen/instructions/repayObligationLiquidity.js.map +1 -0
- package/dist/idl_codegen/instructions/requestElevationGroup.d.ts +11 -0
- package/dist/idl_codegen/instructions/requestElevationGroup.js +47 -0
- package/dist/idl_codegen/instructions/requestElevationGroup.js.map +1 -0
- package/dist/idl_codegen/instructions/socializeLoss.d.ts +14 -0
- package/dist/idl_codegen/instructions/socializeLoss.js +53 -0
- package/dist/idl_codegen/instructions/socializeLoss.js.map +1 -0
- package/dist/idl_codegen/instructions/updateEntireReserveConfig.d.ts +13 -0
- package/dist/idl_codegen/instructions/updateEntireReserveConfig.js +51 -0
- package/dist/idl_codegen/instructions/updateEntireReserveConfig.js.map +1 -0
- package/dist/idl_codegen/instructions/updateLendingMarket.d.ts +12 -0
- package/dist/idl_codegen/instructions/updateLendingMarket.js +50 -0
- package/dist/idl_codegen/instructions/updateLendingMarket.js.map +1 -0
- package/dist/idl_codegen/instructions/updateLendingMarketOwner.d.ts +6 -0
- package/dist/idl_codegen/instructions/updateLendingMarketOwner.js +21 -0
- package/dist/idl_codegen/instructions/updateLendingMarketOwner.js.map +1 -0
- package/dist/idl_codegen/instructions/updateReserveConfig.d.ts +13 -0
- package/dist/idl_codegen/instructions/updateReserveConfig.js +51 -0
- package/dist/idl_codegen/instructions/updateReserveConfig.js.map +1 -0
- package/dist/idl_codegen/instructions/updateSingleReserveConfig.d.ts +13 -0
- package/dist/idl_codegen/instructions/updateSingleReserveConfig.js +51 -0
- package/dist/idl_codegen/instructions/updateSingleReserveConfig.js.map +1 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.d.ts +18 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.js +69 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateral.js.map +1 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.d.ts +21 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js +84 -0
- package/dist/idl_codegen/instructions/withdrawObligationCollateralAndRedeemReserveCollateral.js.map +1 -0
- package/dist/idl_codegen/instructions/withdrawProtocolFee.d.ts +16 -0
- package/dist/idl_codegen/instructions/withdrawProtocolFee.js +59 -0
- package/dist/idl_codegen/instructions/withdrawProtocolFee.js.map +1 -0
- package/dist/idl_codegen/instructions/withdrawReferrerFees.d.ts +12 -0
- package/dist/idl_codegen/instructions/withdrawReferrerFees.js +35 -0
- package/dist/idl_codegen/instructions/withdrawReferrerFees.js.map +1 -0
- package/dist/idl_codegen/programId.d.ts +4 -0
- package/dist/idl_codegen/programId.js +13 -0
- package/dist/idl_codegen/programId.js.map +1 -0
- package/dist/idl_codegen/types/AssetTier.d.ts +44 -0
- package/dist/idl_codegen/types/AssetTier.js +128 -0
- package/dist/idl_codegen/types/AssetTier.js.map +1 -0
- package/dist/idl_codegen/types/BigFractionBytes.d.ts +27 -0
- package/dist/idl_codegen/types/BigFractionBytes.js +73 -0
- package/dist/idl_codegen/types/BigFractionBytes.js.map +1 -0
- package/dist/idl_codegen/types/BorrowRateCurve.d.ts +27 -0
- package/dist/idl_codegen/types/BorrowRateCurve.js +62 -0
- package/dist/idl_codegen/types/BorrowRateCurve.js.map +1 -0
- package/dist/idl_codegen/types/CurvePoint.d.ts +26 -0
- package/dist/idl_codegen/types/CurvePoint.js +66 -0
- package/dist/idl_codegen/types/CurvePoint.js.map +1 -0
- package/dist/idl_codegen/types/ElevationGroup.d.ts +52 -0
- package/dist/idl_codegen/types/ElevationGroup.js +103 -0
- package/dist/idl_codegen/types/ElevationGroup.js.map +1 -0
- package/dist/idl_codegen/types/FeeCalculation.d.ts +31 -0
- package/dist/idl_codegen/types/FeeCalculation.js +102 -0
- package/dist/idl_codegen/types/FeeCalculation.js.map +1 -0
- package/dist/idl_codegen/types/InitObligationArgs.d.ts +26 -0
- package/dist/idl_codegen/types/InitObligationArgs.js +66 -0
- package/dist/idl_codegen/types/InitObligationArgs.js.map +1 -0
- package/dist/idl_codegen/types/LastUpdate.d.ts +47 -0
- package/dist/idl_codegen/types/LastUpdate.js +86 -0
- package/dist/idl_codegen/types/LastUpdate.js.map +1 -0
- package/dist/idl_codegen/types/ObligationCollateral.d.ts +48 -0
- package/dist/idl_codegen/types/ObligationCollateral.js +87 -0
- package/dist/idl_codegen/types/ObligationCollateral.js.map +1 -0
- package/dist/idl_codegen/types/ObligationLiquidity.d.ts +75 -0
- package/dist/idl_codegen/types/ObligationLiquidity.js +107 -0
- package/dist/idl_codegen/types/ObligationLiquidity.js.map +1 -0
- package/dist/idl_codegen/types/PriceHeuristic.d.ts +41 -0
- package/dist/idl_codegen/types/PriceHeuristic.js +75 -0
- package/dist/idl_codegen/types/PriceHeuristic.js.map +1 -0
- package/dist/idl_codegen/types/PythConfiguration.d.ts +25 -0
- package/dist/idl_codegen/types/PythConfiguration.js +62 -0
- package/dist/idl_codegen/types/PythConfiguration.js.map +1 -0
- package/dist/idl_codegen/types/ReserveCollateral.d.ts +53 -0
- package/dist/idl_codegen/types/ReserveCollateral.js +93 -0
- package/dist/idl_codegen/types/ReserveCollateral.js.map +1 -0
- package/dist/idl_codegen/types/ReserveConfig.d.ts +304 -0
- package/dist/idl_codegen/types/ReserveConfig.js +209 -0
- package/dist/idl_codegen/types/ReserveConfig.js.map +1 -0
- package/dist/idl_codegen/types/ReserveFarmKind.d.ts +31 -0
- package/dist/idl_codegen/types/ReserveFarmKind.js +102 -0
- package/dist/idl_codegen/types/ReserveFarmKind.js.map +1 -0
- package/dist/idl_codegen/types/ReserveFees.d.ts +78 -0
- package/dist/idl_codegen/types/ReserveFees.js +86 -0
- package/dist/idl_codegen/types/ReserveFees.js.map +1 -0
- package/dist/idl_codegen/types/ReserveLiquidity.d.ts +173 -0
- package/dist/idl_codegen/types/ReserveLiquidity.js +166 -0
- package/dist/idl_codegen/types/ReserveLiquidity.js.map +1 -0
- package/dist/idl_codegen/types/ReserveStatus.d.ts +44 -0
- package/dist/idl_codegen/types/ReserveStatus.js +128 -0
- package/dist/idl_codegen/types/ReserveStatus.js.map +1 -0
- package/dist/idl_codegen/types/ScopeConfiguration.d.ts +41 -0
- package/dist/idl_codegen/types/ScopeConfiguration.js +76 -0
- package/dist/idl_codegen/types/ScopeConfiguration.js.map +1 -0
- package/dist/idl_codegen/types/SwitchboardConfiguration.d.ts +30 -0
- package/dist/idl_codegen/types/SwitchboardConfiguration.js +67 -0
- package/dist/idl_codegen/types/SwitchboardConfiguration.js.map +1 -0
- package/dist/idl_codegen/types/TokenInfo.d.ts +109 -0
- package/dist/idl_codegen/types/TokenInfo.js +116 -0
- package/dist/idl_codegen/types/TokenInfo.js.map +1 -0
- package/dist/idl_codegen/types/UpdateConfigMode.d.ts +538 -0
- package/dist/idl_codegen/types/UpdateConfigMode.js +1116 -0
- package/dist/idl_codegen/types/UpdateConfigMode.js.map +1 -0
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.d.ts +155 -0
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js +273 -0
- package/dist/idl_codegen/types/UpdateLendingMarketConfigValue.js.map +1 -0
- package/dist/idl_codegen/types/UpdateLendingMarketMode.d.ts +200 -0
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js +440 -0
- package/dist/idl_codegen/types/UpdateLendingMarketMode.js.map +1 -0
- package/dist/idl_codegen/types/WithdrawalCaps.d.ts +38 -0
- package/dist/idl_codegen/types/WithdrawalCaps.js +86 -0
- package/dist/idl_codegen/types/WithdrawalCaps.js.map +1 -0
- package/dist/idl_codegen/types/index.d.ts +65 -0
- package/dist/idl_codegen/types/index.js +77 -0
- package/dist/idl_codegen/types/index.js.map +1 -0
- package/dist/idl_codegen/zero_padding/ObligationZP.d.ts +53 -0
- package/dist/idl_codegen/zero_padding/ObligationZP.js +140 -0
- package/dist/idl_codegen/zero_padding/ObligationZP.js.map +1 -0
- package/dist/idl_codegen/zero_padding/index.d.ts +1 -0
- package/dist/idl_codegen/zero_padding/index.js +6 -0
- package/dist/idl_codegen/zero_padding/index.js.map +1 -0
- package/dist/idl_codegen_jupiter_perps/accounts/Pool.d.ts +48 -0
- package/dist/idl_codegen_jupiter_perps/accounts/Pool.js +144 -0
- package/dist/idl_codegen_jupiter_perps/accounts/Pool.js.map +1 -0
- package/dist/idl_codegen_jupiter_perps/accounts/index.d.ts +2 -0
- package/dist/idl_codegen_jupiter_perps/accounts/index.js +6 -0
- package/dist/idl_codegen_jupiter_perps/accounts/index.js.map +1 -0
- package/dist/idl_codegen_jupiter_perps/programId.d.ts +3 -0
- package/dist/idl_codegen_jupiter_perps/programId.js +9 -0
- package/dist/idl_codegen_jupiter_perps/programId.js.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/Fees.d.ts +62 -0
- package/dist/idl_codegen_jupiter_perps/types/Fees.js +115 -0
- package/dist/idl_codegen_jupiter_perps/types/Fees.js.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/Limit.d.ts +32 -0
- package/dist/idl_codegen_jupiter_perps/types/Limit.js +75 -0
- package/dist/idl_codegen_jupiter_perps/types/Limit.js.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/PoolApr.d.ts +32 -0
- package/dist/idl_codegen_jupiter_perps/types/PoolApr.js +75 -0
- package/dist/idl_codegen_jupiter_perps/types/PoolApr.js.map +1 -0
- package/dist/idl_codegen_jupiter_perps/types/index.d.ts +6 -0
- package/dist/idl_codegen_jupiter_perps/types/index.js +10 -0
- package/dist/idl_codegen_jupiter_perps/types/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/lending_operations/index.d.ts +2 -0
- package/dist/lending_operations/index.js +19 -0
- package/dist/lending_operations/index.js.map +1 -0
- package/dist/lending_operations/repay_with_collateral_calcs.d.ts +5 -0
- package/dist/lending_operations/repay_with_collateral_calcs.js +26 -0
- package/dist/lending_operations/repay_with_collateral_calcs.js.map +1 -0
- package/dist/lending_operations/repay_with_collateral_operations.d.ts +47 -0
- package/dist/lending_operations/repay_with_collateral_operations.js +163 -0
- package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -0
- package/dist/leverage/calcs.d.ts +132 -0
- package/dist/leverage/calcs.js +291 -0
- package/dist/leverage/calcs.js.map +1 -0
- package/dist/leverage/index.d.ts +4 -0
- package/dist/leverage/index.js +21 -0
- package/dist/leverage/index.js.map +1 -0
- package/dist/leverage/instructions.d.ts +43 -0
- package/dist/leverage/instructions.js +103 -0
- package/dist/leverage/instructions.js.map +1 -0
- package/dist/leverage/operations.d.ts +231 -0
- package/dist/leverage/operations.js +1058 -0
- package/dist/leverage/operations.js.map +1 -0
- package/dist/leverage/utils.d.ts +22 -0
- package/dist/leverage/utils.js +144 -0
- package/dist/leverage/utils.js.map +1 -0
- package/dist/lib.d.ts +9 -0
- package/dist/lib.js +26 -0
- package/dist/lib.js.map +1 -0
- package/dist/referrals/index.d.ts +2 -0
- package/dist/referrals/index.js +19 -0
- package/dist/referrals/index.js.map +1 -0
- package/dist/referrals/instructions.d.ts +16 -0
- package/dist/referrals/instructions.js +76 -0
- package/dist/referrals/instructions.js.map +1 -0
- package/dist/referrals/operations.d.ts +97 -0
- package/dist/referrals/operations.js +258 -0
- package/dist/referrals/operations.js.map +1 -0
- package/dist/utils/ObligationType.d.ts +49 -0
- package/dist/utils/ObligationType.js +129 -0
- package/dist/utils/ObligationType.js.map +1 -0
- package/dist/utils/api.d.ts +6 -0
- package/dist/utils/api.js +61 -0
- package/dist/utils/api.js.map +1 -0
- package/dist/utils/ata.d.ts +25 -0
- package/dist/utils/ata.js +155 -0
- package/dist/utils/ata.js.map +1 -0
- package/dist/utils/constants.d.ts +48 -0
- package/dist/utils/constants.js +75 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/idl.d.ts +2 -0
- package/dist/utils/idl.js +9 -0
- package/dist/utils/idl.js.map +1 -0
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.js +31 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/instruction.d.ts +22 -0
- package/dist/utils/instruction.js +202 -0
- package/dist/utils/instruction.js.map +1 -0
- package/dist/utils/kamino.d.ts +3 -0
- package/dist/utils/kamino.js +45 -0
- package/dist/utils/kamino.js.map +1 -0
- package/dist/utils/layout.d.ts +13 -0
- package/dist/utils/layout.js +123 -0
- package/dist/utils/layout.js.map +1 -0
- package/dist/utils/lookupTable.d.ts +5 -0
- package/dist/utils/lookupTable.js +57 -0
- package/dist/utils/lookupTable.js.map +1 -0
- package/dist/utils/oracle.d.ts +51 -0
- package/dist/utils/oracle.js +295 -0
- package/dist/utils/oracle.js.map +1 -0
- package/dist/utils/pubkey.d.ts +74 -0
- package/dist/utils/pubkey.js +229 -0
- package/dist/utils/pubkey.js.map +1 -0
- package/dist/utils/seeds.d.ts +122 -0
- package/dist/utils/seeds.js +153 -0
- package/dist/utils/seeds.js.map +1 -0
- package/dist/utils/slots.d.ts +18 -0
- package/dist/utils/slots.js +32 -0
- package/dist/utils/slots.js.map +1 -0
- package/dist/utils/syncNative.d.ts +10 -0
- package/dist/utils/syncNative.js +46 -0
- package/dist/utils/syncNative.js.map +1 -0
- package/dist/utils/userMetadata.d.ts +15 -0
- package/dist/utils/userMetadata.js +259 -0
- package/dist/utils/userMetadata.js.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.initUserMetadata = exports.layout = void 0;
|
|
27
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
28
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const programId_1 = require("../programId");
|
|
30
|
+
exports.layout = borsh.struct([borsh.publicKey("userLookupTable")]);
|
|
31
|
+
function initUserMetadata(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
32
|
+
const keys = [
|
|
33
|
+
{ pubkey: accounts.owner, isSigner: true, isWritable: false },
|
|
34
|
+
{ pubkey: accounts.feePayer, isSigner: true, isWritable: true },
|
|
35
|
+
{ pubkey: accounts.userMetadata, isSigner: false, isWritable: true },
|
|
36
|
+
{
|
|
37
|
+
pubkey: accounts.referrerUserMetadata,
|
|
38
|
+
isSigner: false,
|
|
39
|
+
isWritable: false,
|
|
40
|
+
},
|
|
41
|
+
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
42
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
43
|
+
];
|
|
44
|
+
const identifier = Buffer.from([117, 169, 176, 69, 197, 23, 15, 162]);
|
|
45
|
+
const buffer = Buffer.alloc(1000);
|
|
46
|
+
const len = exports.layout.encode({
|
|
47
|
+
userLookupTable: args.userLookupTable,
|
|
48
|
+
}, buffer);
|
|
49
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
50
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
51
|
+
return ix;
|
|
52
|
+
}
|
|
53
|
+
exports.initUserMetadata = initUserMetadata;
|
|
54
|
+
//# sourceMappingURL=initUserMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initUserMetadata.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/initUserMetadata.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAe5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAA;AAExE,SAAgB,gBAAgB,CAC9B,IAA0B,EAC1B,QAAkC,EAClC,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE;QAC7D,EAAE,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QAC/D,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QACpE;YACE,MAAM,EAAE,QAAQ,CAAC,oBAAoB;YACrC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QAC7D,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;KACvE,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IACrE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,eAAe,EAAE,IAAI,CAAC,eAAe;KACtC,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AA5BD,4CA4BC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface InitUserMetadataArgs {\n userLookupTable: PublicKey\n}\n\nexport interface InitUserMetadataAccounts {\n owner: PublicKey\n feePayer: PublicKey\n userMetadata: PublicKey\n referrerUserMetadata: PublicKey\n rent: PublicKey\n systemProgram: PublicKey\n}\n\nexport const layout = borsh.struct([borsh.publicKey(\"userLookupTable\")])\n\nexport function initUserMetadata(\n args: InitUserMetadataArgs,\n accounts: InitUserMetadataAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.owner, isSigner: true, isWritable: false },\n { pubkey: accounts.feePayer, isSigner: true, isWritable: true },\n { pubkey: accounts.userMetadata, isSigner: false, isWritable: true },\n {\n pubkey: accounts.referrerUserMetadata,\n isSigner: false,\n isWritable: false,\n },\n { pubkey: accounts.rent, isSigner: false, isWritable: false },\n { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },\n ]\n const identifier = Buffer.from([117, 169, 176, 69, 197, 23, 15, 162])\n const buffer = Buffer.alloc(1000)\n const len = layout.encode(\n {\n userLookupTable: args.userLookupTable,\n },\n buffer\n )\n const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
export interface LiquidateObligationAndRedeemReserveCollateralArgs {
|
|
4
|
+
liquidityAmount: BN;
|
|
5
|
+
minAcceptableReceivedCollateralAmount: BN;
|
|
6
|
+
maxAllowedLtvOverridePercent: BN;
|
|
7
|
+
}
|
|
8
|
+
export interface LiquidateObligationAndRedeemReserveCollateralAccounts {
|
|
9
|
+
liquidator: PublicKey;
|
|
10
|
+
obligation: PublicKey;
|
|
11
|
+
lendingMarket: PublicKey;
|
|
12
|
+
lendingMarketAuthority: PublicKey;
|
|
13
|
+
repayReserve: PublicKey;
|
|
14
|
+
repayReserveLiquiditySupply: PublicKey;
|
|
15
|
+
withdrawReserve: PublicKey;
|
|
16
|
+
withdrawReserveCollateralMint: PublicKey;
|
|
17
|
+
withdrawReserveCollateralSupply: PublicKey;
|
|
18
|
+
withdrawReserveLiquiditySupply: PublicKey;
|
|
19
|
+
withdrawReserveLiquidityFeeReceiver: PublicKey;
|
|
20
|
+
userSourceLiquidity: PublicKey;
|
|
21
|
+
userDestinationCollateral: PublicKey;
|
|
22
|
+
userDestinationLiquidity: PublicKey;
|
|
23
|
+
tokenProgram: PublicKey;
|
|
24
|
+
instructionSysvarAccount: PublicKey;
|
|
25
|
+
}
|
|
26
|
+
export declare const layout: any;
|
|
27
|
+
export declare function liquidateObligationAndRedeemReserveCollateral(args: LiquidateObligationAndRedeemReserveCollateralArgs, accounts: LiquidateObligationAndRedeemReserveCollateralAccounts, programId?: PublicKey): TransactionInstruction;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.liquidateObligationAndRedeemReserveCollateral = exports.layout = void 0;
|
|
27
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
28
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const programId_1 = require("../programId");
|
|
30
|
+
exports.layout = borsh.struct([
|
|
31
|
+
borsh.u64("liquidityAmount"),
|
|
32
|
+
borsh.u64("minAcceptableReceivedCollateralAmount"),
|
|
33
|
+
borsh.u64("maxAllowedLtvOverridePercent"),
|
|
34
|
+
]);
|
|
35
|
+
function liquidateObligationAndRedeemReserveCollateral(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
36
|
+
const keys = [
|
|
37
|
+
{ pubkey: accounts.liquidator, isSigner: true, isWritable: false },
|
|
38
|
+
{ pubkey: accounts.obligation, isSigner: false, isWritable: true },
|
|
39
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
40
|
+
{
|
|
41
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
42
|
+
isSigner: false,
|
|
43
|
+
isWritable: false,
|
|
44
|
+
},
|
|
45
|
+
{ pubkey: accounts.repayReserve, isSigner: false, isWritable: true },
|
|
46
|
+
{
|
|
47
|
+
pubkey: accounts.repayReserveLiquiditySupply,
|
|
48
|
+
isSigner: false,
|
|
49
|
+
isWritable: true,
|
|
50
|
+
},
|
|
51
|
+
{ pubkey: accounts.withdrawReserve, isSigner: false, isWritable: true },
|
|
52
|
+
{
|
|
53
|
+
pubkey: accounts.withdrawReserveCollateralMint,
|
|
54
|
+
isSigner: false,
|
|
55
|
+
isWritable: true,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
pubkey: accounts.withdrawReserveCollateralSupply,
|
|
59
|
+
isSigner: false,
|
|
60
|
+
isWritable: true,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
pubkey: accounts.withdrawReserveLiquiditySupply,
|
|
64
|
+
isSigner: false,
|
|
65
|
+
isWritable: true,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
pubkey: accounts.withdrawReserveLiquidityFeeReceiver,
|
|
69
|
+
isSigner: false,
|
|
70
|
+
isWritable: true,
|
|
71
|
+
},
|
|
72
|
+
{ pubkey: accounts.userSourceLiquidity, isSigner: false, isWritable: true },
|
|
73
|
+
{
|
|
74
|
+
pubkey: accounts.userDestinationCollateral,
|
|
75
|
+
isSigner: false,
|
|
76
|
+
isWritable: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
pubkey: accounts.userDestinationLiquidity,
|
|
80
|
+
isSigner: false,
|
|
81
|
+
isWritable: true,
|
|
82
|
+
},
|
|
83
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
84
|
+
{
|
|
85
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
86
|
+
isSigner: false,
|
|
87
|
+
isWritable: false,
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
const identifier = Buffer.from([177, 71, 154, 188, 226, 133, 74, 55]);
|
|
91
|
+
const buffer = Buffer.alloc(1000);
|
|
92
|
+
const len = exports.layout.encode({
|
|
93
|
+
liquidityAmount: args.liquidityAmount,
|
|
94
|
+
minAcceptableReceivedCollateralAmount: args.minAcceptableReceivedCollateralAmount,
|
|
95
|
+
maxAllowedLtvOverridePercent: args.maxAllowedLtvOverridePercent,
|
|
96
|
+
}, buffer);
|
|
97
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
98
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
99
|
+
return ix;
|
|
100
|
+
}
|
|
101
|
+
exports.liquidateObligationAndRedeemReserveCollateral = liquidateObligationAndRedeemReserveCollateral;
|
|
102
|
+
//# sourceMappingURL=liquidateObligationAndRedeemReserveCollateral.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquidateObligationAndRedeemReserveCollateral.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/liquidateObligationAndRedeemReserveCollateral.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AA2B5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC5B,KAAK,CAAC,GAAG,CAAC,uCAAuC,CAAC;IAClD,KAAK,CAAC,GAAG,CAAC,8BAA8B,CAAC;CAC1C,CAAC,CAAA;AAEF,SAAgB,6CAA6C,CAC3D,IAAuD,EACvD,QAA+D,EAC/D,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE;QAClE,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QAClE,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACtE;YACE,MAAM,EAAE,QAAQ,CAAC,sBAAsB;YACvC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QACpE;YACE,MAAM,EAAE,QAAQ,CAAC,2BAA2B;YAC5C,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QACvE;YACE,MAAM,EAAE,QAAQ,CAAC,6BAA6B;YAC9C,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,+BAA+B;YAChD,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,8BAA8B;YAC/C,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,mCAAmC;YACpD,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,mBAAmB,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QAC3E;YACE,MAAM,EAAE,QAAQ,CAAC,yBAAyB;YAC1C,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,wBAAwB;YACzC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACrE;YACE,MAAM,EAAE,QAAQ,CAAC,wBAAwB;YACzC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;KACF,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IACrE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,qCAAqC,EACnC,IAAI,CAAC,qCAAqC;QAC5C,4BAA4B,EAAE,IAAI,CAAC,4BAA4B;KAChE,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AAzED,sGAyEC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface LiquidateObligationAndRedeemReserveCollateralArgs {\n liquidityAmount: BN\n minAcceptableReceivedCollateralAmount: BN\n maxAllowedLtvOverridePercent: BN\n}\n\nexport interface LiquidateObligationAndRedeemReserveCollateralAccounts {\n liquidator: PublicKey\n obligation: PublicKey\n lendingMarket: PublicKey\n lendingMarketAuthority: PublicKey\n repayReserve: PublicKey\n repayReserveLiquiditySupply: PublicKey\n withdrawReserve: PublicKey\n withdrawReserveCollateralMint: PublicKey\n withdrawReserveCollateralSupply: PublicKey\n withdrawReserveLiquiditySupply: PublicKey\n withdrawReserveLiquidityFeeReceiver: PublicKey\n userSourceLiquidity: PublicKey\n userDestinationCollateral: PublicKey\n userDestinationLiquidity: PublicKey\n tokenProgram: PublicKey\n instructionSysvarAccount: PublicKey\n}\n\nexport const layout = borsh.struct([\n borsh.u64(\"liquidityAmount\"),\n borsh.u64(\"minAcceptableReceivedCollateralAmount\"),\n borsh.u64(\"maxAllowedLtvOverridePercent\"),\n])\n\nexport function liquidateObligationAndRedeemReserveCollateral(\n args: LiquidateObligationAndRedeemReserveCollateralArgs,\n accounts: LiquidateObligationAndRedeemReserveCollateralAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.liquidator, isSigner: true, isWritable: false },\n { pubkey: accounts.obligation, isSigner: false, isWritable: true },\n { pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },\n {\n pubkey: accounts.lendingMarketAuthority,\n isSigner: false,\n isWritable: false,\n },\n { pubkey: accounts.repayReserve, isSigner: false, isWritable: true },\n {\n pubkey: accounts.repayReserveLiquiditySupply,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.withdrawReserve, isSigner: false, isWritable: true },\n {\n pubkey: accounts.withdrawReserveCollateralMint,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.withdrawReserveCollateralSupply,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.withdrawReserveLiquiditySupply,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.withdrawReserveLiquidityFeeReceiver,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.userSourceLiquidity, isSigner: false, isWritable: true },\n {\n pubkey: accounts.userDestinationCollateral,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.userDestinationLiquidity,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },\n {\n pubkey: accounts.instructionSysvarAccount,\n isSigner: false,\n isWritable: false,\n },\n ]\n const identifier = Buffer.from([177, 71, 154, 188, 226, 133, 74, 55])\n const buffer = Buffer.alloc(1000)\n const len = layout.encode(\n {\n liquidityAmount: args.liquidityAmount,\n minAcceptableReceivedCollateralAmount:\n args.minAcceptableReceivedCollateralAmount,\n maxAllowedLtvOverridePercent: args.maxAllowedLtvOverridePercent,\n },\n buffer\n )\n const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
export interface RedeemFeesAccounts {
|
|
3
|
+
reserve: PublicKey;
|
|
4
|
+
reserveLiquidityFeeReceiver: PublicKey;
|
|
5
|
+
reserveSupplyLiquidity: PublicKey;
|
|
6
|
+
lendingMarket: PublicKey;
|
|
7
|
+
lendingMarketAuthority: PublicKey;
|
|
8
|
+
tokenProgram: PublicKey;
|
|
9
|
+
}
|
|
10
|
+
export declare function redeemFees(accounts: RedeemFeesAccounts, programId?: PublicKey): TransactionInstruction;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.redeemFees = void 0;
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
const programId_1 = require("../programId");
|
|
6
|
+
function redeemFees(accounts, programId = programId_1.PROGRAM_ID) {
|
|
7
|
+
const keys = [
|
|
8
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
9
|
+
{
|
|
10
|
+
pubkey: accounts.reserveLiquidityFeeReceiver,
|
|
11
|
+
isSigner: false,
|
|
12
|
+
isWritable: true,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
pubkey: accounts.reserveSupplyLiquidity,
|
|
16
|
+
isSigner: false,
|
|
17
|
+
isWritable: true,
|
|
18
|
+
},
|
|
19
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
20
|
+
{
|
|
21
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
22
|
+
isSigner: false,
|
|
23
|
+
isWritable: false,
|
|
24
|
+
},
|
|
25
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
26
|
+
];
|
|
27
|
+
const identifier = Buffer.from([215, 39, 180, 41, 173, 46, 248, 220]);
|
|
28
|
+
const data = identifier;
|
|
29
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
30
|
+
return ix;
|
|
31
|
+
}
|
|
32
|
+
exports.redeemFees = redeemFees;
|
|
33
|
+
//# sourceMappingURL=redeemFees.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redeemFees.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/redeemFees.ts"],"names":[],"mappings":";;;AAAA,6CAAgF,CAAC,wDAAwD;AAIzI,4CAAyC;AAWzC,SAAgB,UAAU,CACxB,QAA4B,EAC5B,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QAC/D;YACE,MAAM,EAAE,QAAQ,CAAC,2BAA2B;YAC5C,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,sBAAsB;YACvC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACtE;YACE,MAAM,EAAE,QAAQ,CAAC,sBAAsB;YACvC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;KACtE,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;IACrE,MAAM,IAAI,GAAG,UAAU,CAAA;IACvB,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AA5BD,gCA4BC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface RedeemFeesAccounts {\n reserve: PublicKey\n reserveLiquidityFeeReceiver: PublicKey\n reserveSupplyLiquidity: PublicKey\n lendingMarket: PublicKey\n lendingMarketAuthority: PublicKey\n tokenProgram: PublicKey\n}\n\nexport function redeemFees(\n accounts: RedeemFeesAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.reserve, isSigner: false, isWritable: true },\n {\n pubkey: accounts.reserveLiquidityFeeReceiver,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.reserveSupplyLiquidity,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },\n {\n pubkey: accounts.lendingMarketAuthority,\n isSigner: false,\n isWritable: false,\n },\n { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },\n ]\n const identifier = Buffer.from([215, 39, 180, 41, 173, 46, 248, 220])\n const data = identifier\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
export interface RedeemReserveCollateralArgs {
|
|
4
|
+
collateralAmount: BN;
|
|
5
|
+
}
|
|
6
|
+
export interface RedeemReserveCollateralAccounts {
|
|
7
|
+
owner: PublicKey;
|
|
8
|
+
lendingMarket: PublicKey;
|
|
9
|
+
reserve: PublicKey;
|
|
10
|
+
lendingMarketAuthority: PublicKey;
|
|
11
|
+
reserveCollateralMint: PublicKey;
|
|
12
|
+
reserveLiquiditySupply: PublicKey;
|
|
13
|
+
userSourceCollateral: PublicKey;
|
|
14
|
+
userDestinationLiquidity: PublicKey;
|
|
15
|
+
tokenProgram: PublicKey;
|
|
16
|
+
instructionSysvarAccount: PublicKey;
|
|
17
|
+
}
|
|
18
|
+
export declare const layout: any;
|
|
19
|
+
export declare function redeemReserveCollateral(args: RedeemReserveCollateralArgs, accounts: RedeemReserveCollateralAccounts, programId?: PublicKey): TransactionInstruction;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.redeemReserveCollateral = exports.layout = void 0;
|
|
27
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
28
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const programId_1 = require("../programId");
|
|
30
|
+
exports.layout = borsh.struct([borsh.u64("collateralAmount")]);
|
|
31
|
+
function redeemReserveCollateral(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
32
|
+
const keys = [
|
|
33
|
+
{ pubkey: accounts.owner, isSigner: true, isWritable: false },
|
|
34
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
35
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
36
|
+
{
|
|
37
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
38
|
+
isSigner: false,
|
|
39
|
+
isWritable: false,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
pubkey: accounts.reserveCollateralMint,
|
|
43
|
+
isSigner: false,
|
|
44
|
+
isWritable: true,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
pubkey: accounts.reserveLiquiditySupply,
|
|
48
|
+
isSigner: false,
|
|
49
|
+
isWritable: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
pubkey: accounts.userSourceCollateral,
|
|
53
|
+
isSigner: false,
|
|
54
|
+
isWritable: true,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
pubkey: accounts.userDestinationLiquidity,
|
|
58
|
+
isSigner: false,
|
|
59
|
+
isWritable: true,
|
|
60
|
+
},
|
|
61
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
62
|
+
{
|
|
63
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
64
|
+
isSigner: false,
|
|
65
|
+
isWritable: false,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
const identifier = Buffer.from([234, 117, 181, 125, 185, 142, 220, 29]);
|
|
69
|
+
const buffer = Buffer.alloc(1000);
|
|
70
|
+
const len = exports.layout.encode({
|
|
71
|
+
collateralAmount: args.collateralAmount,
|
|
72
|
+
}, buffer);
|
|
73
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
74
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
75
|
+
return ix;
|
|
76
|
+
}
|
|
77
|
+
exports.redeemReserveCollateral = redeemReserveCollateral;
|
|
78
|
+
//# sourceMappingURL=redeemReserveCollateral.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redeemReserveCollateral.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/redeemReserveCollateral.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAmB5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAA;AAEnE,SAAgB,uBAAuB,CACrC,IAAiC,EACjC,QAAyC,EACzC,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE;QAC7D,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACtE,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QAC/D;YACE,MAAM,EAAE,QAAQ,CAAC,sBAAsB;YACvC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,qBAAqB;YACtC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,sBAAsB;YACvC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,oBAAoB;YACrC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,wBAAwB;YACzC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACrE;YACE,MAAM,EAAE,QAAQ,CAAC,wBAAwB;YACzC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;KACF,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAA;IACvE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;KACxC,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AApDD,0DAoDC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface RedeemReserveCollateralArgs {\n collateralAmount: BN\n}\n\nexport interface RedeemReserveCollateralAccounts {\n owner: PublicKey\n lendingMarket: PublicKey\n reserve: PublicKey\n lendingMarketAuthority: PublicKey\n reserveCollateralMint: PublicKey\n reserveLiquiditySupply: PublicKey\n userSourceCollateral: PublicKey\n userDestinationLiquidity: PublicKey\n tokenProgram: PublicKey\n instructionSysvarAccount: PublicKey\n}\n\nexport const layout = borsh.struct([borsh.u64(\"collateralAmount\")])\n\nexport function redeemReserveCollateral(\n args: RedeemReserveCollateralArgs,\n accounts: RedeemReserveCollateralAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.owner, isSigner: true, isWritable: false },\n { pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },\n { pubkey: accounts.reserve, isSigner: false, isWritable: true },\n {\n pubkey: accounts.lendingMarketAuthority,\n isSigner: false,\n isWritable: false,\n },\n {\n pubkey: accounts.reserveCollateralMint,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.reserveLiquiditySupply,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.userSourceCollateral,\n isSigner: false,\n isWritable: true,\n },\n {\n pubkey: accounts.userDestinationLiquidity,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },\n {\n pubkey: accounts.instructionSysvarAccount,\n isSigner: false,\n isWritable: false,\n },\n ]\n const identifier = Buffer.from([234, 117, 181, 125, 185, 142, 220, 29])\n const buffer = Buffer.alloc(1000)\n const len = layout.encode(\n {\n collateralAmount: args.collateralAmount,\n },\n buffer\n )\n const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
export interface RefreshObligationAccounts {
|
|
3
|
+
lendingMarket: PublicKey;
|
|
4
|
+
obligation: PublicKey;
|
|
5
|
+
}
|
|
6
|
+
export declare function refreshObligation(accounts: RefreshObligationAccounts, programId?: PublicKey): TransactionInstruction;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refreshObligation = void 0;
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
const programId_1 = require("../programId");
|
|
6
|
+
function refreshObligation(accounts, programId = programId_1.PROGRAM_ID) {
|
|
7
|
+
const keys = [
|
|
8
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
9
|
+
{ pubkey: accounts.obligation, isSigner: false, isWritable: true },
|
|
10
|
+
];
|
|
11
|
+
const identifier = Buffer.from([33, 132, 147, 228, 151, 192, 72, 89]);
|
|
12
|
+
const data = identifier;
|
|
13
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
14
|
+
return ix;
|
|
15
|
+
}
|
|
16
|
+
exports.refreshObligation = refreshObligation;
|
|
17
|
+
//# sourceMappingURL=refreshObligation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshObligation.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/refreshObligation.ts"],"names":[],"mappings":";;;AAAA,6CAAgF,CAAC,wDAAwD;AAIzI,4CAAyC;AAOzC,SAAgB,iBAAiB,CAC/B,QAAmC,EACnC,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACtE,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;KACnE,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IACrE,MAAM,IAAI,GAAG,UAAU,CAAA;IACvB,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AAZD,8CAYC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface RefreshObligationAccounts {\n lendingMarket: PublicKey\n obligation: PublicKey\n}\n\nexport function refreshObligation(\n accounts: RefreshObligationAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },\n { pubkey: accounts.obligation, isSigner: false, isWritable: true },\n ]\n const identifier = Buffer.from([33, 132, 147, 228, 151, 192, 72, 89])\n const data = identifier\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
export interface RefreshObligationFarmsForReserveArgs {
|
|
3
|
+
mode: number;
|
|
4
|
+
}
|
|
5
|
+
export interface RefreshObligationFarmsForReserveAccounts {
|
|
6
|
+
crank: PublicKey;
|
|
7
|
+
obligation: PublicKey;
|
|
8
|
+
lendingMarketAuthority: PublicKey;
|
|
9
|
+
reserve: PublicKey;
|
|
10
|
+
reserveFarmState: PublicKey;
|
|
11
|
+
obligationFarmUserState: PublicKey;
|
|
12
|
+
lendingMarket: PublicKey;
|
|
13
|
+
farmsProgram: PublicKey;
|
|
14
|
+
rent: PublicKey;
|
|
15
|
+
tokenProgram: PublicKey;
|
|
16
|
+
systemProgram: PublicKey;
|
|
17
|
+
}
|
|
18
|
+
export declare const layout: any;
|
|
19
|
+
export declare function refreshObligationFarmsForReserve(args: RefreshObligationFarmsForReserveArgs, accounts: RefreshObligationFarmsForReserveAccounts, programId?: PublicKey): TransactionInstruction;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.refreshObligationFarmsForReserve = exports.layout = void 0;
|
|
27
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
28
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const programId_1 = require("../programId");
|
|
30
|
+
exports.layout = borsh.struct([borsh.u8("mode")]);
|
|
31
|
+
function refreshObligationFarmsForReserve(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
32
|
+
const keys = [
|
|
33
|
+
{ pubkey: accounts.crank, isSigner: true, isWritable: true },
|
|
34
|
+
{ pubkey: accounts.obligation, isSigner: false, isWritable: false },
|
|
35
|
+
{
|
|
36
|
+
pubkey: accounts.lendingMarketAuthority,
|
|
37
|
+
isSigner: false,
|
|
38
|
+
isWritable: true,
|
|
39
|
+
},
|
|
40
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: false },
|
|
41
|
+
{ pubkey: accounts.reserveFarmState, isSigner: false, isWritable: true },
|
|
42
|
+
{
|
|
43
|
+
pubkey: accounts.obligationFarmUserState,
|
|
44
|
+
isSigner: false,
|
|
45
|
+
isWritable: true,
|
|
46
|
+
},
|
|
47
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
48
|
+
{ pubkey: accounts.farmsProgram, isSigner: false, isWritable: false },
|
|
49
|
+
{ pubkey: accounts.rent, isSigner: false, isWritable: false },
|
|
50
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
51
|
+
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
|
|
52
|
+
];
|
|
53
|
+
const identifier = Buffer.from([140, 144, 253, 21, 10, 74, 248, 3]);
|
|
54
|
+
const buffer = Buffer.alloc(1000);
|
|
55
|
+
const len = exports.layout.encode({
|
|
56
|
+
mode: args.mode,
|
|
57
|
+
}, buffer);
|
|
58
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
59
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
60
|
+
return ix;
|
|
61
|
+
}
|
|
62
|
+
exports.refreshObligationFarmsForReserve = refreshObligationFarmsForReserve;
|
|
63
|
+
//# sourceMappingURL=refreshObligationFarmsForReserve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshObligationFarmsForReserve.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/refreshObligationFarmsForReserve.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAgF,CAAC,wDAAwD;AAEzI,wDAAyC,CAAC,wDAAwD;AAElG,4CAAyC;AAoB5B,QAAA,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAEtD,SAAgB,gCAAgC,CAC9C,IAA0C,EAC1C,QAAkD,EAClD,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE;QAC5D,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACnE;YACE,MAAM,EAAE,QAAQ,CAAC,sBAAsB;YACvC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QAChE,EAAE,MAAM,EAAE,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QACxE;YACE,MAAM,EAAE,QAAQ,CAAC,uBAAuB;YACxC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,IAAI;SACjB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACtE,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACrE,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QAC7D,EAAE,MAAM,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACrE,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;KACvE,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACnE,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,GAAG,GAAG,cAAM,CAAC,MAAM,CACvB;QACE,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,EACD,MAAM,CACP,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAA;IAClE,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AArCD,4EAqCC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface RefreshObligationFarmsForReserveArgs {\n mode: number\n}\n\nexport interface RefreshObligationFarmsForReserveAccounts {\n crank: PublicKey\n obligation: PublicKey\n lendingMarketAuthority: PublicKey\n reserve: PublicKey\n reserveFarmState: PublicKey\n obligationFarmUserState: PublicKey\n lendingMarket: PublicKey\n farmsProgram: PublicKey\n rent: PublicKey\n tokenProgram: PublicKey\n systemProgram: PublicKey\n}\n\nexport const layout = borsh.struct([borsh.u8(\"mode\")])\n\nexport function refreshObligationFarmsForReserve(\n args: RefreshObligationFarmsForReserveArgs,\n accounts: RefreshObligationFarmsForReserveAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.crank, isSigner: true, isWritable: true },\n { pubkey: accounts.obligation, isSigner: false, isWritable: false },\n {\n pubkey: accounts.lendingMarketAuthority,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.reserve, isSigner: false, isWritable: false },\n { pubkey: accounts.reserveFarmState, isSigner: false, isWritable: true },\n {\n pubkey: accounts.obligationFarmUserState,\n isSigner: false,\n isWritable: true,\n },\n { pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },\n { pubkey: accounts.farmsProgram, isSigner: false, isWritable: false },\n { pubkey: accounts.rent, isSigner: false, isWritable: false },\n { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },\n { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },\n ]\n const identifier = Buffer.from([140, 144, 253, 21, 10, 74, 248, 3])\n const buffer = Buffer.alloc(1000)\n const len = layout.encode(\n {\n mode: args.mode,\n },\n buffer\n )\n const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len)\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
export interface RefreshReserveAccounts {
|
|
3
|
+
reserve: PublicKey;
|
|
4
|
+
lendingMarket: PublicKey;
|
|
5
|
+
pythOracle: PublicKey;
|
|
6
|
+
switchboardPriceOracle: PublicKey;
|
|
7
|
+
switchboardTwapOracle: PublicKey;
|
|
8
|
+
scopePrices: PublicKey;
|
|
9
|
+
}
|
|
10
|
+
export declare function refreshReserve(accounts: RefreshReserveAccounts, programId?: PublicKey): TransactionInstruction;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refreshReserve = void 0;
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
const programId_1 = require("../programId");
|
|
6
|
+
function refreshReserve(accounts, programId = programId_1.PROGRAM_ID) {
|
|
7
|
+
const keys = [
|
|
8
|
+
{ pubkey: accounts.reserve, isSigner: false, isWritable: true },
|
|
9
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
10
|
+
{ pubkey: accounts.pythOracle, isSigner: false, isWritable: false },
|
|
11
|
+
{
|
|
12
|
+
pubkey: accounts.switchboardPriceOracle,
|
|
13
|
+
isSigner: false,
|
|
14
|
+
isWritable: false,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
pubkey: accounts.switchboardTwapOracle,
|
|
18
|
+
isSigner: false,
|
|
19
|
+
isWritable: false,
|
|
20
|
+
},
|
|
21
|
+
{ pubkey: accounts.scopePrices, isSigner: false, isWritable: false },
|
|
22
|
+
];
|
|
23
|
+
const identifier = Buffer.from([2, 218, 138, 235, 79, 201, 25, 102]);
|
|
24
|
+
const data = identifier;
|
|
25
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
26
|
+
return ix;
|
|
27
|
+
}
|
|
28
|
+
exports.refreshReserve = refreshReserve;
|
|
29
|
+
//# sourceMappingURL=refreshReserve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshReserve.js","sourceRoot":"","sources":["../../../src/idl_codegen/instructions/refreshReserve.ts"],"names":[],"mappings":";;;AAAA,6CAAgF,CAAC,wDAAwD;AAIzI,4CAAyC;AAWzC,SAAgB,cAAc,CAC5B,QAAgC,EAChC,YAAuB,sBAAU;IAEjC,MAAM,IAAI,GAAuB;QAC/B,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;QAC/D,EAAE,MAAM,EAAE,QAAQ,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACtE,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;QACnE;YACE,MAAM,EAAE,QAAQ,CAAC,sBAAsB;YACvC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD;YACE,MAAM,EAAE,QAAQ,CAAC,qBAAqB;YACtC,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;SAClB;QACD,EAAE,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;KACrE,CAAA;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,CAAA;IACpE,MAAM,IAAI,GAAG,UAAU,CAAA;IACvB,MAAM,EAAE,GAAG,IAAI,gCAAsB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,OAAO,EAAE,CAAA;AACX,CAAC;AAxBD,wCAwBC","sourcesContent":["import { TransactionInstruction, PublicKey, AccountMeta } from \"@solana/web3.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport BN from \"bn.js\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as borsh from \"@coral-xyz/borsh\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as types from \"../types\" // eslint-disable-line @typescript-eslint/no-unused-vars\nimport { PROGRAM_ID } from \"../programId\"\n\nexport interface RefreshReserveAccounts {\n reserve: PublicKey\n lendingMarket: PublicKey\n pythOracle: PublicKey\n switchboardPriceOracle: PublicKey\n switchboardTwapOracle: PublicKey\n scopePrices: PublicKey\n}\n\nexport function refreshReserve(\n accounts: RefreshReserveAccounts,\n programId: PublicKey = PROGRAM_ID\n) {\n const keys: Array<AccountMeta> = [\n { pubkey: accounts.reserve, isSigner: false, isWritable: true },\n { pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },\n { pubkey: accounts.pythOracle, isSigner: false, isWritable: false },\n {\n pubkey: accounts.switchboardPriceOracle,\n isSigner: false,\n isWritable: false,\n },\n {\n pubkey: accounts.switchboardTwapOracle,\n isSigner: false,\n isWritable: false,\n },\n { pubkey: accounts.scopePrices, isSigner: false, isWritable: false },\n ]\n const identifier = Buffer.from([2, 218, 138, 235, 79, 201, 25, 102])\n const data = identifier\n const ix = new TransactionInstruction({ keys, programId, data })\n return ix\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TransactionInstruction, PublicKey } from "@solana/web3.js";
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
export interface RepayObligationLiquidityArgs {
|
|
4
|
+
liquidityAmount: BN;
|
|
5
|
+
}
|
|
6
|
+
export interface RepayObligationLiquidityAccounts {
|
|
7
|
+
owner: PublicKey;
|
|
8
|
+
obligation: PublicKey;
|
|
9
|
+
lendingMarket: PublicKey;
|
|
10
|
+
repayReserve: PublicKey;
|
|
11
|
+
reserveDestinationLiquidity: PublicKey;
|
|
12
|
+
userSourceLiquidity: PublicKey;
|
|
13
|
+
tokenProgram: PublicKey;
|
|
14
|
+
instructionSysvarAccount: PublicKey;
|
|
15
|
+
}
|
|
16
|
+
export declare const layout: any;
|
|
17
|
+
export declare function repayObligationLiquidity(args: RepayObligationLiquidityArgs, accounts: RepayObligationLiquidityAccounts, programId?: PublicKey): TransactionInstruction;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.repayObligationLiquidity = exports.layout = void 0;
|
|
27
|
+
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
28
|
+
const borsh = __importStar(require("@coral-xyz/borsh")); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
29
|
+
const programId_1 = require("../programId");
|
|
30
|
+
exports.layout = borsh.struct([borsh.u64("liquidityAmount")]);
|
|
31
|
+
function repayObligationLiquidity(args, accounts, programId = programId_1.PROGRAM_ID) {
|
|
32
|
+
const keys = [
|
|
33
|
+
{ pubkey: accounts.owner, isSigner: true, isWritable: false },
|
|
34
|
+
{ pubkey: accounts.obligation, isSigner: false, isWritable: true },
|
|
35
|
+
{ pubkey: accounts.lendingMarket, isSigner: false, isWritable: false },
|
|
36
|
+
{ pubkey: accounts.repayReserve, isSigner: false, isWritable: true },
|
|
37
|
+
{
|
|
38
|
+
pubkey: accounts.reserveDestinationLiquidity,
|
|
39
|
+
isSigner: false,
|
|
40
|
+
isWritable: true,
|
|
41
|
+
},
|
|
42
|
+
{ pubkey: accounts.userSourceLiquidity, isSigner: false, isWritable: true },
|
|
43
|
+
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
|
|
44
|
+
{
|
|
45
|
+
pubkey: accounts.instructionSysvarAccount,
|
|
46
|
+
isSigner: false,
|
|
47
|
+
isWritable: false,
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
const identifier = Buffer.from([145, 178, 13, 225, 76, 240, 147, 72]);
|
|
51
|
+
const buffer = Buffer.alloc(1000);
|
|
52
|
+
const len = exports.layout.encode({
|
|
53
|
+
liquidityAmount: args.liquidityAmount,
|
|
54
|
+
}, buffer);
|
|
55
|
+
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
|
|
56
|
+
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
|
|
57
|
+
return ix;
|
|
58
|
+
}
|
|
59
|
+
exports.repayObligationLiquidity = repayObligationLiquidity;
|
|
60
|
+
//# sourceMappingURL=repayObligationLiquidity.js.map
|