@@ -80,22 +80,34 @@ export declare class Psbt {
80
80
getFeeRate ( ) : number ;
81
81
getFee ( ) : number ;
82
82
finalizeAllInputs ( ) : this;
83
- finalizeInput ( inputIndex : number , finalScriptsFunc ?: FinalScriptsFunc ) : this;
83
+ finalizeInput ( inputIndex : number , finalScriptsFunc ?: FinalScriptsFunc | FinalTaprootScriptsFunc ) : this;
84
+ finalizeTaprootInput ( inputIndex : number , tapLeafHashToFinalize ?: Buffer , finalScriptsFunc ?: FinalTaprootScriptsFunc ) : this;
85
+ private _finalizeInput ;
86
+ private _finalizeTaprootInput ;
84
87
getInputType ( inputIndex : number ) : AllScriptType ;
85
88
inputHasPubkey ( inputIndex : number , pubkey : Buffer ) : boolean ;
86
89
inputHasHDKey ( inputIndex : number , root : HDSigner ) : boolean ;
87
90
outputHasPubkey ( outputIndex : number , pubkey : Buffer ) : boolean ;
88
91
outputHasHDKey ( outputIndex : number , root : HDSigner ) : boolean ;
89
92
validateSignaturesOfAllInputs ( validator : ValidateSigFunction ) : boolean ;
90
93
validateSignaturesOfInput ( inputIndex : number , validator : ValidateSigFunction , pubkey ?: Buffer ) : boolean ;
94
+ private _validateSignaturesOfInput ;
95
+ private validateSignaturesOfTaprootInput ;
91
96
signAllInputsHD ( hdKeyPair : HDSigner , sighashTypes ?: number [ ] ) : this;
92
97
signAllInputsHDAsync ( hdKeyPair : HDSigner | HDSignerAsync , sighashTypes ?: number [ ] ) : Promise < void > ;
93
98
signInputHD ( inputIndex : number , hdKeyPair : HDSigner , sighashTypes ?: number [ ] ) : this;
94
99
signInputHDAsync ( inputIndex : number , hdKeyPair : HDSigner | HDSignerAsync , sighashTypes ?: number [ ] ) : Promise < void > ;
95
100
signAllInputs ( keyPair : Signer , sighashTypes ?: number [ ] ) : this;
96
101
signAllInputsAsync ( keyPair : Signer | SignerAsync , sighashTypes ?: number [ ] ) : Promise < void > ;
97
102
signInput ( inputIndex : number , keyPair : Signer , sighashTypes ?: number [ ] ) : this;
103
+ signTaprootInput ( inputIndex : number , keyPair : Signer , tapLeafHashToSign ?: Buffer , sighashTypes ?: number [ ] ) : this;
104
+ private _signInput ;
105
+ private _signTaprootInput ;
98
106
signInputAsync ( inputIndex : number , keyPair : Signer | SignerAsync , sighashTypes ?: number [ ] ) : Promise < void > ;
107
+ signTaprootInputAsync ( inputIndex : number , keyPair : Signer | SignerAsync , tapLeafHash ?: Buffer , sighashTypes ?: number [ ] ) : Promise < void > ;
108
+ private _signInputAsync ;
109
+ private _signTaprootInputAsync ;
110
+ private checkTaprootHashesForSig ;
99
111
toBuffer ( ) : Buffer ;
100
112
toHex ( ) : string ;
101
113
toBase64 ( ) : string ;
@@ -143,15 +155,13 @@ export interface HDSigner extends HDSignerBase {
143
155
* Return a 64 byte signature (32 byte r and 32 byte s in that order)
144
156
*/
145
157
sign ( hash : Buffer ) : Buffer ;
146
- signSchnorr ?( hash : Buffer ) : Buffer ;
147
158
}
148
159
/**
149
160
* Same as above but with async sign method
150
161
*/
151
162
export interface HDSignerAsync extends HDSignerBase {
152
163
derivePath ( path : string ) : HDSignerAsync ;
153
164
sign ( hash : Buffer ) : Promise < Buffer > ;
154
- signSchnorr ?( hash : Buffer ) : Promise < Buffer > ;
155
165
}
156
166
export interface Signer {
157
167
publicKey : Buffer ;
@@ -177,11 +187,15 @@ declare type FinalScriptsFunc = (inputIndex: number, // Which input is it?
177
187
input : PsbtInput , // The PSBT input contents
178
188
script : Buffer , // The "meaningful" locking script Buffer (redeemScript for P2SH etc.)
179
189
isSegwit : boolean , // Is it segwit?
180
- isTapscript : boolean , // Is taproot script path?
181
190
isP2SH : boolean , // Is it P2SH?
182
191
isP2WSH : boolean ) => {
183
192
finalScriptSig : Buffer | undefined ;
184
- finalScriptWitness : Buffer | Buffer [ ] | undefined ;
193
+ finalScriptWitness : Buffer | undefined ;
194
+ } ;
195
+ declare type FinalTaprootScriptsFunc = ( inputIndex : number , // Which input is it?
196
+ input : PsbtInput , // The PSBT input contents
197
+ tapLeafHashToFinalize ?: Buffer ) => {
198
+ finalScriptWitness : Buffer | undefined ;
185
199
} ;
186
- declare type AllScriptType = 'witnesspubkeyhash' | 'pubkeyhash' | 'multisig' | 'pubkey' | 'taproot' | ' nonstandard' | 'p2sh-witnesspubkeyhash' | 'p2sh-pubkeyhash' | 'p2sh-multisig' | 'p2sh-pubkey' | 'p2sh-nonstandard' | 'p2wsh-pubkeyhash' | 'p2wsh-multisig' | 'p2wsh-pubkey' | 'p2wsh-nonstandard' | 'p2sh-p2wsh-pubkeyhash' | 'p2sh-p2wsh-multisig' | 'p2sh-p2wsh-pubkey' | 'p2sh-p2wsh-nonstandard' | 'p2tr-pubkey' | 'p2tr -nonstandard';
200
+ declare type AllScriptType = 'witnesspubkeyhash' | 'pubkeyhash' | 'multisig' | 'pubkey' | 'nonstandard' | 'p2sh-witnesspubkeyhash' | 'p2sh-pubkeyhash' | 'p2sh-multisig' | 'p2sh-pubkey' | 'p2sh-nonstandard' | 'p2wsh-pubkeyhash' | 'p2wsh-multisig' | 'p2wsh-pubkey' | 'p2wsh-nonstandard' | 'p2sh-p2wsh-pubkeyhash' | 'p2sh-p2wsh-multisig' | 'p2sh-p2wsh-pubkey' | 'p2sh-p2wsh-nonstandard' ;
187
201
export { } ;
0 commit comments