diff --git a/packages/sdk/src/browser-wallets/xverse/signatures.ts b/packages/sdk/src/browser-wallets/xverse/signatures.ts index f6ae2a85..d4bf60af 100644 --- a/packages/sdk/src/browser-wallets/xverse/signatures.ts +++ b/packages/sdk/src/browser-wallets/xverse/signatures.ts @@ -32,7 +32,18 @@ export async function signPsbt({ const signedPsbt = Psbt.fromBase64(psbtBase64) - finalize && signedPsbt.finalizeAllInputs() + if (finalize) { + if (!inputs.length) { + signedPsbt.finalizeAllInputs() + } else { + inputs.forEach((input) => { + input.signingIndexes.forEach((index) => { + signedPsbt.finalizeInput(index) + }) + }) + } + } + hex = extractTx ? signedPsbt.extractTransaction().toHex() : signedPsbt.toHex() base64 = !extractTx ? signedPsbt.toBase64() : null }