File tree 3 files changed +7
-13
lines changed
3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,6 @@ const bech32_1 = require('bech32');
11
11
const OPS = bscript . OPS ;
12
12
const TAPROOT_VERSION = 0x01 ;
13
13
const ANNEX_PREFIX = 0x50 ;
14
- // witness: {signature}
15
- // input: <>
16
- // output: OP_1 {pubKey}
17
14
function p2tr ( a , opts ) {
18
15
if (
19
16
! a . address &&
@@ -93,7 +90,7 @@ function p2tr(a, opts) {
93
90
return bscript . compile ( [ OPS . OP_1 , o . pubkey ] ) ;
94
91
} ) ;
95
92
lazy . prop ( o , 'scriptLeaf' , ( ) => {
96
- if ( ! a . scriptLeaf ) return a . scriptLeaf ;
93
+ if ( a . scriptLeaf ) return a . scriptLeaf ;
97
94
} ) ;
98
95
lazy . prop ( o , 'pubkey' , ( ) => {
99
96
if ( a . pubkey ) return a . pubkey ;
Original file line number Diff line number Diff line change @@ -12,18 +12,18 @@ import { p2tr } from './p2tr';
12
12
export interface Payment {
13
13
name ?: string ;
14
14
network ?: Network ;
15
- output ?: Buffer ; // the full scriptPubKey
15
+ output ?: Buffer ;
16
16
data ?: Buffer [ ] ;
17
17
m ?: number ;
18
18
n ?: number ;
19
19
pubkeys ?: Buffer [ ] ;
20
20
input ?: Buffer ;
21
21
signatures ?: Buffer [ ] ;
22
- internalPubkey ?: Buffer ; // taproot: output key
23
- pubkey ?: Buffer ; // taproot: output key
22
+ internalPubkey ?: Buffer ;
23
+ pubkey ?: Buffer ;
24
24
signature ?: Buffer ;
25
- address ?: string ; // taproot: betch32m
26
- hash ?: Buffer ; // taproot: MAST root
25
+ address ?: string ;
26
+ hash ?: Buffer ;
27
27
redeem ?: Payment ;
28
28
scriptsTree ?: any ; // todo: solve
29
29
scriptLeaf ?: TaprootLeaf ;
Original file line number Diff line number Diff line change @@ -18,9 +18,6 @@ const OPS = bscript.OPS;
18
18
const TAPROOT_VERSION = 0x01 ;
19
19
const ANNEX_PREFIX = 0x50 ;
20
20
21
- // witness: {signature}
22
- // input: <>
23
- // output: OP_1 {pubKey}
24
21
export function p2tr ( a : Payment , opts ?: PaymentOpts ) : Payment {
25
22
if (
26
23
! a . address &&
@@ -105,7 +102,7 @@ export function p2tr(a: Payment, opts?: PaymentOpts): Payment {
105
102
return bscript . compile ( [ OPS . OP_1 , o . pubkey ] ) ;
106
103
} ) ;
107
104
lazy . prop ( o , 'scriptLeaf' , ( ) => {
108
- if ( ! a . scriptLeaf ) return a . scriptLeaf ;
105
+ if ( a . scriptLeaf ) return a . scriptLeaf ;
109
106
} ) ;
110
107
lazy . prop ( o , 'pubkey' , ( ) => {
111
108
if ( a . pubkey ) return a . pubkey ;
You can’t perform that action at this time.
0 commit comments