File tree Expand file tree Collapse file tree
modules/abstract-utxo/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ import {
7979 getFullNameFromCoinName ,
8080 getMainnetCoinName ,
8181 getNetworkFromCoinName ,
82+ isMainnetCoin ,
8283 isUtxoCoinNameMainnet ,
8384 UtxoCoinName ,
8485 UtxoCoinNameMainnet ,
@@ -409,11 +410,20 @@ export abstract class AbstractUtxoCoin
409410{
410411 abstract name : UtxoCoinName ;
411412
413+ /**
414+ * Returns whether this coin is a mainnet coin.
415+ * Default implementation uses the name property.
416+ * Can be overridden by subclasses.
417+ */
418+ protected isMainnet ( ) : boolean {
419+ return isMainnetCoin ( this . name ) ;
420+ }
421+
412422 public readonly amountType : 'number' | 'bigint' ;
413423
414- protected readonly supportedTxFormats : { readonly psbt : boolean ; readonly legacy : boolean } = {
424+ protected supportedTxFormats : { psbt : boolean ; legacy : boolean } = {
415425 psbt : true ,
416- legacy : false ,
426+ legacy : this . isMainnet ( ) ,
417427 } ;
418428
419429 protected constructor ( bitgo : BitGoBase , amountType : 'number' | 'bigint' = 'number' ) {
You can’t perform that action at this time.
0 commit comments