defituna_client/generated/errors/
tuna.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 TunaError {
13    /// 6000 - AmountSlippageExceeded
14    #[error("AmountSlippageExceeded")]
15    AmountSlippageExceeded = 0x1770,
16    /// 6001 - BadDebt
17    #[error("BadDebt")]
18    BadDebt = 0x1771,
19    /// 6002 - InvalidRemainingAccountsLength
20    #[error("InvalidRemainingAccountsLength")]
21    InvalidRemainingAccountsLength = 0x1772,
22    /// 6003 - InvalidAccounts
23    #[error("InvalidAccounts")]
24    InvalidTickArrayAccounts = 0x1773,
25    /// 6004 - InvalidAccountOwner
26    #[error("InvalidAccountOwner")]
27    InvalidAccountOwner = 0x1774,
28    /// 6005 - InvalidInstructionArguments
29    #[error("InvalidInstructionArguments")]
30    InvalidInstructionArguments = 0x1775,
31    /// 6006 - Provided SqrtPriceLimit not in the same direction as the swap.
32    #[error("Provided SqrtPriceLimit not in the same direction as the swap.")]
33    InvalidSqrtPriceLimitDirection = 0x1776,
34    /// 6007 - InvalidTickArraySequence
35    #[error("InvalidTickArraySequence")]
36    InvalidTickArraySequence = 0x1777,
37    /// 6008 - InsufficientLiquidity
38    #[error("InsufficientLiquidity")]
39    InsufficientLiquidity = 0x1778,
40    /// 6009 - InterestRateIsOutOfRange
41    #[error("InterestRateIsOutOfRange")]
42    InterestRateIsOutOfRange = 0x1779,
43    /// 6010 - LeverageIsOutOfRange
44    #[error("LeverageIsOutOfRange")]
45    LeverageIsOutOfRange = 0x177A,
46    /// 6011 - LeftoversExceeded
47    #[error("LeftoversExceeded")]
48    LeftoversExceeded = 0x177B,
49    /// 6012 - LimitOrderExecutionFeeIsOutOfRange
50    #[error("LimitOrderExecutionFeeIsOutOfRange")]
51    LimitOrderExecutionFeeIsOutOfRange = 0x177C,
52    /// 6013 - LiquidationFeeIsOutOfRange
53    #[error("LiquidationFeeIsOutOfRange")]
54    LiquidationFeeIsOutOfRange = 0x177D,
55    /// 6014 - LiquidationThresholdIsOutOfRange
56    #[error("LiquidationThresholdIsOutOfRange")]
57    LiquidationThresholdIsOutOfRange = 0x177E,
58    /// 6015 - Liquidity amount must be greater than zero.
59    #[error("Liquidity amount must be greater than zero.")]
60    LiquidityZero = 0x177F,
61    /// 6016 - MarketDisabled
62    #[error("MarketDisabled")]
63    MarketDisabled = 0x1780,
64    /// 6017 - MarketDebtLimitExceeded
65    #[error("MarketDebtLimitExceeded")]
66    MarketDebtLimitExceeded = 0x1781,
67    /// 6018 - MathOverflow
68    #[error("MathOverflow")]
69    MathOverflow = 0x1782,
70    /// 6019 - MathUnderflow
71    #[error("MathUnderflow")]
72    MathUnderflow = 0x1783,
73    /// 6020 - Unable to call transfer hook without extra accounts
74    #[error("Unable to call transfer hook without extra accounts")]
75    NoExtraAccountsForTransferHook = 0x1784,
76    /// 6021 - OracleStalePrice
77    #[error("OracleStalePrice")]
78    OracleStalePrice = 0x1785,
79    /// 6022 - OraclePriceDeviationThresholdExceeded
80    #[error("OraclePriceDeviationThresholdExceeded")]
81    OraclePriceDeviationThresholdExceeded = 0x1786,
82    /// 6023 - OraclePriceDeviationThresholdOutOfRange
83    #[error("OraclePriceDeviationThresholdOutOfRange")]
84    OraclePriceDeviationThresholdOutOfRange = 0x1787,
85    /// 6024 - Trade resulted in partial fill
86    #[error("Trade resulted in partial fill")]
87    PartialFillError = 0x1788,
88    /// 6025 - PositionIsHealthy
89    #[error("PositionIsHealthy")]
90    PositionIsHealthy = 0x1789,
91    /// 6026 - PositionIsLiquidated
92    #[error("PositionIsLiquidated")]
93    PositionIsLiquidated = 0x178A,
94    /// 6027 - PositionIsUnhealthy
95    #[error("PositionIsUnhealthy")]
96    PositionIsUnhealthy = 0x178B,
97    /// 6028 - PositionNotEmpty
98    #[error("PositionNotEmpty")]
99    PositionNotEmpty = 0x178C,
100    /// 6029 - ProtocolFeeIsOutOfRange
101    #[error("ProtocolFeeIsOutOfRange")]
102    ProtocolFeeIsOutOfRange = 0x178D,
103    /// 6030 - SolverFailedToFindRoot
104    #[error("SolverFailedToFindRoot")]
105    SolverFailedToFindRoot = 0x178E,
106    /// 6031 - SqrtPriceOutOfBounds
107    #[error("SqrtPriceOutOfBounds")]
108    SqrtPriceOutOfBounds = 0x178F,
109    /// 6032 - SupplyLimitExceeded
110    #[error("SupplyLimitExceeded")]
111    SupplyLimitExceeded = 0x1790,
112    /// 6033 - Suspended
113    #[error("Suspended")]
114    Suspended = 0x1791,
115    /// 6034 - SwapSlippageExceeded
116    #[error("SwapSlippageExceeded")]
117    SwapSlippageExceeded = 0x1792,
118    /// 6035 - SwapSlippageIsOutOfRange
119    #[error("SwapSlippageIsOutOfRange")]
120    SwapSlippageIsOutOfRange = 0x1793,
121    /// 6036 - TickIndexOfBounds
122    #[error("TickIndexOfBounds")]
123    TickIndexOfBounds = 0x1794,
124    /// 6037 - Transfer fee calculation failed
125    #[error("Transfer fee calculation failed")]
126    TransferFeeCalculationError = 0x1795,
127    /// 6038 - TypeCastOverflow
128    #[error("TypeCastOverflow")]
129    TypeCastOverflow = 0x1796,
130    /// 6039 - UnexpectedValue
131    #[error("UnexpectedValue")]
132    UnexpectedValue = 0x1797,
133    /// 6040 - Token mint has unsupported attributes
134    #[error("Token mint has unsupported attributes")]
135    UnsupportedTokenMint = 0x1798,
136    /// 6041 - VaultNotInitialized
137    #[error("VaultNotInitialized")]
138    VaultNotInitialized = 0x1799,
139    /// 6042 - WithdrawRequestExceedsUserBalance
140    #[error("WithdrawRequestExceedsUserBalance")]
141    WithdrawRequestExceedsUserBalance = 0x179A,
142    /// 6043 - ZeroPriceRange
143    #[error("ZeroPriceRange")]
144    ZeroPriceRange = 0x179B,
145    /// 6044 - There are no tradable amount to swap.
146    #[error("There are no tradable amount to swap.")]
147    ZeroTradableAmount = 0x179C,
148    /// 6045 - ZeroYield
149    #[error("ZeroYield")]
150    ZeroYield = 0x179D,
151    /// 6046 - RaydiumInvalidFirstTickArrayAccount
152    #[error("RaydiumInvalidFirstTickArrayAccount")]
153    RaydiumInvalidFirstTickArrayAccount = 0x179E,
154    /// 6047 - RaydiumInvalidTickArray
155    #[error("RaydiumInvalidTickArray")]
156    RaydiumInvalidTickArray = 0x179F,
157    /// 6048 - RaydiumInvaildTickIndex
158    #[error("RaydiumInvaildTickIndex")]
159    RaydiumInvaildTickIndex = 0x17A0,
160    /// 6049 - RaydiumMaxTokenOverflow
161    #[error("RaydiumMaxTokenOverflow")]
162    RaydiumMaxTokenOverflow = 0x17A1,
163    /// 6050 - RaydiumNotEnoughTickArrayAccount
164    #[error("RaydiumNotEnoughTickArrayAccount")]
165    RaydiumNotEnoughTickArrayAccount = 0x17A2,
166    /// 6051 - RaydiumSqrtPriceLimitOverflow
167    #[error("RaydiumSqrtPriceLimitOverflow")]
168    RaydiumSqrtPriceLimitOverflow = 0x17A3,
169    /// 6052 - RaydiumZeroAmountSpecified
170    #[error("RaydiumZeroAmountSpecified")]
171    RaydiumZeroAmountSpecified = 0x17A4,
172    /// 6053 - UnableToLoadAccountData
173    #[error("UnableToLoadAccountData")]
174    UnableToLoadAccountData = 0x17A5,
175    /// 6054 - UnableToDeserializeAccountData
176    #[error("UnableToDeserializeAccountData")]
177    UnableToDeserializeAccountData = 0x17A6,
178}
179
180impl solana_program::program_error::PrintProgramError for TunaError {
181    fn print<E>(&self) {
182        solana_program::msg!(&self.to_string());
183    }
184}
185
186impl<T> solana_program::decode_error::DecodeError<T> for TunaError {
187    fn type_of() -> &'static str {
188        "TunaError"
189    }
190}
191