jup-ag / jupiter-quote-api-node

91 stars 32 forks source link

How to add a dedicated account for fee paying ? #34

Open kaiyes opened 2 months ago

kaiyes commented 2 months ago

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

I always get the error "Cannot sign with non signer key"
kaiyes commented 2 months ago

This issue has the exact same problem as mine, but no answers there either https://solana.stackexchange.com/questions/7432/setting-feepayer-of-versionedtransaction