use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum MallowAuctionError {
#[error("Bump seed not in hash map")]
BumpSeedNotInHashMap = 0x1770,
#[error("Invalid start/end date")]
InvalidDates = 0x1771,
#[error("Auction has a bid")]
AuctionHasBid = 0x1772,
#[error("Auction has no bid")]
AuctionHasNoBid = 0x1773,
#[error("Auction has not started")]
AuctionNotStarted = 0x1774,
#[error("Auction has ended")]
AuctionEnded = 0x1775,
#[error("Auction has not ended")]
AuctionNotEnded = 0x1776,
#[error("Bid too low")]
BidTooLow = 0x1777,
#[error("Invalid bidder")]
InvalidBidder = 0x1778,
#[error("Creator not found")]
CreatorNotFound = 0x1779,
#[error("Invalid royalty")]
InvalidRoyalty = 0x177A,
#[error("Associated token address not found")]
ATANotFound = 0x177B,
#[error("Invalid bid mint token account")]
InvalidBidMintTokenAccount = 0x177C,
#[error("Invalid auction config bid token account")]
InvalidAuctionConfigBidTokenAccount = 0x177D,
#[error("Invalid reduced fee whitelist account")]
InvalidFeeSchedule = 0x177E,
#[error("Invalid metadata account")]
InvalidMetadataAccount = 0x177F,
#[error("Invalid argument")]
InvalidArg = 0x1780,
#[error("Invalid payee shares")]
InvalidPayeeShares = 0x1781,
#[error("Invalid bid mint")]
InvalidBidMint = 0x1782,
#[error("Invalid PDA transfer source")]
InvalidPDATransferSource = 0x1783,
#[error("Invalid PDA transfer destination")]
InvalidPDATransferDestination = 0x1784,
#[error("Invalid public key")]
PublicKeyMismatch = 0x1785,
#[error("Incorrect owner")]
IncorrectOwner = 0x1786,
#[error("Account not initialized")]
UninitializedAccount = 0x1787,
#[error("Invalid duration")]
InvalidDuration = 0x1788,
#[error("Invalid reserve price")]
InvalidReservePrice = 0x1789,
#[error("Invalid authority")]
InvalidAuthority = 0x178A,
#[error("Invalid fee account")]
InvalidFeeAccount = 0x178B,
#[error("Auction is paused")]
AuctionPaused = 0x178C,
#[error("Wrong ix type for settle")]
WrongSettleIx = 0x178D,
#[error("Already acknowledged")]
AlreadyAcknowledged = 0x178E,
#[error("Invalid marketplace authority")]
InvalidMarketplaceAuthority = 0x178F,
#[error("Cannot burn on complete")]
InvalidBurnOnComplete = 0x1790,
#[error("Invalid payer")]
InvalidPayer = 0x1791,
}
impl From<MallowAuctionError> for solana_program_error::ProgramError {
fn from(e: MallowAuctionError) -> Self {
solana_program_error::ProgramError::Custom(e as u32)
}
}