From 70a8c596888a4632270e2d8157526dc1903642f2 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 12 Jul 2024 15:35:10 -0700 Subject: [PATCH] open ix builder with payer --- api/src/instruction.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/instruction.rs b/api/src/instruction.rs index 4aa285b..a6d5ec3 100644 --- a/api/src/instruction.rs +++ b/api/src/instruction.rs @@ -278,13 +278,14 @@ pub fn mine( } /// Builds an open instruction. -pub fn open(signer: Pubkey, miner: Pubkey) -> Instruction { +pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction { let proof_pda = Pubkey::find_program_address(&[PROOF, signer.as_ref()], &crate::id()); Instruction { program_id: crate::id(), accounts: vec![ AccountMeta::new(signer, true), - AccountMeta::new(miner, true), + AccountMeta::new_readonly(miner, false), + AccountMeta::new(payer, true), AccountMeta::new(proof_pda.0, false), AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new_readonly(sysvar::slot_hashes::id(), false),