Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7906

how to use sendAndConfirmTransaction?

$
0
0

so i have a solana program and i wanted to sign the transaction so they can write to the program on the frontend. but the thing is, sendAndConfirmTransaction need a wallet object that has a secret key type to assign it to the signer parameter, but AnchorWallet doesnt have it. so how do to actually send a transaction?

code example

const a = await program.methods                    .instruction(value)                    .accounts({                        account: accountAddress                    })                    .transaction()                a.recentBlockhash = blockhash                a.feePayer = wallet.publicKey                const signedTransaction = await provider.wallet.signTransaction(initializeVote)                const transaction = await sendAndConfirmTransaction(connection, signedTransaction, []) //emptying the signer parameter cause idk what to put there

Viewing all articles
Browse latest Browse all 7906

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>