Skip to content

Commit 9e82ee2

Browse files
OttoAllmendingerllm-git
andcommitted
feat(abstract-utxo): force PSBT format for Bitcoin Testnet hot wallets
Forces PSBT format for Bitcoin Testnet hot wallets and explicitly handles Zcash separately. This change maintains legacy format for Zcash while ensuring all other UTXO-based coins on testnet use PSBT format. Issue: BTC-2732 Co-authored-by: llm-git <[email protected]>
1 parent 836c26b commit 9e82ee2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/abstract-utxo/src/abstractUtxoCoin.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,17 +1003,19 @@ export abstract class AbstractUtxoCoin extends BaseCoin {
10031003
return requestedTxFormat as TxFormat;
10041004
}
10051005

1006+
if (utxolib.getMainnet(this.network) === utxolib.networks.zcash) {
1007+
// FIXME(BTC-1322): fix zcash PSBT support
1008+
return 'legacy';
1009+
}
1010+
10061011
const walletFlagMusigKp = wallet.flag('musigKp') === 'true';
10071012
const isHotWallet = wallet.type() === 'hot';
10081013

10091014
// if not txFormat is already specified figure out if we should default to psbt format
10101015
if (
10111016
wallet.subType() === 'distributedCustody' ||
10121017
// default to testnet for all utxo coins except zcash
1013-
(isTestnet(this.network) &&
1014-
// FIXME(BTC-1322): fix zcash PSBT support
1015-
getMainnet(this.network) !== utxolib.networks.zcash &&
1016-
isHotWallet) ||
1018+
(isTestnet(this.network) && isHotWallet) ||
10171019
// if mainnet, only default to psbt for btc hot wallets
10181020
(isMainnet(this.network) && getMainnet(this.network) === utxolib.networks.bitcoin && isHotWallet) ||
10191021
// default to psbt if it has the wallet flag

0 commit comments

Comments
 (0)