mpl-distro 0.2.0

Program for creating token distributions
Documentation
//! This code was AUTOGENERATED using the kinobi library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//!
//! [https://github.com/metaplex-foundation/kinobi]
//!

use num_derive::FromPrimitive;
use thiserror::Error;

#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum MplDistroError {
    /// 0 (0x0) - Invalid System Program
    #[error("Invalid System Program")]
    InvalidSystemProgram,
    /// 1 (0x1) - Error deserializing account
    #[error("Error deserializing account")]
    DeserializationError,
    /// 2 (0x2) - Error serializing account
    #[error("Error serializing account")]
    SerializationError,
    /// 3 (0x3) - Invalid Distribution PDA Derivation
    #[error("Invalid Distribution PDA Derivation")]
    InvalidDistributionPdaDerivation,
    /// 4 (0x4) - Invalid Spl Token Program
    #[error("Invalid Spl Token Program")]
    InvalidSplTokenProgram,
    /// 5 (0x5) - Invalid Fee Wallet
    #[error("Invalid Fee Wallet")]
    InvalidFeeWallet,
    /// 6 (0x6) - Invalid Token Program
    #[error("Invalid Token Program")]
    InvalidTokenProgram,
    /// 7 (0x7) - Invalid Associated Token Program
    #[error("Invalid Associated Token Program")]
    InvalidAssociatedTokenProgram,
    /// 8 (0x8) - Invalid Distribution Account Owner
    #[error("Invalid Distribution Account Owner")]
    InvalidDistributionAccountOwner,
    /// 9 (0x9) - The distribution has already started
    #[error("The distribution has already started")]
    DistributionStarted,
    /// 10 (0xA) - Invalid Mint
    #[error("Invalid Mint")]
    InvalidMint,
    /// 11 (0xB) - Invalid Distribution Authority
    #[error("Invalid Distribution Authority")]
    InvalidDistributionAuthority,
    /// 12 (0xC) - Invalid Payer Token Account
    #[error("Invalid Payer Token Account")]
    InvalidPayerTokenAccount,
    /// 13 (0xD) - Invalid Distribution Token Account
    #[error("Invalid Distribution Token Account")]
    InvalidDistributionTokenAccount,
    /// 14 (0xE) - The distribution has not started yet
    #[error("The distribution has not started yet")]
    DistributionNotStarted,
    /// 15 (0xF) - The distribution has ended
    #[error("The distribution has ended")]
    DistributionEnded,
    /// 16 (0x10) - Invalid Recipient Token Account
    #[error("Invalid Recipient Token Account")]
    InvalidRecipientTokenAccount,
    /// 17 (0x11) - Invalid Claim Proof
    #[error("Invalid Claim Proof")]
    InvalidClaimProof,
    /// 18 (0x12) - The tokens have already been claimed by this recipient
    #[error("The tokens have already been claimed by this recipient")]
    AlreadyClaimed,
    /// 19 (0x13) - Invalid Claim Receipt PDA Derivation
    #[error("Invalid Claim Receipt PDA Derivation")]
    InvalidClaimReceiptPdaDerivation,
    /// 20 (0x14) - End time must be after start time
    #[error("End time must be after start time")]
    InvalidDistributionTimeRange,
    /// 21 (0x15) - Name must be 32 bytes or less
    #[error("Name must be 32 bytes or less")]
    NameTooLong,
    /// 22 (0x16) - Invalid Depositor Token Account
    #[error("Invalid Depositor Token Account")]
    InvalidDepositorTokenAccount,
    /// 23 (0x17) - Mint must be owned by the SPL Token Program
    #[error("Mint must be owned by the SPL Token Program")]
    InvalidMintOwner,
    /// 24 (0x18) - Cannot withdraw funds while distribution is active
    #[error("Cannot withdraw funds while distribution is active")]
    CannotWithdrawDuringActiveDistribution,
    /// 25 (0x19) - Arithmetic operation overflowed
    #[error("Arithmetic operation overflowed")]
    ArithmeticOverflow,
    /// 26 (0x1A) - Insufficient funds in distribution to fulfill claim amount
    #[error("Insufficient funds in distribution to fulfill claim amount")]
    InsufficientFunds,
    /// 27 (0x1B) - Tree height exceeds maximum supported height
    #[error("Tree height exceeds maximum supported height")]
    InvalidTreeHeight,
    /// 28 (0x1C) - Invalid Payer
    #[error("Invalid Payer")]
    InvalidPayer,
    /// 29 (0x1D) - Insufficient funds in Distribution to subsidize receipts
    #[error("Insufficient funds in Distribution to subsidize receipts")]
    InsufficientFundsToSubsidizeReceipts,
    /// 30 (0x1E) - Invalid NFT Mint
    #[error("Invalid NFT Mint")]
    InvalidNftMint,
    /// 31 (0x1F) - Invalid NFT Amount
    #[error("Invalid NFT Amount")]
    InvalidNftAmount,
    /// 32 (0x20) - Invalid NFT Owner
    #[error("Invalid NFT Owner")]
    InvalidNftOwner,
    /// 33 (0x21) - Recipient must sign
    #[error("Recipient must sign")]
    RecipientMustSign,
    /// 34 (0x22) - Distribution authority must sign
    #[error("Distribution authority must sign")]
    DistributionAuthorityMustSign,
    /// 35 (0x23) - Invalid Distribution Type
    #[error("Invalid Distribution Type")]
    InvalidDistributionType,
    /// 36 (0x24) - Invalid NFT Token Account Owner
    #[error("Invalid NFT Token Account Owner")]
    InvalidNftTokenAccountOwner,
    /// 37 (0x25) - Insufficient funds in distribution to withdraw requested SOL amount
    #[error("Insufficient funds in distribution to withdraw requested SOL amount")]
    InsufficientFundsToWithdrawSol,
    /// 38 (0x26) - Distribution does not subsidize receipts
    #[error("Distribution does not subsidize receipts")]
    DistributionDoesNotSubsidizeReceipts,
    /// 39 (0x27) - Cannot withdraw while distribution is active
    #[error("Cannot withdraw while distribution is active")]
    CannotWithdrawWhileActive,
    /// 40 (0x28) - Invalid distributor for this distribution
    #[error("Invalid distributor for this distribution")]
    InvalidDistributor,
}

impl solana_program::program_error::PrintProgramError for MplDistroError {
    fn print<E>(&self) {
        solana_program::msg!(&self.to_string());
    }
}