1use crate::{MplTokenMetadataDecoder, PROGRAM_ID};
3
4#[cfg(feature = "postgres")]
5pub mod postgres;
6
7#[cfg(feature = "graphql")]
8pub mod graphql;
9
10pub mod approve_collection_authority;
11pub mod approve_use_authority;
12pub mod bubblegum_set_collection_size;
13pub mod burn;
14pub mod burn_edition_nft;
15pub mod burn_nft;
16pub mod close_accounts;
17pub mod close_escrow_account;
18pub mod collect;
19pub mod convert_master_edition_v1_to_v2;
20pub mod create;
21pub mod create_escrow_account;
22pub mod create_master_edition;
23pub mod create_master_edition_v3;
24pub mod create_metadata_account;
25pub mod create_metadata_account_v2;
26pub mod create_metadata_account_v3;
27pub mod delegate;
28pub mod deprecated_create_master_edition;
29pub mod deprecated_create_reservation_list;
30pub mod deprecated_mint_new_edition_from_master_edition_via_printing_token;
31pub mod deprecated_mint_printing_tokens;
32pub mod deprecated_mint_printing_tokens_via_token;
33pub mod deprecated_set_reservation_list;
34pub mod freeze_delegated_account;
35pub mod lock;
36pub mod migrate;
37pub mod mint;
38pub mod mint_new_edition_from_master_edition_via_token;
39pub mod mint_new_edition_from_master_edition_via_vault_proxy;
40pub mod print;
41pub mod puff_metadata;
42pub mod remove_creator_verification;
43pub mod resize;
44pub mod revoke;
45pub mod revoke_collection_authority;
46pub mod revoke_use_authority;
47pub mod set_and_verify_collection;
48pub mod set_and_verify_sized_collection_item;
49pub mod set_collection_size;
50pub mod set_token_standard;
51pub mod sign_metadata;
52pub mod thaw_delegated_account;
53pub mod transfer;
54pub mod transfer_out_of_escrow;
55pub mod unlock;
56pub mod unverify;
57pub mod unverify_collection;
58pub mod unverify_sized_collection_item;
59pub mod update;
60pub mod update_metadata_account;
61pub mod update_metadata_account_v2;
62pub mod update_primary_sale_happened_via_token;
63pub mod r#use;
64pub mod utilize;
65pub mod verify;
66pub mod verify_collection;
67pub mod verify_sized_collection_item;
68
69pub use self::{
70 approve_collection_authority::*, approve_use_authority::*, bubblegum_set_collection_size::*,
71 burn::*, burn_edition_nft::*, burn_nft::*, close_accounts::*, close_escrow_account::*,
72 collect::*, convert_master_edition_v1_to_v2::*, create::*, create_escrow_account::*,
73 create_master_edition::*, create_master_edition_v3::*, create_metadata_account::*,
74 create_metadata_account_v2::*, create_metadata_account_v3::*, delegate::*,
75 deprecated_create_master_edition::*, deprecated_create_reservation_list::*,
76 deprecated_mint_new_edition_from_master_edition_via_printing_token::*,
77 deprecated_mint_printing_tokens::*, deprecated_mint_printing_tokens_via_token::*,
78 deprecated_set_reservation_list::*, freeze_delegated_account::*, lock::*, migrate::*, mint::*,
79 mint_new_edition_from_master_edition_via_token::*,
80 mint_new_edition_from_master_edition_via_vault_proxy::*, print::*, puff_metadata::*, r#use::*,
81 remove_creator_verification::*, resize::*, revoke::*, revoke_collection_authority::*,
82 revoke_use_authority::*, set_and_verify_collection::*, set_and_verify_sized_collection_item::*,
83 set_collection_size::*, set_token_standard::*, sign_metadata::*, thaw_delegated_account::*,
84 transfer::*, transfer_out_of_escrow::*, unlock::*, unverify::*, unverify_collection::*,
85 unverify_sized_collection_item::*, update::*, update_metadata_account::*,
86 update_metadata_account_v2::*, update_primary_sale_happened_via_token::*, utilize::*,
87 verify::*, verify_collection::*, verify_sized_collection_item::*,
88};
89
90#[derive(Debug, Clone, PartialEq)]
91#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
92#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
93pub enum MplTokenMetadataInstruction {
94 ApproveCollectionAuthority {
95 program_id: solana_pubkey::Pubkey,
96 data: ApproveCollectionAuthority,
97 accounts: ApproveCollectionAuthorityInstructionAccounts,
98 },
99 ApproveUseAuthority {
100 program_id: solana_pubkey::Pubkey,
101 data: ApproveUseAuthority,
102 accounts: ApproveUseAuthorityInstructionAccounts,
103 },
104 BubblegumSetCollectionSize {
105 program_id: solana_pubkey::Pubkey,
106 data: BubblegumSetCollectionSize,
107 accounts: BubblegumSetCollectionSizeInstructionAccounts,
108 },
109 Burn {
110 program_id: solana_pubkey::Pubkey,
111 data: Burn,
112 accounts: BurnInstructionAccounts,
113 },
114 BurnEditionNft {
115 program_id: solana_pubkey::Pubkey,
116 data: BurnEditionNft,
117 accounts: BurnEditionNftInstructionAccounts,
118 },
119 BurnNft {
120 program_id: solana_pubkey::Pubkey,
121 data: BurnNft,
122 accounts: BurnNftInstructionAccounts,
123 },
124 CloseAccounts {
125 program_id: solana_pubkey::Pubkey,
126 data: CloseAccounts,
127 accounts: CloseAccountsInstructionAccounts,
128 },
129 CloseEscrowAccount {
130 program_id: solana_pubkey::Pubkey,
131 data: CloseEscrowAccount,
132 accounts: CloseEscrowAccountInstructionAccounts,
133 },
134 Collect {
135 program_id: solana_pubkey::Pubkey,
136 data: Collect,
137 accounts: CollectInstructionAccounts,
138 },
139 ConvertMasterEditionV1ToV2 {
140 program_id: solana_pubkey::Pubkey,
141 data: ConvertMasterEditionV1ToV2,
142 accounts: ConvertMasterEditionV1ToV2InstructionAccounts,
143 },
144 Create {
145 program_id: solana_pubkey::Pubkey,
146 data: Create,
147 accounts: CreateInstructionAccounts,
148 },
149 CreateEscrowAccount {
150 program_id: solana_pubkey::Pubkey,
151 data: CreateEscrowAccount,
152 accounts: CreateEscrowAccountInstructionAccounts,
153 },
154 CreateMasterEdition {
155 program_id: solana_pubkey::Pubkey,
156 data: CreateMasterEdition,
157 accounts: CreateMasterEditionInstructionAccounts,
158 },
159 CreateMasterEditionV3 {
160 program_id: solana_pubkey::Pubkey,
161 data: CreateMasterEditionV3,
162 accounts: CreateMasterEditionV3InstructionAccounts,
163 },
164 CreateMetadataAccount {
165 program_id: solana_pubkey::Pubkey,
166 data: CreateMetadataAccount,
167 accounts: CreateMetadataAccountInstructionAccounts,
168 },
169 CreateMetadataAccountV2 {
170 program_id: solana_pubkey::Pubkey,
171 data: CreateMetadataAccountV2,
172 accounts: CreateMetadataAccountV2InstructionAccounts,
173 },
174 CreateMetadataAccountV3 {
175 program_id: solana_pubkey::Pubkey,
176 data: CreateMetadataAccountV3,
177 accounts: CreateMetadataAccountV3InstructionAccounts,
178 },
179 Delegate {
180 program_id: solana_pubkey::Pubkey,
181 data: Delegate,
182 accounts: DelegateInstructionAccounts,
183 },
184 DeprecatedCreateMasterEdition {
185 program_id: solana_pubkey::Pubkey,
186 data: DeprecatedCreateMasterEdition,
187 accounts: DeprecatedCreateMasterEditionInstructionAccounts,
188 },
189 DeprecatedCreateReservationList {
190 program_id: solana_pubkey::Pubkey,
191 data: DeprecatedCreateReservationList,
192 accounts: DeprecatedCreateReservationListInstructionAccounts,
193 },
194 DeprecatedMintNewEditionFromMasterEditionViaPrintingToken {
195 program_id: solana_pubkey::Pubkey,
196 data: DeprecatedMintNewEditionFromMasterEditionViaPrintingToken,
197 accounts: DeprecatedMintNewEditionFromMasterEditionViaPrintingTokenInstructionAccounts,
198 },
199 DeprecatedMintPrintingTokens {
200 program_id: solana_pubkey::Pubkey,
201 data: DeprecatedMintPrintingTokens,
202 accounts: DeprecatedMintPrintingTokensInstructionAccounts,
203 },
204 DeprecatedMintPrintingTokensViaToken {
205 program_id: solana_pubkey::Pubkey,
206 data: DeprecatedMintPrintingTokensViaToken,
207 accounts: DeprecatedMintPrintingTokensViaTokenInstructionAccounts,
208 },
209 DeprecatedSetReservationList {
210 program_id: solana_pubkey::Pubkey,
211 data: DeprecatedSetReservationList,
212 accounts: DeprecatedSetReservationListInstructionAccounts,
213 },
214 FreezeDelegatedAccount {
215 program_id: solana_pubkey::Pubkey,
216 data: FreezeDelegatedAccount,
217 accounts: FreezeDelegatedAccountInstructionAccounts,
218 },
219 Lock {
220 program_id: solana_pubkey::Pubkey,
221 data: Lock,
222 accounts: LockInstructionAccounts,
223 },
224 Migrate {
225 program_id: solana_pubkey::Pubkey,
226 data: Migrate,
227 accounts: MigrateInstructionAccounts,
228 },
229 Mint {
230 program_id: solana_pubkey::Pubkey,
231 data: Mint,
232 accounts: MintInstructionAccounts,
233 },
234 MintNewEditionFromMasterEditionViaToken {
235 program_id: solana_pubkey::Pubkey,
236 data: MintNewEditionFromMasterEditionViaToken,
237 accounts: MintNewEditionFromMasterEditionViaTokenInstructionAccounts,
238 },
239 MintNewEditionFromMasterEditionViaVaultProxy {
240 program_id: solana_pubkey::Pubkey,
241 data: MintNewEditionFromMasterEditionViaVaultProxy,
242 accounts: MintNewEditionFromMasterEditionViaVaultProxyInstructionAccounts,
243 },
244 Print {
245 program_id: solana_pubkey::Pubkey,
246 data: Print,
247 accounts: PrintInstructionAccounts,
248 },
249 PuffMetadata {
250 program_id: solana_pubkey::Pubkey,
251 data: PuffMetadata,
252 accounts: PuffMetadataInstructionAccounts,
253 },
254 RemoveCreatorVerification {
255 program_id: solana_pubkey::Pubkey,
256 data: RemoveCreatorVerification,
257 accounts: RemoveCreatorVerificationInstructionAccounts,
258 },
259 Resize {
260 program_id: solana_pubkey::Pubkey,
261 data: Resize,
262 accounts: ResizeInstructionAccounts,
263 },
264 Revoke {
265 program_id: solana_pubkey::Pubkey,
266 data: Revoke,
267 accounts: RevokeInstructionAccounts,
268 },
269 RevokeCollectionAuthority {
270 program_id: solana_pubkey::Pubkey,
271 data: RevokeCollectionAuthority,
272 accounts: RevokeCollectionAuthorityInstructionAccounts,
273 },
274 RevokeUseAuthority {
275 program_id: solana_pubkey::Pubkey,
276 data: RevokeUseAuthority,
277 accounts: RevokeUseAuthorityInstructionAccounts,
278 },
279 SetAndVerifyCollection {
280 program_id: solana_pubkey::Pubkey,
281 data: SetAndVerifyCollection,
282 accounts: SetAndVerifyCollectionInstructionAccounts,
283 },
284 SetAndVerifySizedCollectionItem {
285 program_id: solana_pubkey::Pubkey,
286 data: SetAndVerifySizedCollectionItem,
287 accounts: SetAndVerifySizedCollectionItemInstructionAccounts,
288 },
289 SetCollectionSize {
290 program_id: solana_pubkey::Pubkey,
291 data: SetCollectionSize,
292 accounts: SetCollectionSizeInstructionAccounts,
293 },
294 SetTokenStandard {
295 program_id: solana_pubkey::Pubkey,
296 data: SetTokenStandard,
297 accounts: SetTokenStandardInstructionAccounts,
298 },
299 SignMetadata {
300 program_id: solana_pubkey::Pubkey,
301 data: SignMetadata,
302 accounts: SignMetadataInstructionAccounts,
303 },
304 ThawDelegatedAccount {
305 program_id: solana_pubkey::Pubkey,
306 data: ThawDelegatedAccount,
307 accounts: ThawDelegatedAccountInstructionAccounts,
308 },
309 Transfer {
310 program_id: solana_pubkey::Pubkey,
311 data: Transfer,
312 accounts: TransferInstructionAccounts,
313 },
314 TransferOutOfEscrow {
315 program_id: solana_pubkey::Pubkey,
316 data: TransferOutOfEscrow,
317 accounts: TransferOutOfEscrowInstructionAccounts,
318 },
319 Unlock {
320 program_id: solana_pubkey::Pubkey,
321 data: Unlock,
322 accounts: UnlockInstructionAccounts,
323 },
324 Unverify {
325 program_id: solana_pubkey::Pubkey,
326 data: Unverify,
327 accounts: UnverifyInstructionAccounts,
328 },
329 UnverifyCollection {
330 program_id: solana_pubkey::Pubkey,
331 data: UnverifyCollection,
332 accounts: UnverifyCollectionInstructionAccounts,
333 },
334 UnverifySizedCollectionItem {
335 program_id: solana_pubkey::Pubkey,
336 data: UnverifySizedCollectionItem,
337 accounts: UnverifySizedCollectionItemInstructionAccounts,
338 },
339 Update {
340 program_id: solana_pubkey::Pubkey,
341 data: Update,
342 accounts: UpdateInstructionAccounts,
343 },
344 UpdateMetadataAccount {
345 program_id: solana_pubkey::Pubkey,
346 data: UpdateMetadataAccount,
347 accounts: UpdateMetadataAccountInstructionAccounts,
348 },
349 UpdateMetadataAccountV2 {
350 program_id: solana_pubkey::Pubkey,
351 data: UpdateMetadataAccountV2,
352 accounts: UpdateMetadataAccountV2InstructionAccounts,
353 },
354 UpdatePrimarySaleHappenedViaToken {
355 program_id: solana_pubkey::Pubkey,
356 data: UpdatePrimarySaleHappenedViaToken,
357 accounts: UpdatePrimarySaleHappenedViaTokenInstructionAccounts,
358 },
359 Use {
360 program_id: solana_pubkey::Pubkey,
361 data: Use,
362 accounts: UseInstructionAccounts,
363 },
364 Utilize {
365 program_id: solana_pubkey::Pubkey,
366 data: Utilize,
367 accounts: UtilizeInstructionAccounts,
368 },
369 Verify {
370 program_id: solana_pubkey::Pubkey,
371 data: Verify,
372 accounts: VerifyInstructionAccounts,
373 },
374 VerifyCollection {
375 program_id: solana_pubkey::Pubkey,
376 data: VerifyCollection,
377 accounts: VerifyCollectionInstructionAccounts,
378 },
379 VerifySizedCollectionItem {
380 program_id: solana_pubkey::Pubkey,
381 data: VerifySizedCollectionItem,
382 accounts: VerifySizedCollectionItemInstructionAccounts,
383 },
384}
385
386impl carbon_core::instruction::InstructionDecoder<'_> for MplTokenMetadataDecoder {
387 type InstructionType = MplTokenMetadataInstruction;
388
389 fn decode_instruction(
390 &self,
391 instruction: &solana_instruction::Instruction,
392 ) -> Option<Self::InstructionType> {
393 if instruction.program_id != PROGRAM_ID {
394 return None;
395 }
396
397 carbon_core::try_decode_instructions!(
398 instruction,
399 PROGRAM_ID,
400 MplTokenMetadataInstruction::ApproveCollectionAuthority => ApproveCollectionAuthority,
401 MplTokenMetadataInstruction::ApproveUseAuthority => ApproveUseAuthority,
402 MplTokenMetadataInstruction::BubblegumSetCollectionSize => BubblegumSetCollectionSize,
403 MplTokenMetadataInstruction::Burn => Burn,
404 MplTokenMetadataInstruction::BurnEditionNft => BurnEditionNft,
405 MplTokenMetadataInstruction::BurnNft => BurnNft,
406 MplTokenMetadataInstruction::CloseAccounts => CloseAccounts,
407 MplTokenMetadataInstruction::CloseEscrowAccount => CloseEscrowAccount,
408 MplTokenMetadataInstruction::Collect => Collect,
409 MplTokenMetadataInstruction::ConvertMasterEditionV1ToV2 => ConvertMasterEditionV1ToV2,
410 MplTokenMetadataInstruction::Create => Create,
411 MplTokenMetadataInstruction::CreateEscrowAccount => CreateEscrowAccount,
412 MplTokenMetadataInstruction::CreateMasterEdition => CreateMasterEdition,
413 MplTokenMetadataInstruction::CreateMasterEditionV3 => CreateMasterEditionV3,
414 MplTokenMetadataInstruction::CreateMetadataAccount => CreateMetadataAccount,
415 MplTokenMetadataInstruction::CreateMetadataAccountV2 => CreateMetadataAccountV2,
416 MplTokenMetadataInstruction::CreateMetadataAccountV3 => CreateMetadataAccountV3,
417 MplTokenMetadataInstruction::Delegate => Delegate,
418 MplTokenMetadataInstruction::DeprecatedCreateMasterEdition => DeprecatedCreateMasterEdition,
419 MplTokenMetadataInstruction::DeprecatedCreateReservationList => DeprecatedCreateReservationList,
420 MplTokenMetadataInstruction::DeprecatedMintNewEditionFromMasterEditionViaPrintingToken => DeprecatedMintNewEditionFromMasterEditionViaPrintingToken,
421 MplTokenMetadataInstruction::DeprecatedMintPrintingTokens => DeprecatedMintPrintingTokens,
422 MplTokenMetadataInstruction::DeprecatedMintPrintingTokensViaToken => DeprecatedMintPrintingTokensViaToken,
423 MplTokenMetadataInstruction::DeprecatedSetReservationList => DeprecatedSetReservationList,
424 MplTokenMetadataInstruction::FreezeDelegatedAccount => FreezeDelegatedAccount,
425 MplTokenMetadataInstruction::Lock => Lock,
426 MplTokenMetadataInstruction::Migrate => Migrate,
427 MplTokenMetadataInstruction::Mint => Mint,
428 MplTokenMetadataInstruction::MintNewEditionFromMasterEditionViaToken => MintNewEditionFromMasterEditionViaToken,
429 MplTokenMetadataInstruction::MintNewEditionFromMasterEditionViaVaultProxy => MintNewEditionFromMasterEditionViaVaultProxy,
430 MplTokenMetadataInstruction::Print => Print,
431 MplTokenMetadataInstruction::PuffMetadata => PuffMetadata,
432 MplTokenMetadataInstruction::RemoveCreatorVerification => RemoveCreatorVerification,
433 MplTokenMetadataInstruction::Resize => Resize,
434 MplTokenMetadataInstruction::Revoke => Revoke,
435 MplTokenMetadataInstruction::RevokeCollectionAuthority => RevokeCollectionAuthority,
436 MplTokenMetadataInstruction::RevokeUseAuthority => RevokeUseAuthority,
437 MplTokenMetadataInstruction::SetAndVerifyCollection => SetAndVerifyCollection,
438 MplTokenMetadataInstruction::SetAndVerifySizedCollectionItem => SetAndVerifySizedCollectionItem,
439 MplTokenMetadataInstruction::SetCollectionSize => SetCollectionSize,
440 MplTokenMetadataInstruction::SetTokenStandard => SetTokenStandard,
441 MplTokenMetadataInstruction::SignMetadata => SignMetadata,
442 MplTokenMetadataInstruction::ThawDelegatedAccount => ThawDelegatedAccount,
443 MplTokenMetadataInstruction::Transfer => Transfer,
444 MplTokenMetadataInstruction::TransferOutOfEscrow => TransferOutOfEscrow,
445 MplTokenMetadataInstruction::Unlock => Unlock,
446 MplTokenMetadataInstruction::Unverify => Unverify,
447 MplTokenMetadataInstruction::UnverifyCollection => UnverifyCollection,
448 MplTokenMetadataInstruction::UnverifySizedCollectionItem => UnverifySizedCollectionItem,
449 MplTokenMetadataInstruction::Update => Update,
450 MplTokenMetadataInstruction::UpdateMetadataAccount => UpdateMetadataAccount,
451 MplTokenMetadataInstruction::UpdateMetadataAccountV2 => UpdateMetadataAccountV2,
452 MplTokenMetadataInstruction::UpdatePrimarySaleHappenedViaToken => UpdatePrimarySaleHappenedViaToken,
453 MplTokenMetadataInstruction::Use => Use,
454 MplTokenMetadataInstruction::Utilize => Utilize,
455 MplTokenMetadataInstruction::Verify => Verify,
456 MplTokenMetadataInstruction::VerifyCollection => VerifyCollection,
457 MplTokenMetadataInstruction::VerifySizedCollectionItem => VerifySizedCollectionItem,
458 )
459 }
460}