#![allow(
clippy::all,
clippy::pedantic,
clippy::nursery,
clippy::expect_used,
clippy::unwrap_used,
clippy::indexing_slicing,
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
clippy::mem_forget,
unfulfilled_lint_expectations,
unexpected_cfgs,
unused_imports
)]
use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum SendLaunchpadError {
#[error("Token creation is disabled")]
TokenCreationDisabled = 0x1770,
#[error("Slippage tolerance exceeded")]
SlippageExceeded = 0x1771,
#[error("Already migrated")]
AlreadyMigrated = 0x1772,
#[error("Migration threshold not reached")]
ThresholdNotReached = 0x1773,
#[error(
"Migration threshold reached - trading disabled until migration completes"
)]
ThresholdReached = 0x1774,
#[error("Invalid base mint")]
InvalidBaseMint = 0x1775,
#[error("Invalid quote mint")]
InvalidQuoteMint = 0x1776,
#[error("Bonding curve is not tradeable")]
NotTradeable = 0x1777,
#[error("Invalid status transition")]
InvalidStatusTransition = 0x1778,
#[error("Curve is live")]
CurveIsLive = 0x1779,
#[error("Base mint not found")]
BaseMintNotFound = 0x177A,
#[error("Blocked by held supply")]
BlockedByHeldSupply = 0x177B,
#[error("Invalid coin creator")]
InvalidCoinCreator = 0x177C,
#[error("Invalid authority")]
InvalidAuthority = 0x177D,
#[error("Insufficient balance in source account")]
InsufficientBalance = 0x177E,
#[error("Pool has unclaimed protocol or creator fees")]
PoolFeesOutstanding = 0x177F,
#[error("Program is paused")]
ProgramPaused = 0x1B58,
#[error("Unauthorized")]
Unauthorized = 0x1B59,
#[error("Arithmetic overflow")]
ArithmeticOverflow = 0x1B5A,
#[error("Invalid Pyth price account")]
InvalidPythAccount = 0x1B5B,
#[error("Invalid Pyth feed ID")]
InvalidPythFeed = 0x1B5C,
#[error(
"Invalid slug: must be non-empty, <= max_len bytes, lowercase alphanumeric or underscore"
)]
InvalidSlug = 0x1B5D,
#[error("Text too long")]
TextTooLong = 0x1B5E,
#[error("User token account owned by the wrong token program")]
UserTokenAccountWrongProgram = 0x1B5F,
#[error("User token account is not an initialized token account")]
UserTokenAccountInvalid = 0x1B60,
#[error("User token account mint does not match the trade")]
UserTokenAccountWrongMint = 0x1B61,
#[error("User token account is not owned by the trading user")]
UserTokenAccountWrongAuthority = 0x1B62,
#[error("Nothing to claim")]
NothingToClaim = 0x1B63,
#[error("Creator identity is not a decodable wallet address")]
InvalidCreatorId = 0x1B64,
#[error("Quote mint has no USDC price on its nexus reward state")]
QuoteMintPriceUnset = 0x1B65,
#[error("Token-2022 transfer fee schedule cannot settle the exact amount")]
TransferFeeNotSettleable = 0x1B66,
#[error("Insufficient liquidity")]
InsufficientLiquidity = 0x1BBC,
#[error("Invalid amount")]
InvalidAmount = 0x1BBD,
}
impl From<SendLaunchpadError> for solana_program::program_error::ProgramError {
fn from(e: SendLaunchpadError) -> Self {
solana_program::program_error::ProgramError::Custom(e as u32)
}
}