use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum TensorAmmError {
#[error("wrong whitelist")]
WrongWhitelist = 0x2EE0,
#[error("operation not permitted on this pool type")]
WrongPoolType = 0x2EE1,
#[error("fees entered above allowed threshold")]
FeesTooHigh = 0x2EE2,
#[error("delta too large")]
DeltaTooLarge = 0x2EE3,
#[error("arithmetic error")]
ArithmeticError = 0x2EE4,
#[error("specified price not within current price")]
PriceMismatch = 0x2EE5,
#[error("cannot close pool with nfts in escrow -- withdraw all before closing")]
ExistingNfts = 0x2EE6,
#[error("fees not allowed for non-trade pools")]
FeesNotAllowed = 0x2EE7,
#[error("wrong pool version provided")]
WrongPoolVersion = 0x2EE8,
#[error("bad mint proof account")]
BadMintProof = 0x2EE9,
#[error("wrong cosigner")]
WrongCosigner = 0x2EEA,
#[error("bad shared escrow account")]
BadSharedEscrow = 0x2EEB,
#[error("expected a non-shared escrow pool to be passed in")]
PoolOnSharedEscrow = 0x2EEC,
#[error("cannot use shared escrow in NFT pools")]
CannotUseSharedEscrow = 0x2EED,
#[error("max taker sell count exceeded, pool cannot buy anymore NFTs")]
MaxTakerSellCountExceeded = 0x2EEE,
#[error("max taker sell count is too small")]
MaxTakerSellCountTooSmall = 0x2EEF,
#[error("starting price can't be smaller than 1 lamport")]
StartingPriceTooSmall = 0x2EF0,
#[error("Pool must keep minimum rent balance")]
PoolInsufficientRent = 0x2EF1,
#[error("Wrong rent payer")]
WrongRentPayer = 0x2EF2,
#[error("Expiry too large")]
ExpiryTooLarge = 0x2EF3,
#[error("Expired Pool")]
ExpiredPool = 0x2EF4,
#[error("Pool not expired")]
PoolNotExpired = 0x2EF5,
#[error("Invalid pool amount")]
InvalidPoolAmount = 0x2EF6,
#[error("Wrong maker broker account")]
WrongMakerBroker = 0x2EF7,
#[error("Wrong owner")]
WrongOwner = 0x2EF8,
#[error("Escrow program not set")]
EscrowProgramNotSet = 0x2EF9,
#[error("Missing maker broker account")]
MissingMakerBroker = 0x2EFA,
#[error("Missing cosigner account")]
MissingCosigner = 0x2EFB,
#[error("Invalid edition")]
InvalidEdition = 0x2EFC,
}
impl solana_program::program_error::PrintProgramError for TensorAmmError {
fn print<E>(&self) {
solana_program::msg!(&self.to_string());
}
}