UNPKG

@kamino-finance/klend-sdk

Version:

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

542 lines 18.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AUMBelowPendingFees = exports.AUMDecreasedAfterInvest = exports.SharesMintedAmountDoesNotMatch = exports.DisinvestedLiquidityAmountDoesNotMatch = exports.SharesBurnedAmountDoesNotMatch = exports.UserReceivedAmountDoesNotMatch = exports.LiquidityToWithdrawDoesNotMatch = exports.AmountToWithdrawDoesNotMatch = exports.TokensDepositedAmountDoesNotMatch = exports.CannotWithdrawFromEmptyVault = exports.ReserveSpaceExhausted = exports.DepositAmountBelowMinimum = exports.BPSValueTooBig = exports.NotEnoughLiquidityDisinvestedToSendToUser = exports.ReserveIsStale = exports.InitialAccountintIncorrect = exports.SharesMintIncorrect = exports.SharesMintDecimalsIncorrect = exports.TokenVaultIncorrect = exports.TokenMintDecimalsIncorrect = exports.TokenMintIncorrect = exports.BaseVaultAuthorityBumpIncorrect = exports.BaseVaultAuthorityIncorrect = exports.AdminAuthorityIncorrect = exports.InvestAmountBelowMinimum = exports.CannotFindReserveInAllocations = exports.OutOfRangeOfReserveIndex = exports.ReserveAccountAndKeyMismatch = exports.ReserveNotProvidedInTheAccounts = exports.CouldNotDeserializeAccountAsReserve = exports.ReserveNotPartOfAllocations = exports.ReserveAlreadyExists = exports.TooMuchLiquidityToWithdraw = exports.WithdrawAmountBelowMinimum = exports.IntegerOverflow = exports.MathOverflow = exports.SharesIssuedAmountDoesNotMatch = exports.DepositAmountsZero = void 0; exports.fromCode = fromCode; class DepositAmountsZero extends Error { logs; static code = 6000; code = 6000; name = "DepositAmountsZero"; msg = "DepositAmountsZero"; constructor(logs) { super("6000: DepositAmountsZero"); this.logs = logs; } } exports.DepositAmountsZero = DepositAmountsZero; class SharesIssuedAmountDoesNotMatch extends Error { logs; static code = 6001; code = 6001; name = "SharesIssuedAmountDoesNotMatch"; msg = "SharesIssuedAmountDoesNotMatch"; constructor(logs) { super("6001: SharesIssuedAmountDoesNotMatch"); this.logs = logs; } } exports.SharesIssuedAmountDoesNotMatch = SharesIssuedAmountDoesNotMatch; class MathOverflow extends Error { logs; static code = 6002; code = 6002; name = "MathOverflow"; msg = "MathOverflow"; constructor(logs) { super("6002: MathOverflow"); this.logs = logs; } } exports.MathOverflow = MathOverflow; class IntegerOverflow extends Error { logs; static code = 6003; code = 6003; name = "IntegerOverflow"; msg = "IntegerOverflow"; constructor(logs) { super("6003: IntegerOverflow"); this.logs = logs; } } exports.IntegerOverflow = IntegerOverflow; class WithdrawAmountBelowMinimum extends Error { logs; static code = 6004; code = 6004; name = "WithdrawAmountBelowMinimum"; msg = "Withdrawn amount is below minimum"; constructor(logs) { super("6004: Withdrawn amount is below minimum"); this.logs = logs; } } exports.WithdrawAmountBelowMinimum = WithdrawAmountBelowMinimum; class TooMuchLiquidityToWithdraw extends Error { logs; static code = 6005; code = 6005; name = "TooMuchLiquidityToWithdraw"; msg = "TooMuchLiquidityToWithdraw"; constructor(logs) { super("6005: TooMuchLiquidityToWithdraw"); this.logs = logs; } } exports.TooMuchLiquidityToWithdraw = TooMuchLiquidityToWithdraw; class ReserveAlreadyExists extends Error { logs; static code = 6006; code = 6006; name = "ReserveAlreadyExists"; msg = "ReserveAlreadyExists"; constructor(logs) { super("6006: ReserveAlreadyExists"); this.logs = logs; } } exports.ReserveAlreadyExists = ReserveAlreadyExists; class ReserveNotPartOfAllocations extends Error { logs; static code = 6007; code = 6007; name = "ReserveNotPartOfAllocations"; msg = "ReserveNotPartOfAllocations"; constructor(logs) { super("6007: ReserveNotPartOfAllocations"); this.logs = logs; } } exports.ReserveNotPartOfAllocations = ReserveNotPartOfAllocations; class CouldNotDeserializeAccountAsReserve extends Error { logs; static code = 6008; code = 6008; name = "CouldNotDeserializeAccountAsReserve"; msg = "CouldNotDeserializeAccountAsReserve"; constructor(logs) { super("6008: CouldNotDeserializeAccountAsReserve"); this.logs = logs; } } exports.CouldNotDeserializeAccountAsReserve = CouldNotDeserializeAccountAsReserve; class ReserveNotProvidedInTheAccounts extends Error { logs; static code = 6009; code = 6009; name = "ReserveNotProvidedInTheAccounts"; msg = "ReserveNotProvidedInTheAccounts"; constructor(logs) { super("6009: ReserveNotProvidedInTheAccounts"); this.logs = logs; } } exports.ReserveNotProvidedInTheAccounts = ReserveNotProvidedInTheAccounts; class ReserveAccountAndKeyMismatch extends Error { logs; static code = 6010; code = 6010; name = "ReserveAccountAndKeyMismatch"; msg = "ReserveAccountAndKeyMismatch"; constructor(logs) { super("6010: ReserveAccountAndKeyMismatch"); this.logs = logs; } } exports.ReserveAccountAndKeyMismatch = ReserveAccountAndKeyMismatch; class OutOfRangeOfReserveIndex extends Error { logs; static code = 6011; code = 6011; name = "OutOfRangeOfReserveIndex"; msg = "OutOfRangeOfReserveIndex"; constructor(logs) { super("6011: OutOfRangeOfReserveIndex"); this.logs = logs; } } exports.OutOfRangeOfReserveIndex = OutOfRangeOfReserveIndex; class CannotFindReserveInAllocations extends Error { logs; static code = 6012; code = 6012; name = "CannotFindReserveInAllocations"; msg = "OutOfRangeOfReserveIndex"; constructor(logs) { super("6012: OutOfRangeOfReserveIndex"); this.logs = logs; } } exports.CannotFindReserveInAllocations = CannotFindReserveInAllocations; class InvestAmountBelowMinimum extends Error { logs; static code = 6013; code = 6013; name = "InvestAmountBelowMinimum"; msg = "Invested amount is below minimum"; constructor(logs) { super("6013: Invested amount is below minimum"); this.logs = logs; } } exports.InvestAmountBelowMinimum = InvestAmountBelowMinimum; class AdminAuthorityIncorrect extends Error { logs; static code = 6014; code = 6014; name = "AdminAuthorityIncorrect"; msg = "AdminAuthorityIncorrect"; constructor(logs) { super("6014: AdminAuthorityIncorrect"); this.logs = logs; } } exports.AdminAuthorityIncorrect = AdminAuthorityIncorrect; class BaseVaultAuthorityIncorrect extends Error { logs; static code = 6015; code = 6015; name = "BaseVaultAuthorityIncorrect"; msg = "BaseVaultAuthorityIncorrect"; constructor(logs) { super("6015: BaseVaultAuthorityIncorrect"); this.logs = logs; } } exports.BaseVaultAuthorityIncorrect = BaseVaultAuthorityIncorrect; class BaseVaultAuthorityBumpIncorrect extends Error { logs; static code = 6016; code = 6016; name = "BaseVaultAuthorityBumpIncorrect"; msg = "BaseVaultAuthorityBumpIncorrect"; constructor(logs) { super("6016: BaseVaultAuthorityBumpIncorrect"); this.logs = logs; } } exports.BaseVaultAuthorityBumpIncorrect = BaseVaultAuthorityBumpIncorrect; class TokenMintIncorrect extends Error { logs; static code = 6017; code = 6017; name = "TokenMintIncorrect"; msg = "TokenMintIncorrect"; constructor(logs) { super("6017: TokenMintIncorrect"); this.logs = logs; } } exports.TokenMintIncorrect = TokenMintIncorrect; class TokenMintDecimalsIncorrect extends Error { logs; static code = 6018; code = 6018; name = "TokenMintDecimalsIncorrect"; msg = "TokenMintDecimalsIncorrect"; constructor(logs) { super("6018: TokenMintDecimalsIncorrect"); this.logs = logs; } } exports.TokenMintDecimalsIncorrect = TokenMintDecimalsIncorrect; class TokenVaultIncorrect extends Error { logs; static code = 6019; code = 6019; name = "TokenVaultIncorrect"; msg = "TokenVaultIncorrect"; constructor(logs) { super("6019: TokenVaultIncorrect"); this.logs = logs; } } exports.TokenVaultIncorrect = TokenVaultIncorrect; class SharesMintDecimalsIncorrect extends Error { logs; static code = 6020; code = 6020; name = "SharesMintDecimalsIncorrect"; msg = "SharesMintDecimalsIncorrect"; constructor(logs) { super("6020: SharesMintDecimalsIncorrect"); this.logs = logs; } } exports.SharesMintDecimalsIncorrect = SharesMintDecimalsIncorrect; class SharesMintIncorrect extends Error { logs; static code = 6021; code = 6021; name = "SharesMintIncorrect"; msg = "SharesMintIncorrect"; constructor(logs) { super("6021: SharesMintIncorrect"); this.logs = logs; } } exports.SharesMintIncorrect = SharesMintIncorrect; class InitialAccountintIncorrect extends Error { logs; static code = 6022; code = 6022; name = "InitialAccountintIncorrect"; msg = "InitialAccountintIncorrect"; constructor(logs) { super("6022: InitialAccountintIncorrect"); this.logs = logs; } } exports.InitialAccountintIncorrect = InitialAccountintIncorrect; class ReserveIsStale extends Error { logs; static code = 6023; code = 6023; name = "ReserveIsStale"; msg = "Reserve is stale and must be refreshed before any operation"; constructor(logs) { super("6023: Reserve is stale and must be refreshed before any operation"); this.logs = logs; } } exports.ReserveIsStale = ReserveIsStale; class NotEnoughLiquidityDisinvestedToSendToUser extends Error { logs; static code = 6024; code = 6024; name = "NotEnoughLiquidityDisinvestedToSendToUser"; msg = "Not enough liquidity disinvested to send to user"; constructor(logs) { super("6024: Not enough liquidity disinvested to send to user"); this.logs = logs; } } exports.NotEnoughLiquidityDisinvestedToSendToUser = NotEnoughLiquidityDisinvestedToSendToUser; class BPSValueTooBig extends Error { logs; static code = 6025; code = 6025; name = "BPSValueTooBig"; msg = "BPS value is greater than 10000"; constructor(logs) { super("6025: BPS value is greater than 10000"); this.logs = logs; } } exports.BPSValueTooBig = BPSValueTooBig; class DepositAmountBelowMinimum extends Error { logs; static code = 6026; code = 6026; name = "DepositAmountBelowMinimum"; msg = "Deposited amount is below minimum"; constructor(logs) { super("6026: Deposited amount is below minimum"); this.logs = logs; } } exports.DepositAmountBelowMinimum = DepositAmountBelowMinimum; class ReserveSpaceExhausted extends Error { logs; static code = 6027; code = 6027; name = "ReserveSpaceExhausted"; msg = "Vault have no space for new reserves"; constructor(logs) { super("6027: Vault have no space for new reserves"); this.logs = logs; } } exports.ReserveSpaceExhausted = ReserveSpaceExhausted; class CannotWithdrawFromEmptyVault extends Error { logs; static code = 6028; code = 6028; name = "CannotWithdrawFromEmptyVault"; msg = "Cannot withdraw from empty vault"; constructor(logs) { super("6028: Cannot withdraw from empty vault"); this.logs = logs; } } exports.CannotWithdrawFromEmptyVault = CannotWithdrawFromEmptyVault; class TokensDepositedAmountDoesNotMatch extends Error { logs; static code = 6029; code = 6029; name = "TokensDepositedAmountDoesNotMatch"; msg = "TokensDepositedAmountDoesNotMatch"; constructor(logs) { super("6029: TokensDepositedAmountDoesNotMatch"); this.logs = logs; } } exports.TokensDepositedAmountDoesNotMatch = TokensDepositedAmountDoesNotMatch; class AmountToWithdrawDoesNotMatch extends Error { logs; static code = 6030; code = 6030; name = "AmountToWithdrawDoesNotMatch"; msg = "Amount to withdraw does not match"; constructor(logs) { super("6030: Amount to withdraw does not match"); this.logs = logs; } } exports.AmountToWithdrawDoesNotMatch = AmountToWithdrawDoesNotMatch; class LiquidityToWithdrawDoesNotMatch extends Error { logs; static code = 6031; code = 6031; name = "LiquidityToWithdrawDoesNotMatch"; msg = "Liquidity to withdraw does not match"; constructor(logs) { super("6031: Liquidity to withdraw does not match"); this.logs = logs; } } exports.LiquidityToWithdrawDoesNotMatch = LiquidityToWithdrawDoesNotMatch; class UserReceivedAmountDoesNotMatch extends Error { logs; static code = 6032; code = 6032; name = "UserReceivedAmountDoesNotMatch"; msg = "User received amount does not match"; constructor(logs) { super("6032: User received amount does not match"); this.logs = logs; } } exports.UserReceivedAmountDoesNotMatch = UserReceivedAmountDoesNotMatch; class SharesBurnedAmountDoesNotMatch extends Error { logs; static code = 6033; code = 6033; name = "SharesBurnedAmountDoesNotMatch"; msg = "Shares burned amount does not match"; constructor(logs) { super("6033: Shares burned amount does not match"); this.logs = logs; } } exports.SharesBurnedAmountDoesNotMatch = SharesBurnedAmountDoesNotMatch; class DisinvestedLiquidityAmountDoesNotMatch extends Error { logs; static code = 6034; code = 6034; name = "DisinvestedLiquidityAmountDoesNotMatch"; msg = "Disinvested liquidity amount does not match"; constructor(logs) { super("6034: Disinvested liquidity amount does not match"); this.logs = logs; } } exports.DisinvestedLiquidityAmountDoesNotMatch = DisinvestedLiquidityAmountDoesNotMatch; class SharesMintedAmountDoesNotMatch extends Error { logs; static code = 6035; code = 6035; name = "SharesMintedAmountDoesNotMatch"; msg = "SharesMintedAmountDoesNotMatch"; constructor(logs) { super("6035: SharesMintedAmountDoesNotMatch"); this.logs = logs; } } exports.SharesMintedAmountDoesNotMatch = SharesMintedAmountDoesNotMatch; class AUMDecreasedAfterInvest extends Error { logs; static code = 6036; code = 6036; name = "AUMDecreasedAfterInvest"; msg = "AUM decreased after invest"; constructor(logs) { super("6036: AUM decreased after invest"); this.logs = logs; } } exports.AUMDecreasedAfterInvest = AUMDecreasedAfterInvest; class AUMBelowPendingFees extends Error { logs; static code = 6037; code = 6037; name = "AUMBelowPendingFees"; msg = "AUM is below pending fees"; constructor(logs) { super("6037: AUM is below pending fees"); this.logs = logs; } } exports.AUMBelowPendingFees = AUMBelowPendingFees; function fromCode(code, logs) { switch (code) { case 6000: return new DepositAmountsZero(logs); case 6001: return new SharesIssuedAmountDoesNotMatch(logs); case 6002: return new MathOverflow(logs); case 6003: return new IntegerOverflow(logs); case 6004: return new WithdrawAmountBelowMinimum(logs); case 6005: return new TooMuchLiquidityToWithdraw(logs); case 6006: return new ReserveAlreadyExists(logs); case 6007: return new ReserveNotPartOfAllocations(logs); case 6008: return new CouldNotDeserializeAccountAsReserve(logs); case 6009: return new ReserveNotProvidedInTheAccounts(logs); case 6010: return new ReserveAccountAndKeyMismatch(logs); case 6011: return new OutOfRangeOfReserveIndex(logs); case 6012: return new CannotFindReserveInAllocations(logs); case 6013: return new InvestAmountBelowMinimum(logs); case 6014: return new AdminAuthorityIncorrect(logs); case 6015: return new BaseVaultAuthorityIncorrect(logs); case 6016: return new BaseVaultAuthorityBumpIncorrect(logs); case 6017: return new TokenMintIncorrect(logs); case 6018: return new TokenMintDecimalsIncorrect(logs); case 6019: return new TokenVaultIncorrect(logs); case 6020: return new SharesMintDecimalsIncorrect(logs); case 6021: return new SharesMintIncorrect(logs); case 6022: return new InitialAccountintIncorrect(logs); case 6023: return new ReserveIsStale(logs); case 6024: return new NotEnoughLiquidityDisinvestedToSendToUser(logs); case 6025: return new BPSValueTooBig(logs); case 6026: return new DepositAmountBelowMinimum(logs); case 6027: return new ReserveSpaceExhausted(logs); case 6028: return new CannotWithdrawFromEmptyVault(logs); case 6029: return new TokensDepositedAmountDoesNotMatch(logs); case 6030: return new AmountToWithdrawDoesNotMatch(logs); case 6031: return new LiquidityToWithdrawDoesNotMatch(logs); case 6032: return new UserReceivedAmountDoesNotMatch(logs); case 6033: return new SharesBurnedAmountDoesNotMatch(logs); case 6034: return new DisinvestedLiquidityAmountDoesNotMatch(logs); case 6035: return new SharesMintedAmountDoesNotMatch(logs); case 6036: return new AUMDecreasedAfterInvest(logs); case 6037: return new AUMBelowPendingFees(logs); } return null; } //# sourceMappingURL=custom.js.map