From ac668b692d6b50e5c1aee381a27917975de8c0c1 Mon Sep 17 00:00:00 2001 From: steveluscher Date: Mon, 13 May 2024 22:08:14 +0000 Subject: [PATCH 1/2] Partial sign transactions *after* modifying them --- .../src/SolanaClient/BackpackSolanaWallet.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts b/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts index 1ce79aead..a760daa5d 100644 --- a/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts +++ b/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts @@ -169,11 +169,6 @@ export class BackpackSolanaWallet { const commitment = request.commitment; if (!isVersionedTransaction(tx)) { - if (signers) { - signers.forEach((s: Signer) => { - tx.partialSign(s); - }); - } if (!tx.feePayer) { tx.feePayer = publicKey; } @@ -181,6 +176,11 @@ export class BackpackSolanaWallet { const { blockhash } = await connection.getLatestBlockhash(commitment); tx.recentBlockhash = blockhash; } + if (signers) { + signers.forEach((s: Signer) => { + tx.partialSign(s); + }); + } } else { if (signers) { tx.sign(signers); From e5f565600b4baf81af2dd6beb0951f13fc9d4a1d Mon Sep 17 00:00:00 2001 From: steveluscher Date: Mon, 13 May 2024 22:11:37 +0000 Subject: [PATCH 2/2] Partial sign transactions in a batch --- .../secure-clients/src/SolanaClient/BackpackSolanaWallet.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts b/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts index a760daa5d..78d2c976e 100644 --- a/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts +++ b/packages/secure-clients/src/SolanaClient/BackpackSolanaWallet.ts @@ -177,9 +177,7 @@ export class BackpackSolanaWallet { tx.recentBlockhash = blockhash; } if (signers) { - signers.forEach((s: Signer) => { - tx.partialSign(s); - }); + tx.partialSign(...signers); } } else { if (signers) {