tensor_amm/generated/errors/
tensor_amm.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum TensorAmmError {
13 #[error("wrong whitelist")]
15 WrongWhitelist = 0x2EE0,
16 #[error("operation not permitted on this pool type")]
18 WrongPoolType = 0x2EE1,
19 #[error("fees entered above allowed threshold")]
21 FeesTooHigh = 0x2EE2,
22 #[error("delta too large")]
24 DeltaTooLarge = 0x2EE3,
25 #[error("arithmetic error")]
27 ArithmeticError = 0x2EE4,
28 #[error("specified price not within current price")]
30 PriceMismatch = 0x2EE5,
31 #[error("cannot close pool with nfts in escrow -- withdraw all before closing")]
33 ExistingNfts = 0x2EE6,
34 #[error("fees not allowed for non-trade pools")]
36 FeesNotAllowed = 0x2EE7,
37 #[error("wrong pool version provided")]
39 WrongPoolVersion = 0x2EE8,
40 #[error("bad mint proof account")]
42 BadMintProof = 0x2EE9,
43 #[error("wrong cosigner")]
45 WrongCosigner = 0x2EEA,
46 #[error("bad shared escrow account")]
48 BadSharedEscrow = 0x2EEB,
49 #[error("expected a non-shared escrow pool to be passed in")]
51 PoolOnSharedEscrow = 0x2EEC,
52 #[error("cannot use shared escrow in NFT pools")]
54 CannotUseSharedEscrow = 0x2EED,
55 #[error("max taker sell count exceeded, pool cannot buy anymore NFTs")]
57 MaxTakerSellCountExceeded = 0x2EEE,
58 #[error("max taker sell count is too small")]
60 MaxTakerSellCountTooSmall = 0x2EEF,
61 #[error("starting price can't be smaller than 1 lamport")]
63 StartingPriceTooSmall = 0x2EF0,
64 #[error("Pool must keep minimum rent balance")]
66 PoolInsufficientRent = 0x2EF1,
67 #[error("Wrong rent payer")]
69 WrongRentPayer = 0x2EF2,
70 #[error("Expiry too large")]
72 ExpiryTooLarge = 0x2EF3,
73 #[error("Expired Pool")]
75 ExpiredPool = 0x2EF4,
76 #[error("Pool not expired")]
78 PoolNotExpired = 0x2EF5,
79 #[error("Invalid pool amount")]
81 InvalidPoolAmount = 0x2EF6,
82 #[error("Wrong maker broker account")]
84 WrongMakerBroker = 0x2EF7,
85 #[error("Wrong owner")]
87 WrongOwner = 0x2EF8,
88 #[error("Escrow program not set")]
90 EscrowProgramNotSet = 0x2EF9,
91 #[error("Missing maker broker account")]
93 MissingMakerBroker = 0x2EFA,
94 #[error("Missing cosigner account")]
96 MissingCosigner = 0x2EFB,
97 #[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}