//! 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 StablebondError {
    /// 6000 (0x1770) - Admin does not match admin in config
    #[error("Admin does not match admin in config")]
    AdminConfigMismatch,
    /// 6001 (0x1771) - Admin is not signer
    #[error("Admin is not signer")]
    AdminIsNotSigner,
    /// 6002 (0x1772) - Delegate is not signer
    #[error("Delegate is not signer")]
    DelegateIsNotSigner,
    /// 6003 (0x1773) - User is not signer
    #[error("User is not signer")]
    UserIsNotSigner,
    /// 6004 (0x1774) - Invalid Delegate Address
    #[error("Invalid Delegate Address")]
    InvalidDelegateAddress,
    /// 6005 (0x1775) - Invalid Delegate Owner
    #[error("Invalid Delegate Owner")]
    InvalidDelegateOwner,
    /// 6006 (0x1776) - Invalid Delegate
    #[error("Invalid Delegate")]
    InvalidDelegate,
    /// 6007 (0x1777) - Delegate not initialized
    #[error("Delegate not initialized")]
    DelegateNotInitialized,
    /// 6008 (0x1778) - Delegate already initialized
    #[error("Delegate already initialized")]
    DelegateAlreadyInitialized,
    /// 6009 (0x1779) - Config already initialized
    #[error("Config already initialized")]
    ConfigAlreadyInitialized,
    /// 6010 (0x177A) - Payment already initialized
    #[error("Payment already initialized")]
    PaymentAlreadyInitialized,
    /// 6011 (0x177B) - Payout already initialized
    #[error("Payout already initialized")]
    PayoutAlreadyInitialized,
    /// 6012 (0x177C) - Invalid Config
    #[error("Invalid Config")]
    InvalidConfig,
    /// 6013 (0x177D) - Invalid Config Address
    #[error("Invalid Config Address")]
    InvalidConfigAddress,
    /// 6014 (0x177E) - Invalid Config Owner
    #[error("Invalid Config Owner")]
    InvalidConfigOwner,
    /// 6015 (0x177F) - Mint is not signer
    #[error("Mint is not signer")]
    MintIsNotSigner,
    /// 6016 (0x1780) - Bond not initialized
    #[error("Bond not initialized")]
    BondNotInitialized,
    /// 6017 (0x1781) - Invalid Bond Owner
    #[error("Invalid Bond Owner")]
    InvalidBondOwner,
    /// 6018 (0x1782) - Issuance already initialized
    #[error("Issuance already initialized")]
    IssuanceAlreadyInitialized,
    /// 6019 (0x1783) - Invalid Issuance
    #[error("Invalid Issuance")]
    InvalidIssuance,
    /// 6020 (0x1784) - Invalid Token 2022 Program
    #[error("Invalid Token 2022 Program")]
    InvalidToken2022Program,
    /// 6021 (0x1785) - Invalid Token Program
    #[error("Invalid Token Program")]
    InvalidTokenProgram,
    /// 6022 (0x1786) - Invalid System Program
    #[error("Invalid System Program")]
    InvalidSystemProgram,
    /// 6023 (0x1787) - Invalid interest rate
    #[error("Invalid interest rate")]
    InvalidInterestRate,
    /// 6024 (0x1788) - Invalid mint for bond
    #[error("Invalid mint for bond")]
    InvalidMintForBond,
    /// 6025 (0x1789) - Invalid price feed owner
    #[error("Invalid price feed owner")]
    InvalidPriceFeedOwner,
    /// 6026 (0x178A) - Issuance not initialized
    #[error("Issuance not initialized")]
    IssuanceNotInitialized,
    /// 6027 (0x178B) - Config not initialized
    #[error("Config not initialized")]
    ConfigNotInitialized,
    /// 6028 (0x178C) - Payment not initialized
    #[error("Payment not initialized")]
    PaymentNotInitialized,
    /// 6029 (0x178D) - Payout not initialized
    #[error("Payout not initialized")]
    PayoutNotInitialized,
    /// 6030 (0x178E) - Invalid Payment Address
    #[error("Invalid Payment Address")]
    InvalidPaymentAddress,
    /// 6031 (0x178F) - Invalid Payout Address
    #[error("Invalid Payout Address")]
    InvalidPayoutAddress,
    /// 6032 (0x1790) - Invalid Payout Owner
    #[error("Invalid Payout Owner")]
    InvalidPayoutOwner,
    /// 6033 (0x1791) - Invalid Payment Owner
    #[error("Invalid Payment Owner")]
    InvalidPaymentOwner,
    /// 6034 (0x1792) - Invalid Issuance Owner
    #[error("Invalid Issuance Owner")]
    InvalidIssuanceOwner,
    /// 6035 (0x1793) - Invalid Mint Owner
    #[error("Invalid Mint Owner")]
    InvalidMintOwner,
    /// 6036 (0x1794) - Invalid Issuance Status
    #[error("Invalid Issuance Status")]
    InvalidIssuanceStatus,
    /// 6037 (0x1795) - Invalid Bond Mint
    #[error("Invalid Bond Mint")]
    InvalidBondMint,
    /// 6038 (0x1796) - Invalid Payment Mint
    #[error("Invalid Payment Mint")]
    InvalidBondTokenAccountOwner,
    /// 6039 (0x1797) - Invalid Bond Token Account Owner
    #[error("Invalid Bond Token Account Owner")]
    InvalidPaymentMint,
    /// 6040 (0x1798) - Invalid Payment Token Account Owner
    #[error("Invalid Payment Token Account Owner")]
    InvalidPaymentTokenAccountOwner,
    /// 6041 (0x1799) - Invalid Payment Token Account
    #[error("Invalid Payment Token Account")]
    InvalidPaymentTokenAccount,
    /// 6042 (0x179A) - Invalid Amount
    #[error("Invalid Amount")]
    InvalidAmount,
    /// 6043 (0x179B) - Oracle Not Configured
    #[error("Oracle Not Configured")]
    OracleNotConfigured,
    /// 6044 (0x179C) - Invalid Oracle
    #[error("Invalid Oracle")]
    InvalidOracleAccount,
    /// 6045 (0x179D) - Unsupported Oracle
    #[error("Unsupported Oracle")]
    UnsupportedOracle,
    /// 6046 (0x179E) - Stale Oracle
    #[error("Stale Oracle")]
    StaleOracle,
    /// 6047 (0x179F) - Math Overflow
    #[error("Math Overflow")]
    MathOverflow,
    /// 6048 (0x17A0) - Unable To Get Clock
    #[error("Unable To Get Clock")]
    UnableToGetClock,
    /// 6049 (0x17A1) - Not Enough Liquidity
    #[error("Not Enough Liquidity")]
    NotEnoughLiquidity,
    /// 6050 (0x17A2) - IssuancePastCutoffTime
    #[error("IssuancePastCutoffTime")]
    IssuancePastCutoffTime,
    /// 6051 (0x17A3) - Issuance Not Started
    #[error("Issuance Not Started")]
    IssuanceNotStarted,
    /// 6052 (0x17A4) - Invalid NFT Issuance Vault Owner
    #[error("Invalid NFT Issuance Vault Owner")]
    InvalidNftIssuanceVaultOwner,
    /// 6053 (0x17A5) - Invalid NFT Issuance Vault
    #[error("Invalid NFT Issuance Vault")]
    InvalidNftIssuanceVault,
    /// 6054 (0x17A6) - Failed To Create Nft Collection
    #[error("Failed To Create Nft Collection")]
    FailedToCreateNftCollection,
    /// 6055 (0x17A7) - No Redemptions Requested
    #[error("No Redemptions Requested")]
    NoRedemptionsRequested,
}

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