-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add a dedicated account for fee paying ? #34
Comments
This issue has the exact same problem as mine, but no answers there either |
is there any udpate? |
I've also got the exact same issue |
You are dealing with a Versioned Transaction. The way that you are doing right now is for Legacy transactions. So you need to deserialize the transaction, fetch Address Lookup Tables, decompile the message, add your fee payer as one of the message signers, recompile the message fetch latest blockhash, sign with the main key, sign with the feepayer key, and send. |
Hi, I've been trying in vein to add a fee payer account like we can for sending sols.
const swapTransactionBuf = Buffer.from(swapResult.swapTransaction, 'base64')
var transaction = VersionedTransaction.deserialize(swapTransactionBuf)
// Set fee payer
transaction.feePayer = feePayerkeypair.publicKey // Ensure the transaction's fee payer is set
transaction.recentBlockhash = (
await connection.getRecentBlockhash()
).blockhash
// Sign the transaction with both the wallet and the fee payer
transaction.sign([feePayer.keypair, accountKeypayer ]) // Sign the transaction with both the user's wallet and the fee payer
The text was updated successfully, but these errors were encountered: