@@ -4,11 +4,9 @@ import type { Address, Instruction, TransactionSigner } from "@solana/kit";
44import {
55 findMergeMinerPda ,
66 findMinerPda ,
7- findMinterPda ,
87 findQuarryPda ,
9- getClaimRewardsMMInstruction ,
10- getWithdrawTokensMMInstruction ,
11- QUARRY_MINT_WRAPPER_PROGRAM_ADDRESS ,
8+ getClaimRewardsMMInstructionAsync ,
9+ getWithdrawTokensMMInstructionAsync ,
1210} from "@macalinao/clients-quarry" ;
1311import {
1412 findAssociatedTokenPda ,
@@ -60,12 +58,6 @@ export async function claimRewardsCommon({
6058} : ClaimRewardsCommonArgs ) : Promise < Instruction [ ] > {
6159 const instructions : Instruction [ ] = [ ] ;
6260
63- // Derive the minter PDA
64- const [ minter ] = await findMinterPda ( {
65- wrapper : rewarder . data . mintWrapper ,
66- authority : stake . rewarder ,
67- } ) ;
68-
6961 // Get or create associated token accounts for the merge miner
7062 const [ mmQuarryTokenAccount ] = await findAssociatedTokenPda ( {
7163 mint : quarryMint ,
@@ -122,30 +114,23 @@ export async function claimRewardsCommon({
122114
123115 // Claim rewards instruction
124116 instructions . push (
125- getClaimRewardsMMInstruction ( {
117+ await getClaimRewardsMMInstructionAsync ( {
126118 mintWrapper : rewarder . data . mintWrapper ,
127- mintWrapperProgram : QUARRY_MINT_WRAPPER_PROGRAM_ADDRESS ,
128- minter,
129119 rewardsTokenMint : rewarder . data . rewardsTokenMint ,
130- rewardsTokenAccount : mmRewardsTokenAccount ,
131- claimFeeTokenAccount : rewarder . data . claimFeeTokenAccount ,
132120 stakeTokenAccount : mmQuarryTokenAccount ,
133121 pool : stake . pool ,
134122 mm : stake . mm ,
135123 rewarder : stake . rewarder ,
136124 quarry : stake . quarry ,
137- miner : stake . miner ,
138125 minerVault : stake . minerVault ,
139126 } ) ,
140127 ) ;
141128
142129 // Withdraw rewards tokens from merge miner to owner
143130 instructions . push (
144- getWithdrawTokensMMInstruction ( {
131+ await getWithdrawTokensMMInstructionAsync ( {
145132 owner : mmOwner ,
146133 pool : stake . pool ,
147- mm : stake . mm ,
148- mmTokenAccount : mmRewardsTokenAccount ,
149134 withdrawMint : rewarder . data . rewardsTokenMint ,
150135 tokenDestination : ownerRewardsTokenAccount ,
151136 } ) ,
0 commit comments