use super::super::types::*;
use carbon_core::{borsh, CarbonDeserialize};
#[derive(
CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
)]
#[carbon(discriminator = "0x9162c076b8937668")]
pub struct MintV1 {
pub message: MetadataArgs,
}
#[derive(Debug, PartialEq, Eq, Clone, Hash, serde::Serialize, serde::Deserialize)]
pub struct MintV1InstructionAccounts {
pub tree_authority: solana_pubkey::Pubkey,
pub leaf_owner: solana_pubkey::Pubkey,
pub leaf_delegate: solana_pubkey::Pubkey,
pub merkle_tree: solana_pubkey::Pubkey,
pub payer: solana_pubkey::Pubkey,
pub tree_delegate: solana_pubkey::Pubkey,
pub log_wrapper: solana_pubkey::Pubkey,
pub compression_program: solana_pubkey::Pubkey,
pub system_program: solana_pubkey::Pubkey,
}
impl carbon_core::deserialize::ArrangeAccounts for MintV1 {
type ArrangedAccounts = MintV1InstructionAccounts;
fn arrange_accounts(
accounts: &[solana_instruction::AccountMeta],
) -> Option<Self::ArrangedAccounts> {
let [tree_authority, leaf_owner, leaf_delegate, merkle_tree, payer, tree_delegate, log_wrapper, compression_program, system_program, _remaining @ ..] =
accounts
else {
return None;
};
Some(MintV1InstructionAccounts {
tree_authority: tree_authority.pubkey,
leaf_owner: leaf_owner.pubkey,
leaf_delegate: leaf_delegate.pubkey,
merkle_tree: merkle_tree.pubkey,
payer: payer.pubkey,
tree_delegate: tree_delegate.pubkey,
log_wrapper: log_wrapper.pubkey,
compression_program: compression_program.pubkey,
system_program: system_program.pubkey,
})
}
}