raydium_cpmm 0.1.12

raydium client
Documentation
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!

use num_derive::FromPrimitive;
use thiserror::Error;

#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum RaydiumCpSwapError {
    /// 6000 - Not approved
    #[error("Not approved")]
    NotApproved = 0x1770,
    /// 6001 - Input account owner is not the program address
    #[error("Input account owner is not the program address")]
    InvalidOwner = 0x1771,
    /// 6002 - Input token account empty
    #[error("Input token account empty")]
    EmptySupply = 0x1772,
    /// 6003 - InvalidInput
    #[error("InvalidInput")]
    InvalidInput = 0x1773,
    /// 6004 - Address of the provided lp token mint is incorrect
    #[error("Address of the provided lp token mint is incorrect")]
    IncorrectLpMint = 0x1774,
    /// 6005 - Exceeds desired slippage limit
    #[error("Exceeds desired slippage limit")]
    ExceededSlippage = 0x1775,
    /// 6006 - Given pool token amount results in zero trading tokens
    #[error("Given pool token amount results in zero trading tokens")]
    ZeroTradingTokens = 0x1776,
    /// 6007 - Not support token_2022 mint extension
    #[error("Not support token_2022 mint extension")]
    NotSupportMint = 0x1777,
    /// 6008 - invaild vault
    #[error("invaild vault")]
    InvalidVault = 0x1778,
    /// 6009 - Init lp amount is too less(Because 100 amount lp will be locked)
    #[error("Init lp amount is too less(Because 100 amount lp will be locked)")]
    InitLpAmountTooLess = 0x1779,
    /// 6010 - TransferFee calculate not match
    #[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"
    }
}