yellowstone_shield_client/generated/errors/
shield.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum ShieldError {
13 #[error("Error deserializing an account")]
15 DeserializationError = 0x0,
16 #[error("Error serializing an account")]
18 SerializationError = 0x1,
19 #[error("Invalid program owner. This likely mean the provided account does not exist")]
21 InvalidProgramOwner = 0x2,
22 #[error("Invalid PDA derivation")]
24 InvalidPda = 0x3,
25 #[error("Expected empty account")]
27 ExpectedEmptyAccount = 0x4,
28 #[error("Expected non empty account")]
30 ExpectedNonEmptyAccount = 0x5,
31 #[error("Expected signer account")]
33 ExpectedSignerAccount = 0x6,
34 #[error("Expected writable account")]
36 ExpectedWritableAccount = 0x7,
37 #[error("Account mismatch")]
39 AccountMismatch = 0x8,
40 #[error("Invalid account key")]
42 InvalidAccountKey = 0x9,
43 #[error("Numerical overflow")]
45 NumericalOverflow = 0xA,
46 #[error("Expected ositive amount")]
48 ExpectedPositiveAmount = 0xB,
49 #[error("Incorrect token owner")]
51 IncorrectTokenOwner = 0xC,
52 #[error("Mismatching mint")]
54 MistmatchMint = 0xD,
55 #[error("identity not found")]
57 IdentityNotFound = 0xE,
58 #[error("Invalid associated token account")]
60 InvalidAssociatedTokenAccount = 0xF,
61 #[error("Condition not met")]
63 MissedCondition = 0x10,
64 #[error("invalid account data")]
66 InvalidAccountData = 0x11,
67 #[error("Invalid argument")]
69 InvalidArgument = 0x12,
70 #[error("Invalid instruction data")]
72 InvalidInstructionData = 0x13,
73 #[error("Account data too small")]
75 AccountDataTooSmall = 0x14,
76 #[error("Insufficient funds")]
78 InsufficientFunds = 0x15,
79 #[error("Incorrect program id")]
81 IncorrectProgramId = 0x16,
82 #[error("Missing required signature")]
84 MissingRequiredSignature = 0x17,
85 #[error("Account already initialized")]
87 AccountAlreadyInitialized = 0x18,
88 #[error("Uninitialized account")]
90 UninitializedAccount = 0x19,
91 #[error("Not enough account keys")]
93 NotEnoughAccountKeys = 0x1A,
94 #[error("Account borrow failed")]
96 AccountBorrowFailed = 0x1B,
97 #[error("Max seed length exceeded")]
99 MaxSeedLengthExceeded = 0x1C,
100 #[error("Invalid seeds")]
102 InvalidSeeds = 0x1D,
103 #[error("Borsh IO error")]
105 BorshIoError = 0x1E,
106 #[error("Account not rent exempt")]
108 AccountNotRentExempt = 0x1F,
109 #[error("Unsupported sysvar")]
111 UnsupportedSysvar = 0x20,
112 #[error("Illegal owner")]
114 IllegalOwner = 0x21,
115 #[error("Max accounts data allocations exceeded")]
117 MaxAccountsDataAllocationsExceeded = 0x22,
118 #[error("Invalid realloc")]
120 InvalidRealloc = 0x23,
121 #[error("Max instruction trace length exceeded")]
123 MaxInstructionTraceLengthExceeded = 0x24,
124 #[error("Builtin programs must consume compute units")]
126 BuiltinProgramsMustConsumeComputeUnits = 0x25,
127 #[error("Invalid account owner")]
129 InvalidAccountOwner = 0x26,
130 #[error("Arithmetic overflow")]
132 ArithmeticOverflow = 0x27,
133 #[error("Immutable")]
135 Immutable = 0x28,
136 #[error("Incorrect authority")]
138 IncorrectAuthority = 0x29,
139 #[error("Generic program error")]
141 GenericError = 0x2A,
142 #[error("Invalid strategy")]
144 InvalidStrategy = 0x2B,
145 #[error("Invalid Policy Kind")]
147 InvalidPolicyKind = 0x2C,
148 #[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}