tensor_amm/generated/errors/
tensor_amm.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum TensorAmmError {
13    /// 12000 - wrong whitelist
14    #[error("wrong whitelist")]
15    WrongWhitelist = 0x2EE0,
16    /// 12001 - operation not permitted on this pool type
17    #[error("operation not permitted on this pool type")]
18    WrongPoolType = 0x2EE1,
19    /// 12002 - fees entered above allowed threshold
20    #[error("fees entered above allowed threshold")]
21    FeesTooHigh = 0x2EE2,
22    /// 12003 - delta too large
23    #[error("delta too large")]
24    DeltaTooLarge = 0x2EE3,
25    /// 12004 - arithmetic error
26    #[error("arithmetic error")]
27    ArithmeticError = 0x2EE4,
28    /// 12005 - specified price not within current price
29    #[error("specified price not within current price")]
30    PriceMismatch = 0x2EE5,
31    /// 12006 - cannot close pool with nfts in escrow -- withdraw all before closing
32    #[error("cannot close pool with nfts in escrow -- withdraw all before closing")]
33    ExistingNfts = 0x2EE6,
34    /// 12007 - fees not allowed for non-trade pools
35    #[error("fees not allowed for non-trade pools")]
36    FeesNotAllowed = 0x2EE7,
37    /// 12008 - wrong pool version provided
38    #[error("wrong pool version provided")]
39    WrongPoolVersion = 0x2EE8,
40    /// 12009 - bad mint proof account
41    #[error("bad mint proof account")]
42    BadMintProof = 0x2EE9,
43    /// 12010 - wrong cosigner
44    #[error("wrong cosigner")]
45    WrongCosigner = 0x2EEA,
46    /// 12011 - bad shared escrow account
47    #[error("bad shared escrow account")]
48    BadSharedEscrow = 0x2EEB,
49    /// 12012 - expected a non-shared escrow pool to be passed in
50    #[error("expected a non-shared escrow pool to be passed in")]
51    PoolOnSharedEscrow = 0x2EEC,
52    /// 12013 - cannot use shared escrow in NFT pools
53    #[error("cannot use shared escrow in NFT pools")]
54    CannotUseSharedEscrow = 0x2EED,
55    /// 12014 - max taker sell count exceeded, pool cannot buy anymore NFTs
56    #[error("max taker sell count exceeded, pool cannot buy anymore NFTs")]
57    MaxTakerSellCountExceeded = 0x2EEE,
58    /// 12015 - max taker sell count is too small
59    #[error("max taker sell count is too small")]
60    MaxTakerSellCountTooSmall = 0x2EEF,
61    /// 12016 - starting price can't be smaller than 1 lamport
62    #[error("starting price can't be smaller than 1 lamport")]
63    StartingPriceTooSmall = 0x2EF0,
64    /// 12017 - Pool must keep minimum rent balance
65    #[error("Pool must keep minimum rent balance")]
66    PoolInsufficientRent = 0x2EF1,
67    /// 12018 - Wrong rent payer
68    #[error("Wrong rent payer")]
69    WrongRentPayer = 0x2EF2,
70    /// 12019 - Expiry too large
71    #[error("Expiry too large")]
72    ExpiryTooLarge = 0x2EF3,
73    /// 12020 - Expired Pool
74    #[error("Expired Pool")]
75    ExpiredPool = 0x2EF4,
76    /// 12021 - Pool not expired
77    #[error("Pool not expired")]
78    PoolNotExpired = 0x2EF5,
79    /// 12022 - Invalid pool amount
80    #[error("Invalid pool amount")]
81    InvalidPoolAmount = 0x2EF6,
82    /// 12023 - Wrong maker broker account
83    #[error("Wrong maker broker account")]
84    WrongMakerBroker = 0x2EF7,
85    /// 12024 - Wrong owner
86    #[error("Wrong owner")]
87    WrongOwner = 0x2EF8,
88    /// 12025 - Escrow program not set
89    #[error("Escrow program not set")]
90    EscrowProgramNotSet = 0x2EF9,
91    /// 12026 - Missing maker broker account
92    #[error("Missing maker broker account")]
93    MissingMakerBroker = 0x2EFA,
94    /// 12027 - Missing cosigner account
95    #[error("Missing cosigner account")]
96    MissingCosigner = 0x2EFB,
97    /// 12028 - Invalid edition
98    #[error("Invalid edition")]
99    InvalidEdition = 0x2EFC,
100}
101
102impl solana_program::program_error::PrintProgramError for TensorAmmError {
103    fn print<E>(&self) {
104        solana_program::msg!(&self.to_string());
105    }
106}