Skip to main content

carbon_mpl_core_decoder/instructions/
mod.rs

1//! This code was AUTOGENERATED using the Codama library.
2use crate::{MplCoreDecoder, PROGRAM_ID};
3
4#[cfg(feature = "postgres")]
5pub mod postgres;
6
7#[cfg(feature = "graphql")]
8pub mod graphql;
9
10pub mod add_assets_to_group_v1;
11pub mod add_collection_external_plugin_adapter_v1;
12pub mod add_collection_plugin_v1;
13pub mod add_collections_to_group_v1;
14pub mod add_external_plugin_adapter_v1;
15pub mod add_groups_to_group_v1;
16pub mod add_plugin_v1;
17pub mod approve_collection_plugin_authority_v1;
18pub mod approve_plugin_authority_v1;
19pub mod burn_collection_v1;
20pub mod burn_v1;
21pub mod close_group_v1;
22pub mod collect;
23pub mod compress_v1;
24pub mod create_collection_v1;
25pub mod create_collection_v2;
26pub mod create_group_v1;
27pub mod create_v1;
28pub mod create_v2;
29pub mod decompress_v1;
30pub mod execute_v1;
31pub mod remove_assets_from_group_v1;
32pub mod remove_collection_external_plugin_adapter_v1;
33pub mod remove_collection_plugin_v1;
34pub mod remove_collections_from_group_v1;
35pub mod remove_external_plugin_adapter_v1;
36pub mod remove_groups_from_group_v1;
37pub mod remove_plugin_v1;
38pub mod revoke_collection_plugin_authority_v1;
39pub mod revoke_plugin_authority_v1;
40pub mod transfer_v1;
41pub mod update_collection_external_plugin_adapter_v1;
42pub mod update_collection_info_v1;
43pub mod update_collection_plugin_v1;
44pub mod update_collection_v1;
45pub mod update_external_plugin_adapter_v1;
46pub mod update_group_v1;
47pub mod update_plugin_v1;
48pub mod update_v1;
49pub mod update_v2;
50pub mod write_collection_external_plugin_adapter_data_v1;
51pub mod write_external_plugin_adapter_data_v1;
52
53pub use self::{
54    add_assets_to_group_v1::*, add_collection_external_plugin_adapter_v1::*,
55    add_collection_plugin_v1::*, add_collections_to_group_v1::*, add_external_plugin_adapter_v1::*,
56    add_groups_to_group_v1::*, add_plugin_v1::*, approve_collection_plugin_authority_v1::*,
57    approve_plugin_authority_v1::*, burn_collection_v1::*, burn_v1::*, close_group_v1::*,
58    collect::*, compress_v1::*, create_collection_v1::*, create_collection_v2::*,
59    create_group_v1::*, create_v1::*, create_v2::*, decompress_v1::*, execute_v1::*,
60    remove_assets_from_group_v1::*, remove_collection_external_plugin_adapter_v1::*,
61    remove_collection_plugin_v1::*, remove_collections_from_group_v1::*,
62    remove_external_plugin_adapter_v1::*, remove_groups_from_group_v1::*, remove_plugin_v1::*,
63    revoke_collection_plugin_authority_v1::*, revoke_plugin_authority_v1::*, transfer_v1::*,
64    update_collection_external_plugin_adapter_v1::*, update_collection_info_v1::*,
65    update_collection_plugin_v1::*, update_collection_v1::*, update_external_plugin_adapter_v1::*,
66    update_group_v1::*, update_plugin_v1::*, update_v1::*, update_v2::*,
67    write_collection_external_plugin_adapter_data_v1::*, write_external_plugin_adapter_data_v1::*,
68};
69
70#[derive(Debug, Clone, PartialEq)]
71#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
72#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
73pub enum MplCoreInstruction {
74    AddAssetsToGroupV1 {
75        program_id: solana_pubkey::Pubkey,
76        data: AddAssetsToGroupV1,
77        accounts: AddAssetsToGroupV1InstructionAccounts,
78    },
79    AddCollectionExternalPluginAdapterV1 {
80        program_id: solana_pubkey::Pubkey,
81        data: AddCollectionExternalPluginAdapterV1,
82        accounts: AddCollectionExternalPluginAdapterV1InstructionAccounts,
83    },
84    AddCollectionPluginV1 {
85        program_id: solana_pubkey::Pubkey,
86        data: AddCollectionPluginV1,
87        accounts: AddCollectionPluginV1InstructionAccounts,
88    },
89    AddCollectionsToGroupV1 {
90        program_id: solana_pubkey::Pubkey,
91        data: AddCollectionsToGroupV1,
92        accounts: AddCollectionsToGroupV1InstructionAccounts,
93    },
94    AddExternalPluginAdapterV1 {
95        program_id: solana_pubkey::Pubkey,
96        data: AddExternalPluginAdapterV1,
97        accounts: AddExternalPluginAdapterV1InstructionAccounts,
98    },
99    AddGroupsToGroupV1 {
100        program_id: solana_pubkey::Pubkey,
101        data: AddGroupsToGroupV1,
102        accounts: AddGroupsToGroupV1InstructionAccounts,
103    },
104    AddPluginV1 {
105        program_id: solana_pubkey::Pubkey,
106        data: AddPluginV1,
107        accounts: AddPluginV1InstructionAccounts,
108    },
109    ApproveCollectionPluginAuthorityV1 {
110        program_id: solana_pubkey::Pubkey,
111        data: ApproveCollectionPluginAuthorityV1,
112        accounts: ApproveCollectionPluginAuthorityV1InstructionAccounts,
113    },
114    ApprovePluginAuthorityV1 {
115        program_id: solana_pubkey::Pubkey,
116        data: ApprovePluginAuthorityV1,
117        accounts: ApprovePluginAuthorityV1InstructionAccounts,
118    },
119    BurnCollectionV1 {
120        program_id: solana_pubkey::Pubkey,
121        data: BurnCollectionV1,
122        accounts: BurnCollectionV1InstructionAccounts,
123    },
124    BurnV1 {
125        program_id: solana_pubkey::Pubkey,
126        data: BurnV1,
127        accounts: BurnV1InstructionAccounts,
128    },
129    CloseGroupV1 {
130        program_id: solana_pubkey::Pubkey,
131        data: CloseGroupV1,
132        accounts: CloseGroupV1InstructionAccounts,
133    },
134    Collect {
135        program_id: solana_pubkey::Pubkey,
136        data: Collect,
137        accounts: CollectInstructionAccounts,
138    },
139    CompressV1 {
140        program_id: solana_pubkey::Pubkey,
141        data: CompressV1,
142        accounts: CompressV1InstructionAccounts,
143    },
144    CreateCollectionV1 {
145        program_id: solana_pubkey::Pubkey,
146        data: CreateCollectionV1,
147        accounts: CreateCollectionV1InstructionAccounts,
148    },
149    CreateCollectionV2 {
150        program_id: solana_pubkey::Pubkey,
151        data: CreateCollectionV2,
152        accounts: CreateCollectionV2InstructionAccounts,
153    },
154    CreateGroupV1 {
155        program_id: solana_pubkey::Pubkey,
156        data: CreateGroupV1,
157        accounts: CreateGroupV1InstructionAccounts,
158    },
159    CreateV1 {
160        program_id: solana_pubkey::Pubkey,
161        data: CreateV1,
162        accounts: CreateV1InstructionAccounts,
163    },
164    CreateV2 {
165        program_id: solana_pubkey::Pubkey,
166        data: CreateV2,
167        accounts: CreateV2InstructionAccounts,
168    },
169    DecompressV1 {
170        program_id: solana_pubkey::Pubkey,
171        data: DecompressV1,
172        accounts: DecompressV1InstructionAccounts,
173    },
174    ExecuteV1 {
175        program_id: solana_pubkey::Pubkey,
176        data: ExecuteV1,
177        accounts: ExecuteV1InstructionAccounts,
178    },
179    RemoveAssetsFromGroupV1 {
180        program_id: solana_pubkey::Pubkey,
181        data: RemoveAssetsFromGroupV1,
182        accounts: RemoveAssetsFromGroupV1InstructionAccounts,
183    },
184    RemoveCollectionExternalPluginAdapterV1 {
185        program_id: solana_pubkey::Pubkey,
186        data: RemoveCollectionExternalPluginAdapterV1,
187        accounts: RemoveCollectionExternalPluginAdapterV1InstructionAccounts,
188    },
189    RemoveCollectionPluginV1 {
190        program_id: solana_pubkey::Pubkey,
191        data: RemoveCollectionPluginV1,
192        accounts: RemoveCollectionPluginV1InstructionAccounts,
193    },
194    RemoveCollectionsFromGroupV1 {
195        program_id: solana_pubkey::Pubkey,
196        data: RemoveCollectionsFromGroupV1,
197        accounts: RemoveCollectionsFromGroupV1InstructionAccounts,
198    },
199    RemoveExternalPluginAdapterV1 {
200        program_id: solana_pubkey::Pubkey,
201        data: RemoveExternalPluginAdapterV1,
202        accounts: RemoveExternalPluginAdapterV1InstructionAccounts,
203    },
204    RemoveGroupsFromGroupV1 {
205        program_id: solana_pubkey::Pubkey,
206        data: RemoveGroupsFromGroupV1,
207        accounts: RemoveGroupsFromGroupV1InstructionAccounts,
208    },
209    RemovePluginV1 {
210        program_id: solana_pubkey::Pubkey,
211        data: RemovePluginV1,
212        accounts: RemovePluginV1InstructionAccounts,
213    },
214    RevokeCollectionPluginAuthorityV1 {
215        program_id: solana_pubkey::Pubkey,
216        data: RevokeCollectionPluginAuthorityV1,
217        accounts: RevokeCollectionPluginAuthorityV1InstructionAccounts,
218    },
219    RevokePluginAuthorityV1 {
220        program_id: solana_pubkey::Pubkey,
221        data: RevokePluginAuthorityV1,
222        accounts: RevokePluginAuthorityV1InstructionAccounts,
223    },
224    TransferV1 {
225        program_id: solana_pubkey::Pubkey,
226        data: TransferV1,
227        accounts: TransferV1InstructionAccounts,
228    },
229    UpdateCollectionExternalPluginAdapterV1 {
230        program_id: solana_pubkey::Pubkey,
231        data: UpdateCollectionExternalPluginAdapterV1,
232        accounts: UpdateCollectionExternalPluginAdapterV1InstructionAccounts,
233    },
234    UpdateCollectionInfoV1 {
235        program_id: solana_pubkey::Pubkey,
236        data: UpdateCollectionInfoV1,
237        accounts: UpdateCollectionInfoV1InstructionAccounts,
238    },
239    UpdateCollectionPluginV1 {
240        program_id: solana_pubkey::Pubkey,
241        data: UpdateCollectionPluginV1,
242        accounts: UpdateCollectionPluginV1InstructionAccounts,
243    },
244    UpdateCollectionV1 {
245        program_id: solana_pubkey::Pubkey,
246        data: UpdateCollectionV1,
247        accounts: UpdateCollectionV1InstructionAccounts,
248    },
249    UpdateExternalPluginAdapterV1 {
250        program_id: solana_pubkey::Pubkey,
251        data: UpdateExternalPluginAdapterV1,
252        accounts: UpdateExternalPluginAdapterV1InstructionAccounts,
253    },
254    UpdateGroupV1 {
255        program_id: solana_pubkey::Pubkey,
256        data: UpdateGroupV1,
257        accounts: UpdateGroupV1InstructionAccounts,
258    },
259    UpdatePluginV1 {
260        program_id: solana_pubkey::Pubkey,
261        data: UpdatePluginV1,
262        accounts: UpdatePluginV1InstructionAccounts,
263    },
264    UpdateV1 {
265        program_id: solana_pubkey::Pubkey,
266        data: UpdateV1,
267        accounts: UpdateV1InstructionAccounts,
268    },
269    UpdateV2 {
270        program_id: solana_pubkey::Pubkey,
271        data: UpdateV2,
272        accounts: UpdateV2InstructionAccounts,
273    },
274    WriteCollectionExternalPluginAdapterDataV1 {
275        program_id: solana_pubkey::Pubkey,
276        data: WriteCollectionExternalPluginAdapterDataV1,
277        accounts: WriteCollectionExternalPluginAdapterDataV1InstructionAccounts,
278    },
279    WriteExternalPluginAdapterDataV1 {
280        program_id: solana_pubkey::Pubkey,
281        data: WriteExternalPluginAdapterDataV1,
282        accounts: WriteExternalPluginAdapterDataV1InstructionAccounts,
283    },
284}
285
286impl carbon_core::instruction::InstructionDecoder<'_> for MplCoreDecoder {
287    type InstructionType = MplCoreInstruction;
288
289    fn decode_instruction(
290        &self,
291        instruction: &solana_instruction::Instruction,
292    ) -> Option<Self::InstructionType> {
293        if instruction.program_id != PROGRAM_ID {
294            return None;
295        }
296
297        carbon_core::try_decode_instructions!(
298            instruction,
299            PROGRAM_ID,
300            MplCoreInstruction::AddAssetsToGroupV1 => AddAssetsToGroupV1,
301            MplCoreInstruction::AddCollectionExternalPluginAdapterV1 => AddCollectionExternalPluginAdapterV1,
302            MplCoreInstruction::AddCollectionPluginV1 => AddCollectionPluginV1,
303            MplCoreInstruction::AddCollectionsToGroupV1 => AddCollectionsToGroupV1,
304            MplCoreInstruction::AddExternalPluginAdapterV1 => AddExternalPluginAdapterV1,
305            MplCoreInstruction::AddGroupsToGroupV1 => AddGroupsToGroupV1,
306            MplCoreInstruction::AddPluginV1 => AddPluginV1,
307            MplCoreInstruction::ApproveCollectionPluginAuthorityV1 => ApproveCollectionPluginAuthorityV1,
308            MplCoreInstruction::ApprovePluginAuthorityV1 => ApprovePluginAuthorityV1,
309            MplCoreInstruction::BurnCollectionV1 => BurnCollectionV1,
310            MplCoreInstruction::BurnV1 => BurnV1,
311            MplCoreInstruction::CloseGroupV1 => CloseGroupV1,
312            MplCoreInstruction::Collect => Collect,
313            MplCoreInstruction::CompressV1 => CompressV1,
314            MplCoreInstruction::CreateCollectionV1 => CreateCollectionV1,
315            MplCoreInstruction::CreateCollectionV2 => CreateCollectionV2,
316            MplCoreInstruction::CreateGroupV1 => CreateGroupV1,
317            MplCoreInstruction::CreateV1 => CreateV1,
318            MplCoreInstruction::CreateV2 => CreateV2,
319            MplCoreInstruction::DecompressV1 => DecompressV1,
320            MplCoreInstruction::ExecuteV1 => ExecuteV1,
321            MplCoreInstruction::RemoveAssetsFromGroupV1 => RemoveAssetsFromGroupV1,
322            MplCoreInstruction::RemoveCollectionExternalPluginAdapterV1 => RemoveCollectionExternalPluginAdapterV1,
323            MplCoreInstruction::RemoveCollectionPluginV1 => RemoveCollectionPluginV1,
324            MplCoreInstruction::RemoveCollectionsFromGroupV1 => RemoveCollectionsFromGroupV1,
325            MplCoreInstruction::RemoveExternalPluginAdapterV1 => RemoveExternalPluginAdapterV1,
326            MplCoreInstruction::RemoveGroupsFromGroupV1 => RemoveGroupsFromGroupV1,
327            MplCoreInstruction::RemovePluginV1 => RemovePluginV1,
328            MplCoreInstruction::RevokeCollectionPluginAuthorityV1 => RevokeCollectionPluginAuthorityV1,
329            MplCoreInstruction::RevokePluginAuthorityV1 => RevokePluginAuthorityV1,
330            MplCoreInstruction::TransferV1 => TransferV1,
331            MplCoreInstruction::UpdateCollectionExternalPluginAdapterV1 => UpdateCollectionExternalPluginAdapterV1,
332            MplCoreInstruction::UpdateCollectionInfoV1 => UpdateCollectionInfoV1,
333            MplCoreInstruction::UpdateCollectionPluginV1 => UpdateCollectionPluginV1,
334            MplCoreInstruction::UpdateCollectionV1 => UpdateCollectionV1,
335            MplCoreInstruction::UpdateExternalPluginAdapterV1 => UpdateExternalPluginAdapterV1,
336            MplCoreInstruction::UpdateGroupV1 => UpdateGroupV1,
337            MplCoreInstruction::UpdatePluginV1 => UpdatePluginV1,
338            MplCoreInstruction::UpdateV1 => UpdateV1,
339            MplCoreInstruction::UpdateV2 => UpdateV2,
340            MplCoreInstruction::WriteCollectionExternalPluginAdapterDataV1 => WriteCollectionExternalPluginAdapterDataV1,
341            MplCoreInstruction::WriteExternalPluginAdapterDataV1 => WriteExternalPluginAdapterDataV1,
342        )
343    }
344}