From d8814f21e6491ece1b15add3a63f70507e12fab9 Mon Sep 17 00:00:00 2001 From: 1bcMax Date: Tue, 3 Mar 2026 21:31:30 -0800 Subject: [PATCH] fix: attach signers to Solana sweep transaction message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit signTransactionMessageWithSigners was producing unsigned transactions because only plain Address strings were in the instruction accounts — no actual signer objects were attached. Use addSignersToTransactionMessage to bind both newSigner and oldSigner before signing. --- src/solana-sweep.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/solana-sweep.ts b/src/solana-sweep.ts index 3ecb2c1..6893977 100644 --- a/src/solana-sweep.ts +++ b/src/solana-sweep.ts @@ -18,6 +18,7 @@ import { setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, signTransactionMessageWithSigners, + addSignersToTransactionMessage, getSignatureFromTransaction, sendAndConfirmTransactionFactory, getProgramDerivedAddress, @@ -245,7 +246,13 @@ export async function sweepSolanaWallet( (msg) => appendTransactionMessageInstructions([createAtaIx, ...transferIxs], msg), ); - const signedTx = await signTransactionMessageWithSigners(txMessage); + // Attach both signers so signTransactionMessageWithSigners can find them + const txMessageWithSigners = addSignersToTransactionMessage( + [newSigner, oldSigner], + txMessage, + ); + + const signedTx = await signTransactionMessageWithSigners(txMessageWithSigners); const txSignature = getSignatureFromTransaction(signedTx); // Send transaction and poll for confirmation