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 - Round duration must be greater than zero
23    #[error("Round duration must be greater than zero")]
24    InvalidRoundDuration = 0x1773,
25    /// 6004 - Entropy value is invalid
26    #[error("Entropy value is invalid")]
27    InvalidEntropy = 0x1774,
28    /// 6005 - Round is not accepting deploys
29    #[error("Round is not accepting deploys")]
30    RoundNotActive = 0x1775,
31    /// 6006 - Deployment amount must be greater than zero
32    #[error("Deployment amount must be greater than zero")]
33    InvalidDeploymentAmount = 0x1776,
34    /// 6007 - Selection mask must pick between 1 and 21 tiles within the 21-bit range
35    #[error("Selection mask must pick between 1 and 21 tiles within the 21-bit range")]
36    InvalidSelectionMask = 0x1777,
37    /// 6008 - Arithmetic overflow
38    #[error("Arithmetic overflow")]
39    MathOverflow = 0x1778,
40    /// 6009 - Arithmetic underflow
41    #[error("Arithmetic underflow")]
42    MathUnderflow = 0x1779,
43    /// 6010 - Round winning tile has already been revealed
44    #[error("Round winning tile has already been revealed")]
45    AlreadyRevealed = 0x177A,
46    /// 6011 - Slot hash entropy is unavailable or invalid
47    #[error("Slot hash entropy is unavailable or invalid")]
48    InvalidSlotHash = 0x177B,
49    /// 6012 - Round winning tile has not been revealed yet
50    #[error("Round winning tile has not been revealed yet")]
51    RoundNotRevealed = 0x177C,
52    /// 6013 - Round is not in the finished state
53    #[error("Round is not in the finished state")]
54    RoundNotFinished = 0x177D,
55    /// 6014 - Round is not in the settled state
56    #[error("Round is not in the settled state")]
57    RoundNotSettled = 0x177E,
58    /// 6015 - Swap program account does not match the configured swap program
59    #[error("Swap program account does not match the configured swap program")]
60    InvalidSwapProgram = 0x177F,
61    /// 6016 - Round stake has already been swapped into BTC
62    #[error("Round stake has already been swapped into BTC")]
63    AlreadySwapped = 0x1780,
64    /// 6017 - Swap spent more USD than the budgeted amount
65    #[error("Swap spent more USD than the budgeted amount")]
66    SwapOverspent = 0x1781,
67    /// 6018 - Swap output is below the minimum acceptable amount
68    #[error("Swap output is below the minimum acceptable amount")]
69    SlippageExceeded = 0x1782,
70    /// 6019 - Share amount must be greater than zero
71    #[error("Share amount must be greater than zero")]
72    InvalidShareAmount = 0x1783,
73    /// 6020 - Miner does not hold enough Sats Vault shares
74    #[error("Miner does not hold enough Sats Vault shares")]
75    InsufficientShares = 0x1784,
76    /// 6021 - Strike jackpot was already triggered on the provided round
77    #[error("Strike jackpot was already triggered on the provided round")]
78    StrikeAlreadyTriggered = 0x1785,
79    /// 6022 - Epoch iteration is not accepting ticket purchases
80    #[error("Epoch iteration is not accepting ticket purchases")]
81    EpochNotOpen = 0x1786,
82    /// 6023 - Epoch iteration window has not elapsed yet
83    #[error("Epoch iteration window has not elapsed yet")]
84    EpochWindowNotElapsed = 0x1787,
85    /// 6024 - Epoch iteration is not in the settling state
86    #[error("Epoch iteration is not in the settling state")]
87    EpochNotSettling = 0x1788,
88    /// 6025 - Epoch iteration is not sealed awaiting entropy
89    #[error("Epoch iteration is not sealed awaiting entropy")]
90    EpochNotSealed = 0x1789,
91    /// 6026 - Epoch iteration is not in the settled state
92    #[error("Epoch iteration is not in the settled state")]
93    EpochNotSettled = 0x178A,
94    /// 6027 - Supplied page does not contain the current winning ticket
95    #[error("Supplied page does not contain the current winning ticket")]
96    EpochInvalidPage = 0x178B,
97    /// 6028 - Signer is not a winner of this epoch draw
98    #[error("Signer is not a winner of this epoch draw")]
99    EpochNotAWinner = 0x178C,
100    /// 6029 - Epoch reward has already been distributed
101    #[error("Epoch reward has already been distributed")]
102    EpochAlreadyDistributed = 0x178D,
103    /// 6030 - Epoch iteration has reached the maximum number of participants
104    #[error("Epoch iteration has reached the maximum number of participants")]
105    EpochMaxParticipants = 0x178E,
106    /// 6031 - Tickets count must be greater than zero
107    #[error("Tickets count must be greater than zero")]
108    InvalidTicketsCount = 0x178F,
109    /// 6032 - Miner does not have enough hashrate
110    #[error("Miner does not have enough hashrate")]
111    InsufficientHashrate = 0x1790,
112    /// 6033 - 1 BTC Vault iteration is not accepting ticket purchases
113    #[error("1 BTC Vault iteration is not accepting ticket purchases")]
114    OneBtcNotOpen = 0x1791,
115    /// 6034 - 1 BTC Vault iteration is not in the settled state
116    #[error("1 BTC Vault iteration is not in the settled state")]
117    OneBtcNotSettled = 0x1792,
118    /// 6035 - 1 BTC Vault iteration is not sealed awaiting entropy
119    #[error("1 BTC Vault iteration is not sealed awaiting entropy")]
120    OneBtcNotSealed = 0x1793,
121    /// 6036 - 1 BTC Vault has not accumulated enough BTC to trigger a draw
122    #[error("1 BTC Vault has not accumulated enough BTC to trigger a draw")]
123    OneBtcNotTriggerable = 0x1794,
124    /// 6037 - 1 BTC Vault draw has no participants
125    #[error("1 BTC Vault draw has no participants")]
126    OneBtcNoParticipants = 0x1795,
127    /// 6038 - Ticket does not hold the winning ticket for this draw
128    #[error("Ticket does not hold the winning ticket for this draw")]
129    OneBtcNotAWinner = 0x1796,
130    /// 6039 - The winning ticket cannot be closed until the prize is claimed
131    #[error("The winning ticket cannot be closed until the prize is claimed")]
132    OneBtcWinningTicketLocked = 0x1797,
133    /// 6040 - Epoch page has already been sealed
134    #[error("Epoch page has already been sealed")]
135    EpochPageAlreadySealed = 0x1798,
136    /// 6041 - Epoch page is not sealed yet
137    #[error("Epoch page is not sealed yet")]
138    EpochPageNotSealed = 0x1799,
139    /// 6042 - Epoch sealed page chain does not reconcile with the iteration's ticket total
140    #[error("Epoch sealed page chain does not reconcile with the iteration's ticket total")]
141    EpochSealMismatch = 0x179A,
142    /// 6043 - Treasury has no accrued fees to withdraw
143    #[error("Treasury has no accrued fees to withdraw")]
144    TreasuryEmpty = 0x179B,
145    /// 6044 - Claim amount must be greater than zero
146    #[error("Claim amount must be greater than zero")]
147    InvalidClaimAmount = 0x179C,
148    /// 6045 - Miner does not hold enough unclaimed USD
149    #[error("Miner does not hold enough unclaimed USD")]
150    InsufficientUnclaimedUsd = 0x179D,
151    /// 6046 - Automation balance cannot cover the per-round deploy amount
152    #[error("Automation balance cannot cover the per-round deploy amount")]
153    InsufficientAutomationBalance = 0x179E,
154    /// 6047 - Automation amount must be greater than zero
155    #[error("Automation amount must be greater than zero")]
156    InvalidAutomationAmount = 0x179F,
157    /// 6048 - Selection mask does not match the automation strategy
158    #[error("Selection mask does not match the automation strategy")]
159    InvalidAutomationStrategyMask = 0x17A0,
160    /// 6049 - Deploy amount is below the 1 USD minimum
161    #[error("Deploy amount is below the 1 USD minimum")]
162    DeployAmountBelowMinimum = 0x17A1,
163    /// 6050 - Epoch iteration duration must be greater than zero
164    #[error("Epoch iteration duration must be greater than zero")]
165    InvalidEpochIterationDuration = 0x17A2,
166    /// 6051 - Unclaimed hashrate bps must not exceed 10_000
167    #[error("Unclaimed hashrate bps must not exceed 10_000")]
168    InvalidUnclaimedHashrateBps = 0x17A3,
169    /// 6052 - Strike trigger modulus must be greater than zero
170    #[error("Strike trigger modulus must be greater than zero")]
171    InvalidStrikeTriggerModulus = 0x17A4,
172    /// 6053 - Sats Vault round fee bps plus deploy fee bps must stay below 10_000
173    #[error("Sats Vault round fee bps plus deploy fee bps must stay below 10_000")]
174    InvalidSwapBps = 0x17A5,
175    /// 6054 - Mint account data is too short to contain the decimals field
176    #[error("Mint account data is too short to contain the decimals field")]
177    InvalidMintData = 0x17A6,
178    /// 6055 - Deploy fee legs must each be at least 1 bps and sum to exactly 800 bps
179    #[error("Deploy fee legs must each be at least 1 bps and sum to exactly 800 bps")]
180    InvalidDeployFees = 0x17A7,
181    /// 6056 - Grubstake amount must be greater than zero
182    #[error("Grubstake amount must be greater than zero")]
183    InvalidGrubstakeAmount = 0x17A8,
184    /// 6057 - Withdrawal exceeds the unreserved grubstake balance
185    #[error("Withdrawal exceeds the unreserved grubstake balance")]
186    InsufficientGrubstake = 0x17A9,
187    /// 6058 - Grubstake airdrop expiration must be in the future
188    #[error("Grubstake airdrop expiration must be in the future")]
189    InvalidGrubstakeExpiration = 0x17AA,
190    /// 6059 - Grubstake airdrop has expired and can only be reclaimed
191    #[error("Grubstake airdrop has expired and can only be reclaimed")]
192    GrubstakeAirdropExpired = 0x17AB,
193    /// 6060 - Grubstake airdrop has not expired yet
194    #[error("Grubstake airdrop has not expired yet")]
195    GrubstakeAirdropNotExpired = 0x17AC,
196    /// 6061 - Miner's grubstake spend window has expired
197    #[error("Miner's grubstake spend window has expired")]
198    GrubstakeExpired = 0x17AD,
199    /// 6062 - Amount exceeds the miner's grubstake balance
200    #[error("Amount exceeds the miner's grubstake balance")]
201    InsufficientMinerGrubstake = 0x17AE,
202    /// 6063 - Miner's grubstake spend window has not expired yet
203    #[error("Miner's grubstake spend window has not expired yet")]
204    GrubstakeNotExpired = 0x17AF,
205    /// 6064 - Automation is not grubstake-funded
206    #[error("Automation is not grubstake-funded")]
207    NotGrubstakeFunded = 0x17B0,
208    /// 6065 - Affiliate tag must be 3-16 characters of a-z, 0-9, '_' or '-'
209    #[error("Affiliate tag must be 3-16 characters of a-z, 0-9, '_' or '-'")]
210    InvalidAffiliateTag = 0x17B1,
211    /// 6066 - An affiliate cannot refer their own miner
212    #[error("An affiliate cannot refer their own miner")]
213    SelfReferralNotAllowed = 0x17B2,
214    /// 6067 - Affiliate account does not match the miner's bound affiliate
215    #[error("Affiliate account does not match the miner's bound affiliate")]
216    AffiliateMismatch = 0x17B3,
217    /// 6068 - Redemption exceeds the affiliate's unclaimed points
218    #[error("Redemption exceeds the affiliate's unclaimed points")]
219    InsufficientAffiliatePoints = 0x17B4,
220    /// 6069 - Treasury has not accrued enough to cover the redemption
221    #[error("Treasury has not accrued enough to cover the redemption")]
222    InsufficientTreasuryBalance = 0x17B5,
223    /// 6070 - Affiliate rate cannot exceed 10000 bps
224    #[error("Affiliate rate cannot exceed 10000 bps")]
225    InvalidAffiliateRate = 0x17B6,
226    /// 6071 - Account is not the configured rng program
227    #[error("Account is not the configured rng program")]
228    InvalidRngProgram = 0x17B7,
229    /// 6072 - Account is not the rng program's config PDA
230    #[error("Account is not the rng program's config PDA")]
231    InvalidRngConfig = 0x17B8,
232    /// 6073 - Account is not the expected rotor of the rng program
233    #[error("Account is not the expected rotor of the rng program")]
234    InvalidRotor = 0x17B9,
235    /// 6074 - Rotor has not settled fresh randomness past the arm-time snapshot
236    #[error("Rotor has not settled fresh randomness past the arm-time snapshot")]
237    RotorNotSettled = 0x17BA,
238    /// 6075 - Account is not the configured token mint
239    #[error("Account is not the configured token mint")]
240    InvalidTokenMint = 0x17BB,
241    /// 6076 - Account is not the satrush-mint program
242    #[error("Account is not the satrush-mint program")]
243    InvalidMintProgram = 0x17BC,
244    /// 6077 - Account is not the expected satrush-mint PDA
245    #[error("Account is not the expected satrush-mint PDA")]
246    InvalidMintAccount = 0x17BD,
247    /// 6078 - Token account data is too short to read its balance
248    #[error("Token account data is too short to read its balance")]
249    InvalidTokenAccountData = 0x17BE,
250    /// 6079 - Account is not a program-owned miner account
251    #[error("Account is not a program-owned miner account")]
252    InvalidMinerAccount = 0x17BF,
253    /// 6080 - Miner account already carries the v2 layout
254    #[error("Miner account already carries the v2 layout")]
255    MinerAlreadyMigrated = 0x17C0,
256    /// 6081 - Account is not the program's config account
257    #[error("Account is not the program's config account")]
258    InvalidConfigAccount = 0x17C1,
259    /// 6082 - Config account already carries the v2 layout
260    #[error("Config account already carries the v2 layout")]
261    ConfigAlreadyMigrated = 0x17C2,
262    /// 6083 - Account is not the program's board account
263    #[error("Account is not the program's board account")]
264    InvalidBoardAccount = 0x17C3,
265    /// 6084 - Board account already carries the v2 layout
266    #[error("Board account already carries the v2 layout")]
267    BoardAlreadyMigrated = 0x17C4,
268    /// 6085 - Account is not the program's treasury account
269    #[error("Account is not the program's treasury account")]
270    InvalidTreasuryAccount = 0x17C5,
271    /// 6086 - Treasury account already carries the v2 layout
272    #[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