mpl_bubblegum/generated/errors/
mpl_bubblegum.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum MplBubblegumError {
13 #[error("Asset Owner Does not match")]
15 AssetOwnerMismatch,
16 #[error("PublicKeyMismatch")]
18 PublicKeyMismatch,
19 #[error("Hashing Mismatch Within Leaf Schema")]
21 HashingMismatch,
22 #[error("Unsupported Schema Version")]
24 UnsupportedSchemaVersion,
25 #[error("Creator shares must sum to 100")]
27 CreatorShareTotalMustBe100,
28 #[error("No duplicate creator addresses in metadata")]
30 DuplicateCreatorAddress,
31 #[error("Creator did not verify the metadata")]
33 CreatorDidNotVerify,
34 #[error("Creator not found in creator Vec")]
36 CreatorNotFound,
37 #[error("No creators in creator Vec")]
39 NoCreatorsPresent,
40 #[error("User-provided creator Vec must result in same user-provided creator hash")]
42 CreatorHashMismatch,
43 #[error("User-provided metadata must result in same user-provided data hash")]
45 DataHashMismatch,
46 #[error("Creators list too long")]
48 CreatorsTooLong,
49 #[error("Name in metadata is too long")]
51 MetadataNameTooLong,
52 #[error("Symbol in metadata is too long")]
54 MetadataSymbolTooLong,
55 #[error("Uri in metadata is too long")]
57 MetadataUriTooLong,
58 #[error("Basis points in metadata cannot exceed 10000")]
60 MetadataBasisPointsTooHigh,
61 #[error("Tree creator or tree delegate must sign.")]
63 TreeAuthorityIncorrect,
64 #[error("Not enough unapproved mints left")]
66 InsufficientMintCapacity,
67 #[error("NumericalOverflowError")]
69 NumericalOverflowError,
70 #[error("Incorrect account owner")]
72 IncorrectOwner,
73 #[error("Cannot Verify Collection in this Instruction")]
75 CollectionCannotBeVerifiedInThisInstruction,
76 #[error("Collection Not Found on Metadata")]
78 CollectionNotFound,
79 #[error("Collection item is already verified.")]
81 AlreadyVerified,
82 #[error("Collection item is already unverified.")]
84 AlreadyUnverified,
85 #[error("Incorrect leaf metadata update authority.")]
87 UpdateAuthorityIncorrect,
88 #[error("This transaction must be signed by either the leaf owner or leaf delegate")]
90 LeafAuthorityMustSign,
91 #[error("Collection Not Compatable with Compression, Must be Sized")]
93 CollectionMustBeSized,
94 #[error("Metadata mint does not match collection mint")]
96 MetadataMintMismatch,
97 #[error("Invalid collection authority")]
99 InvalidCollectionAuthority,
100 #[error("Invalid delegate record pda derivation")]
102 InvalidDelegateRecord,
103 #[error("Edition account doesnt match collection")]
105 CollectionMasterEditionAccountInvalid,
106 #[error("Collection Must Be a Unique Master Edition v2")]
108 CollectionMustBeAUniqueMasterEdition,
109 #[error("Could not convert external error to BubblegumError")]
111 UnknownExternalError,
112 #[error("Decompression is disabled for this tree.")]
114 DecompressionDisabled,
115 #[error("Missing collection mint account")]
117 MissingCollectionMintAccount,
118 #[error("Missing collection metadata account")]
120 MissingCollectionMetadataAccount,
121 #[error("Collection mismatch")]
123 CollectionMismatch,
124 #[error("Metadata not mutable")]
126 MetadataImmutable,
127 #[error("Can only update primary sale to true")]
129 PrimarySaleCanOnlyBeFlippedToTrue,
130 #[error("Creator did not unverify the metadata")]
132 CreatorDidNotUnverify,
133 #[error("Only NonFungible standard is supported")]
135 InvalidTokenStandard,
136 #[error("Canopy size should be set bigger for this tree")]
138 InvalidCanopySize,
139 #[error("Invalid log wrapper program")]
141 InvalidLogWrapper,
142 #[error("Invalid compression program")]
144 InvalidCompressionProgram,
145 #[error("Leaf must be delegated to someone other than the leaf owner")]
147 LeafMustBeDelegated,
148 #[error("Asset is frozen")]
150 AssetIsFrozen,
151 #[error("Asset is non-transferable")]
153 AssetIsNonTransferable,
154 #[error("Invalid authority")]
156 InvalidAuthority,
157 #[error("Collection is frozen")]
159 CollectionIsFrozen,
160 #[error("Core collections must have the Bubblegum V2 plugin on them")]
162 CollectionMustHaveBubblegumPlugin,
163 #[error("Feature not currently available")]
165 NotAvailable,
166 #[error("Missing collection account")]
168 MissingCollectionAccount,
169 #[error("Asset data length too long")]
171 AssetDataLengthTooLong,
172 #[error("Item is already in the collection")]
174 AlreadyInCollection,
175 #[error("Item is already not in a collection")]
177 AlreadyNotInCollection,
178 #[error("Missing mpl-core CPI signer account")]
180 MissingMplCoreCpiSignerAccount,
181 #[error("Asset is not frozen")]
183 AssetIsNotFrozen,
184}
185
186impl solana_program::program_error::PrintProgramError for MplBubblegumError {
187 fn print<E>(&self) {
188 solana_program::msg!(&self.to_string());
189 }
190}