yellowstone_shield_client/generated/errors/
shield.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 ShieldError {
13    /// 0 - Error deserializing an account
14    #[error("Error deserializing an account")]
15    DeserializationError = 0x0,
16    /// 1 - Error serializing an account
17    #[error("Error serializing an account")]
18    SerializationError = 0x1,
19    /// 2 - Invalid program owner. This likely mean the provided account does not exist
20    #[error("Invalid program owner. This likely mean the provided account does not exist")]
21    InvalidProgramOwner = 0x2,
22    /// 3 - Invalid PDA derivation
23    #[error("Invalid PDA derivation")]
24    InvalidPda = 0x3,
25    /// 4 - Expected empty account
26    #[error("Expected empty account")]
27    ExpectedEmptyAccount = 0x4,
28    /// 5 - Expected non empty account
29    #[error("Expected non empty account")]
30    ExpectedNonEmptyAccount = 0x5,
31    /// 6 - Expected signer account
32    #[error("Expected signer account")]
33    ExpectedSignerAccount = 0x6,
34    /// 7 - Expected writable account
35    #[error("Expected writable account")]
36    ExpectedWritableAccount = 0x7,
37    /// 8 - Account mismatch
38    #[error("Account mismatch")]
39    AccountMismatch = 0x8,
40    /// 9 - Invalid account key
41    #[error("Invalid account key")]
42    InvalidAccountKey = 0x9,
43    /// 10 - Numerical overflow
44    #[error("Numerical overflow")]
45    NumericalOverflow = 0xA,
46    /// 11 - Expected ositive amount
47    #[error("Expected ositive amount")]
48    ExpectedPositiveAmount = 0xB,
49    /// 12 - Incorrect token owner
50    #[error("Incorrect token owner")]
51    IncorrectTokenOwner = 0xC,
52    /// 13 - Mismatching mint
53    #[error("Mismatching mint")]
54    MistmatchMint = 0xD,
55    /// 14 - identity not found
56    #[error("identity not found")]
57    IdentityNotFound = 0xE,
58    /// 15 - Invalid associated token account
59    #[error("Invalid associated token account")]
60    InvalidAssociatedTokenAccount = 0xF,
61    /// 16 - Condition not met
62    #[error("Condition not met")]
63    MissedCondition = 0x10,
64    /// 17 - invalid account data
65    #[error("invalid account data")]
66    InvalidAccountData = 0x11,
67    /// 18 - Invalid argument
68    #[error("Invalid argument")]
69    InvalidArgument = 0x12,
70    /// 19 - Invalid instruction data
71    #[error("Invalid instruction data")]
72    InvalidInstructionData = 0x13,
73    /// 20 - Account data too small
74    #[error("Account data too small")]
75    AccountDataTooSmall = 0x14,
76    /// 21 - Insufficient funds
77    #[error("Insufficient funds")]
78    InsufficientFunds = 0x15,
79    /// 22 - Incorrect program id
80    #[error("Incorrect program id")]
81    IncorrectProgramId = 0x16,
82    /// 23 - Missing required signature
83    #[error("Missing required signature")]
84    MissingRequiredSignature = 0x17,
85    /// 24 - Account already initialized
86    #[error("Account already initialized")]
87    AccountAlreadyInitialized = 0x18,
88    /// 25 - Uninitialized account
89    #[error("Uninitialized account")]
90    UninitializedAccount = 0x19,
91    /// 26 - Not enough account keys
92    #[error("Not enough account keys")]
93    NotEnoughAccountKeys = 0x1A,
94    /// 27 - Account borrow failed
95    #[error("Account borrow failed")]
96    AccountBorrowFailed = 0x1B,
97    /// 28 - Max seed length exceeded
98    #[error("Max seed length exceeded")]
99    MaxSeedLengthExceeded = 0x1C,
100    /// 29 - Invalid seeds
101    #[error("Invalid seeds")]
102    InvalidSeeds = 0x1D,
103    /// 30 - Borsh IO error
104    #[error("Borsh IO error")]
105    BorshIoError = 0x1E,
106    /// 31 - Account not rent exempt
107    #[error("Account not rent exempt")]
108    AccountNotRentExempt = 0x1F,
109    /// 32 - Unsupported sysvar
110    #[error("Unsupported sysvar")]
111    UnsupportedSysvar = 0x20,
112    /// 33 - Illegal owner
113    #[error("Illegal owner")]
114    IllegalOwner = 0x21,
115    /// 34 - Max accounts data allocations exceeded
116    #[error("Max accounts data allocations exceeded")]
117    MaxAccountsDataAllocationsExceeded = 0x22,
118    /// 35 - Invalid realloc
119    #[error("Invalid realloc")]
120    InvalidRealloc = 0x23,
121    /// 36 - Max instruction trace length exceeded
122    #[error("Max instruction trace length exceeded")]
123    MaxInstructionTraceLengthExceeded = 0x24,
124    /// 37 - Builtin programs must consume compute units
125    #[error("Builtin programs must consume compute units")]
126    BuiltinProgramsMustConsumeComputeUnits = 0x25,
127    /// 38 - Invalid account owner
128    #[error("Invalid account owner")]
129    InvalidAccountOwner = 0x26,
130    /// 39 - Arithmetic overflow
131    #[error("Arithmetic overflow")]
132    ArithmeticOverflow = 0x27,
133    /// 40 - Immutable
134    #[error("Immutable")]
135    Immutable = 0x28,
136    /// 41 - Incorrect authority
137    #[error("Incorrect authority")]
138    IncorrectAuthority = 0x29,
139    /// 42 - Generic program error
140    #[error("Generic program error")]
141    GenericError = 0x2A,
142    /// 43 - Invalid strategy
143    #[error("Invalid strategy")]
144    InvalidStrategy = 0x2B,
145    /// 44 - Invalid Policy Kind
146    #[error("Invalid Policy Kind")]
147    InvalidPolicyKind = 0x2C,
148    /// 45 - Invalid Index To Reference Identity
149    #[error("Invalid Index To Reference Identity")]
150    InvalidIndexToReferenceIdentity = 0x2D,
151}
152
153impl From<ShieldError> for solana_program_error::ProgramError {
154    fn from(e: ShieldError) -> Self {
155        solana_program_error::ProgramError::Custom(e as u32)
156    }
157}