diff --git a/src/lib/network.ts b/src/lib/network.ts index afd2ff9c..25b46865 100644 --- a/src/lib/network.ts +++ b/src/lib/network.ts @@ -41,7 +41,16 @@ export async function getNetwork(): Promise { } export function getBtcNetwork() { - return network.value === 'mainnet' ? networks.bitcoin : networks.testnet + switch (network.value) { + case 'mainnet': + return networks.bitcoin + case 'testnet': + return networks.testnet + case 'regtest': + return networks.regtest + default: + throw new Error('Unknown network') + } } export function getNet(): Net {