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 in the settled state
89    #[error("Epoch iteration is not in the settled state")]
90    EpochNotSettled = 0x1789,
91    /// 6026 - Supplied page does not contain the current winning ticket
92    #[error("Supplied page does not contain the current winning ticket")]
93    EpochInvalidPage = 0x178A,
94    /// 6027 - Signer is not a winner of this epoch draw
95    #[error("Signer is not a winner of this epoch draw")]
96    EpochNotAWinner = 0x178B,
97    /// 6028 - Epoch reward has already been claimed
98    #[error("Epoch reward has already been claimed")]
99    EpochAlreadyClaimed = 0x178C,
100    /// 6029 - Epoch iteration has reached the maximum number of participants
101    #[error("Epoch iteration has reached the maximum number of participants")]
102    EpochMaxParticipants = 0x178D,
103    /// 6030 - Tickets count must be greater than zero
104    #[error("Tickets count must be greater than zero")]
105    InvalidTicketsCount = 0x178E,
106    /// 6031 - Miner does not have enough hashrate
107    #[error("Miner does not have enough hashrate")]
108    InsufficientHashrate = 0x178F,
109    /// 6032 - 1 BTC Vault iteration is not accepting ticket purchases
110    #[error("1 BTC Vault iteration is not accepting ticket purchases")]
111    OneBtcNotOpen = 0x1790,
112    /// 6033 - 1 BTC Vault iteration is not in the settled state
113    #[error("1 BTC Vault iteration is not in the settled state")]
114    OneBtcNotSettled = 0x1791,
115    /// 6034 - 1 BTC Vault has not accumulated enough BTC to trigger a draw
116    #[error("1 BTC Vault has not accumulated enough BTC to trigger a draw")]
117    OneBtcNotTriggerable = 0x1792,
118    /// 6035 - 1 BTC Vault draw has no participants
119    #[error("1 BTC Vault draw has no participants")]
120    OneBtcNoParticipants = 0x1793,
121    /// 6036 - Ticket does not hold the winning ticket for this draw
122    #[error("Ticket does not hold the winning ticket for this draw")]
123    OneBtcNotAWinner = 0x1794,
124    /// 6037 - The winning ticket cannot be closed until the prize is claimed
125    #[error("The winning ticket cannot be closed until the prize is claimed")]
126    OneBtcWinningTicketLocked = 0x1795,
127    /// 6038 - Epoch page has already been sealed
128    #[error("Epoch page has already been sealed")]
129    EpochPageAlreadySealed = 0x1796,
130    /// 6039 - Epoch page is not sealed yet
131    #[error("Epoch page is not sealed yet")]
132    EpochPageNotSealed = 0x1797,
133    /// 6040 - Epoch sealed page chain does not reconcile with the iteration's ticket total
134    #[error("Epoch sealed page chain does not reconcile with the iteration's ticket total")]
135    EpochSealMismatch = 0x1798,
136    /// 6041 - Treasury has no accrued fees to withdraw
137    #[error("Treasury has no accrued fees to withdraw")]
138    TreasuryEmpty = 0x1799,
139    /// 6042 - Claim amount must be greater than zero
140    #[error("Claim amount must be greater than zero")]
141    InvalidClaimAmount = 0x179A,
142    /// 6043 - Miner does not hold enough unclaimed USD
143    #[error("Miner does not hold enough unclaimed USD")]
144    InsufficientUnclaimedUsd = 0x179B,
145    /// 6044 - Automation balance cannot cover the per-round deploy amount
146    #[error("Automation balance cannot cover the per-round deploy amount")]
147    InsufficientAutomationBalance = 0x179C,
148    /// 6045 - Automation amount must be greater than zero
149    #[error("Automation amount must be greater than zero")]
150    InvalidAutomationAmount = 0x179D,
151    /// 6046 - Selection mask does not match the automation strategy
152    #[error("Selection mask does not match the automation strategy")]
153    InvalidAutomationStrategyMask = 0x179E,
154    /// 6047 - Deploy amount is below the 1 USD minimum
155    #[error("Deploy amount is below the 1 USD minimum")]
156    DeployAmountBelowMinimum = 0x179F,
157    /// 6048 - Epoch iteration duration must be greater than zero
158    #[error("Epoch iteration duration must be greater than zero")]
159    InvalidEpochIterationDuration = 0x17A0,
160    /// 6049 - Unclaimed hashrate bps must not exceed 10_000
161    #[error("Unclaimed hashrate bps must not exceed 10_000")]
162    InvalidUnclaimedHashrateBps = 0x17A1,
163    /// 6050 - Strike trigger modulus must be greater than zero
164    #[error("Strike trigger modulus must be greater than zero")]
165    InvalidStrikeTriggerModulus = 0x17A2,
166    /// 6051 - Sats Vault round fee bps plus deploy fee bps must stay below 10_000
167    #[error("Sats Vault round fee bps plus deploy fee bps must stay below 10_000")]
168    InvalidSwapBps = 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