Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable bitcoin for mainnet #771

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions webapp/hooks/useNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,24 @@ export const useNetworks = function () {

// All enabled networks
const networks: RemoteChain[] = useMemo(
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
() => evmNetworks.concat(featureFlags.btcTunnelEnabled ? [bitcoin] : []),
[bitcoin, evmNetworks],
// TODO bitcoin is only enabled for testnet https://github.com/hemilabs/ui-monorepo/issues/738
() =>
evmNetworks.concat(
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
featureFlags.btcTunnelEnabled && type === 'testnet' ? [bitcoin] : [],
),
[bitcoin, evmNetworks, type],
)

// All enabled networks that can tunnel to/from Hemi
const remoteNetworks: RemoteChain[] = useMemo(
// TODO bitcoin is only enabled for testnet https://github.com/hemilabs/ui-monorepo/issues/738
() =>
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
evmRemoteNetworks.concat(featureFlags.btcTunnelEnabled ? [bitcoin] : []),
[bitcoin, evmRemoteNetworks],
evmRemoteNetworks.concat(
// @ts-expect-error .concat() automatically casts the result type to evmNetworks' type.
featureFlags.btcTunnelEnabled && type === 'testnet' ? [bitcoin] : [],
),
[bitcoin, evmRemoteNetworks, type],
)

return {
Expand Down
Loading