I've got a program that is required to be signed by two signers. One signer is the account in my phantom wallet and the other is created in the code.
const blockhash = await program.connection.getLatestBlockhash('finalized'); const transaction = new Transaction({ lastValidBlockHeight: blockhash.lastValidBlockHeight, blockhash: blockhash.blockhash, feePayer: wallet.publicKey }); transaction.add(instruction); transaction.sign(keypair); const signed = await wallet.signTransaction(transaction); const signature = await program.connection.sendRawTransaction(signed.serialize()); await program.connection.confirmTransaction({ blockhash: blockhash.blockhash, lastValidBlockHeight: blockhash.lastValidBlockHeight, signature: signature }, 'max');
After the const signed
line I get this error:
Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0xbc4
and it doesn't go to the const signature
line.
Please help me what am I doing wrong here?