sendfun_sdk/dex/generated/errors/
send_dex.rs1#![allow(
2 clippy::all,
3 clippy::pedantic,
4 clippy::nursery,
5 clippy::expect_used,
6 clippy::unwrap_used,
7 clippy::indexing_slicing,
8 clippy::allow_attributes,
9 clippy::allow_attributes_without_reason,
10 clippy::mem_forget,
11 unfulfilled_lint_expectations,
12 unexpected_cfgs,
13 unused_imports
14)]
15
16use num_derive::FromPrimitive;
24use thiserror::Error;
25
26#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
27pub enum SendDexError {
28 #[error("Pool is paused")]
30 PoolPaused = 0x1770,
31 #[error("Slippage tolerance exceeded")]
33 SlippageExceeded = 0x1771,
34 #[error("Insufficient balance in source account")]
36 InsufficientBalance = 0x1772,
37 #[error("Invalid base mint")]
39 InvalidBaseMint = 0x1773,
40 #[error("Invalid quote mint")]
42 InvalidQuoteMint = 0x1774,
43 #[error("Pool creation is disabled")]
45 PoolCreationDisabled = 0x1775,
46 #[error("Invalid pool state")]
48 InvalidPoolState = 0x1776,
49 #[error("Invalid deposit")]
51 InvalidDeposit = 0x1777,
52 #[error("Invalid pool balance")]
54 InvalidPoolBalance = 0x1778,
55 #[error("Insufficient pool balance")]
57 InsufficientPoolBalance = 0x1779,
58 #[error("Invalid authority")]
60 InvalidAuthority = 0x177A,
61 #[error("creator_hash does not match (creator_platform, creator_id)")]
63 InvalidCreatorHash = 0x177B,
64 #[error("Platform config cannot be the default address")]
66 InvalidPlatformConfig = 0x177C,
67 #[error("Program is paused")]
69 ProgramPaused = 0x1B58,
70 #[error("Unauthorized")]
72 Unauthorized = 0x1B59,
73 #[error("Arithmetic overflow")]
75 ArithmeticOverflow = 0x1B5A,
76 #[error("Invalid Pyth price account")]
78 InvalidPythAccount = 0x1B5B,
79 #[error("Invalid Pyth feed ID")]
81 InvalidPythFeed = 0x1B5C,
82 #[error(
84 "Invalid slug: must be non-empty, <= max_len bytes, lowercase alphanumeric or underscore"
85 )]
86 InvalidSlug = 0x1B5D,
87 #[error("Text too long")]
89 TextTooLong = 0x1B5E,
90 #[error("User token account owned by the wrong token program")]
92 UserTokenAccountWrongProgram = 0x1B5F,
93 #[error("User token account is not an initialized token account")]
95 UserTokenAccountInvalid = 0x1B60,
96 #[error("User token account mint does not match the trade")]
98 UserTokenAccountWrongMint = 0x1B61,
99 #[error("User token account is not owned by the trading user")]
101 UserTokenAccountWrongAuthority = 0x1B62,
102 #[error("Nothing to claim")]
104 NothingToClaim = 0x1B63,
105 #[error("Creator identity is not a decodable wallet address")]
107 InvalidCreatorId = 0x1B64,
108 #[error("Quote mint has no USDC price on its nexus reward state")]
110 QuoteMintPriceUnset = 0x1B65,
111 #[error("Token-2022 transfer fee schedule cannot settle the exact amount")]
113 TransferFeeNotSettleable = 0x1B66,
114 #[error("Insufficient liquidity")]
116 InsufficientLiquidity = 0x1BBC,
117 #[error("Invalid amount")]
119 InvalidAmount = 0x1BBD,
120}
121
122impl From<SendDexError> for solana_program::program_error::ProgramError {
123 fn from(e: SendDexError) -> Self {
124 solana_program::program_error::ProgramError::Custom(e as u32)
125 }
126}