1use solana_program::pubkey::Pubkey;
2use steel::*;
3
4use crate::{consts::MINT_ADDRESS, instruction::*, state::*};
5
6pub fn mint_ore(signer: Pubkey, to: Pubkey, amount: u64) -> Instruction {
7 let authority_address = authority_pda().0;
8 Instruction {
9 program_id: crate::ID,
10 accounts: vec![
11 AccountMeta::new(signer, true),
12 AccountMeta::new(authority_address, false),
13 AccountMeta::new(MINT_ADDRESS, false),
14 AccountMeta::new(to, false),
15 AccountMeta::new_readonly(spl_token::ID, false),
16 ],
17 data: MintORE {
18 amount: amount.to_le_bytes(),
19 }
20 .to_bytes(),
21 }
22}
23
24pub fn init(signer: Pubkey) -> Instruction {
25 let authority_address = authority_pda().0;
26 Instruction {
27 program_id: crate::ID,
28 accounts: vec![
29 AccountMeta::new(signer, true),
30 AccountMeta::new(authority_address, false),
31 AccountMeta::new(system_program::ID, false),
32 ],
33 data: Init {}.to_bytes(),
34 }
35}