@@ -13,8 +13,6 @@ import {
1313 TransactionFromBuffer ,
1414 TapKeySig ,
1515 TapScriptSig ,
16- TapInternalKey ,
17- TapTree ,
1816} from 'bip174/src/lib/interfaces' ;
1917import { checkForInput , checkForOutput } from 'bip174/src/lib/utils' ;
2018import { fromOutputScript , toOutputScript } from './address' ;
@@ -29,11 +27,9 @@ import {
2927 tapScriptFinalizer ,
3028 serializeTaprootSignature ,
3129 isTaprootInput ,
32- isTaprootOutput ,
3330 checkTaprootInputFields ,
3431 checkTaprootOutputFields ,
3532 tweakInternalPubKey ,
36- getNewTaprootScriptAndAddress ,
3733} from './psbt/bip371' ;
3834import {
3935 witnessStackToScriptWitness ,
@@ -316,12 +312,11 @@ export class Psbt {
316312 ! outputData ||
317313 outputData . value === undefined ||
318314 ( ( outputData as any ) . address === undefined &&
319- ( outputData as any ) . script === undefined &&
320- ( outputData as any ) . tapInternalKey === undefined )
315+ ( outputData as any ) . script === undefined )
321316 ) {
322317 throw new Error (
323318 `Invalid arguments for Psbt.addOutput. ` +
324- `Requires single object with at least [script, address or tapInternalKey ] and [value]` ,
319+ `Requires single object with at least [script or address ] and [value]` ,
325320 ) ;
326321 }
327322 checkInputsForPartialSig ( this . data . inputs , 'addOutput' ) ;
@@ -331,17 +326,7 @@ export class Psbt {
331326 const script = toOutputScript ( address , network ) ;
332327 outputData = Object . assign ( outputData , { script } ) ;
333328 }
334-
335- if ( isTaprootOutput ( outputData ) ) {
336- checkTaprootOutputFields ( outputData , outputData , 'addOutput' ) ;
337- const scriptAndAddress = getNewTaprootScriptAndAddress (
338- outputData ,
339- outputData ,
340- this . opts . network ,
341- ) ;
342- if ( scriptAndAddress )
343- outputData = Object . assign ( outputData , scriptAndAddress ) ;
344- }
329+ checkTaprootOutputFields ( outputData , outputData , 'addOutput' ) ;
345330
346331 const c = this . __CACHE ;
347332 this . data . addOutput ( outputData ) ;
@@ -1117,6 +1102,9 @@ export class Psbt {
11171102 }
11181103
11191104 updateOutput ( outputIndex : number , updateData : PsbtOutputUpdate ) : this {
1105+ // const outputData = this.data.outputs[outputIndex];
1106+ // checkTaprootOutputFields(outputData, updateData, 'updateOutput');
1107+
11201108 this . data . updateOutput ( outputIndex , updateData ) ;
11211109 return this ;
11221110 }
@@ -1165,10 +1153,7 @@ interface PsbtOpts {
11651153
11661154interface PsbtInputExtended extends PsbtInput , TransactionInput { }
11671155
1168- type PsbtOutputExtended =
1169- | PsbtOutputExtendedAddress
1170- | PsbtOutputExtendedScript
1171- | PsbtOutputExtendedTaproot ;
1156+ type PsbtOutputExtended = PsbtOutputExtendedAddress | PsbtOutputExtendedScript ;
11721157
11731158interface PsbtOutputExtendedAddress extends PsbtOutput {
11741159 address : string ;
@@ -1180,13 +1165,6 @@ interface PsbtOutputExtendedScript extends PsbtOutput {
11801165 value : number ;
11811166}
11821167
1183- interface PsbtOutputExtendedTaproot extends PsbtOutput {
1184- tapInternalKey : TapInternalKey ;
1185- tapTree ?: TapTree ;
1186- script ?: Buffer ;
1187- value : number ;
1188- }
1189-
11901168interface HDSignerBase {
11911169 /**
11921170 * DER format compressed publicKey buffer
0 commit comments