Transaction Signature Verification failed

Viewed 357

I am trying to send a solana transaction with the web3js library.

I tried both functions

web3.sendConfirmTransaction(connection,transaction,[signers])

and by sending raw transaction after I sign the transaction with :

transaction.sign() 
web3.SendConfirmRawTransaction(connection,transaction.serialise()) 

but I keep getting errors saying transaction verification failed. by tracking the error, the second signature in the signatures array is null that's what is generating the error. anyone can help !!

1 Answers

Assuming that signers is an array of Keypairs that can sign, you should instead do:

web3.sendConfirmTransaction(connection, transaction, signers)

And

connection.sendTransaction(transaction, signers); 

sendTransaction will take care of fetching the blockhash, signing the transaction, serializing, and sending.

Related