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_MINT_WRAPPER_PROGRAM_ID;
use crate::utils::sighash;

pub fn new_create_quarry_v2(
    quarry: Pubkey,
    rewarder: Pubkey,
    minter: Pubkey,
    payer: Pubkey,
) -> Instruction {
    let distor = sighash::sighash("global", "create_quarry_v2").to_vec();

    Instruction {
        program_id: FARMING_MINT_WRAPPER_PROGRAM_ID,
        accounts: vec![
            AccountMeta::new(quarry, false),
            AccountMeta::new_readonly(payer, true),
            AccountMeta::new(rewarder, false),
            AccountMeta::new_readonly(minter, false),
            AccountMeta::new(payer, true),
            AccountMeta::new_readonly(solana_program::system_program::id(), false),
        ],
        data: distor,
    }
}