Skip to main content

orca_sol/errors/
whirlpool.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 WhirlpoolError {
13    /// 6000 - Enum value could not be converted
14    #[error("Enum value could not be converted")]
15    InvalidEnum = 0x1770,
16    /// 6001 - Invalid start tick index provided.
17    #[error("Invalid start tick index provided.")]
18    InvalidStartTick = 0x1771,
19    /// 6002 - Tick-array already exists in this whirlpool
20    #[error("Tick-array already exists in this whirlpool")]
21    TickArrayExistInPool = 0x1772,
22    /// 6003 - Attempt to search for a tick-array failed
23    #[error("Attempt to search for a tick-array failed")]
24    TickArrayIndexOutofBounds = 0x1773,
25    /// 6004 - Tick-spacing is not supported
26    #[error("Tick-spacing is not supported")]
27    InvalidTickSpacing = 0x1774,
28    /// 6005 - Position is not empty It cannot be closed
29    #[error("Position is not empty It cannot be closed")]
30    ClosePositionNotEmpty = 0x1775,
31    /// 6006 - Unable to divide by zero
32    #[error("Unable to divide by zero")]
33    DivideByZero = 0x1776,
34    /// 6007 - Unable to cast number into BigInt
35    #[error("Unable to cast number into BigInt")]
36    NumberCastError = 0x1777,
37    /// 6008 - Unable to down cast number
38    #[error("Unable to down cast number")]
39    NumberDownCastError = 0x1778,
40    /// 6009 - Tick not found within tick array
41    #[error("Tick not found within tick array")]
42    TickNotFound = 0x1779,
43    /// 6010 - Provided tick index is either out of bounds or uninitializable
44    #[error("Provided tick index is either out of bounds or uninitializable")]
45    InvalidTickIndex = 0x177A,
46    /// 6011 - Provided sqrt price out of bounds
47    #[error("Provided sqrt price out of bounds")]
48    SqrtPriceOutOfBounds = 0x177B,
49    /// 6012 - Liquidity amount must be greater than zero
50    #[error("Liquidity amount must be greater than zero")]
51    LiquidityZero = 0x177C,
52    /// 6013 - Liquidity amount must be less than i64::MAX
53    #[error("Liquidity amount must be less than i64::MAX")]
54    LiquidityTooHigh = 0x177D,
55    /// 6014 - Liquidity overflow
56    #[error("Liquidity overflow")]
57    LiquidityOverflow = 0x177E,
58    /// 6015 - Liquidity underflow
59    #[error("Liquidity underflow")]
60    LiquidityUnderflow = 0x177F,
61    /// 6016 - Tick liquidity net underflowed or overflowed
62    #[error("Tick liquidity net underflowed or overflowed")]
63    LiquidityNetError = 0x1780,
64    /// 6017 - Exceeded token max
65    #[error("Exceeded token max")]
66    TokenMaxExceeded = 0x1781,
67    /// 6018 - Did not meet token min
68    #[error("Did not meet token min")]
69    TokenMinSubceeded = 0x1782,
70    /// 6019 - Position token account has a missing or invalid delegate
71    #[error("Position token account has a missing or invalid delegate")]
72    MissingOrInvalidDelegate = 0x1783,
73    /// 6020 - Position token amount must be 1
74    #[error("Position token amount must be 1")]
75    InvalidPositionTokenAmount = 0x1784,
76    /// 6021 - Timestamp should be convertible from i64 to u64
77    #[error("Timestamp should be convertible from i64 to u64")]
78    InvalidTimestampConversion = 0x1785,
79    /// 6022 - Timestamp should be greater than the last updated timestamp
80    #[error("Timestamp should be greater than the last updated timestamp")]
81    InvalidTimestamp = 0x1786,
82    /// 6023 - Invalid tick array sequence provided for instruction.
83    #[error("Invalid tick array sequence provided for instruction.")]
84    InvalidTickArraySequence = 0x1787,
85    /// 6024 - Token Mint in wrong order
86    #[error("Token Mint in wrong order")]
87    InvalidTokenMintOrder = 0x1788,
88    /// 6025 - Reward not initialized
89    #[error("Reward not initialized")]
90    RewardNotInitialized = 0x1789,
91    /// 6026 - Invalid reward index
92    #[error("Invalid reward index")]
93    InvalidRewardIndex = 0x178A,
94    /// 6027 - Reward vault requires amount to support emissions for at least one day
95    #[error("Reward vault requires amount to support emissions for at least one day")]
96    RewardVaultAmountInsufficient = 0x178B,
97    /// 6028 - Exceeded max fee rate
98    #[error("Exceeded max fee rate")]
99    FeeRateMaxExceeded = 0x178C,
100    /// 6029 - Exceeded max protocol fee rate
101    #[error("Exceeded max protocol fee rate")]
102    ProtocolFeeRateMaxExceeded = 0x178D,
103    /// 6030 - Multiplication with shift right overflow
104    #[error("Multiplication with shift right overflow")]
105    MultiplicationShiftRightOverflow = 0x178E,
106    /// 6031 - Muldiv overflow
107    #[error("Muldiv overflow")]
108    MulDivOverflow = 0x178F,
109    /// 6032 - Invalid div_u256 input
110    #[error("Invalid div_u256 input")]
111    MulDivInvalidInput = 0x1790,
112    /// 6033 - Multiplication overflow
113    #[error("Multiplication overflow")]
114    MultiplicationOverflow = 0x1791,
115    /// 6034 - Provided SqrtPriceLimit not in the same direction as the swap.
116    #[error("Provided SqrtPriceLimit not in the same direction as the swap.")]
117    InvalidSqrtPriceLimitDirection = 0x1792,
118    /// 6035 - There are no tradable amount to swap.
119    #[error("There are no tradable amount to swap.")]
120    ZeroTradableAmount = 0x1793,
121    /// 6036 - Amount out below minimum threshold
122    #[error("Amount out below minimum threshold")]
123    AmountOutBelowMinimum = 0x1794,
124    /// 6037 - Amount in above maximum threshold
125    #[error("Amount in above maximum threshold")]
126    AmountInAboveMaximum = 0x1795,
127    /// 6038 - Invalid index for tick array sequence
128    #[error("Invalid index for tick array sequence")]
129    TickArraySequenceInvalidIndex = 0x1796,
130    /// 6039 - Amount calculated overflows
131    #[error("Amount calculated overflows")]
132    AmountCalcOverflow = 0x1797,
133    /// 6040 - Amount remaining overflows
134    #[error("Amount remaining overflows")]
135    AmountRemainingOverflow = 0x1798,
136    /// 6041 - Invalid intermediary mint
137    #[error("Invalid intermediary mint")]
138    InvalidIntermediaryMint = 0x1799,
139    /// 6042 - Duplicate two hop pool
140    #[error("Duplicate two hop pool")]
141    DuplicateTwoHopPool = 0x179A,
142    /// 6043 - Bundle index is out of bounds
143    #[error("Bundle index is out of bounds")]
144    InvalidBundleIndex = 0x179B,
145    /// 6044 - Position has already been opened
146    #[error("Position has already been opened")]
147    BundledPositionAlreadyOpened = 0x179C,
148    /// 6045 - Position has already been closed
149    #[error("Position has already been closed")]
150    BundledPositionAlreadyClosed = 0x179D,
151    /// 6046 - Unable to delete PositionBundle with open positions
152    #[error("Unable to delete PositionBundle with open positions")]
153    PositionBundleNotDeletable = 0x179E,
154    /// 6047 - Token mint has unsupported attributes
155    #[error("Token mint has unsupported attributes")]
156    UnsupportedTokenMint = 0x179F,
157    /// 6048 - Invalid remaining accounts
158    #[error("Invalid remaining accounts")]
159    RemainingAccountsInvalidSlice = 0x17A0,
160    /// 6049 - Insufficient remaining accounts
161    #[error("Insufficient remaining accounts")]
162    RemainingAccountsInsufficient = 0x17A1,
163    /// 6050 - Unable to call transfer hook without extra accounts
164    #[error("Unable to call transfer hook without extra accounts")]
165    NoExtraAccountsForTransferHook = 0x17A2,
166    /// 6051 - Output and input amount mismatch
167    #[error("Output and input amount mismatch")]
168    IntermediateTokenAmountMismatch = 0x17A3,
169    /// 6052 - Transfer fee calculation failed
170    #[error("Transfer fee calculation failed")]
171    TransferFeeCalculationError = 0x17A4,
172    /// 6053 - Same accounts type is provided more than once
173    #[error("Same accounts type is provided more than once")]
174    RemainingAccountsDuplicatedAccountsType = 0x17A5,
175    /// 6054 - This whirlpool only supports full-range positions
176    #[error("This whirlpool only supports full-range positions")]
177    FullRangeOnlyPool = 0x17A6,
178    /// 6055 - Too many supplemental tick arrays provided
179    #[error("Too many supplemental tick arrays provided")]
180    TooManySupplementalTickArrays = 0x17A7,
181    /// 6056 - TickArray account for different whirlpool provided
182    #[error("TickArray account for different whirlpool provided")]
183    DifferentWhirlpoolTickArrayAccount = 0x17A8,
184    /// 6057 - Trade resulted in partial fill
185    #[error("Trade resulted in partial fill")]
186    PartialFillError = 0x17A9,
187    /// 6058 - Position is not lockable
188    #[error("Position is not lockable")]
189    PositionNotLockable = 0x17AA,
190    /// 6059 - Operation not allowed on locked position
191    #[error("Operation not allowed on locked position")]
192    OperationNotAllowedOnLockedPosition = 0x17AB,
193    /// 6060 - Cannot reset position range with same tick range
194    #[error("Cannot reset position range with same tick range")]
195    SameTickRangeNotAllowed = 0x17AC,
196    /// 6061 - Invalid adaptive fee constants
197    #[error("Invalid adaptive fee constants")]
198    InvalidAdaptiveFeeConstants = 0x17AD,
199    /// 6062 - Invalid fee tier index
200    #[error("Invalid fee tier index")]
201    InvalidFeeTierIndex = 0x17AE,
202    /// 6063 - Invalid trade enable timestamp
203    #[error("Invalid trade enable timestamp")]
204    InvalidTradeEnableTimestamp = 0x17AF,
205    /// 6064 - Trade is not enabled yet
206    #[error("Trade is not enabled yet")]
207    TradeIsNotEnabled = 0x17B0,
208}
209
210impl solana_program_error::PrintProgramError for WhirlpoolError {
211    fn print<E>(&self) {
212        solana_msg::msg!(&self.to_string());
213    }
214}
215
216impl<T> solana_decode_error::DecodeError<T> for WhirlpoolError {
217    fn type_of() -> &'static str {
218        "WhirlpoolError"
219    }
220}