@@ -97,18 +97,26 @@ const DEFAULT_OPTS: PsbtOpts = {
9797 * Transaction object. Such as fee rate not being larger than maximumFeeRate etc.
9898 */
9999export class Psbt {
100- static fromBase64 ( data : string , opts : PsbtOptsOptional = { } ) : Psbt {
100+ static fromBase64 (
101+ data : string ,
102+ opts : PsbtDeserializeOptsOptional = { } ,
103+ ) : Psbt {
101104 const buffer = Buffer . from ( data , 'base64' ) ;
102105 return this . fromBuffer ( buffer , opts ) ;
103106 }
104107
105- static fromHex ( data : string , opts : PsbtOptsOptional = { } ) : Psbt {
108+ static fromHex ( data : string , opts : PsbtDeserializeOptsOptional = { } ) : Psbt {
106109 const buffer = Buffer . from ( data , 'hex' ) ;
107110 return this . fromBuffer ( buffer , opts ) ;
108111 }
109112
110- static fromBuffer ( buffer : Buffer , opts : PsbtOptsOptional = { } ) : Psbt {
111- const psbtBase = PsbtBase . fromBuffer ( buffer , transactionFromBuffer ) ;
113+ static fromBuffer (
114+ buffer : Buffer ,
115+ opts : PsbtDeserializeOptsOptional = { } ,
116+ ) : Psbt {
117+ const psbtBase = PsbtBase . fromBuffer ( buffer , transactionFromBuffer , {
118+ bip32PathsAbsolute : opts . bip32PathsAbsolute ,
119+ } ) ;
112120 const psbt = new Psbt ( opts , psbtBase ) ;
113121 checkTxForDupeIns ( psbt . __CACHE . __TX , psbt . __CACHE ) ;
114122 return psbt ;
@@ -775,6 +783,10 @@ interface PsbtOptsOptional {
775783 maximumFeeRate ?: number ;
776784}
777785
786+ interface PsbtDeserializeOptsOptional extends PsbtOptsOptional {
787+ bip32PathsAbsolute ?: boolean ;
788+ }
789+
778790interface PsbtOpts {
779791 network : Network ;
780792 maximumFeeRate : number ;
0 commit comments