pub fn update_rate(
    token_program_id: &Pubkey,
    mint: &Pubkey,
    rate_authority: &Pubkey,
    signers: &[&Pubkey],
    rate: i16,
) -> Result<Instruction, ProgramError> {
    check_program_account(token_program_id)?;
    let mut accounts = vec![
        AccountMeta::new(*mint, false),
        AccountMeta::new_readonly(*rate_authority, signers.is_empty()),
    ];
    for signer_pubkey in signers.iter() {
        accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
    }
    Ok(encode_instruction(
        token_program_id,
        accounts,
        TokenInstruction::InterestBearingMintExtension,
        InterestBearingMintInstruction::UpdateRate,
        &BasisPoints::from(rate),
    ))
}
/// Create an `UpdateRate` instruction
Create an `UpdateRate` instruction
Create an ` UpdateRate ` instruction
pub fn update_rate(
    token_program_id: &Pubkey,
    mint: &Pubkey,
    rate_authority: &Pubkey,
    signers: &[&Pubkey],
    rate: i16,
) -> Result<Instruction, ProgramError> {
    check_program_account(token_program_id)?;
    let mut accounts = vec![
        AccountMeta::new(*mint, false),
        AccountMeta::new_readonly(*rate_authority, signers.is_empty()),
    ];
    for signer_pubkey in signers.iter() {
        accounts.push(AccountMeta::new_readonly(**signer_pubkey, true));
    }
    Ok(encode_instruction(
        token_program_id,
        accounts,
        TokenInstruction::InterestBearingMintExtension,
        InterestBearingMintInstruction::UpdateRate,
        &BasisPoints::from(rate),
    ))
}
pub fn update_rate ( token_program_id : & Pubkey , mint : & Pubkey , rate_authority : & Pubkey , signers : & [ & Pubkey ] , rate : i16 , ) -> Result < Instruction , ProgramError > { check_program_account ( token_program_id ) ? ; let mut accounts = vec ! [ AccountMeta new ( mint false ) AccountMeta new_readonly ( rate_authority signers is_empty ( ) ) ] ; for signer_pubkey in signers . iter ( ) { accounts . push ( AccountMeta :: new_readonly ( * * signer_pubkey , true ) ) ; } Ok ( encode_instruction ( token_program_id , accounts , TokenInstruction :: InterestBearingMintExtension , InterestBearingMintInstruction :: UpdateRate , & BasisPoints :: from ( rate ) , ) ) }
Create an `UpdateRate` instruction
Create an ` UpdateRate ` instruction
token_program_id
&Pubkey
mint
&Pubkey
rate_authority
&Pubkey
signers
&[&Pubkey]
rate
i16
token_program_id
&Pubkey
mint
&Pubkey
rate_authority
&Pubkey
signers
&[&Pubkey]
rate
i16