From d8078d80cdbf7d2ebd131e6f9253572a6a133d34 Mon Sep 17 00:00:00 2001 From: chadchapnick <143517546+chadchapnick@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:00:16 -0500 Subject: [PATCH] fix: multisig support for indirect keystore interactions (#120) --- .changeset/thirty-dolls-type.md | 5 +++++ packages/caravan-psbt/src/psbtv0/utils.ts | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .changeset/thirty-dolls-type.md diff --git a/.changeset/thirty-dolls-type.md b/.changeset/thirty-dolls-type.md new file mode 100644 index 00000000..d5be85ff --- /dev/null +++ b/.changeset/thirty-dolls-type.md @@ -0,0 +1,5 @@ +--- +"@caravan/psbt": patch +--- + +Restore multisig support for indirect keystore interactions diff --git a/packages/caravan-psbt/src/psbtv0/utils.ts b/packages/caravan-psbt/src/psbtv0/utils.ts index c432197a..3988014a 100644 --- a/packages/caravan-psbt/src/psbtv0/utils.ts +++ b/packages/caravan-psbt/src/psbtv0/utils.ts @@ -93,6 +93,12 @@ export interface LegacyMultisig { path: string; pubkey: Buffer; }[]; + redeem?: { + output: Buffer; + }; + witness?: { + output: Buffer; + }; } // This may be incomplete as the fixture objects are extremely opaque. @@ -137,8 +143,8 @@ export const convertLegacyOutput = (output: LegacyOutput): PsbtOutput => { value: new BigNumber(output.amountSats).toNumber(), bip32Derivation: output.bip32Derivation || getBip32Derivation(output.multisig), - witnessScript: output.witnessScript, - redeemScript: output.redeemScript, + witnessScript: output.witnessScript || output.multisig?.witness?.output, + redeemScript: output.redeemScript || output.multisig?.redeem?.output, }; };