Skip to main content

meteora_dbc_client/generated/errors/
dynamic_bonding_curve.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 DynamicBondingCurveError {
13    /// 6000 - Math operation overflow
14    #[error("Math operation overflow")]
15    MathOverflow = 0x1770,
16    /// 6001 - Invalid fee setup
17    #[error("Invalid fee setup")]
18    InvalidFee = 0x1771,
19    /// 6002 - Exceeded slippage tolerance
20    #[error("Exceeded slippage tolerance")]
21    ExceededSlippage = 0x1772,
22    /// 6003 - Exceeded max fee bps
23    #[error("Exceeded max fee bps")]
24    ExceedMaxFeeBps = 0x1773,
25    /// 6004 - Invalid admin
26    #[error("Invalid admin")]
27    InvalidAdmin = 0x1774,
28    /// 6005 - Amount is zero
29    #[error("Amount is zero")]
30    AmountIsZero = 0x1775,
31    /// 6006 - Type cast error
32    #[error("Type cast error")]
33    TypeCastFailed = 0x1776,
34    /// 6007 - Invalid activation type
35    #[error("Invalid activation type")]
36    InvalidActivationType = 0x1777,
37    /// 6008 - Invalid quote mint
38    #[error("Invalid quote mint")]
39    InvalidQuoteMint = 0x1778,
40    /// 6009 - Invalid collect fee mode
41    #[error("Invalid collect fee mode")]
42    InvalidCollectFeeMode = 0x1779,
43    /// 6010 - Invalid migration fee option
44    #[error("Invalid migration fee option")]
45    InvalidMigrationFeeOption = 0x177A,
46    /// 6011 - Invalid input
47    #[error("Invalid input")]
48    InvalidInput = 0x177B,
49    /// 6012 - Not enough liquidity
50    #[error("Not enough liquidity")]
51    NotEnoughLiquidity = 0x177C,
52    /// 6013 - Pool is completed
53    #[error("Pool is completed")]
54    PoolIsCompleted = 0x177D,
55    /// 6014 - Pool is incompleted
56    #[error("Pool is incompleted")]
57    PoolIsIncompleted = 0x177E,
58    /// 6015 - Invalid migration option
59    #[error("Invalid migration option")]
60    InvalidMigrationOption = 0x177F,
61    /// 6016 - Invalid activation type
62    #[error("Invalid activation type")]
63    InvalidTokenDecimals = 0x1780,
64    /// 6017 - Invalid token type
65    #[error("Invalid token type")]
66    InvalidTokenType = 0x1781,
67    /// 6018 - Invalid fee percentage
68    #[error("Invalid fee percentage")]
69    InvalidFeePercentage = 0x1782,
70    /// 6019 - Invalid quote threshold
71    #[error("Invalid quote threshold")]
72    InvalidQuoteThreshold = 0x1783,
73    /// 6020 - Invalid token supply
74    #[error("Invalid token supply")]
75    InvalidTokenSupply = 0x1784,
76    /// 6021 - Invalid curve
77    #[error("Invalid curve")]
78    InvalidCurve = 0x1785,
79    /// 6022 - Not permit to do this action
80    #[error("Not permit to do this action")]
81    NotPermitToDoThisAction = 0x1786,
82    /// 6023 - Invalid owner account
83    #[error("Invalid owner account")]
84    InvalidOwnerAccount = 0x1787,
85    /// 6024 - Invalid config account
86    #[error("Invalid config account")]
87    InvalidConfigAccount = 0x1788,
88    /// 6025 - Surplus has been withdraw
89    #[error("Surplus has been withdraw")]
90    SurplusHasBeenWithdraw = 0x1789,
91    /// 6026 - Leftover has been withdraw
92    #[error("Leftover has been withdraw")]
93    LeftoverHasBeenWithdraw = 0x178A,
94    /// 6027 - Total base token is exceeded max supply
95    #[error("Total base token is exceeded max supply")]
96    TotalBaseTokenExceedMaxSupply = 0x178B,
97    /// 6028 - Unsupport native mint token 2022
98    #[error("Unsupport native mint token 2022")]
99    UnsupportNativeMintToken2022 = 0x178C,
100    /// 6029 - Insufficient liquidity for migration
101    #[error("Insufficient liquidity for migration")]
102    InsufficientLiquidityForMigration = 0x178D,
103    /// 6030 - Missing pool config in remaining account
104    #[error("Missing pool config in remaining account")]
105    MissingPoolConfigInRemainingAccount = 0x178E,
106    /// 6031 - Invalid vesting parameters
107    #[error("Invalid vesting parameters")]
108    InvalidVestingParameters = 0x178F,
109    /// 6032 - Invalid leftover address
110    #[error("Invalid leftover address")]
111    InvalidLeftoverAddress = 0x1790,
112    /// 6033 - Swap amount is over a threshold
113    #[error("Swap amount is over a threshold")]
114    SwapAmountIsOverAThreshold = 0x1791,
115    /// 6034 - Invalid fee scheduler
116    #[error("Invalid fee scheduler")]
117    InvalidFeeScheduler = 0x1792,
118    /// 6035 - Invalid creator trading fee percentage
119    #[error("Invalid creator trading fee percentage")]
120    InvalidCreatorTradingFeePercentage = 0x1793,
121    /// 6036 - Invalid new creator
122    #[error("Invalid new creator")]
123    InvalidNewCreator = 0x1794,
124    /// 6037 - Invalid token authority option
125    #[error("Invalid token authority option")]
126    InvalidTokenAuthorityOption = 0x1795,
127    /// 6038 - Invalid account for the instruction
128    #[error("Invalid account for the instruction")]
129    InvalidAccount = 0x1796,
130    /// 6039 - Invalid migrator fee percentage
131    #[error("Invalid migrator fee percentage")]
132    InvalidMigratorFeePercentage = 0x1797,
133    /// 6040 - Migration fee has been withdraw
134    #[error("Migration fee has been withdraw")]
135    MigrationFeeHasBeenWithdraw = 0x1798,
136    /// 6041 - Invalid base fee mode
137    #[error("Invalid base fee mode")]
138    InvalidBaseFeeMode = 0x1799,
139    /// 6042 - Invalid fee rate limiter
140    #[error("Invalid fee rate limiter")]
141    InvalidFeeRateLimiter = 0x179A,
142    /// 6043 - Fail to validate single swap instruction in rate limiter
143    #[error("Fail to validate single swap instruction in rate limiter")]
144    FailToValidateSingleSwapInstruction = 0x179B,
145    /// 6044 - Invalid migrated pool fee params
146    #[error("Invalid migrated pool fee params")]
147    InvalidMigratedPoolFee = 0x179C,
148    /// 6045 - Undertermined error
149    #[error("Undertermined error")]
150    UndeterminedError = 0x179D,
151    /// 6046 - Rate limiter not supported
152    #[error("Rate limiter not supported")]
153    RateLimiterNotSupported = 0x179E,
154    /// 6047 - Amount left is not zero
155    #[error("Amount left is not zero")]
156    AmountLeftIsNotZero = 0x179F,
157    /// 6048 - Next sqrt price is smaller than start sqrt price
158    #[error("Next sqrt price is smaller than start sqrt price")]
159    NextSqrtPriceIsSmallerThanStartSqrtPrice = 0x17A0,
160    /// 6049 - Invalid min base fee
161    #[error("Invalid min base fee")]
162    InvalidMinBaseFee = 0x17A1,
163    /// 6050 - Account invariant violation
164    #[error("Account invariant violation")]
165    AccountInvariantViolation = 0x17A2,
166}
167
168impl From<DynamicBondingCurveError> for solana_program_error::ProgramError {
169    fn from(e: DynamicBondingCurveError) -> Self {
170        solana_program_error::ProgramError::Custom(e as u32)
171    }
172}
173