meteora-sol 0.1.9

Meteora DLMM
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 LbClmmError {
    /// 6000 - Invalid start bin index
    #[error("Invalid start bin index")]
    InvalidStartBinIndex = 0x1770,
    /// 6001 - Invalid bin id
    #[error("Invalid bin id")]
    InvalidBinId = 0x1771,
    /// 6002 - Invalid input data
    #[error("Invalid input data")]
    InvalidInput = 0x1772,
    /// 6003 - Exceeded amount slippage tolerance
    #[error("Exceeded amount slippage tolerance")]
    ExceededAmountSlippageTolerance = 0x1773,
    /// 6004 - Exceeded bin slippage tolerance
    #[error("Exceeded bin slippage tolerance")]
    ExceededBinSlippageTolerance = 0x1774,
    /// 6005 - Composition factor flawed
    #[error("Composition factor flawed")]
    CompositionFactorFlawed = 0x1775,
    /// 6006 - Non preset bin step
    #[error("Non preset bin step")]
    NonPresetBinStep = 0x1776,
    /// 6007 - Zero liquidity
    #[error("Zero liquidity")]
    ZeroLiquidity = 0x1777,
    /// 6008 - Invalid position
    #[error("Invalid position")]
    InvalidPosition = 0x1778,
    /// 6009 - Bin array not found
    #[error("Bin array not found")]
    BinArrayNotFound = 0x1779,
    /// 6010 - Invalid token mint
    #[error("Invalid token mint")]
    InvalidTokenMint = 0x177A,
    /// 6011 - Invalid account for single deposit
    #[error("Invalid account for single deposit")]
    InvalidAccountForSingleDeposit = 0x177B,
    /// 6012 - Pair insufficient liquidity
    #[error("Pair insufficient liquidity")]
    PairInsufficientLiquidity = 0x177C,
    /// 6013 - Invalid fee owner
    #[error("Invalid fee owner")]
    InvalidFeeOwner = 0x177D,
    /// 6014 - Invalid fee withdraw amount
    #[error("Invalid fee withdraw amount")]
    InvalidFeeWithdrawAmount = 0x177E,
    /// 6015 - Invalid admin
    #[error("Invalid admin")]
    InvalidAdmin = 0x177F,
    /// 6016 - Identical fee owner
    #[error("Identical fee owner")]
    IdenticalFeeOwner = 0x1780,
    /// 6017 - Invalid basis point
    #[error("Invalid basis point")]
    InvalidBps = 0x1781,
    /// 6018 - Math operation overflow
    #[error("Math operation overflow")]
    MathOverflow = 0x1782,
    /// 6019 - Type cast error
    #[error("Type cast error")]
    TypeCastFailed = 0x1783,
    /// 6020 - Invalid reward index
    #[error("Invalid reward index")]
    InvalidRewardIndex = 0x1784,
    /// 6021 - Invalid reward duration
    #[error("Invalid reward duration")]
    InvalidRewardDuration = 0x1785,
    /// 6022 - Reward already initialized
    #[error("Reward already initialized")]
    RewardInitialized = 0x1786,
    /// 6023 - Reward not initialized
    #[error("Reward not initialized")]
    RewardUninitialized = 0x1787,
    /// 6024 - Identical funder
    #[error("Identical funder")]
    IdenticalFunder = 0x1788,
    /// 6025 - Reward campaign in progress
    #[error("Reward campaign in progress")]
    RewardCampaignInProgress = 0x1789,
    /// 6026 - Reward duration is the same
    #[error("Reward duration is the same")]
    IdenticalRewardDuration = 0x178A,
    /// 6027 - Invalid bin array
    #[error("Invalid bin array")]
    InvalidBinArray = 0x178B,
    /// 6028 - Bin arrays must be continuous
    #[error("Bin arrays must be continuous")]
    NonContinuousBinArrays = 0x178C,
    /// 6029 - Invalid reward vault
    #[error("Invalid reward vault")]
    InvalidRewardVault = 0x178D,
    /// 6030 - Position is not empty
    #[error("Position is not empty")]
    NonEmptyPosition = 0x178E,
    /// 6031 - Unauthorized access
    #[error("Unauthorized access")]
    UnauthorizedAccess = 0x178F,
    /// 6032 - Invalid fee parameter
    #[error("Invalid fee parameter")]
    InvalidFeeParameter = 0x1790,
    /// 6033 - Missing oracle account
    #[error("Missing oracle account")]
    MissingOracle = 0x1791,
    /// 6034 - Insufficient observation sample
    #[error("Insufficient observation sample")]
    InsufficientSample = 0x1792,
    /// 6035 - Invalid lookup timestamp
    #[error("Invalid lookup timestamp")]
    InvalidLookupTimestamp = 0x1793,
    /// 6036 - Bitmap extension account is not provided
    #[error("Bitmap extension account is not provided")]
    BitmapExtensionAccountIsNotProvided = 0x1794,
    /// 6037 - Cannot find non-zero liquidity binArrayId
    #[error("Cannot find non-zero liquidity binArrayId")]
    CannotFindNonZeroLiquidityBinArrayId = 0x1795,
    /// 6038 - Bin id out of bound
    #[error("Bin id out of bound")]
    BinIdOutOfBound = 0x1796,
    /// 6039 - Insufficient amount in for minimum out
    #[error("Insufficient amount in for minimum out")]
    InsufficientOutAmount = 0x1797,
    /// 6040 - Invalid position width
    #[error("Invalid position width")]
    InvalidPositionWidth = 0x1798,
    /// 6041 - Excessive fee update
    #[error("Excessive fee update")]
    ExcessiveFeeUpdate = 0x1799,
    /// 6042 - Pool disabled
    #[error("Pool disabled")]
    PoolDisabled = 0x179A,
    /// 6043 - Invalid pool type
    #[error("Invalid pool type")]
    InvalidPoolType = 0x179B,
    /// 6044 - Whitelist for wallet is full
    #[error("Whitelist for wallet is full")]
    ExceedMaxWhitelist = 0x179C,
    /// 6045 - Invalid index
    #[error("Invalid index")]
    InvalidIndex = 0x179D,
    /// 6046 - Reward not ended
    #[error("Reward not ended")]
    RewardNotEnded = 0x179E,
    /// 6047 - Must withdraw ineligible reward
    #[error("Must withdraw ineligible reward")]
    MustWithdrawnIneligibleReward = 0x179F,
    /// 6048 - Unauthorized address
    #[error("Unauthorized address")]
    UnauthorizedAddress = 0x17A0,
    /// 6049 - Cannot update because operators are the same
    #[error("Cannot update because operators are the same")]
    OperatorsAreTheSame = 0x17A1,
    /// 6050 - Withdraw to wrong token account
    #[error("Withdraw to wrong token account")]
    WithdrawToWrongTokenAccount = 0x17A2,
    /// 6051 - Wrong rent receiver
    #[error("Wrong rent receiver")]
    WrongRentReceiver = 0x17A3,
    /// 6052 - Already activated
    #[error("Already activated")]
    AlreadyPassActivationPoint = 0x17A4,
    /// 6053 - Swapped amount is exceeded max swapped amount
    #[error("Swapped amount is exceeded max swapped amount")]
    ExceedMaxSwappedAmount = 0x17A5,
    /// 6054 - Invalid strategy parameters
    #[error("Invalid strategy parameters")]
    InvalidStrategyParameters = 0x17A6,
    /// 6055 - Liquidity locked
    #[error("Liquidity locked")]
    LiquidityLocked = 0x17A7,
    /// 6056 - Bin range is not empty
    #[error("Bin range is not empty")]
    BinRangeIsNotEmpty = 0x17A8,
    /// 6057 - Amount out is not matched with exact amount out
    #[error("Amount out is not matched with exact amount out")]
    NotExactAmountOut = 0x17A9,
    /// 6058 - Invalid activation type
    #[error("Invalid activation type")]
    InvalidActivationType = 0x17AA,
    /// 6059 - Invalid activation duration
    #[error("Invalid activation duration")]
    InvalidActivationDuration = 0x17AB,
    /// 6060 - Missing token amount as token launch owner proof
    #[error("Missing token amount as token launch owner proof")]
    MissingTokenAmountAsTokenLaunchProof = 0x17AC,
    /// 6061 - Quote token must be SOL or USDC
    #[error("Quote token must be SOL or USDC")]
    InvalidQuoteToken = 0x17AD,
    /// 6062 - Invalid bin step
    #[error("Invalid bin step")]
    InvalidBinStep = 0x17AE,
    /// 6063 - Invalid base fee
    #[error("Invalid base fee")]
    InvalidBaseFee = 0x17AF,
    /// 6064 - Invalid pre-activation duration
    #[error("Invalid pre-activation duration")]
    InvalidPreActivationDuration = 0x17B0,
    /// 6065 - Already pass pre-activation swap point
    #[error("Already pass pre-activation swap point")]
    AlreadyPassPreActivationSwapPoint = 0x17B1,
    /// 6066 - Invalid status
    #[error("Invalid status")]
    InvalidStatus = 0x17B2,
    /// 6067 - Exceed max oracle length
    #[error("Exceed max oracle length")]
    ExceededMaxOracleLength = 0x17B3,
    /// 6068 - Invalid minimum liquidity
    #[error("Invalid minimum liquidity")]
    InvalidMinimumLiquidity = 0x17B4,
    /// 6069 - Not support token_2022 mint extension
    #[error("Not support token_2022 mint extension")]
    NotSupportMint = 0x17B5,
    /// 6070 - Unsupported mint extension
    #[error("Unsupported mint extension")]
    UnsupportedMintExtension = 0x17B6,
    /// 6071 - Unsupported native mint token2022
    #[error("Unsupported native mint token2022")]
    UnsupportNativeMintToken2022 = 0x17B7,
    /// 6072 - Unmatch token mint
    #[error("Unmatch token mint")]
    UnmatchTokenMint = 0x17B8,
    /// 6073 - Unsupported token mint
    #[error("Unsupported token mint")]
    UnsupportedTokenMint = 0x17B9,
    /// 6074 - Insufficient remaining accounts
    #[error("Insufficient remaining accounts")]
    InsufficientRemainingAccounts = 0x17BA,
    /// 6075 - Invalid remaining account slice
    #[error("Invalid remaining account slice")]
    InvalidRemainingAccountSlice = 0x17BB,
    /// 6076 - Duplicated remaining account types
    #[error("Duplicated remaining account types")]
    DuplicatedRemainingAccountTypes = 0x17BC,
    /// 6077 - Missing remaining account for transfer hook
    #[error("Missing remaining account for transfer hook")]
    MissingRemainingAccountForTransferHook = 0x17BD,
    /// 6078 - Remaining account was passed for transfer hook but there's no hook program
    #[error("Remaining account was passed for transfer hook but there's no hook program")]
    NoTransferHookProgram = 0x17BE,
    /// 6079 - Zero funded amount
    #[error("Zero funded amount")]
    ZeroFundedAmount = 0x17BF,
    /// 6080 - Invalid side
    #[error("Invalid side")]
    InvalidSide = 0x17C0,
    /// 6081 - Invalid resize length
    #[error("Invalid resize length")]
    InvalidResizeLength = 0x17C1,
    /// 6082 - Not support at the moment
    #[error("Not support at the moment")]
    NotSupportAtTheMoment = 0x17C2,
}

#[allow(deprecated)]
impl solana_program_error::PrintProgramError for LbClmmError {
    fn print<E>(&self) {
        solana_msg::msg!(&self.to_string());
    }
}

#[allow(deprecated)]
impl<T> solana_decode_error::DecodeError<T> for LbClmmError {
    fn type_of() -> &'static str {
        "LbClmmError"
    }
}