From dd6ce2b0bd684f2485b29f5895e4d53182668ce3 Mon Sep 17 00:00:00 2001 From: Chad Date: Tue, 27 Aug 2024 21:21:21 -0500 Subject: [PATCH] fix: multisig support for indirect keystore interactions --- packages/caravan-psbt/src/psbtv0/utils.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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, }; };