From 5c97d43d3e625a0b87dac3b8b0e84c441bd7055e Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 27 Mar 2026 10:47:27 +0100 Subject: [PATCH 1/2] feat(abstract-utxo): add protected isMainnet method Add protected `isMainnet()` method to AbstractUtxoCoin class. Default implementation delegates to `isMainnetCoin()` helper and can be overridden by subclasses if needed. Issue: BTC-0 Co-authored-by: llm-git --- modules/abstract-utxo/src/abstractUtxoCoin.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/abstract-utxo/src/abstractUtxoCoin.ts b/modules/abstract-utxo/src/abstractUtxoCoin.ts index 5c139a3247..6f600f72d0 100644 --- a/modules/abstract-utxo/src/abstractUtxoCoin.ts +++ b/modules/abstract-utxo/src/abstractUtxoCoin.ts @@ -79,6 +79,7 @@ import { getFullNameFromCoinName, getMainnetCoinName, getNetworkFromCoinName, + isMainnetCoin, isUtxoCoinNameMainnet, UtxoCoinName, UtxoCoinNameMainnet, @@ -409,6 +410,15 @@ export abstract class AbstractUtxoCoin { abstract name: UtxoCoinName; + /** + * Returns whether this coin is a mainnet coin. + * Default implementation uses the name property. + * Can be overridden by subclasses. + */ + protected isMainnet(): boolean { + return isMainnetCoin(this.name); + } + public readonly amountType: 'number' | 'bigint'; protected readonly supportedTxFormats: { readonly psbt: boolean; readonly legacy: boolean } = { From ed26128945bcc14c80b97776c1574375adad3569 Mon Sep 17 00:00:00 2001 From: Otto Allmendinger Date: Fri, 27 Mar 2026 10:47:27 +0100 Subject: [PATCH 2/2] feat(abstract-utxo): enable legacy tx format for mainnet Changes the supportedTxFormats property from readonly to mutable and sets legacy format support based on network type. Legacy format is now enabled for mainnet networks while remaining disabled for testnet. Issue: BTC-0 Co-authored-by: llm-git --- modules/abstract-utxo/src/abstractUtxoCoin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/abstract-utxo/src/abstractUtxoCoin.ts b/modules/abstract-utxo/src/abstractUtxoCoin.ts index 6f600f72d0..8e88a4a9be 100644 --- a/modules/abstract-utxo/src/abstractUtxoCoin.ts +++ b/modules/abstract-utxo/src/abstractUtxoCoin.ts @@ -421,9 +421,9 @@ export abstract class AbstractUtxoCoin public readonly amountType: 'number' | 'bigint'; - protected readonly supportedTxFormats: { readonly psbt: boolean; readonly legacy: boolean } = { + protected supportedTxFormats: { psbt: boolean; legacy: boolean } = { psbt: true, - legacy: false, + legacy: this.isMainnet(), }; protected constructor(bitgo: BitGoBase, amountType: 'number' | 'bigint' = 'number') {