Skip to main content

sendfun_sdk/dex/generated/errors/
send_dex.rs

1#![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
16//! This code was AUTOGENERATED using the codama library.
17//! Please DO NOT EDIT THIS FILE, instead use visitors
18//! to add features, then rerun codama to update it.
19//!
20//! <https://github.com/codama-idl/codama>
21//!
22
23use num_derive::FromPrimitive;
24use thiserror::Error;
25
26#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
27pub enum SendDexError {
28	/// 6000 - Pool is paused
29	#[error("Pool is paused")]
30	PoolPaused = 0x1770,
31	/// 6001 - Slippage tolerance exceeded
32	#[error("Slippage tolerance exceeded")]
33	SlippageExceeded = 0x1771,
34	/// 6002 - Insufficient balance in source account
35	#[error("Insufficient balance in source account")]
36	InsufficientBalance = 0x1772,
37	/// 6003 - Invalid base mint
38	#[error("Invalid base mint")]
39	InvalidBaseMint = 0x1773,
40	/// 6004 - Invalid quote mint
41	#[error("Invalid quote mint")]
42	InvalidQuoteMint = 0x1774,
43	/// 6005 - Pool creation is disabled
44	#[error("Pool creation is disabled")]
45	PoolCreationDisabled = 0x1775,
46	/// 6006 - Invalid pool state
47	#[error("Invalid pool state")]
48	InvalidPoolState = 0x1776,
49	/// 6007 - Invalid deposit
50	#[error("Invalid deposit")]
51	InvalidDeposit = 0x1777,
52	/// 6008 - Invalid pool balance
53	#[error("Invalid pool balance")]
54	InvalidPoolBalance = 0x1778,
55	/// 6009 - Insufficient pool balance
56	#[error("Insufficient pool balance")]
57	InsufficientPoolBalance = 0x1779,
58	/// 6010 - Invalid authority
59	#[error("Invalid authority")]
60	InvalidAuthority = 0x177A,
61	/// 6011 - creator_hash does not match (creator_platform, creator_id)
62	#[error("creator_hash does not match (creator_platform, creator_id)")]
63	InvalidCreatorHash = 0x177B,
64	/// 6012 - Platform config cannot be the default address
65	#[error("Platform config cannot be the default address")]
66	InvalidPlatformConfig = 0x177C,
67	/// 7000 - Program is paused
68	#[error("Program is paused")]
69	ProgramPaused = 0x1B58,
70	/// 7001 - Unauthorized
71	#[error("Unauthorized")]
72	Unauthorized = 0x1B59,
73	/// 7002 - Arithmetic overflow
74	#[error("Arithmetic overflow")]
75	ArithmeticOverflow = 0x1B5A,
76	/// 7003 - Invalid Pyth price account
77	#[error("Invalid Pyth price account")]
78	InvalidPythAccount = 0x1B5B,
79	/// 7004 - Invalid Pyth feed ID
80	#[error("Invalid Pyth feed ID")]
81	InvalidPythFeed = 0x1B5C,
82	/// 7005 - Invalid slug: must be non-empty, <= max_len bytes, lowercase alphanumeric or underscore
83	#[error(
84		"Invalid slug: must be non-empty, <= max_len bytes, lowercase alphanumeric or underscore"
85	)]
86	InvalidSlug = 0x1B5D,
87	/// 7006 - Text too long
88	#[error("Text too long")]
89	TextTooLong = 0x1B5E,
90	/// 7007 - User token account owned by the wrong token program
91	#[error("User token account owned by the wrong token program")]
92	UserTokenAccountWrongProgram = 0x1B5F,
93	/// 7008 - User token account is not an initialized token account
94	#[error("User token account is not an initialized token account")]
95	UserTokenAccountInvalid = 0x1B60,
96	/// 7009 - User token account mint does not match the trade
97	#[error("User token account mint does not match the trade")]
98	UserTokenAccountWrongMint = 0x1B61,
99	/// 7010 - User token account is not owned by the trading user
100	#[error("User token account is not owned by the trading user")]
101	UserTokenAccountWrongAuthority = 0x1B62,
102	/// 7011 - Nothing to claim
103	#[error("Nothing to claim")]
104	NothingToClaim = 0x1B63,
105	/// 7012 - Creator identity is not a decodable wallet address
106	#[error("Creator identity is not a decodable wallet address")]
107	InvalidCreatorId = 0x1B64,
108	/// 7013 - Quote mint has no USDC price on its nexus reward state
109	#[error("Quote mint has no USDC price on its nexus reward state")]
110	QuoteMintPriceUnset = 0x1B65,
111	/// 7014 - Token-2022 transfer fee schedule cannot settle the exact amount
112	#[error("Token-2022 transfer fee schedule cannot settle the exact amount")]
113	TransferFeeNotSettleable = 0x1B66,
114	/// 7100 - Insufficient liquidity
115	#[error("Insufficient liquidity")]
116	InsufficientLiquidity = 0x1BBC,
117	/// 7101 - Invalid amount
118	#[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}