satrush_client/generated/errors/
satrush.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum SatrushError {
13 #[error("Signer is not authorized to execute this instruction")]
15 Unauthorized = 0x1770,
16 #[error("Ongoing round is not yet finished")]
18 RoundInProgress = 0x1771,
19 #[error("Invalid round id supplied to create round")]
21 InvalidRoundId = 0x1772,
22 #[error("Round duration must be greater than zero")]
24 InvalidRoundDuration = 0x1773,
25 #[error("Entropy value is invalid")]
27 InvalidEntropy = 0x1774,
28 #[error("Round is not accepting deploys")]
30 RoundNotActive = 0x1775,
31 #[error("Deployment amount must be greater than zero")]
33 InvalidDeploymentAmount = 0x1776,
34 #[error("Selection mask must pick between 1 and 21 tiles within the 21-bit range")]
36 InvalidSelectionMask = 0x1777,
37 #[error("Arithmetic overflow")]
39 MathOverflow = 0x1778,
40 #[error("Arithmetic underflow")]
42 MathUnderflow = 0x1779,
43 #[error("Round winning tile has already been revealed")]
45 AlreadyRevealed = 0x177A,
46 #[error("Slot hash entropy is unavailable or invalid")]
48 InvalidSlotHash = 0x177B,
49 #[error("Round winning tile has not been revealed yet")]
51 RoundNotRevealed = 0x177C,
52 #[error("Deployment has already been settled")]
54 AlreadySettled = 0x177D,
55 #[error("Round is not in the settled state")]
57 RoundNotSettled = 0x177E,
58 #[error("Deployment has not been settled yet")]
60 DeploymentNotSettled = 0x177F,
61 #[error("Round is not currently accepting deploys (window closed)")]
63 RoundWindowClosed = 0x1780,
64 #[error("Board already has a round; use advance_round to rotate")]
66 BoardAlreadyBootstrapped = 0x1781,
67 #[error("Swap program account does not match the configured swap program")]
69 InvalidSwapProgram = 0x1782,
70 #[error("Round stake has already been swapped into BTC")]
72 AlreadySwapped = 0x1783,
73 #[error("Swap spent more USD than the budgeted amount")]
75 SwapOverspent = 0x1784,
76 #[error("Swap output is below the minimum acceptable amount")]
78 SlippageExceeded = 0x1785,
79 #[error("Invalid jupiter route was provided")]
81 InvalidJupiterRoute = 0x1786,
82 #[error("Share amount must be greater than zero")]
84 InvalidShareAmount = 0x1787,
85 #[error("Miner does not hold enough Sats Vault shares")]
87 InsufficientShares = 0x1788,
88 #[error("Strike jackpot was already triggered on the provided round")]
90 StrikeAlreadyTriggered = 0x1789,
91 #[error("Strike pending balance is below the swap threshold")]
93 StrikeBelowThreshold = 0x178A,
94 #[error("Epoch iteration is not accepting ticket purchases")]
96 EpochNotOpen = 0x178B,
97 #[error("Epoch iteration window has not elapsed yet")]
99 EpochWindowNotElapsed = 0x178C,
100 #[error("Epoch pending balance is below the swap threshold")]
102 EpochBelowThreshold = 0x178D,
103 #[error("Epoch iteration is not in the settling state")]
105 EpochNotSettling = 0x178E,
106 #[error("Epoch iteration is not in the settled state")]
108 EpochNotSettled = 0x178F,
109 #[error("Supplied page does not contain the current winning ticket")]
111 EpochInvalidPage = 0x1790,
112 #[error("Signer is not a winner of this epoch draw")]
114 EpochNotAWinner = 0x1791,
115 #[error("Epoch reward has already been claimed")]
117 EpochAlreadyClaimed = 0x1792,
118 #[error("Epoch iteration has reached the maximum number of participants")]
120 EpochMaxParticipants = 0x1793,
121 #[error("Hashrate spent is below the minimum required for entry")]
123 EpochBelowMinHashrate = 0x1794,
124 #[error("Miner does not have enough hashrate")]
126 InsufficientHashrate = 0x1795,
127 #[error("1 BTC Vault iteration is not accepting ticket purchases")]
129 OneBtcNotOpen = 0x1796,
130 #[error("1 BTC Vault iteration is not in the settled state")]
132 OneBtcNotSettled = 0x1797,
133 #[error("1 BTC Vault pending balance is below the swap threshold")]
135 OneBtcBelowThreshold = 0x1798,
136 #[error("1 BTC Vault has not accumulated enough BTC to trigger a draw")]
138 OneBtcNotTriggerable = 0x1799,
139 #[error("1 BTC Vault draw has no participants")]
141 OneBtcNoParticipants = 0x179A,
142 #[error("Ticket does not hold the winning ticket for this draw")]
144 OneBtcNotAWinner = 0x179B,
145 #[error("Hashrate spent is below the minimum required for a ticket purchase")]
147 OneBtcBelowMinHashrate = 0x179C,
148 #[error("The winning ticket cannot be closed until the prize is claimed")]
150 OneBtcWinningTicketLocked = 0x179D,
151 #[error("Epoch page has already been sealed")]
153 EpochPageAlreadySealed = 0x179E,
154 #[error("Epoch page is not sealed yet")]
156 EpochPageNotSealed = 0x179F,
157 #[error("Epoch sealed page chain does not reconcile with the iteration's ticket total")]
159 EpochSealMismatch = 0x17A0,
160 #[error("Treasury has no accrued fees to withdraw")]
162 TreasuryEmpty = 0x17A1,
163 #[error("Claim amount must be greater than zero")]
165 InvalidClaimAmount = 0x17A2,
166 #[error("Miner does not hold enough unclaimed USD")]
168 InsufficientUnclaimedUsd = 0x17A3,
169}
170
171impl From<SatrushError> for solana_program_error::ProgramError {
172 fn from(e: SatrushError) -> Self {
173 solana_program_error::ProgramError::Custom(e as u32)
174 }
175}
176