Skip to main content

sendfun_sdk/nexus/generated/errors/
send_nexus.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 SendNexusError {
28	/// 6000 - Insufficient stake balance
29	#[error("Insufficient stake balance")]
30	InsufficientStake = 0x1770,
31	/// 6001 - Invalid reward mint
32	#[error("Invalid reward mint")]
33	InvalidRewardMint = 0x1771,
34	/// 6002 - Invalid vault
35	#[error("Invalid vault")]
36	InvalidVault = 0x1772,
37	/// 6005 - Staking already enabled
38	#[error("Staking already enabled")]
39	StakingAlreadyEnabled = 0x1775,
40	/// 6006 - Staking not enabled
41	#[error("Staking not enabled")]
42	StakingNotEnabled = 0x1776,
43	/// 6007 - Invalid staking mint
44	#[error("Invalid staking mint")]
45	InvalidStakingMint = 0x1777,
46	/// 6008 - Invalid reward state
47	#[error("Invalid reward state")]
48	InvalidRewardState = 0x1778,
49	/// 6009 - Invalid mint
50	#[error("Invalid mint")]
51	InvalidMint = 0x1779,
52	/// 6010 - Invalid destination account
53	#[error("Invalid destination account")]
54	InvalidDestination = 0x177A,
55	/// 6011 - Staking mint already bound
56	#[error("Staking mint already bound")]
57	StakingMintAlreadyBound = 0x177B,
58	/// 6012 - Invalid fee configuration
59	#[error("Invalid fee configuration")]
60	InvalidFeePreset = 0x177C,
61	/// 6013 - Invalid preset index
62	#[error("Invalid preset index")]
63	InvalidPresetIndex = 0x177D,
64	/// 6014 - Must provide either fee_preset or custom fees
65	#[error("Must provide either fee_preset or custom fees")]
66	MissingFeeSource = 0x177E,
67	/// 6015 - Cannot specify both fee_preset and custom_fees
68	#[error("Cannot specify both fee_preset and custom_fees")]
69	AmbiguousFeeSource = 0x177F,
70	/// 6016 - Partner name cannot be empty
71	#[error("Partner name cannot be empty")]
72	InvalidPartnerName = 0x1780,
73	/// 6017 - Partner account does not use this preset
74	#[error("Partner account does not use this preset")]
75	PartnerNotOnPreset = 0x1781,
76	/// 6018 - Invalid partner note
77	#[error("Invalid partner note")]
78	InvalidPartnerNote = 0x1782,
79	/// 6019 - Invalid preset name
80	#[error("Invalid preset name")]
81	InvalidPresetName = 0x1783,
82	/// 6020 - Too many auth platforms (max 255)
83	#[error("Too many auth platforms (max 255)")]
84	TooManyAuthPlatforms = 0x1784,
85	/// 6021 - Invalid auth platform index
86	#[error("Invalid auth platform index")]
87	InvalidAuthPlatformIndex = 0x1785,
88	/// 6022 - Invalid auth platform name
89	#[error("Invalid auth platform name")]
90	InvalidAuthPlatformName = 0x1786,
91	/// 6023 - Duplicate auth platform name
92	#[error("Duplicate auth platform name")]
93	DuplicateAuthPlatformName = 0x1787,
94	/// 6024 - Invalid authority
95	#[error("Invalid authority")]
96	InvalidAuthority = 0x1788,
97	/// 6025 - Cannot add the default partner
98	#[error("Cannot add the default partner")]
99	ReservedPartner = 0x1789,
100	/// 6026 - Invalid reward accrual
101	#[error("Invalid reward accrual")]
102	InvalidRewardAccrual = 0x178A,
103	/// 6027 - Settle every reward mint before staking or unstaking - call settle for each registered mint
104	#[error(
105		"Settle every reward mint before staking or unstaking - call settle for each registered mint"
106	)]
107	RewardsNotSettled = 0x178B,
108	/// 6028 - USDC price must be non-zero - 0 means no price
109	#[error("USDC price must be non-zero - 0 means no price")]
110	InvalidUsdcPrice = 0x178C,
111	/// 6029 - Platform config cannot be the default address
112	#[error("Platform config cannot be the default address")]
113	InvalidPlatformConfig = 0x178D,
114	/// 6030 - Partner config address does not match its stored seeds
115	#[error("Partner config address does not match its stored seeds")]
116	InvalidPartnerConfig = 0x178E,
117	/// 6031 - Fee preset belongs to a different platform
118	#[error("Fee preset belongs to a different platform")]
119	PresetPlatformMismatch = 0x178F,
120	/// 7000 - Program is paused
121	#[error("Program is paused")]
122	ProgramPaused = 0x1B58,
123	/// 7001 - Unauthorized
124	#[error("Unauthorized")]
125	Unauthorized = 0x1B59,
126	/// 7002 - Arithmetic overflow
127	#[error("Arithmetic overflow")]
128	ArithmeticOverflow = 0x1B5A,
129	/// 7003 - Invalid Pyth price account
130	#[error("Invalid Pyth price account")]
131	InvalidPythAccount = 0x1B5B,
132	/// 7004 - Invalid Pyth feed ID
133	#[error("Invalid Pyth feed ID")]
134	InvalidPythFeed = 0x1B5C,
135	/// 7005 - Invalid slug: must be non-empty, <= max_len bytes, lowercase alphanumeric or underscore
136	#[error(
137		"Invalid slug: must be non-empty, <= max_len bytes, lowercase alphanumeric or underscore"
138	)]
139	InvalidSlug = 0x1B5D,
140	/// 7006 - Text too long
141	#[error("Text too long")]
142	TextTooLong = 0x1B5E,
143	/// 7007 - User token account owned by the wrong token program
144	#[error("User token account owned by the wrong token program")]
145	UserTokenAccountWrongProgram = 0x1B5F,
146	/// 7008 - User token account is not an initialized token account
147	#[error("User token account is not an initialized token account")]
148	UserTokenAccountInvalid = 0x1B60,
149	/// 7009 - User token account mint does not match the trade
150	#[error("User token account mint does not match the trade")]
151	UserTokenAccountWrongMint = 0x1B61,
152	/// 7010 - User token account is not owned by the trading user
153	#[error("User token account is not owned by the trading user")]
154	UserTokenAccountWrongAuthority = 0x1B62,
155	/// 7011 - Nothing to claim
156	#[error("Nothing to claim")]
157	NothingToClaim = 0x1B63,
158	/// 7012 - Creator identity is not a decodable wallet address
159	#[error("Creator identity is not a decodable wallet address")]
160	InvalidCreatorId = 0x1B64,
161	/// 7013 - Quote mint has no USDC price on its nexus reward state
162	#[error("Quote mint has no USDC price on its nexus reward state")]
163	QuoteMintPriceUnset = 0x1B65,
164	/// 7014 - Token-2022 transfer fee schedule cannot settle the exact amount
165	#[error("Token-2022 transfer fee schedule cannot settle the exact amount")]
166	TransferFeeNotSettleable = 0x1B66,
167	/// 7100 - Insufficient liquidity
168	#[error("Insufficient liquidity")]
169	InsufficientLiquidity = 0x1BBC,
170	/// 7101 - Invalid amount
171	#[error("Invalid amount")]
172	InvalidAmount = 0x1BBD,
173}
174
175impl From<SendNexusError> for solana_program::program_error::ProgramError {
176	fn from(e: SendNexusError) -> Self {
177		solana_program::program_error::ProgramError::Custom(e as u32)
178	}
179}