From 3286ffcc47295e3c0b56edc725d44a5137bf1864 Mon Sep 17 00:00:00 2001 From: Polybius93 Date: Wed, 20 Nov 2024 14:11:13 +0100 Subject: [PATCH] feat: add dfns network map --- src/app/hooks/use-dfns.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/hooks/use-dfns.ts b/src/app/hooks/use-dfns.ts index 5293cf1c..77486e1e 100644 --- a/src/app/hooks/use-dfns.ts +++ b/src/app/hooks/use-dfns.ts @@ -11,6 +11,12 @@ import { bytesToHex } from 'viem'; import { BITCOIN_NETWORK_MAP } from '@shared/constants/bitcoin.constants'; +const BITCOIN_NETWORK_DFNS_MAP = { + mainnet: 'Bitcoin', + testnet: 'BitcoinTestnet3', + regtest: 'BitcoinTestnet3', +}; + interface UseDFNSReturnType { connectDFNSWallet: ( userName: string, @@ -82,7 +88,7 @@ export function useDFNS(): UseDFNSReturnType { return (await dfnsDLCHandler.getWallets()).items .filter( item => - item.network === 'BitcoinTestnet3' && + item.network === BITCOIN_NETWORK_DFNS_MAP[appConfiguration.bitcoinNetwork] && item.signingKey.scheme === 'Schnorr' && item.signingKey.curve === 'secp256k1' )