precious-void / raydium-swap

Swap example using the Raydium SDK
124 stars 41 forks source link

Transaction signature verification failure #6

Closed parzival-thinks closed 1 month ago

parzival-thinks commented 6 months ago

Hi everyone! I'm trying to run a simple swap in JS on Raydium. I'm running the code in this repo and it got me farther than anything else! Everything seems to work until I try and send the transaction (sendVersionedTransaction). When I do I keep getting:

SendTransactionError: failed to send transaction: Transaction signature verification failure

And this message if I use sendLegacyTransaction

Missing signature for public key [9gtCn29xvft9LTd6rzK1qcnzKuDYpVKZLJmR9joncr6x].

For a different public key address every time I try and run the same swap. For the life of me I can't figure out why. Has anyone else had this issue? Or does anyone know of a fix? I'd really appreciate it and thanks again!!

Allen-Taylor commented 6 months ago

Check your private key string, it should be in the base58 string format.

this.wallet = new Wallet(Keypair.fromSecretKey(base58.decode(WALLET_PRIVATE_KEY)))