pub fn instruction(
        self,
        token_program_id: &Pubkey,
        mint: &Pubkey,
    ) -> Result<Instruction, ProgramError> {
        match self {
            Self::DefaultAccountState { state } => {
                default_account_state::instruction::initialize_default_account_state(
                    token_program_id,
                    mint,
                    &state,
                )
            }
            Self::MintCloseAuthority { close_authority } => {
                instruction::initialize_mint_close_authority(
                    token_program_id,
                    mint,
                    close_authority.as_ref(),
                )
            }
            Self::TransferFeeConfig {
                transfer_fee_config_authority,
                withdraw_withheld_authority,
                transfer_fee_basis_points,
                maximum_fee,
            } => transfer_fee::instruction::initialize_transfer_fee_config(
                token_program_id,
                mint,
                transfer_fee_config_authority.as_ref(),
                withdraw_withheld_authority.as_ref(),
                transfer_fee_basis_points,
                maximum_fee,
            ),
        }
    }
/// Generate an appropriate initialization instruction for the given mint
Generate an appropriate initialization instruction for the given mint
Generate an appropriate initialization instruction for the given mint
pub fn instruction(
        self,
        token_program_id: &Pubkey,
        mint: &Pubkey,
    ) -> Result<Instruction, ProgramError> {
        match self {
            Self::DefaultAccountState { state } => {
                default_account_state::instruction::initialize_default_account_state(
                    token_program_id,
                    mint,
                    &state,
                )
            }
            Self::MintCloseAuthority { close_authority } => {
                instruction::initialize_mint_close_authority(
                    token_program_id,
                    mint,
                    close_authority.as_ref(),
                )
            }
            Self::TransferFeeConfig {
                transfer_fee_config_authority,
                withdraw_withheld_authority,
                transfer_fee_basis_points,
                maximum_fee,
            } => transfer_fee::instruction::initialize_transfer_fee_config(
                token_program_id,
                mint,
                transfer_fee_config_authority.as_ref(),
                withdraw_withheld_authority.as_ref(),
                transfer_fee_basis_points,
                maximum_fee,
            ),
        }
    }
pub fn instruction ( self , token_program_id : & Pubkey , mint : & Pubkey , ) -> Result < Instruction , ProgramError > { match self { Self :: DefaultAccountState { state } => { default_account_state :: instruction :: initialize_default_account_state ( token_program_id , mint , & state , ) } Self :: MintCloseAuthority { close_authority } => { instruction :: initialize_mint_close_authority ( token_program_id , mint , close_authority . as_ref ( ) , ) } Self :: TransferFeeConfig { transfer_fee_config_authority , withdraw_withheld_authority , transfer_fee_basis_points , maximum_fee , } => transfer_fee :: instruction :: initialize_transfer_fee_config ( token_program_id , mint , transfer_fee_config_authority . as_ref ( ) , withdraw_withheld_authority . as_ref ( ) , transfer_fee_basis_points , maximum_fee , ) , } }
Generate an appropriate initialization instruction for the given mint
Generate an appropriate initialization instruction for the given mint
self
token_program_id
&Pubkey
mint
&Pubkey
self
token_program_id
&Pubkey
mint
&Pubkey