Skip to main content
2 of 2
added 329 characters in body
Jimii
  • 7.7k
  • 1
  • 8
  • 22

As the error suggests, make sure that you are using the correct signer when sending the tx.

By default, the .rpc method uses the local Solana ~/.config/solana/id.json wallet to sign for transaction.

Check that it is similar to the wallet signer you are using.

If different, you can first convert the method call into a transaction and sign it

await program.methods
    .increaseCounter(new BN(1))
    .accounts({
        counter: counterPda,
        authority: wallet.publicKey,
        system_program: SystemProgram.programId,
    })
    .transaction();

await signTransaction(tx);
Jimii
  • 7.7k
  • 1
  • 8
  • 22