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("Round is not in the finished state")]
54 RoundNotFinished = 0x177D,
55 #[error("Round is not in the settled state")]
57 RoundNotSettled = 0x177E,
58 #[error("Swap program account does not match the configured swap program")]
60 InvalidSwapProgram = 0x177F,
61 #[error("Round stake has already been swapped into BTC")]
63 AlreadySwapped = 0x1780,
64 #[error("Swap spent more USD than the budgeted amount")]
66 SwapOverspent = 0x1781,
67 #[error("Swap output is below the minimum acceptable amount")]
69 SlippageExceeded = 0x1782,
70 #[error("Share amount must be greater than zero")]
72 InvalidShareAmount = 0x1783,
73 #[error("Miner does not hold enough Sats Vault shares")]
75 InsufficientShares = 0x1784,
76 #[error("Strike jackpot was already triggered on the provided round")]
78 StrikeAlreadyTriggered = 0x1785,
79 #[error("Epoch iteration is not accepting ticket purchases")]
81 EpochNotOpen = 0x1786,
82 #[error("Epoch iteration window has not elapsed yet")]
84 EpochWindowNotElapsed = 0x1787,
85 #[error("Epoch iteration is not in the settling state")]
87 EpochNotSettling = 0x1788,
88 #[error("Epoch iteration is not sealed awaiting entropy")]
90 EpochNotSealed = 0x1789,
91 #[error("Epoch iteration is not in the settled state")]
93 EpochNotSettled = 0x178A,
94 #[error("Supplied page does not contain the current winning ticket")]
96 EpochInvalidPage = 0x178B,
97 #[error("Signer is not a winner of this epoch draw")]
99 EpochNotAWinner = 0x178C,
100 #[error("Epoch reward has already been distributed")]
102 EpochAlreadyDistributed = 0x178D,
103 #[error("Epoch iteration has reached the maximum number of participants")]
105 EpochMaxParticipants = 0x178E,
106 #[error("Tickets count must be greater than zero")]
108 InvalidTicketsCount = 0x178F,
109 #[error("Miner does not have enough hashrate")]
111 InsufficientHashrate = 0x1790,
112 #[error("1 BTC Vault iteration is not accepting ticket purchases")]
114 OneBtcNotOpen = 0x1791,
115 #[error("1 BTC Vault iteration is not in the settled state")]
117 OneBtcNotSettled = 0x1792,
118 #[error("1 BTC Vault iteration is not sealed awaiting entropy")]
120 OneBtcNotSealed = 0x1793,
121 #[error("1 BTC Vault has not accumulated enough BTC to trigger a draw")]
123 OneBtcNotTriggerable = 0x1794,
124 #[error("1 BTC Vault draw has no participants")]
126 OneBtcNoParticipants = 0x1795,
127 #[error("Ticket does not hold the winning ticket for this draw")]
129 OneBtcNotAWinner = 0x1796,
130 #[error("The winning ticket cannot be closed until the prize is claimed")]
132 OneBtcWinningTicketLocked = 0x1797,
133 #[error("Epoch page has already been sealed")]
135 EpochPageAlreadySealed = 0x1798,
136 #[error("Epoch page is not sealed yet")]
138 EpochPageNotSealed = 0x1799,
139 #[error("Epoch sealed page chain does not reconcile with the iteration's ticket total")]
141 EpochSealMismatch = 0x179A,
142 #[error("Treasury has no accrued fees to withdraw")]
144 TreasuryEmpty = 0x179B,
145 #[error("Claim amount must be greater than zero")]
147 InvalidClaimAmount = 0x179C,
148 #[error("Miner does not hold enough unclaimed USD")]
150 InsufficientUnclaimedUsd = 0x179D,
151 #[error("Automation balance cannot cover the per-round deploy amount")]
153 InsufficientAutomationBalance = 0x179E,
154 #[error("Automation amount must be greater than zero")]
156 InvalidAutomationAmount = 0x179F,
157 #[error("Selection mask does not match the automation strategy")]
159 InvalidAutomationStrategyMask = 0x17A0,
160 #[error("Deploy amount is below the 1 USD minimum")]
162 DeployAmountBelowMinimum = 0x17A1,
163 #[error("Epoch iteration duration must be greater than zero")]
165 InvalidEpochIterationDuration = 0x17A2,
166 #[error("Unclaimed hashrate bps must not exceed 10_000")]
168 InvalidUnclaimedHashrateBps = 0x17A3,
169 #[error("Strike trigger modulus must be greater than zero")]
171 InvalidStrikeTriggerModulus = 0x17A4,
172 #[error("Sats Vault round fee bps plus deploy fee bps must stay below 10_000")]
174 InvalidSwapBps = 0x17A5,
175 #[error("Mint account data is too short to contain the decimals field")]
177 InvalidMintData = 0x17A6,
178 #[error("Deploy fee legs must each be at least 1 bps and sum to exactly 800 bps")]
180 InvalidDeployFees = 0x17A7,
181 #[error("Grubstake amount must be greater than zero")]
183 InvalidGrubstakeAmount = 0x17A8,
184 #[error("Withdrawal exceeds the unreserved grubstake balance")]
186 InsufficientGrubstake = 0x17A9,
187 #[error("Grubstake airdrop expiration must be in the future")]
189 InvalidGrubstakeExpiration = 0x17AA,
190 #[error("Grubstake airdrop has expired and can only be reclaimed")]
192 GrubstakeAirdropExpired = 0x17AB,
193 #[error("Grubstake airdrop has not expired yet")]
195 GrubstakeAirdropNotExpired = 0x17AC,
196 #[error("Miner's grubstake spend window has expired")]
198 GrubstakeExpired = 0x17AD,
199 #[error("Amount exceeds the miner's grubstake balance")]
201 InsufficientMinerGrubstake = 0x17AE,
202 #[error("Miner's grubstake spend window has not expired yet")]
204 GrubstakeNotExpired = 0x17AF,
205 #[error("Automation is not grubstake-funded")]
207 NotGrubstakeFunded = 0x17B0,
208 #[error("Affiliate tag must be 3-16 characters of a-z, 0-9, '_' or '-'")]
210 InvalidAffiliateTag = 0x17B1,
211 #[error("An affiliate cannot refer their own miner")]
213 SelfReferralNotAllowed = 0x17B2,
214 #[error("Affiliate account does not match the miner's bound affiliate")]
216 AffiliateMismatch = 0x17B3,
217 #[error("Redemption exceeds the affiliate's unclaimed points")]
219 InsufficientAffiliatePoints = 0x17B4,
220 #[error("Treasury has not accrued enough to cover the redemption")]
222 InsufficientTreasuryBalance = 0x17B5,
223 #[error("Affiliate rate cannot exceed 10000 bps")]
225 InvalidAffiliateRate = 0x17B6,
226 #[error("Account is not the configured rng program")]
228 InvalidRngProgram = 0x17B7,
229 #[error("Account is not the rng program's config PDA")]
231 InvalidRngConfig = 0x17B8,
232 #[error("Account is not the expected rotor of the rng program")]
234 InvalidRotor = 0x17B9,
235 #[error("Rotor has not settled fresh randomness past the arm-time snapshot")]
237 RotorNotSettled = 0x17BA,
238 #[error("Account is not the configured token mint")]
240 InvalidTokenMint = 0x17BB,
241 #[error("Account is not the satrush-mint program")]
243 InvalidMintProgram = 0x17BC,
244 #[error("Account is not the expected satrush-mint PDA")]
246 InvalidMintAccount = 0x17BD,
247 #[error("Token account data is too short to read its balance")]
249 InvalidTokenAccountData = 0x17BE,
250 #[error("Account is not a program-owned miner account")]
252 InvalidMinerAccount = 0x17BF,
253 #[error("Miner account already carries the v2 layout")]
255 MinerAlreadyMigrated = 0x17C0,
256 #[error("Account is not the program's config account")]
258 InvalidConfigAccount = 0x17C1,
259 #[error("Config account already carries the v2 layout")]
261 ConfigAlreadyMigrated = 0x17C2,
262 #[error("Account is not the program's board account")]
264 InvalidBoardAccount = 0x17C3,
265 #[error("Board account already carries the v2 layout")]
267 BoardAlreadyMigrated = 0x17C4,
268 #[error("Account is not the program's treasury account")]
270 InvalidTreasuryAccount = 0x17C5,
271 #[error("Treasury account already carries the v2 layout")]
273 TreasuryAlreadyMigrated = 0x17C6,
274}
275
276impl From<SatrushError> for solana_program_error::ProgramError {
277 fn from(e: SatrushError) -> Self {
278 solana_program_error::ProgramError::Custom(e as u32)
279 }
280}
281