crema-cli 0.1.0

Blockchain, Crema for Solana
Documentation
use solana_program::instruction::{AccountMeta, Instruction};
use solana_program::pubkey::Pubkey;

use crate::program::FARMING_MINE_PROGRAM_ID;
use crate::utils::sighash;

pub fn new_create_miner_wrapper(
    payer: Pubkey,
    quarry: Pubkey,
    rewarder: Pubkey,
    miner: Pubkey,
    mint_value: Pubkey,
    staked_token_ata: Pubkey,
) -> Instruction {
    let distor = sighash::sighash("global", "create_miner_wrapper").to_vec();

    Instruction {
        program_id: FARMING_MINE_PROGRAM_ID,
        accounts: vec![
            AccountMeta::new_readonly(payer, true),
            AccountMeta::new(miner, false),
            AccountMeta::new(quarry, false),
            AccountMeta::new_readonly(rewarder, false),
            AccountMeta::new_readonly(solana_program::system_program::id(), false),
            AccountMeta::new(payer, true),
            AccountMeta::new_readonly(staked_token_ata, false),
            AccountMeta::new_readonly(mint_value, false),
            AccountMeta::new_readonly(spl_token::id(), false),
        ],
        data: distor,
    }
}