Skip to content

Commit

Permalink
fix: multisig support for indirect keystore interactions (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
chadchapnick authored Aug 29, 2024
1 parent 3448d95 commit d8078d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-dolls-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@caravan/psbt": patch
---

Restore multisig support for indirect keystore interactions
10 changes: 8 additions & 2 deletions packages/caravan-psbt/src/psbtv0/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
};
};

Expand Down

0 comments on commit d8078d8

Please sign in to comment.