sendfun_sdk/launchpad/generated/errors/
send_launchpad.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 SendLaunchpadError {
28 #[error("Token creation is disabled")]
30 TokenCreationDisabled = 0x1770,
31 #[error("Slippage tolerance exceeded")]
33 SlippageExceeded = 0x1771,
34 #[error("Already migrated")]
36 AlreadyMigrated = 0x1772,
37 #[error("Migration threshold not reached")]
39 ThresholdNotReached = 0x1773,
40 #[error(
42 "Migration threshold reached - trading disabled until migration completes"
43 )]
44 ThresholdReached = 0x1774,
45 #[error("Invalid base mint")]
47 InvalidBaseMint = 0x1775,
48 #[error("Invalid quote mint")]
50 InvalidQuoteMint = 0x1776,
51 #[error("Bonding curve is not tradeable")]
53 NotTradeable = 0x1777,
54 #[error("Invalid status transition")]
56 InvalidStatusTransition = 0x1778,
57 #[error("Curve is live")]
59 CurveIsLive = 0x1779,
60 #[error("Base mint not found")]
62 BaseMintNotFound = 0x177A,
63 #[error("Blocked by held supply")]
65 BlockedByHeldSupply = 0x177B,
66 #[error("Invalid coin creator")]
68 InvalidCoinCreator = 0x177C,
69 #[error("Invalid authority")]
71 InvalidAuthority = 0x177D,
72 #[error("Insufficient balance in source account")]
74 InsufficientBalance = 0x177E,
75 #[error("Pool has unclaimed protocol or creator fees")]
77 PoolFeesOutstanding = 0x177F,
78 #[error("Program is paused")]
80 ProgramPaused = 0x1B58,
81 #[error("Unauthorized")]
83 Unauthorized = 0x1B59,
84 #[error("Arithmetic overflow")]
86 ArithmeticOverflow = 0x1B5A,
87 #[error("Invalid Pyth price account")]
89 InvalidPythAccount = 0x1B5B,
90 #[error("Invalid Pyth feed ID")]
92 InvalidPythFeed = 0x1B5C,
93 #[error(
95 "Invalid slug: must be non-empty, <= max_len bytes, lowercase alphanumeric or underscore"
96 )]
97 InvalidSlug = 0x1B5D,
98 #[error("Text too long")]
100 TextTooLong = 0x1B5E,
101 #[error("User token account owned by the wrong token program")]
103 UserTokenAccountWrongProgram = 0x1B5F,
104 #[error("User token account is not an initialized token account")]
106 UserTokenAccountInvalid = 0x1B60,
107 #[error("User token account mint does not match the trade")]
109 UserTokenAccountWrongMint = 0x1B61,
110 #[error("User token account is not owned by the trading user")]
112 UserTokenAccountWrongAuthority = 0x1B62,
113 #[error("Nothing to claim")]
115 NothingToClaim = 0x1B63,
116 #[error("Unused")]
118 Unused7012 = 0x1B64,
119 #[error("Quote mint has no USDC price on its nexus reward state")]
121 QuoteMintPriceUnset = 0x1B65,
122 #[error("Token-2022 transfer fee schedule cannot settle the exact amount")]
124 TransferFeeNotSettleable = 0x1B66,
125 #[error("Creator fee exceeds the partner's maximum")]
127 CreatorFeeTooHigh = 0x1B67,
128 #[error("Creator fee mode is not allowed by the partner config")]
130 CreatorFeeModeNotAllowed = 0x1B68,
131 #[error("Insufficient liquidity")]
133 InsufficientLiquidity = 0x1BBC,
134 #[error("Invalid amount")]
136 InvalidAmount = 0x1BBD,
137}
138
139impl From<SendLaunchpadError> for solana_program::program_error::ProgramError {
140 fn from(e: SendLaunchpadError) -> Self {
141 solana_program::program_error::ProgramError::Custom(e as u32)
142 }
143}