use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum PumpError {
#[error("The given account is not authorized to execute this instruction.")]
NotAuthorized = 0x1770,
#[error("The program is already initialized.")]
AlreadyInitialized = 0x1771,
#[error("slippage: Too much SOL required to buy the given amount of tokens.")]
TooMuchSolRequired = 0x1772,
#[error("slippage: Too little SOL received to sell the given amount of tokens.")]
TooLittleSolReceived = 0x1773,
#[error("The mint does not match the bonding curve.")]
MintDoesNotMatchBondingCurve = 0x1774,
#[error("The bonding curve has completed and liquidity migrated to raydium.")]
BondingCurveComplete = 0x1775,
#[error("The bonding curve has not completed.")]
BondingCurveNotComplete = 0x1776,
#[error("The program is not initialized.")]
NotInitialized = 0x1777,
#[error("Withdraw too frequent")]
WithdrawTooFrequent = 0x1778,
#[error("new_size should be > current_size")]
NewSizeShouldBeGreaterThanCurrentSize = 0x1779,
#[error("Account type not supported")]
AccountTypeNotSupported = 0x177a,
#[error("initial_real_token_reserves should be less than token_total_supply")]
InitialRealTokenReservesShouldBeLessThanTokenTotalSupply = 0x177b,
#[error("initial_virtual_token_reserves should be greater than initial_real_token_reserves")]
InitialVirtualTokenReservesShouldBeGreaterThanInitialRealTokenReserves = 0x177c,
#[error("fee_basis_points greater than maximum")]
FeeBasisPointsGreaterThanMaximum = 0x177d,
#[error("Withdraw authority cannot be set to System Program ID")]
AllZerosWithdrawAuthority = 0x177e,
#[error("pool_migration_fee should be less than final_real_sol_reserves")]
PoolMigrationFeeShouldBeLessThanFinalRealSolReserves = 0x177f,
#[error("pool_migration_fee should be greater than creator_fee + MAX_MIGRATE_FEES")]
PoolMigrationFeeShouldBeGreaterThanCreatorFeePlusMaxMigrateFees = 0x1780,
#[error("Migrate instruction is disabled")]
DisabledWithdraw = 0x1781,
#[error("Migrate instruction is disabled")]
DisabledMigrate = 0x1782,
#[error("Invalid creator pubkey")]
InvalidCreator = 0x1783,
#[error("Buy zero amount")]
BuyZeroAmount = 0x1784,
#[error("Not enough tokens to buy")]
NotEnoughTokensToBuy = 0x1785,
#[error("Sell zero amount")]
SellZeroAmount = 0x1786,
#[error("Not enough tokens to sell")]
NotEnoughTokensToSell = 0x1787,
#[error("Overflow")]
Overflow = 0x1788,
#[error("Truncation")]
Truncation = 0x1789,
#[error("Division by zero")]
DivisionByZero = 0x178a,
#[error("Not enough remaining accounts")]
NotEnoughRemainingAccounts = 0x178b,
#[error("All fee recipients should be non-zero")]
AllFeeRecipientsShouldBeNonZero = 0x178c,
#[error("Unsorted or not unique fee recipients")]
UnsortedNotUniqueFeeRecipients = 0x178d,
#[error("Creator should not be zero")]
CreatorShouldNotBeZero = 0x178e,
}
#[allow(deprecated)]
impl solana_program_error::PrintProgramError for PumpError {
fn print<E>(&self) {
solana_msg::msg!(&self.to_string());
}
}
#[allow(deprecated)]
impl<T> solana_decode_error::DecodeError<T> for PumpError {
fn type_of() -> &'static str { "PumpError" }
}