Skip to content

Commit

Permalink
handle p2wsh
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr authored May 21, 2024
1 parent afa8f14 commit 0285b32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const formatOutput = (out: TxOutput, n: number, network: Network): TOutput => {
case 'pubkey':
case 'multisig':
case 'pay-to-witness-pubkey-hash':
case 'pay-to-witness-script-hash':
case 'pay-to-taproot':
case 'scripthash':
const address = bitcoin.address.fromOutputScript(out.script, network);
Expand Down Expand Up @@ -99,6 +100,8 @@ const classifyOutputScript = (script): string => {
return 'multisig';
} else if (isOutput(bitcoin.payments.p2wpkh)) {
return 'pay-to-witness-pubkey-hash';
} else if (isOutput(bitcoin.payments.p2wsh)) {
return 'pay-to-witness-script-hash';
} else if (isOutput(bitcoin.payments.p2sh)) {
return 'scripthash';
} else if (isOutput(bitcoin.payments.p2tr)) {
Expand Down

0 comments on commit 0285b32

Please sign in to comment.