UNPKG

@kamino-finance/klend-sdk

Version:

Typescript SDK for interacting with the Kamino Lending (klend) protocol

1,440 lines 64.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IntegerOverflow = exports.PriceConfidenceTooWide = exports.PriceIsZero = exports.PriceIsLowerThanHeuristic = exports.PriceIsBiggerThanHeuristic = exports.PriceNotValid = exports.InvalidFlag = exports.GlobalEmergencyMode = exports.InvalidTwapPrice = exports.PriceTooDivergentFromTwap = exports.PriceTooOld = exports.CouldNotDeserializeScope = exports.SwitchboardV2Error = exports.FlashLoansDisabled = exports.MultipleFlashBorrows = exports.FlashRepayCpi = exports.InvalidFlashRepay = exports.NoFlashRepayFound = exports.FlashBorrowCpi = exports.InsufficientProtocolFeesToRedeem = exports.InvalidOracleConfig = exports.NegativeInterestRate = exports.ObligationLiquidityEmpty = exports.ObligationCollateralEmpty = exports.InvalidObligationLiquidity = exports.InvalidObligationCollateral = exports.ObligationBorrowsZero = exports.ObligationDepositsZero = exports.ObligationBorrowsEmpty = exports.ObligationDepositsEmpty = exports.InvalidObligationOwner = exports.ObligationReserveLimit = exports.ObligationStale = exports.ObligationHealthy = exports.LiquidationTooSmall = exports.RepayTooSmall = exports.BorrowTooLarge = exports.BorrowTooSmall = exports.WithdrawTooLarge = exports.WithdrawTooSmall = exports.ReserveStale = exports.InsufficientLiquidity = exports.MathOverflow = exports.InvalidAccountInput = exports.InvalidSigner = exports.InvalidConfig = exports.InvalidAmount = exports.InvalidAccountOwner = exports.InvalidMarketOwner = exports.InvalidMarketAuthority = void 0; exports.LiquidationBorrowFactorPriority = exports.BorrowingAboveUtilizationRateDisabled = exports.ReserveAccountingMismatch = exports.ReserveVaultBalanceMismatch = exports.ReserveTokenBalanceMismatch = exports.LiabilitiesBiggerThanAssets = exports.WorseLtvBlocked = exports.NetValueRemainingTooSmall = exports.BorrowingDisabledOutsideElevationGroup = exports.DepositLimitExceeded = exports.BorrowLimitExceeded = exports.BorrowingDisabled = exports.CollateralNonLiquidatable = exports.UserMetadataOwnerAlreadySet = exports.ReferrerStateOwnerMismatch = exports.ObligationInObsoleteReserve = exports.ElevationGroupAlreadyActivated = exports.ReserveObsolete = exports.ShortUrlNotAsciiAlphanumeric = exports.CpiDisabled = exports.InsufficientReferralFeesToRedeem = exports.ReferrerAccountMissing = exports.ReferrerAccountReferrerMissmatch = exports.ReferrerAccountWrongAddress = exports.ReferrerAccountMintMissmatch = exports.ReferrerAccountNotInitialized = exports.ReserveDeprecated = exports.ElevationGroupNewLoansDisabled = exports.UnhealthyElevationGroupLtv = exports.InvalidElevationGroupConfig = exports.InvalidElevationGroup = exports.InconsistentElevationGroup = exports.IsolatedAssetTierViolation = exports.LiquidationRewardTooSmall = exports.LastTimestampGreaterThanCurrent = exports.WithdrawalCapReached = exports.ObligationEmpty = exports.CannotSocializeObligationWithCollateral = exports.InvalidUtilizationRate = exports.InvalidBorrowRateCurvePoint = exports.DeprecatedInvalidObligationId = exports.InvalidObligationSeedsValue = exports.ObligationCollateralLtvZero = exports.InvalidScopePriceAccount = exports.InvalidSwitchboardAccount = exports.InvalidPythPriceAccount = exports.InvalidTwapConfig = exports.NoPriceFound = exports.IncorrectInstructionInPosition = exports.NoFarmForReserve = void 0; exports.NoUpgradeAuthority = exports.OrderCreationDisabled = exports.OperationNotPermittedMarketImmutable = exports.OperationNotPermittedWithCurrentObligationOrders = exports.OrderConfigurationNotSupportedByObligation = exports.InvalidOrderConfiguration = exports.OrderIndexOutOfBounds = exports.InsufficientRepayAmount = exports.RepayTooSmallForFullLiquidation = exports.FarmAccountsMissing = exports.WorseLtvThanUnhealthyLtv = exports.LowestLtvAssetsPriority = exports.ZeroMaxLtvAssetsInDeposits = exports.MaximumWithdrawValueZero = exports.ObligationCurrentlyMarkedForDeleveraging = exports.LendingMarketsMustMatch = exports.ObligationsMustMatch = exports.ObligationOwnersMustMatch = exports.CannotCalculateReferralAmountDueToSlotsMismatch = exports.DepositDisabledOutsideElevationGroup = exports.InvalidTokenAccount = exports.UnsupportedTokenExtension = exports.ObligationElevationGroupMultipleDebtReserve = exports.ObligationCollateralExceedsElevationGroupLimit = exports.ElevationGroupDebtReserveAsCollateral = exports.ElevationGroupHasAnotherDebtReserve = exports.ElevationGroupMaxCollateralReserveZero = exports.ElevationGroupWithoutDebtReserve = exports.ElevationGroupBorrowLimitExceeded = exports.LiquidationLowestLiquidationLtvPriority = void 0; exports.fromCode = fromCode; class InvalidMarketAuthority extends Error { logs; static code = 6000; code = 6000; name = "InvalidMarketAuthority"; msg = "Market authority is invalid"; constructor(logs) { super("6000: Market authority is invalid"); this.logs = logs; } } exports.InvalidMarketAuthority = InvalidMarketAuthority; class InvalidMarketOwner extends Error { logs; static code = 6001; code = 6001; name = "InvalidMarketOwner"; msg = "Market owner is invalid"; constructor(logs) { super("6001: Market owner is invalid"); this.logs = logs; } } exports.InvalidMarketOwner = InvalidMarketOwner; class InvalidAccountOwner extends Error { logs; static code = 6002; code = 6002; name = "InvalidAccountOwner"; msg = "Input account owner is not the program address"; constructor(logs) { super("6002: Input account owner is not the program address"); this.logs = logs; } } exports.InvalidAccountOwner = InvalidAccountOwner; class InvalidAmount extends Error { logs; static code = 6003; code = 6003; name = "InvalidAmount"; msg = "Input amount is invalid"; constructor(logs) { super("6003: Input amount is invalid"); this.logs = logs; } } exports.InvalidAmount = InvalidAmount; class InvalidConfig extends Error { logs; static code = 6004; code = 6004; name = "InvalidConfig"; msg = "Input config value is invalid"; constructor(logs) { super("6004: Input config value is invalid"); this.logs = logs; } } exports.InvalidConfig = InvalidConfig; class InvalidSigner extends Error { logs; static code = 6005; code = 6005; name = "InvalidSigner"; msg = "Input account must be a signer"; constructor(logs) { super("6005: Input account must be a signer"); this.logs = logs; } } exports.InvalidSigner = InvalidSigner; class InvalidAccountInput extends Error { logs; static code = 6006; code = 6006; name = "InvalidAccountInput"; msg = "Invalid account input"; constructor(logs) { super("6006: Invalid account input"); this.logs = logs; } } exports.InvalidAccountInput = InvalidAccountInput; class MathOverflow extends Error { logs; static code = 6007; code = 6007; name = "MathOverflow"; msg = "Math operation overflow"; constructor(logs) { super("6007: Math operation overflow"); this.logs = logs; } } exports.MathOverflow = MathOverflow; class InsufficientLiquidity extends Error { logs; static code = 6008; code = 6008; name = "InsufficientLiquidity"; msg = "Insufficient liquidity available"; constructor(logs) { super("6008: Insufficient liquidity available"); this.logs = logs; } } exports.InsufficientLiquidity = InsufficientLiquidity; class ReserveStale extends Error { logs; static code = 6009; code = 6009; name = "ReserveStale"; msg = "Reserve state needs to be refreshed"; constructor(logs) { super("6009: Reserve state needs to be refreshed"); this.logs = logs; } } exports.ReserveStale = ReserveStale; class WithdrawTooSmall extends Error { logs; static code = 6010; code = 6010; name = "WithdrawTooSmall"; msg = "Withdraw amount too small"; constructor(logs) { super("6010: Withdraw amount too small"); this.logs = logs; } } exports.WithdrawTooSmall = WithdrawTooSmall; class WithdrawTooLarge extends Error { logs; static code = 6011; code = 6011; name = "WithdrawTooLarge"; msg = "Withdraw amount too large"; constructor(logs) { super("6011: Withdraw amount too large"); this.logs = logs; } } exports.WithdrawTooLarge = WithdrawTooLarge; class BorrowTooSmall extends Error { logs; static code = 6012; code = 6012; name = "BorrowTooSmall"; msg = "Borrow amount too small to receive liquidity after fees"; constructor(logs) { super("6012: Borrow amount too small to receive liquidity after fees"); this.logs = logs; } } exports.BorrowTooSmall = BorrowTooSmall; class BorrowTooLarge extends Error { logs; static code = 6013; code = 6013; name = "BorrowTooLarge"; msg = "Borrow amount too large for deposited collateral"; constructor(logs) { super("6013: Borrow amount too large for deposited collateral"); this.logs = logs; } } exports.BorrowTooLarge = BorrowTooLarge; class RepayTooSmall extends Error { logs; static code = 6014; code = 6014; name = "RepayTooSmall"; msg = "Repay amount too small to transfer liquidity"; constructor(logs) { super("6014: Repay amount too small to transfer liquidity"); this.logs = logs; } } exports.RepayTooSmall = RepayTooSmall; class LiquidationTooSmall extends Error { logs; static code = 6015; code = 6015; name = "LiquidationTooSmall"; msg = "Liquidation amount too small to receive collateral"; constructor(logs) { super("6015: Liquidation amount too small to receive collateral"); this.logs = logs; } } exports.LiquidationTooSmall = LiquidationTooSmall; class ObligationHealthy extends Error { logs; static code = 6016; code = 6016; name = "ObligationHealthy"; msg = "Cannot liquidate healthy obligations"; constructor(logs) { super("6016: Cannot liquidate healthy obligations"); this.logs = logs; } } exports.ObligationHealthy = ObligationHealthy; class ObligationStale extends Error { logs; static code = 6017; code = 6017; name = "ObligationStale"; msg = "Obligation state needs to be refreshed"; constructor(logs) { super("6017: Obligation state needs to be refreshed"); this.logs = logs; } } exports.ObligationStale = ObligationStale; class ObligationReserveLimit extends Error { logs; static code = 6018; code = 6018; name = "ObligationReserveLimit"; msg = "Obligation reserve limit exceeded"; constructor(logs) { super("6018: Obligation reserve limit exceeded"); this.logs = logs; } } exports.ObligationReserveLimit = ObligationReserveLimit; class InvalidObligationOwner extends Error { logs; static code = 6019; code = 6019; name = "InvalidObligationOwner"; msg = "Obligation owner is invalid"; constructor(logs) { super("6019: Obligation owner is invalid"); this.logs = logs; } } exports.InvalidObligationOwner = InvalidObligationOwner; class ObligationDepositsEmpty extends Error { logs; static code = 6020; code = 6020; name = "ObligationDepositsEmpty"; msg = "Obligation deposits are empty"; constructor(logs) { super("6020: Obligation deposits are empty"); this.logs = logs; } } exports.ObligationDepositsEmpty = ObligationDepositsEmpty; class ObligationBorrowsEmpty extends Error { logs; static code = 6021; code = 6021; name = "ObligationBorrowsEmpty"; msg = "Obligation borrows are empty"; constructor(logs) { super("6021: Obligation borrows are empty"); this.logs = logs; } } exports.ObligationBorrowsEmpty = ObligationBorrowsEmpty; class ObligationDepositsZero extends Error { logs; static code = 6022; code = 6022; name = "ObligationDepositsZero"; msg = "Obligation deposits have zero value"; constructor(logs) { super("6022: Obligation deposits have zero value"); this.logs = logs; } } exports.ObligationDepositsZero = ObligationDepositsZero; class ObligationBorrowsZero extends Error { logs; static code = 6023; code = 6023; name = "ObligationBorrowsZero"; msg = "Obligation borrows have zero value"; constructor(logs) { super("6023: Obligation borrows have zero value"); this.logs = logs; } } exports.ObligationBorrowsZero = ObligationBorrowsZero; class InvalidObligationCollateral extends Error { logs; static code = 6024; code = 6024; name = "InvalidObligationCollateral"; msg = "Invalid obligation collateral"; constructor(logs) { super("6024: Invalid obligation collateral"); this.logs = logs; } } exports.InvalidObligationCollateral = InvalidObligationCollateral; class InvalidObligationLiquidity extends Error { logs; static code = 6025; code = 6025; name = "InvalidObligationLiquidity"; msg = "Invalid obligation liquidity"; constructor(logs) { super("6025: Invalid obligation liquidity"); this.logs = logs; } } exports.InvalidObligationLiquidity = InvalidObligationLiquidity; class ObligationCollateralEmpty extends Error { logs; static code = 6026; code = 6026; name = "ObligationCollateralEmpty"; msg = "Obligation collateral is empty"; constructor(logs) { super("6026: Obligation collateral is empty"); this.logs = logs; } } exports.ObligationCollateralEmpty = ObligationCollateralEmpty; class ObligationLiquidityEmpty extends Error { logs; static code = 6027; code = 6027; name = "ObligationLiquidityEmpty"; msg = "Obligation liquidity is empty"; constructor(logs) { super("6027: Obligation liquidity is empty"); this.logs = logs; } } exports.ObligationLiquidityEmpty = ObligationLiquidityEmpty; class NegativeInterestRate extends Error { logs; static code = 6028; code = 6028; name = "NegativeInterestRate"; msg = "Interest rate is negative"; constructor(logs) { super("6028: Interest rate is negative"); this.logs = logs; } } exports.NegativeInterestRate = NegativeInterestRate; class InvalidOracleConfig extends Error { logs; static code = 6029; code = 6029; name = "InvalidOracleConfig"; msg = "Input oracle config is invalid"; constructor(logs) { super("6029: Input oracle config is invalid"); this.logs = logs; } } exports.InvalidOracleConfig = InvalidOracleConfig; class InsufficientProtocolFeesToRedeem extends Error { logs; static code = 6030; code = 6030; name = "InsufficientProtocolFeesToRedeem"; msg = "Insufficient protocol fees to claim or no liquidity available"; constructor(logs) { super("6030: Insufficient protocol fees to claim or no liquidity available"); this.logs = logs; } } exports.InsufficientProtocolFeesToRedeem = InsufficientProtocolFeesToRedeem; class FlashBorrowCpi extends Error { logs; static code = 6031; code = 6031; name = "FlashBorrowCpi"; msg = "No cpi flash borrows allowed"; constructor(logs) { super("6031: No cpi flash borrows allowed"); this.logs = logs; } } exports.FlashBorrowCpi = FlashBorrowCpi; class NoFlashRepayFound extends Error { logs; static code = 6032; code = 6032; name = "NoFlashRepayFound"; msg = "No corresponding repay found for flash borrow"; constructor(logs) { super("6032: No corresponding repay found for flash borrow"); this.logs = logs; } } exports.NoFlashRepayFound = NoFlashRepayFound; class InvalidFlashRepay extends Error { logs; static code = 6033; code = 6033; name = "InvalidFlashRepay"; msg = "Invalid repay found"; constructor(logs) { super("6033: Invalid repay found"); this.logs = logs; } } exports.InvalidFlashRepay = InvalidFlashRepay; class FlashRepayCpi extends Error { logs; static code = 6034; code = 6034; name = "FlashRepayCpi"; msg = "No cpi flash repays allowed"; constructor(logs) { super("6034: No cpi flash repays allowed"); this.logs = logs; } } exports.FlashRepayCpi = FlashRepayCpi; class MultipleFlashBorrows extends Error { logs; static code = 6035; code = 6035; name = "MultipleFlashBorrows"; msg = "Multiple flash borrows not allowed in the same transaction"; constructor(logs) { super("6035: Multiple flash borrows not allowed in the same transaction"); this.logs = logs; } } exports.MultipleFlashBorrows = MultipleFlashBorrows; class FlashLoansDisabled extends Error { logs; static code = 6036; code = 6036; name = "FlashLoansDisabled"; msg = "Flash loans are disabled for this reserve"; constructor(logs) { super("6036: Flash loans are disabled for this reserve"); this.logs = logs; } } exports.FlashLoansDisabled = FlashLoansDisabled; class SwitchboardV2Error extends Error { logs; static code = 6037; code = 6037; name = "SwitchboardV2Error"; msg = "Switchboard error"; constructor(logs) { super("6037: Switchboard error"); this.logs = logs; } } exports.SwitchboardV2Error = SwitchboardV2Error; class CouldNotDeserializeScope extends Error { logs; static code = 6038; code = 6038; name = "CouldNotDeserializeScope"; msg = "Cannot deserialize the scope price account"; constructor(logs) { super("6038: Cannot deserialize the scope price account"); this.logs = logs; } } exports.CouldNotDeserializeScope = CouldNotDeserializeScope; class PriceTooOld extends Error { logs; static code = 6039; code = 6039; name = "PriceTooOld"; msg = "Price too old"; constructor(logs) { super("6039: Price too old"); this.logs = logs; } } exports.PriceTooOld = PriceTooOld; class PriceTooDivergentFromTwap extends Error { logs; static code = 6040; code = 6040; name = "PriceTooDivergentFromTwap"; msg = "Price too divergent from twap"; constructor(logs) { super("6040: Price too divergent from twap"); this.logs = logs; } } exports.PriceTooDivergentFromTwap = PriceTooDivergentFromTwap; class InvalidTwapPrice extends Error { logs; static code = 6041; code = 6041; name = "InvalidTwapPrice"; msg = "Invalid twap price"; constructor(logs) { super("6041: Invalid twap price"); this.logs = logs; } } exports.InvalidTwapPrice = InvalidTwapPrice; class GlobalEmergencyMode extends Error { logs; static code = 6042; code = 6042; name = "GlobalEmergencyMode"; msg = "Emergency mode is enabled"; constructor(logs) { super("6042: Emergency mode is enabled"); this.logs = logs; } } exports.GlobalEmergencyMode = GlobalEmergencyMode; class InvalidFlag extends Error { logs; static code = 6043; code = 6043; name = "InvalidFlag"; msg = "Invalid lending market config"; constructor(logs) { super("6043: Invalid lending market config"); this.logs = logs; } } exports.InvalidFlag = InvalidFlag; class PriceNotValid extends Error { logs; static code = 6044; code = 6044; name = "PriceNotValid"; msg = "Price is not valid"; constructor(logs) { super("6044: Price is not valid"); this.logs = logs; } } exports.PriceNotValid = PriceNotValid; class PriceIsBiggerThanHeuristic extends Error { logs; static code = 6045; code = 6045; name = "PriceIsBiggerThanHeuristic"; msg = "Price is bigger than allowed by heuristic"; constructor(logs) { super("6045: Price is bigger than allowed by heuristic"); this.logs = logs; } } exports.PriceIsBiggerThanHeuristic = PriceIsBiggerThanHeuristic; class PriceIsLowerThanHeuristic extends Error { logs; static code = 6046; code = 6046; name = "PriceIsLowerThanHeuristic"; msg = "Price lower than allowed by heuristic"; constructor(logs) { super("6046: Price lower than allowed by heuristic"); this.logs = logs; } } exports.PriceIsLowerThanHeuristic = PriceIsLowerThanHeuristic; class PriceIsZero extends Error { logs; static code = 6047; code = 6047; name = "PriceIsZero"; msg = "Price is zero"; constructor(logs) { super("6047: Price is zero"); this.logs = logs; } } exports.PriceIsZero = PriceIsZero; class PriceConfidenceTooWide extends Error { logs; static code = 6048; code = 6048; name = "PriceConfidenceTooWide"; msg = "Price confidence too wide"; constructor(logs) { super("6048: Price confidence too wide"); this.logs = logs; } } exports.PriceConfidenceTooWide = PriceConfidenceTooWide; class IntegerOverflow extends Error { logs; static code = 6049; code = 6049; name = "IntegerOverflow"; msg = "Conversion between integers failed"; constructor(logs) { super("6049: Conversion between integers failed"); this.logs = logs; } } exports.IntegerOverflow = IntegerOverflow; class NoFarmForReserve extends Error { logs; static code = 6050; code = 6050; name = "NoFarmForReserve"; msg = "This reserve does not have a farm"; constructor(logs) { super("6050: This reserve does not have a farm"); this.logs = logs; } } exports.NoFarmForReserve = NoFarmForReserve; class IncorrectInstructionInPosition extends Error { logs; static code = 6051; code = 6051; name = "IncorrectInstructionInPosition"; msg = "Wrong instruction at expected position"; constructor(logs) { super("6051: Wrong instruction at expected position"); this.logs = logs; } } exports.IncorrectInstructionInPosition = IncorrectInstructionInPosition; class NoPriceFound extends Error { logs; static code = 6052; code = 6052; name = "NoPriceFound"; msg = "No price found"; constructor(logs) { super("6052: No price found"); this.logs = logs; } } exports.NoPriceFound = NoPriceFound; class InvalidTwapConfig extends Error { logs; static code = 6053; code = 6053; name = "InvalidTwapConfig"; msg = "Invalid Twap configuration: Twap is enabled but one of the enabled price doesn't have a twap"; constructor(logs) { super("6053: Invalid Twap configuration: Twap is enabled but one of the enabled price doesn't have a twap"); this.logs = logs; } } exports.InvalidTwapConfig = InvalidTwapConfig; class InvalidPythPriceAccount extends Error { logs; static code = 6054; code = 6054; name = "InvalidPythPriceAccount"; msg = "Pyth price account does not match configuration"; constructor(logs) { super("6054: Pyth price account does not match configuration"); this.logs = logs; } } exports.InvalidPythPriceAccount = InvalidPythPriceAccount; class InvalidSwitchboardAccount extends Error { logs; static code = 6055; code = 6055; name = "InvalidSwitchboardAccount"; msg = "Switchboard account(s) do not match configuration"; constructor(logs) { super("6055: Switchboard account(s) do not match configuration"); this.logs = logs; } } exports.InvalidSwitchboardAccount = InvalidSwitchboardAccount; class InvalidScopePriceAccount extends Error { logs; static code = 6056; code = 6056; name = "InvalidScopePriceAccount"; msg = "Scope price account does not match configuration"; constructor(logs) { super("6056: Scope price account does not match configuration"); this.logs = logs; } } exports.InvalidScopePriceAccount = InvalidScopePriceAccount; class ObligationCollateralLtvZero extends Error { logs; static code = 6057; code = 6057; name = "ObligationCollateralLtvZero"; msg = "The obligation has one collateral with an LTV set to 0. Withdraw it before withdrawing other collaterals"; constructor(logs) { super("6057: The obligation has one collateral with an LTV set to 0. Withdraw it before withdrawing other collaterals"); this.logs = logs; } } exports.ObligationCollateralLtvZero = ObligationCollateralLtvZero; class InvalidObligationSeedsValue extends Error { logs; static code = 6058; code = 6058; name = "InvalidObligationSeedsValue"; msg = "Seeds must be default pubkeys for tag 0, and mint addresses for tag 1 or 2"; constructor(logs) { super("6058: Seeds must be default pubkeys for tag 0, and mint addresses for tag 1 or 2"); this.logs = logs; } } exports.InvalidObligationSeedsValue = InvalidObligationSeedsValue; class DeprecatedInvalidObligationId extends Error { logs; static code = 6059; code = 6059; name = "DeprecatedInvalidObligationId"; msg = "[DEPRECATED] Obligation id must be 0"; constructor(logs) { super("6059: [DEPRECATED] Obligation id must be 0"); this.logs = logs; } } exports.DeprecatedInvalidObligationId = DeprecatedInvalidObligationId; class InvalidBorrowRateCurvePoint extends Error { logs; static code = 6060; code = 6060; name = "InvalidBorrowRateCurvePoint"; msg = "Invalid borrow rate curve point"; constructor(logs) { super("6060: Invalid borrow rate curve point"); this.logs = logs; } } exports.InvalidBorrowRateCurvePoint = InvalidBorrowRateCurvePoint; class InvalidUtilizationRate extends Error { logs; static code = 6061; code = 6061; name = "InvalidUtilizationRate"; msg = "Invalid utilization rate"; constructor(logs) { super("6061: Invalid utilization rate"); this.logs = logs; } } exports.InvalidUtilizationRate = InvalidUtilizationRate; class CannotSocializeObligationWithCollateral extends Error { logs; static code = 6062; code = 6062; name = "CannotSocializeObligationWithCollateral"; msg = "Obligation hasn't been fully liquidated and debt cannot be socialized."; constructor(logs) { super("6062: Obligation hasn't been fully liquidated and debt cannot be socialized."); this.logs = logs; } } exports.CannotSocializeObligationWithCollateral = CannotSocializeObligationWithCollateral; class ObligationEmpty extends Error { logs; static code = 6063; code = 6063; name = "ObligationEmpty"; msg = "Obligation has no borrows or deposits."; constructor(logs) { super("6063: Obligation has no borrows or deposits."); this.logs = logs; } } exports.ObligationEmpty = ObligationEmpty; class WithdrawalCapReached extends Error { logs; static code = 6064; code = 6064; name = "WithdrawalCapReached"; msg = "Withdrawal cap is reached"; constructor(logs) { super("6064: Withdrawal cap is reached"); this.logs = logs; } } exports.WithdrawalCapReached = WithdrawalCapReached; class LastTimestampGreaterThanCurrent extends Error { logs; static code = 6065; code = 6065; name = "LastTimestampGreaterThanCurrent"; msg = "The last interval start timestamp is greater than the current timestamp"; constructor(logs) { super("6065: The last interval start timestamp is greater than the current timestamp"); this.logs = logs; } } exports.LastTimestampGreaterThanCurrent = LastTimestampGreaterThanCurrent; class LiquidationRewardTooSmall extends Error { logs; static code = 6066; code = 6066; name = "LiquidationRewardTooSmall"; msg = "The reward amount is less than the minimum acceptable received liquidity"; constructor(logs) { super("6066: The reward amount is less than the minimum acceptable received liquidity"); this.logs = logs; } } exports.LiquidationRewardTooSmall = LiquidationRewardTooSmall; class IsolatedAssetTierViolation extends Error { logs; static code = 6067; code = 6067; name = "IsolatedAssetTierViolation"; msg = "Isolated Asset Tier Violation"; constructor(logs) { super("6067: Isolated Asset Tier Violation"); this.logs = logs; } } exports.IsolatedAssetTierViolation = IsolatedAssetTierViolation; class InconsistentElevationGroup extends Error { logs; static code = 6068; code = 6068; name = "InconsistentElevationGroup"; msg = "The obligation's elevation group and the reserve's are not the same"; constructor(logs) { super("6068: The obligation's elevation group and the reserve's are not the same"); this.logs = logs; } } exports.InconsistentElevationGroup = InconsistentElevationGroup; class InvalidElevationGroup extends Error { logs; static code = 6069; code = 6069; name = "InvalidElevationGroup"; msg = "The elevation group chosen for the reserve does not exist in the lending market"; constructor(logs) { super("6069: The elevation group chosen for the reserve does not exist in the lending market"); this.logs = logs; } } exports.InvalidElevationGroup = InvalidElevationGroup; class InvalidElevationGroupConfig extends Error { logs; static code = 6070; code = 6070; name = "InvalidElevationGroupConfig"; msg = "The elevation group updated has wrong parameters set"; constructor(logs) { super("6070: The elevation group updated has wrong parameters set"); this.logs = logs; } } exports.InvalidElevationGroupConfig = InvalidElevationGroupConfig; class UnhealthyElevationGroupLtv extends Error { logs; static code = 6071; code = 6071; name = "UnhealthyElevationGroupLtv"; msg = "The current obligation must have most or all its debt repaid before changing the elevation group"; constructor(logs) { super("6071: The current obligation must have most or all its debt repaid before changing the elevation group"); this.logs = logs; } } exports.UnhealthyElevationGroupLtv = UnhealthyElevationGroupLtv; class ElevationGroupNewLoansDisabled extends Error { logs; static code = 6072; code = 6072; name = "ElevationGroupNewLoansDisabled"; msg = "Elevation group does not accept any new loans or any new borrows/withdrawals"; constructor(logs) { super("6072: Elevation group does not accept any new loans or any new borrows/withdrawals"); this.logs = logs; } } exports.ElevationGroupNewLoansDisabled = ElevationGroupNewLoansDisabled; class ReserveDeprecated extends Error { logs; static code = 6073; code = 6073; name = "ReserveDeprecated"; msg = "Reserve was deprecated, no longer usable"; constructor(logs) { super("6073: Reserve was deprecated, no longer usable"); this.logs = logs; } } exports.ReserveDeprecated = ReserveDeprecated; class ReferrerAccountNotInitialized extends Error { logs; static code = 6074; code = 6074; name = "ReferrerAccountNotInitialized"; msg = "Referrer account not initialized"; constructor(logs) { super("6074: Referrer account not initialized"); this.logs = logs; } } exports.ReferrerAccountNotInitialized = ReferrerAccountNotInitialized; class ReferrerAccountMintMissmatch extends Error { logs; static code = 6075; code = 6075; name = "ReferrerAccountMintMissmatch"; msg = "Referrer account mint does not match the operation reserve mint"; constructor(logs) { super("6075: Referrer account mint does not match the operation reserve mint"); this.logs = logs; } } exports.ReferrerAccountMintMissmatch = ReferrerAccountMintMissmatch; class ReferrerAccountWrongAddress extends Error { logs; static code = 6076; code = 6076; name = "ReferrerAccountWrongAddress"; msg = "Referrer account address is not a valid program address"; constructor(logs) { super("6076: Referrer account address is not a valid program address"); this.logs = logs; } } exports.ReferrerAccountWrongAddress = ReferrerAccountWrongAddress; class ReferrerAccountReferrerMissmatch extends Error { logs; static code = 6077; code = 6077; name = "ReferrerAccountReferrerMissmatch"; msg = "Referrer account referrer does not match the owner referrer"; constructor(logs) { super("6077: Referrer account referrer does not match the owner referrer"); this.logs = logs; } } exports.ReferrerAccountReferrerMissmatch = ReferrerAccountReferrerMissmatch; class ReferrerAccountMissing extends Error { logs; static code = 6078; code = 6078; name = "ReferrerAccountMissing"; msg = "Referrer account missing for obligation with referrer"; constructor(logs) { super("6078: Referrer account missing for obligation with referrer"); this.logs = logs; } } exports.ReferrerAccountMissing = ReferrerAccountMissing; class InsufficientReferralFeesToRedeem extends Error { logs; static code = 6079; code = 6079; name = "InsufficientReferralFeesToRedeem"; msg = "Insufficient referral fees to claim or no liquidity available"; constructor(logs) { super("6079: Insufficient referral fees to claim or no liquidity available"); this.logs = logs; } } exports.InsufficientReferralFeesToRedeem = InsufficientReferralFeesToRedeem; class CpiDisabled extends Error { logs; static code = 6080; code = 6080; name = "CpiDisabled"; msg = "CPI disabled for this instruction"; constructor(logs) { super("6080: CPI disabled for this instruction"); this.logs = logs; } } exports.CpiDisabled = CpiDisabled; class ShortUrlNotAsciiAlphanumeric extends Error { logs; static code = 6081; code = 6081; name = "ShortUrlNotAsciiAlphanumeric"; msg = "Referrer short_url is not ascii alphanumeric"; constructor(logs) { super("6081: Referrer short_url is not ascii alphanumeric"); this.logs = logs; } } exports.ShortUrlNotAsciiAlphanumeric = ShortUrlNotAsciiAlphanumeric; class ReserveObsolete extends Error { logs; static code = 6082; code = 6082; name = "ReserveObsolete"; msg = "Reserve is marked as obsolete"; constructor(logs) { super("6082: Reserve is marked as obsolete"); this.logs = logs; } } exports.ReserveObsolete = ReserveObsolete; class ElevationGroupAlreadyActivated extends Error { logs; static code = 6083; code = 6083; name = "ElevationGroupAlreadyActivated"; msg = "Obligation already part of the same elevation group"; constructor(logs) { super("6083: Obligation already part of the same elevation group"); this.logs = logs; } } exports.ElevationGroupAlreadyActivated = ElevationGroupAlreadyActivated; class ObligationInObsoleteReserve extends Error { logs; static code = 6084; code = 6084; name = "ObligationInObsoleteReserve"; msg = "Obligation has a deposit or borrow in an obsolete reserve"; constructor(logs) { super("6084: Obligation has a deposit or borrow in an obsolete reserve"); this.logs = logs; } } exports.ObligationInObsoleteReserve = ObligationInObsoleteReserve; class ReferrerStateOwnerMismatch extends Error { logs; static code = 6085; code = 6085; name = "ReferrerStateOwnerMismatch"; msg = "Referrer state owner does not match the given signer"; constructor(logs) { super("6085: Referrer state owner does not match the given signer"); this.logs = logs; } } exports.ReferrerStateOwnerMismatch = ReferrerStateOwnerMismatch; class UserMetadataOwnerAlreadySet extends Error { logs; static code = 6086; code = 6086; name = "UserMetadataOwnerAlreadySet"; msg = "User metadata owner is already set"; constructor(logs) { super("6086: User metadata owner is already set"); this.logs = logs; } } exports.UserMetadataOwnerAlreadySet = UserMetadataOwnerAlreadySet; class CollateralNonLiquidatable extends Error { logs; static code = 6087; code = 6087; name = "CollateralNonLiquidatable"; msg = "This collateral cannot be liquidated (LTV set to 0)"; constructor(logs) { super("6087: This collateral cannot be liquidated (LTV set to 0)"); this.logs = logs; } } exports.CollateralNonLiquidatable = CollateralNonLiquidatable; class BorrowingDisabled extends Error { logs; static code = 6088; code = 6088; name = "BorrowingDisabled"; msg = "Borrowing is disabled"; constructor(logs) { super("6088: Borrowing is disabled"); this.logs = logs; } } exports.BorrowingDisabled = BorrowingDisabled; class BorrowLimitExceeded extends Error { logs; static code = 6089; code = 6089; name = "BorrowLimitExceeded"; msg = "Cannot borrow above borrow limit"; constructor(logs) { super("6089: Cannot borrow above borrow limit"); this.logs = logs; } } exports.BorrowLimitExceeded = BorrowLimitExceeded; class DepositLimitExceeded extends Error { logs; static code = 6090; code = 6090; name = "DepositLimitExceeded"; msg = "Cannot deposit above deposit limit"; constructor(logs) { super("6090: Cannot deposit above deposit limit"); this.logs = logs; } } exports.DepositLimitExceeded = DepositLimitExceeded; class BorrowingDisabledOutsideElevationGroup extends Error { logs; static code = 6091; code = 6091; name = "BorrowingDisabledOutsideElevationGroup"; msg = "Reserve does not accept any new borrows outside elevation group"; constructor(logs) { super("6091: Reserve does not accept any new borrows outside elevation group"); this.logs = logs; } } exports.BorrowingDisabledOutsideElevationGroup = BorrowingDisabledOutsideElevationGroup; class NetValueRemainingTooSmall extends Error { logs; static code = 6092; code = 6092; name = "NetValueRemainingTooSmall"; msg = "Net value remaining too small"; constructor(logs) { super("6092: Net value remaining too small"); this.logs = logs; } } exports.NetValueRemainingTooSmall = NetValueRemainingTooSmall; class WorseLtvBlocked extends Error { logs; static code = 6093; code = 6093; name = "WorseLtvBlocked"; msg = "Cannot get the obligation in a worse position"; constructor(logs) { super("6093: Cannot get the obligation in a worse position"); this.logs = logs; } } exports.WorseLtvBlocked = WorseLtvBlocked; class LiabilitiesBiggerThanAssets extends Error { logs; static code = 6094; code = 6094; name = "LiabilitiesBiggerThanAssets"; msg = "Cannot have more liabilities than assets in a position"; constructor(logs) { super("6094: Cannot have more liabilities than assets in a position"); this.logs = logs; } } exports.LiabilitiesBiggerThanAssets = LiabilitiesBiggerThanAssets; class ReserveTokenBalanceMismatch extends Error { logs; static code = 6095; code = 6095; name = "ReserveTokenBalanceMismatch"; msg = "Reserve state and token account cannot drift"; constructor(logs) { super("6095: Reserve state and token account cannot drift"); this.logs = logs; } } exports.ReserveTokenBalanceMismatch = ReserveTokenBalanceMismatch; class ReserveVaultBalanceMismatch extends Error { logs; static code = 6096; code = 6096; name = "ReserveVaultBalanceMismatch"; msg = "Reserve token account has been unexpectedly modified"; constructor(logs) { super("6096: Reserve token account has been unexpectedly modified"); this.logs = logs; } } exports.ReserveVaultBalanceMismatch = ReserveVaultBalanceMismatch; class ReserveAccountingMismatch extends Error { logs; static code = 6097; code = 6097; name = "ReserveAccountingMismatch"; msg = "Reserve internal state accounting has been unexpectedly modified"; constructor(logs) { super("6097: Reserve internal state accounting has been unexpectedly modified"); this.logs = logs; } } exports.ReserveAccountingMismatch = ReserveAccountingMismatch; class BorrowingAboveUtilizationRateDisabled extends Error { logs; static code = 6098; code = 6098; name = "BorrowingAboveUtilizationRateDisabled"; msg = "Borrowing above set utilization rate is disabled"; constructor(logs) { super("6098: Borrowing above set utilization rate is disabled"); this.logs = logs; } } exports.BorrowingAboveUtilizationRateDisabled = BorrowingAboveUtilizationRateDisabled; class LiquidationBorrowFactorPriority extends Error { logs; static code = 6099; code = 6099; name = "LiquidationBorrowFactorPriority"; msg = "Liquidation must prioritize the debt with the highest borrow factor"; constructor(logs) { super("6099: Liquidation must prioritize the debt with the highest borrow factor"); this.logs = logs; } } exports.LiquidationBorrowFactorPriority = LiquidationBorrowFactorPriority; class LiquidationLowestLiquidationLtvPriority extends Error { logs; static code = 6100; code = 6100; name = "LiquidationLowestLiquidationLtvPriority"; msg = "Liquidation must prioritize the collateral with the lowest liquidation LTV"; constructor(logs) { super("6100: Liquidation must prioritize the collateral with the lowest liquidation LTV"); this.logs = logs; } } exports.LiquidationLowestLiquidationLtvPriority = LiquidationLowestLiquidationLtvPriority; class ElevationGroupBorrowLimitExceeded extends Error { logs; static code = 6101; code = 6101; name = "ElevationGroupBorrowLimitExceeded"; msg = "Elevation group borrow limit exceeded"; constructor(logs) { super("6101: Elevation group borrow limit exceeded"); this.logs = logs; } } exports.ElevationGroupBorrowLimitExceeded = ElevationGroupBorrowLimitExceeded; class ElevationGroupWithoutDebtReserve extends Error { logs; static code = 6102; code = 6102; name = "ElevationGroupWithoutDebtReserve"; msg = "The elevation group does not have a debt reserve defined"; constructor(logs) { super("6102: The elevation group does not have a debt reserve defined"); this.logs = logs; } } exports.ElevationGroupWithoutDebtReserve = ElevationGroupWithoutDebtReserve; class ElevationGroupMaxCollateralReserveZero extends Error { logs; static code = 6103; code = 6103; name = "ElevationGroupMaxCollateralReserveZero"; msg = "The elevation group does not allow any collateral reserves"; constructor(logs) { super("6103: The elevation group does not allow any collateral reserves"); this.logs = logs; } } exports.ElevationGroupMaxCollateralReserveZero = ElevationGroupMaxCollateralReserveZero; class ElevationGroupHasAnotherDebtReserve extends Error { logs; static code = 6104; code = 6104; name = "ElevationGroupHasAnotherDebtReserve"; msg = "In elevation group attempt to borrow from a reserve that is not the debt reserve"; constructor(logs) { super("6104: In elevation group attempt to borrow from a reserve that is not the debt reserve"); this.logs = logs; } } exports.ElevationGroupHasAnotherDebtReserve = ElevationGroupHasAnotherDebtReserve; class ElevationGroupDebtReserveAsCollateral extends Error { logs; static code = 6105; code = 6105; name = "ElevationGroupDebtReserveAsCollateral"; msg = "The elevation group's debt reserve cannot be used as a collateral reserve"; constructor(logs) { super("6105: The elevation group's debt reserve cannot be used as a collateral reserve"); this.logs = logs; } } exports.ElevationGroupDebtReserveAsCollateral = ElevationGroupDebtReserveAsCollateral; class ObligationCollateralExceedsElevationGroupLimit extends Error { logs; static code = 6106; code = 6106; name = "ObligationCollateralExceedsElevationGroupLimit"; msg = "Obligation have more collateral than the maximum allowed by the elevation group"; constructor(logs) { super("6106: Obligation have more collateral than the maximum allowed by the elevation group"); this.logs = logs; } } exports.ObligationCollateralExceedsElevationGroupLimit = ObligationCollateralExceedsElevationGroupLimit; class ObligationElevationGroupMultipleDebtReserve extends Error { logs; static code = 6107; code = 6107; name = "ObligationElevationGroupMultipleDebtReserve"; msg = "Obligation is an elevation group but have more than one debt reserve"; constructor(logs) { super("6107: Obligation is an elevation group but have more than one debt reserve"); this.logs = logs; } } exports.ObligationElevationGroupMultipleDebtReserve = ObligationElevationGroupMultipleDebtReserve; class UnsupportedTokenExtension extends Error { logs; static code = 6108; code = 6108; name = "UnsupportedTokenExtension"; msg = "Mint has a token (2022) extension that is not supported"; constructor(logs) { super("6108: Mint has a token (2022) extension that is not supported"); this.logs = logs; } } exports.UnsupportedTokenExtension = UnsupportedTokenExtension; class InvalidTokenAccount extends Error { logs; static code = 6109; code = 6109; name = "InvalidTokenAccount"; msg = "Can't have an spl token mint with a t22 account"; constructor(logs) { super("6109: Can't have an spl token mint with a t22 account"); this.logs = logs; } } exports.InvalidTokenAccount = InvalidTokenAccount; class DepositDisabledOutsideElevationGroup extends Error { logs; static code = 6110; code = 6110; name = "DepositDisabledOutsideElevationGroup"; msg = "Can't deposit into this reserve outside elevation group"; constructor(logs) { super("6110: Can't deposit into this reserve outside elevation group"); this.logs = logs; } } exports.DepositDisabledOutsideElevationGroup = DepositDisabledOutsideElevationGroup; class CannotCalculateReferralAmountDueToSlotsMismatch extends Error { logs; static code = 6111; code = 6111; name = "CannotCalculateReferralAmountDueToSlotsMismatch"; msg = "Cannot calculate referral amount due to slots mismatch"; constructor(logs) { super("6111: Cannot calculate referral amount due to slots mismatch"); this.logs = logs; } } exports.CannotCalculateReferralAmountDueToSlotsMismatch = CannotCalculateReferralAmountDueToSlotsMismatch; class ObligationOwnersMustMatch extends Error { logs; static code = 6112; code = 6112; name = "ObligationOwnersMustMatch"; msg = "Obligation owners must match"; constructor(logs) { super("6112: Obligation owners must match"); this.logs = logs; } } exports.ObligationOwnersMustMatch = ObligationOwnersMustMatch; class ObligationsMustMatch extends Error { logs; static code = 6113; code = 6113; name = "ObligationsMustMatch"; msg = "Obligations must match"; constructor(logs) { super("6113: Obligations must match"); this.logs = logs; } } exports.ObligationsMustMatch = ObligationsMustMatch; class LendingMarketsMustMatch extends Error { logs; static code = 6114; code = 6114; name = "LendingMarketsMustMatch"; msg = "Lending markets must match"; constructor(logs) { super("6114: Lending markets must match"); this.logs = logs; } } exports.LendingMarketsMustMatch = LendingMarketsMustMatch; class ObligationCurrentlyMarkedForDeleveraging extends Error { logs; static code = 6115; code = 6115; name = "ObligationCurrentlyMarkedForDeleveraging"; msg = "Obligation is already marked for deleveraging"; constructor(logs) { super("6115: Obligation is already marked for deleveraging"); this.logs = logs; } } exports.ObligationCurrentlyMarkedForDeleveraging = ObligationCurrentlyMarkedForDeleveraging; class MaximumWithdrawValueZero extends Error { logs; static code = 6116; code = 6116; name = "MaximumWithdrawValueZero"; msg = "Maximum withdrawable value of this collateral is zero, LTV needs improved"; constructor(logs) { super("6116: Maximum withdrawable value of this collateral is zero, LTV needs improved"); this.logs = logs; } } exports.MaximumWithdrawValueZero = MaximumWithdrawValueZero; class ZeroMaxLtvAssetsInDeposits extends Error { logs; static code = 6117; code = 6117; name = "ZeroMaxLtvAssetsInDeposits"; msg = "No max LTV 0 assets allowed in deposits for repay and withdraw"; constructor(logs) { super("6117: No max LTV 0 assets allowed in deposits for repay and withdraw"); this.logs = logs; } } exports.ZeroMaxLtvAssetsInDeposits = ZeroMaxLtvAssetsInDeposits; class LowestLtvAssetsPriority extends Error { logs; static code = 6118; code = 6118; name = "LowestLtvAssetsPriority"; msg = "Withdrawing must prioritize the collateral with the lowest reserve max-LTV"; constructor(logs) { super("6118: Withdrawing must prioritize the collateral with the lowest reserve max-LTV"); this.logs = logs; } } exports.LowestLtvAssetsPriority = LowestLtvAssetsPriority; class WorseLtvThanUnhealthyLtv extends Error { logs; static code = 6119; code = 6119; name = "WorseLtvThanUnhealthyLtv"; msg = "Can