meteora_vault_sdk/errors/
vault.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum VaultError {
13    /// 6000 - Vault is disabled
14    #[error("Vault is disabled")]
15    VaultIsDisabled = 0x1770,
16    /// 6001 - Exceeded slippage tolerance
17    #[error("Exceeded slippage tolerance")]
18    ExceededSlippage = 0x1771,
19    /// 6002 - Strategy is not existed
20    #[error("Strategy is not existed")]
21    StrategyIsNotExisted = 0x1772,
22    /// 6003 - UnAuthorized
23    #[error("UnAuthorized")]
24    UnAuthorized = 0x1773,
25    /// 6004 - Math operation overflow
26    #[error("Math operation overflow")]
27    MathOverflow = 0x1774,
28    /// 6005 - Protocol is not supported
29    #[error("Protocol is not supported")]
30    ProtocolIsNotSupported = 0x1775,
31    /// 6006 - Reserve does not support token mint
32    #[error("Reserve does not support token mint")]
33    UnMatchReserve = 0x1776,
34    /// 6007 - lockedProfitDegradation is invalid
35    #[error("lockedProfitDegradation is invalid")]
36    InvalidLockedProfitDegradation = 0x1777,
37    /// 6008 - Maximum number of strategies have been reached
38    #[error("Maximum number of strategies have been reached")]
39    MaxStrategyReached = 0x1778,
40    /// 6009 - Strategy existed
41    #[error("Strategy existed")]
42    StrategyExisted = 0x1779,
43    /// 6010 - Invalid unmint amount
44    #[error("Invalid unmint amount")]
45    InvalidUnmintAmount = 0x177A,
46    /// 6011 - Invalid accounts for strategy
47    #[error("Invalid accounts for strategy")]
48    InvalidAccountsForStrategy = 0x177B,
49    /// 6012 - Invalid bump
50    #[error("Invalid bump")]
51    InvalidBump = 0x177C,
52    /// 6013 - Amount must be greater than 0
53    #[error("Amount must be greater than 0")]
54    AmountMustGreaterThanZero = 0x177D,
55    /// 6014 - Mango is not supported anymore
56    #[error("Mango is not supported anymore")]
57    MangoIsNotSupportedAnymore = 0x177E,
58    /// 6015 - Strategy is not supported
59    #[error("Strategy is not supported")]
60    StrategyIsNotSupported = 0x177F,
61    /// 6016 - Pay amount is exceeded
62    #[error("Pay amount is exceeded")]
63    PayAmountIsExeeced = 0x1780,
64    /// 6017 - Fee vault is not set
65    #[error("Fee vault is not set")]
66    FeeVaultIsNotSet = 0x1781,
67    /// 6018 - deposit amount in lending is not matched
68    #[error("deposit amount in lending is not matched")]
69    LendingAssertionViolation = 0x1782,
70    /// 6019 - Cannot remove strategy becase we have some in lending
71    #[error("Cannot remove strategy becase we have some in lending")]
72    HaveMoneyInLending = 0x1783,
73}
74
75impl solana_program::program_error::PrintProgramError for VaultError {
76    fn print<E>(&self) {
77        solana_program::msg!(&self.to_string());
78    }
79}
80
81impl<T> solana_program::decode_error::DecodeError<T> for VaultError {
82    fn type_of() -> &'static str {
83        "VaultError"
84    }
85}