@@ -371,6 +371,7 @@ export abstract class AbstractUtxoCoin
371371{
372372 public altScriptHash ?: number ;
373373 public supportAltScriptDestination ?: boolean ;
374+ public defaultSdkBackend : SdkBackend = 'utxolib' ;
374375 public readonly amountType : 'number' | 'bigint' ;
375376 private readonly _network : utxolib . Network ;
376377
@@ -536,17 +537,17 @@ export abstract class AbstractUtxoCoin
536537
537538 decodeTransaction < TNumber extends number | bigint > (
538539 input : Buffer | string ,
539- decodeWith ? : SdkBackend
540+ decodeWith : SdkBackend = this . defaultSdkBackend
540541 ) : DecodedTransaction < TNumber > {
541542 if ( typeof input === 'string' ) {
542543 const buffer = stringToBufferTryFormats ( input , [ 'hex' , 'base64' ] ) ;
543544 return this . decodeTransaction ( buffer , decodeWith ) ;
544545 }
545546
546547 if ( utxolib . bitgo . isPsbt ( input ) ) {
547- return decodePsbtWith ( input , this . network , decodeWith ?? 'utxolib' ) ;
548+ return decodePsbtWith ( input , this . network , decodeWith ) ;
548549 } else {
549- if ( decodeWith ?? 'utxolib' !== 'utxolib' ) {
550+ if ( decodeWith !== 'utxolib' ) {
550551 console . error ( 'received decodeWith hint %s, ignoring for legacy transaction' , decodeWith ) ;
551552 }
552553 return utxolib . bitgo . createTransactionFromBuffer ( input , this . network , {
0 commit comments