use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum RaydiumCpSwapError {
#[error("Not approved")]
NotApproved = 0x1770,
#[error("Input account owner is not the program address")]
InvalidOwner = 0x1771,
#[error("Input token account empty")]
EmptySupply = 0x1772,
#[error("InvalidInput")]
InvalidInput = 0x1773,
#[error("Address of the provided lp token mint is incorrect")]
IncorrectLpMint = 0x1774,
#[error("Exceeds desired slippage limit")]
ExceededSlippage = 0x1775,
#[error("Given pool token amount results in zero trading tokens")]
ZeroTradingTokens = 0x1776,
#[error("Not support token_2022 mint extension")]
NotSupportMint = 0x1777,
#[error("invaild vault")]
InvalidVault = 0x1778,
#[error("Init lp amount is too less(Because 100 amount lp will be locked)")]
InitLpAmountTooLess = 0x1779,
#[error("TransferFee calculate not match")]
TransferFeeCalculateNotMatch = 0x177A,
}
#[allow(deprecated)]
impl solana_program_error::PrintProgramError for RaydiumCpSwapError {
fn print<E>(&self) {
solana_msg::msg!(&self.to_string());
}
}
#[allow(deprecated)]
impl<T> solana_decode_error::DecodeError<T> for RaydiumCpSwapError {
fn type_of() -> &'static str {
"RaydiumCpSwapError"
}
}