Skip to content

Commit

Permalink
feat(frontend): display regtest BTC address (#2760)
Browse files Browse the repository at this point in the history
# Motivation

We now need to display a separate BTC address for regtest (previously,
it was always the same with testnet).
  • Loading branch information
DenysKarmazynDFINITY authored Oct 9, 2024
1 parent 7511e63 commit f3962de
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/frontend/src/btc/components/core/BtcWalletAddress.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<script lang="ts">
import Copy from '$lib/components/ui/Copy.svelte';
import { btcAddressMainnet, btcAddressTestnet } from '$lib/derived/address.derived';
import {
btcAddressMainnet,
btcAddressTestnet,
btcAddressRegtest
} from '$lib/derived/address.derived';
import { networkId } from '$lib/derived/network.derived';
import { i18n } from '$lib/stores/i18n.store';
import { shortenWithMiddleEllipsis } from '$lib/utils/format.utils';
import { isNetworkIdBTCRegtest, isNetworkIdBTCTestnet } from '$lib/utils/network.utils';
// Regtest and Testnet BTC wallets have the same address
const address =
isNetworkIdBTCTestnet($networkId) || isNetworkIdBTCRegtest($networkId)
? $btcAddressTestnet
const address = isNetworkIdBTCTestnet($networkId)
? $btcAddressTestnet
: isNetworkIdBTCRegtest($networkId)
? $btcAddressRegtest
: $btcAddressMainnet;
</script>

Expand Down

0 comments on commit f3962de

Please sign in to comment.