pub fn initialize(
    token_program_id: &Pubkey,
    mint: &Pubkey,
    rate_authority: Option<Pubkey>,
    rate: i16,
) -> Result<Instruction, ProgramError> {
    check_program_account(token_program_id)?;
    let accounts = vec![AccountMeta::new(*mint, false)];
    Ok(encode_instruction(
        token_program_id,
        accounts,
        TokenInstruction::InterestBearingMintExtension,
        InterestBearingMintInstruction::Initialize,
        &InitializeInstructionData {
            rate_authority: rate_authority.try_into()?,
            rate: rate.into(),
        },
    ))
}
/// Create an `Initialize` instruction
Create an `Initialize` instruction
Create an ` Initialize ` instruction
pub fn initialize(
    token_program_id: &Pubkey,
    mint: &Pubkey,
    rate_authority: Option<Pubkey>,
    rate: i16,
) -> Result<Instruction, ProgramError> {
    check_program_account(token_program_id)?;
    let accounts = vec![AccountMeta::new(*mint, false)];
    Ok(encode_instruction(
        token_program_id,
        accounts,
        TokenInstruction::InterestBearingMintExtension,
        InterestBearingMintInstruction::Initialize,
        &InitializeInstructionData {
            rate_authority: rate_authority.try_into()?,
            rate: rate.into(),
        },
    ))
}
pub fn initialize ( token_program_id : & Pubkey , mint : & Pubkey , rate_authority : Option < Pubkey > , rate : i16 , ) -> Result < Instruction , ProgramError > { check_program_account ( token_program_id ) ? ; let accounts = vec ! [ AccountMeta new ( mint false ) ] ; Ok ( encode_instruction ( token_program_id , accounts , TokenInstruction :: InterestBearingMintExtension , InterestBearingMintInstruction :: Initialize , & InitializeInstructionData { rate_authority : rate_authority . try_into ( ) ? , rate : rate . into ( ) , } , ) ) }
Create an `Initialize` instruction
Create an ` Initialize ` instruction
token_program_id
&Pubkey
mint
&Pubkey
rate_authority
Option<Pubkey>
rate
i16
token_program_id
&Pubkey
mint
&Pubkey
rate_authority
Option<Pubkey>
rate
i16