stablebond_sdk/generated/errors/
stablebond.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum StablebondError {
13 #[error("Admin does not match admin in config")]
15 AdminConfigMismatch,
16 #[error("Admin is not signer")]
18 AdminIsNotSigner,
19 #[error("Delegate is not signer")]
21 DelegateIsNotSigner,
22 #[error("User is not signer")]
24 UserIsNotSigner,
25 #[error("Invalid Delegate Address")]
27 InvalidDelegateAddress,
28 #[error("Invalid Delegate Owner")]
30 InvalidDelegateOwner,
31 #[error("Invalid Delegate")]
33 InvalidDelegate,
34 #[error("Delegate not initialized")]
36 DelegateNotInitialized,
37 #[error("Delegate already initialized")]
39 DelegateAlreadyInitialized,
40 #[error("Config already initialized")]
42 ConfigAlreadyInitialized,
43 #[error("Payment already initialized")]
45 PaymentAlreadyInitialized,
46 #[error("Payout already initialized")]
48 PayoutAlreadyInitialized,
49 #[error("Invalid Config")]
51 InvalidConfig,
52 #[error("Invalid Config Address")]
54 InvalidConfigAddress,
55 #[error("Invalid Config Owner")]
57 InvalidConfigOwner,
58 #[error("Mint is not signer")]
60 MintIsNotSigner,
61 #[error("Bond not initialized")]
63 BondNotInitialized,
64 #[error("Invalid Bond Owner")]
66 InvalidBondOwner,
67 #[error("Issuance already initialized")]
69 IssuanceAlreadyInitialized,
70 #[error("Invalid Issuance")]
72 InvalidIssuance,
73 #[error("Invalid Token 2022 Program")]
75 InvalidToken2022Program,
76 #[error("Invalid Token Program")]
78 InvalidTokenProgram,
79 #[error("Invalid System Program")]
81 InvalidSystemProgram,
82 #[error("Invalid interest rate")]
84 InvalidInterestRate,
85 #[error("Invalid mint for bond")]
87 InvalidMintForBond,
88 #[error("Invalid price feed owner")]
90 InvalidPriceFeedOwner,
91 #[error("Issuance not initialized")]
93 IssuanceNotInitialized,
94 #[error("Config not initialized")]
96 ConfigNotInitialized,
97 #[error("Payment not initialized")]
99 PaymentNotInitialized,
100 #[error("Payout not initialized")]
102 PayoutNotInitialized,
103 #[error("Invalid Payment Address")]
105 InvalidPaymentAddress,
106 #[error("Invalid Payout Address")]
108 InvalidPayoutAddress,
109 #[error("Invalid Payout Owner")]
111 InvalidPayoutOwner,
112 #[error("Invalid Payment Owner")]
114 InvalidPaymentOwner,
115 #[error("Invalid Issuance Owner")]
117 InvalidIssuanceOwner,
118 #[error("Invalid Mint Owner")]
120 InvalidMintOwner,
121 #[error("Invalid Issuance Status")]
123 InvalidIssuanceStatus,
124 #[error("Invalid Bond Mint")]
126 InvalidBondMint,
127 #[error("Invalid Bond Token Account Owner")]
129 InvalidBondTokenAccountOwner,
130 #[error("Invalid Payment Mint")]
132 InvalidPaymentMint,
133 #[error("Invalid Payment Token Account Owner")]
135 InvalidPaymentTokenAccountOwner,
136 #[error("Invalid Payment Token Account")]
138 InvalidPaymentTokenAccount,
139 #[error("Invalid Amount")]
141 InvalidAmount,
142 #[error("Oracle Not Configured")]
144 OracleNotConfigured,
145 #[error("Invalid Oracle")]
147 InvalidOracleAccount,
148 #[error("Unsupported Oracle")]
150 UnsupportedOracle,
151 #[error("Stale Oracle")]
153 StaleOracle,
154 #[error("Math Overflow")]
156 MathOverflow,
157 #[error("Unable To Get Clock")]
159 UnableToGetClock,
160 #[error("Not Enough Liquidity")]
162 NotEnoughLiquidity,
163 #[error("IssuancePastCutoffTime")]
165 IssuancePastCutoffTime,
166 #[error("Issuance Not Started")]
168 IssuanceNotStarted,
169 #[error("Invalid NFT Issuance Vault Owner")]
171 InvalidNftIssuanceVaultOwner,
172 #[error("Invalid NFT Issuance Vault")]
174 InvalidNftIssuanceVault,
175 #[error("Failed To Create Nft Collection")]
177 FailedToCreateNftCollection,
178 #[error("No Redemptions Requested")]
180 NoRedemptionsRequested,
181 #[error("Invalide Price Feed Account")]
183 InvalidPriceFeedAccount,
184 #[error("PaymentFeed Not Initialized")]
186 PaymentFeedNotInitialized,
187 #[error("Invalid Payment Feed")]
189 InvalidPaymentFeed,
190 #[error("Invalid Account")]
192 InvalidAccount,
193 #[error("Issuance Not Ready To Start")]
195 IssuanceNotReadyToStart,
196 #[error("Invalid Admin Account")]
198 InvalidAdminAccount,
199 #[error("Invalid Config Account")]
201 InvalidConfigAccount,
202 #[error("Invalid Delegate Account")]
204 InvalidDelegateAccount,
205 #[error("Invalid Bond Account")]
207 InvalidBondAccount,
208 #[error("Invalid Issuance Account")]
210 InvalidIssuanceAccount,
211 #[error("Invalid Payment Account")]
213 InvalidPaymentAccount,
214 #[error("Invalid Payout Account")]
216 InvalidPayoutAccount,
217 #[error("Invalid Argument")]
219 InvalidArgument,
220 #[error("Invalid Price")]
222 InvalidPrice,
223 #[error("Invalid Payment Feed Owner")]
225 InvalidPaymentFeedOwner,
226 #[error("Invalid Payment Feed Account")]
228 InvalidPaymentFeedAccount,
229 #[error("Purchase Order Not Initialized")]
231 PurchaseOrderNotInitialized,
232 #[error("Invalid User NFT Token Account Owner")]
234 InvalidUserNftTokenAccountOwner,
235 #[error("Invalid Purchase Order Status")]
237 InvalidPurchaseOrderStatus,
238 #[error("Invalid Purchase Order")]
240 InvalidPurchaseOrder,
241 #[error("Invalid Purchase Order Account Owner")]
243 InvalidPurchaseOrderAccountOwner,
244 #[error("Issuance Not Matured")]
246 IssuanceNotMatured,
247 #[error("Invalid User Payment Token Account Owner")]
249 InvalidUserPaymentTokenAccountOwner,
250 #[error("Invalid Nft Collection")]
252 InvalidNftCollection,
253 #[error("Current Issuance Not Over")]
255 CurrentIssuanceNotOver,
256 #[error("Account Is Not Writeable")]
258 AccountIsNotWriteable,
259 #[error("Price feed exceeded provided confidence interval")]
261 ConfidenceIntervalExceeded,
262 #[error("Price feed has invalid confidence interval")]
264 InvalidConfidenceInterval,
265 #[error("Past Issuance Cutoff Time")]
267 PastIssuanceCutoffTime,
268 #[error("Invalid Kyc Account")]
270 InvalidKycAccount,
271 #[error("Kyc Not Initialized")]
273 KycNotInitialized,
274 #[error("Sell Liquidity Already Initialized")]
276 SellLiquidityAlreadyInitialized,
277 #[error("Insufficient Liquidity")]
279 InsufficientLiquidity,
280 #[error("Invalid Offramp Account")]
282 InvalidOfframpAccount,
283 #[error("Offramp Not Initialized")]
285 OfframpNotInitialized,
286 #[error("Invalid Onramp Account")]
288 InvalidOnrampAccount,
289 #[error("Onramp Not Initialized")]
291 OnrampNotInitialized,
292 #[error("Invalid Sequence Account")]
294 InvalidSequenceAccount,
295 #[error("Sequence Not Initialized")]
297 SequenceNotInitialized,
298 #[error("Invalid Offramp Status")]
300 InvalidOfframpStatus,
301 #[error("Multisig Required")]
303 MultisigRequired,
304 #[error("Failed to create mint instruction")]
306 FailedToCreateMintInstruction,
307 #[error("Bond Multisig Meta Not Initialized")]
309 BondMultisigMetaNotInitialized,
310}
311
312impl solana_program::program_error::PrintProgramError for StablebondError {
313 fn print<E>(&self) {
314 solana_program::msg!(&self.to_string());
315 }
316}