Skip to main content

satrush_client/generated/errors/
satrush.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum SatrushError {
13    /// 6000 - Signer is not authorized to execute this instruction
14    #[error("Signer is not authorized to execute this instruction")]
15    Unauthorized = 0x1770,
16    /// 6001 - Ongoing round is not yet finished
17    #[error("Ongoing round is not yet finished")]
18    RoundInProgress = 0x1771,
19    /// 6002 - Invalid round id supplied to create round
20    #[error("Invalid round id supplied to create round")]
21    InvalidRoundId = 0x1772,
22    /// 6003 - Entropy value is invalid
23    #[error("Entropy value is invalid")]
24    InvalidEntropy = 0x1773,
25    /// 6004 - Round is not accepting deploys
26    #[error("Round is not accepting deploys")]
27    RoundNotActive = 0x1774,
28    /// 6005 - Deployment amount must be greater than zero
29    #[error("Deployment amount must be greater than zero")]
30    InvalidDeploymentAmount = 0x1775,
31    /// 6006 - Selection mask must pick between 1 and 21 tiles within the 21-bit range
32    #[error("Selection mask must pick between 1 and 21 tiles within the 21-bit range")]
33    InvalidSelectionMask = 0x1776,
34    /// 6007 - Arithmetic overflow
35    #[error("Arithmetic overflow")]
36    MathOverflow = 0x1777,
37    /// 6008 - Arithmetic underflow
38    #[error("Arithmetic underflow")]
39    MathUnderflow = 0x1778,
40    /// 6009 - Round winning tile has already been revealed
41    #[error("Round winning tile has already been revealed")]
42    AlreadyRevealed = 0x1779,
43    /// 6010 - Slot hash entropy is unavailable or invalid
44    #[error("Slot hash entropy is unavailable or invalid")]
45    InvalidSlotHash = 0x177A,
46    /// 6011 - Round winning tile has not been revealed yet
47    #[error("Round winning tile has not been revealed yet")]
48    RoundNotRevealed = 0x177B,
49    /// 6012 - Deployment has already been settled
50    #[error("Deployment has already been settled")]
51    AlreadySettled = 0x177C,
52    /// 6013 - Round is not in the settled state
53    #[error("Round is not in the settled state")]
54    RoundNotSettled = 0x177D,
55    /// 6014 - Deployment has not been settled yet
56    #[error("Deployment has not been settled yet")]
57    DeploymentNotSettled = 0x177E,
58    /// 6015 - Round is not currently accepting deploys (window closed)
59    #[error("Round is not currently accepting deploys (window closed)")]
60    RoundWindowClosed = 0x177F,
61    /// 6016 - Board already has a round; use advance_round to rotate
62    #[error("Board already has a round; use advance_round to rotate")]
63    BoardAlreadyBootstrapped = 0x1780,
64    /// 6017 - Swap program account does not match the configured swap program
65    #[error("Swap program account does not match the configured swap program")]
66    InvalidSwapProgram = 0x1781,
67    /// 6018 - Round stake has already been swapped into BTC
68    #[error("Round stake has already been swapped into BTC")]
69    AlreadySwapped = 0x1782,
70    /// 6019 - Swap spent more USD than the budgeted amount
71    #[error("Swap spent more USD than the budgeted amount")]
72    SwapOverspent = 0x1783,
73    /// 6020 - Swap output is below the minimum acceptable amount
74    #[error("Swap output is below the minimum acceptable amount")]
75    SlippageExceeded = 0x1784,
76    /// 6021 - Invalid jupiter route was provided
77    #[error("Invalid jupiter route was provided")]
78    InvalidJupiterRoute = 0x1785,
79    /// 6022 - Share amount must be greater than zero
80    #[error("Share amount must be greater than zero")]
81    InvalidShareAmount = 0x1786,
82    /// 6023 - Miner does not hold enough Sats Vault shares
83    #[error("Miner does not hold enough Sats Vault shares")]
84    InsufficientShares = 0x1787,
85    /// 6024 - Strike jackpot was already triggered on the provided round
86    #[error("Strike jackpot was already triggered on the provided round")]
87    StrikeAlreadyTriggered = 0x1788,
88    /// 6025 - Strike pending balance is below the swap threshold
89    #[error("Strike pending balance is below the swap threshold")]
90    StrikeBelowThreshold = 0x1789,
91    /// 6026 - Epoch iteration is not accepting ticket purchases
92    #[error("Epoch iteration is not accepting ticket purchases")]
93    EpochNotOpen = 0x178A,
94    /// 6027 - Epoch iteration window has not elapsed yet
95    #[error("Epoch iteration window has not elapsed yet")]
96    EpochWindowNotElapsed = 0x178B,
97    /// 6028 - Epoch pending balance is below the swap threshold
98    #[error("Epoch pending balance is below the swap threshold")]
99    EpochBelowThreshold = 0x178C,
100    /// 6029 - Epoch iteration is not in the settling state
101    #[error("Epoch iteration is not in the settling state")]
102    EpochNotSettling = 0x178D,
103    /// 6030 - Epoch iteration is not in the settled state
104    #[error("Epoch iteration is not in the settled state")]
105    EpochNotSettled = 0x178E,
106    /// 6031 - Supplied page does not contain the current winning ticket
107    #[error("Supplied page does not contain the current winning ticket")]
108    EpochInvalidPage = 0x178F,
109    /// 6032 - Signer is not a winner of this epoch draw
110    #[error("Signer is not a winner of this epoch draw")]
111    EpochNotAWinner = 0x1790,
112    /// 6033 - Epoch reward has already been claimed
113    #[error("Epoch reward has already been claimed")]
114    EpochAlreadyClaimed = 0x1791,
115    /// 6034 - Epoch iteration has reached the maximum number of participants
116    #[error("Epoch iteration has reached the maximum number of participants")]
117    EpochMaxParticipants = 0x1792,
118    /// 6035 - Hashrate spent is below the minimum required for entry
119    #[error("Hashrate spent is below the minimum required for entry")]
120    EpochBelowMinHashrate = 0x1793,
121    /// 6036 - Miner does not have enough hashrate
122    #[error("Miner does not have enough hashrate")]
123    InsufficientHashrate = 0x1794,
124    /// 6037 - 1 BTC Vault iteration is not accepting ticket purchases
125    #[error("1 BTC Vault iteration is not accepting ticket purchases")]
126    OneBtcNotOpen = 0x1795,
127    /// 6038 - 1 BTC Vault iteration is not in the settled state
128    #[error("1 BTC Vault iteration is not in the settled state")]
129    OneBtcNotSettled = 0x1796,
130    /// 6039 - 1 BTC Vault pending balance is below the swap threshold
131    #[error("1 BTC Vault pending balance is below the swap threshold")]
132    OneBtcBelowThreshold = 0x1797,
133    /// 6040 - 1 BTC Vault has not accumulated enough BTC to trigger a draw
134    #[error("1 BTC Vault has not accumulated enough BTC to trigger a draw")]
135    OneBtcNotTriggerable = 0x1798,
136    /// 6041 - 1 BTC Vault draw has no participants
137    #[error("1 BTC Vault draw has no participants")]
138    OneBtcNoParticipants = 0x1799,
139    /// 6042 - Ticket does not hold the winning ticket for this draw
140    #[error("Ticket does not hold the winning ticket for this draw")]
141    OneBtcNotAWinner = 0x179A,
142    /// 6043 - Hashrate spent is below the minimum required for a ticket purchase
143    #[error("Hashrate spent is below the minimum required for a ticket purchase")]
144    OneBtcBelowMinHashrate = 0x179B,
145    /// 6044 - The winning ticket cannot be closed until the prize is claimed
146    #[error("The winning ticket cannot be closed until the prize is claimed")]
147    OneBtcWinningTicketLocked = 0x179C,
148    /// 6045 - Epoch page has already been sealed
149    #[error("Epoch page has already been sealed")]
150    EpochPageAlreadySealed = 0x179D,
151    /// 6046 - Epoch page is not sealed yet
152    #[error("Epoch page is not sealed yet")]
153    EpochPageNotSealed = 0x179E,
154    /// 6047 - Epoch sealed page chain does not reconcile with the iteration's ticket total
155    #[error("Epoch sealed page chain does not reconcile with the iteration's ticket total")]
156    EpochSealMismatch = 0x179F,
157    /// 6048 - Treasury has no accrued fees to withdraw
158    #[error("Treasury has no accrued fees to withdraw")]
159    TreasuryEmpty = 0x17A0,
160}
161
162impl From<SatrushError> for solana_program_error::ProgramError {
163    fn from(e: SatrushError) -> Self {
164        solana_program_error::ProgramError::Custom(e as u32)
165    }
166}
167