@@ -80,22 +80,34 @@ export declare class Psbt {
8080 getFeeRate ( ) : number ;
8181 getFee ( ) : number ;
8282 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 ;
8487 getInputType ( inputIndex : number ) : AllScriptType ;
8588 inputHasPubkey ( inputIndex : number , pubkey : Buffer ) : boolean ;
8689 inputHasHDKey ( inputIndex : number , root : HDSigner ) : boolean ;
8790 outputHasPubkey ( outputIndex : number , pubkey : Buffer ) : boolean ;
8891 outputHasHDKey ( outputIndex : number , root : HDSigner ) : boolean ;
8992 validateSignaturesOfAllInputs ( validator : ValidateSigFunction ) : boolean ;
9093 validateSignaturesOfInput ( inputIndex : number , validator : ValidateSigFunction , pubkey ?: Buffer ) : boolean ;
94+ private _validateSignaturesOfInput ;
95+ private validateSignaturesOfTaprootInput ;
9196 signAllInputsHD ( hdKeyPair : HDSigner , sighashTypes ?: number [ ] ) : this;
9297 signAllInputsHDAsync ( hdKeyPair : HDSigner | HDSignerAsync , sighashTypes ?: number [ ] ) : Promise < void > ;
9398 signInputHD ( inputIndex : number , hdKeyPair : HDSigner , sighashTypes ?: number [ ] ) : this;
9499 signInputHDAsync ( inputIndex : number , hdKeyPair : HDSigner | HDSignerAsync , sighashTypes ?: number [ ] ) : Promise < void > ;
95100 signAllInputs ( keyPair : Signer , sighashTypes ?: number [ ] ) : this;
96101 signAllInputsAsync ( keyPair : Signer | SignerAsync , sighashTypes ?: number [ ] ) : Promise < void > ;
97102 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 ;
98106 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 ;
99111 toBuffer ( ) : Buffer ;
100112 toHex ( ) : string ;
101113 toBase64 ( ) : string ;
@@ -143,15 +155,13 @@ export interface HDSigner extends HDSignerBase {
143155 * Return a 64 byte signature (32 byte r and 32 byte s in that order)
144156 */
145157 sign ( hash : Buffer ) : Buffer ;
146- signSchnorr ?( hash : Buffer ) : Buffer ;
147158}
148159/**
149160 * Same as above but with async sign method
150161 */
151162export interface HDSignerAsync extends HDSignerBase {
152163 derivePath ( path : string ) : HDSignerAsync ;
153164 sign ( hash : Buffer ) : Promise < Buffer > ;
154- signSchnorr ?( hash : Buffer ) : Promise < Buffer > ;
155165}
156166export interface Signer {
157167 publicKey : Buffer ;
@@ -177,11 +187,15 @@ declare type FinalScriptsFunc = (inputIndex: number, // Which input is it?
177187input : PsbtInput , // The PSBT input contents
178188script : Buffer , // The "meaningful" locking script Buffer (redeemScript for P2SH etc.)
179189isSegwit : boolean , // Is it segwit?
180- isTapscript : boolean , // Is taproot script path?
181190isP2SH : boolean , // Is it P2SH?
182191isP2WSH : boolean ) => {
183192 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 ;
185199} ;
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' ;
187201export { } ;
0 commit comments