Skip to content

Commit ca3519f

Browse files
fix: remove fast btc (#1114) (#1116)
* fix: remove fast btc * fix: remove fast btc from faq Co-authored-by: norugpull <shanhibbsbgi82@gmail.com>
1 parent dcda3df commit ca3519f

File tree

3 files changed

+17
-83
lines changed

3 files changed

+17
-83
lines changed

apps/frontend/src/app/3_organisms/Header/components/BridgeMenuItem/BridgeMenuItem.tsx

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
import React, { FC, useCallback, useMemo } from 'react';
1+
import React, { FC, useCallback } from 'react';
22

33
import classNames from 'classnames';
44
import { t } from 'i18next';
55

66
import { ChainIds } from '@sovryn/ethers-provider';
7-
import { Badge, Menu, MenuItem, Tooltip } from '@sovryn/ui';
7+
import { Menu, MenuItem, Tooltip } from '@sovryn/ui';
88

9-
import { POWPEG, RSK_FAUCET } from '../../../../../constants/general';
9+
import { POWPEG } from '../../../../../constants/general';
1010
import { BOB } from '../../../../../constants/infrastructure/bob';
1111
import {
1212
BABELFISH_APP_LINK,
1313
SEPOLIA_FAUCET_LINK,
1414
} from '../../../../../constants/links';
1515
import { useWalletConnect } from '../../../../../hooks';
16-
import { useAssetBalance } from '../../../../../hooks/useAssetBalance';
1716
import { useCurrentChain } from '../../../../../hooks/useChainStore';
1817
import { useIsMobile } from '../../../../../hooks/useIsMobile';
1918
import { sharedState } from '../../../../../store/rxjs/shared-state';
2019
import { Environments } from '../../../../../types/global';
21-
import { COMMON_SYMBOLS } from '../../../../../utils/asset';
2220
import { isBobChain, isRskChain } from '../../../../../utils/chain';
23-
import {
24-
isMainnet,
25-
isTestnetFastBtcEnabled,
26-
} from '../../../../../utils/helpers';
21+
import { isMainnet } from '../../../../../utils/helpers';
2722
import { NavDropdown } from '../NavItem/NavDropdown';
2823

2924
export type BridgeMenuItemProps = {
@@ -33,17 +28,8 @@ export type BridgeMenuItemProps = {
3328
export const BridgeMenuItem: FC<BridgeMenuItemProps> = ({ dataAttribute }) => {
3429
const { isMobile } = useIsMobile();
3530
const chainId = useCurrentChain();
36-
const { balance } = useAssetBalance(
37-
isRskChain(chainId) ? COMMON_SYMBOLS.BTC : COMMON_SYMBOLS.ETH,
38-
chainId,
39-
);
40-
const { account } = useWalletConnect();
41-
const hasRbtcBalance = useMemo(() => Number(balance) !== 0, [balance]);
4231

43-
const enableFastBtc = useMemo(
44-
() => isMainnet() || (!isMainnet() && isTestnetFastBtcEnabled()),
45-
[],
46-
);
32+
const { account } = useWalletConnect();
4733

4834
const handleEthClicked = useCallback(() => {
4935
if (isBobChain(chainId)) {
@@ -56,20 +42,6 @@ export const BridgeMenuItem: FC<BridgeMenuItemProps> = ({ dataAttribute }) => {
5642
}
5743
}, [chainId]);
5844

59-
const handleBtcClicked = useCallback(() => {
60-
if (isBobChain(chainId)) {
61-
window.open(
62-
BOB.bridge[isMainnet() ? Environments.Mainnet : Environments.Testnet],
63-
'_blank',
64-
);
65-
} else if (isRskChain(chainId)) {
66-
if (enableFastBtc) sharedState.actions.openFastBtcDialog(!hasRbtcBalance);
67-
else window.open(RSK_FAUCET, '_blank');
68-
} else if (chainId === ChainIds.SEPOLIA) {
69-
window.open(SEPOLIA_FAUCET_LINK, '_blank');
70-
}
71-
}, [hasRbtcBalance, enableFastBtc, chainId]);
72-
7345
const handleRunesClick = useCallback(() => {
7446
sharedState.actions.openRuneBridgeDialog();
7547
}, []);
@@ -139,24 +111,6 @@ export const BridgeMenuItem: FC<BridgeMenuItemProps> = ({ dataAttribute }) => {
139111
})}
140112
onClick={handleEthClicked}
141113
/>
142-
<MenuItem
143-
key={t('header.nav.bridges.subMenu.btcBridge')}
144-
text={
145-
<span className="flex items-center gap-1.5">
146-
{t('header.nav.bridges.subMenu.btcBridge')}
147-
<Badge content={t('common.deprecated')} className="px-1.5" />
148-
</span>
149-
}
150-
label={
151-
!isMobile &&
152-
t('header.nav.bridges.subMenu.btcBridgeDescription')
153-
}
154-
dataAttribute={`dapp-menu-btcBridge`}
155-
className={classNames('no-underline', {
156-
hidden: !isRskChain(chainId),
157-
})}
158-
onClick={handleBtcClicked}
159-
/>
160114
<MenuItem
161115
key={t('header.nav.bridges.subMenu.erc20Bridge')}
162116
text={t('header.nav.bridges.subMenu.erc20Bridge')}

apps/frontend/src/app/5_pages/LandingPage/components/GetStarted/GetStarted.tsx

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
import React, { FC, useCallback, useMemo } from 'react';
1+
import React, { FC } from 'react';
22

33
import { t } from 'i18next';
44

5-
import { Button, ButtonSize, ButtonStyle, Paragraph } from '@sovryn/ui';
5+
import { Button, ButtonStyle, Paragraph } from '@sovryn/ui';
66

77
import { ConnectWalletButton } from '../../../../2_molecules';
88
import { useWalletConnect } from '../../../../../hooks';
9-
import { useAssetBalance } from '../../../../../hooks/useAssetBalance';
109
import { translations } from '../../../../../locales/i18n';
11-
import { sharedState } from '../../../../../store/rxjs/shared-state';
1210
import { GETTING_STARTED_URL } from './GetStarted.constants';
1311
import { GetStartedSteps } from './components/GetStartedSteps/GetStartedSteps';
14-
import { COMMON_SYMBOLS } from '../../../../../utils/asset';
1512

1613
const pageTranslations = translations.landingPage.getStarted;
1714

1815
export const GetStarted: FC = () => {
1916
const { connectWallet, disconnectWallet, account, pending } =
2017
useWalletConnect();
21-
const { balance } = useAssetBalance(COMMON_SYMBOLS.BTC);
22-
23-
const hasRbtcBalance = useMemo(() => Number(balance) !== 0, [balance]);
24-
25-
const handleFastBtcClick = useCallback(
26-
() => sharedState.actions.openFastBtcDialog(!hasRbtcBalance),
27-
[hasRbtcBalance],
28-
);
2918

3019
return (
3120
<div className="max-w-full xl:max-w-md">
@@ -35,23 +24,14 @@ export const GetStarted: FC = () => {
3524
/>
3625
<GetStartedSteps />
3726
<div className="flex m-6">
38-
{account ? (
39-
<Button
40-
text={t(pageTranslations.actions.fundYourWallet)}
41-
onClick={handleFastBtcClick}
42-
size={ButtonSize.large}
43-
dataAttribute="get-started-section-fund"
44-
/>
45-
) : (
46-
<ConnectWalletButton
47-
onConnect={connectWallet}
48-
onDisconnect={disconnectWallet}
49-
address={account}
50-
pending={pending}
51-
dataAttribute="get-started-section-connect"
52-
className="h-10 py-3 px-6"
53-
/>
54-
)}
27+
<ConnectWalletButton
28+
onConnect={connectWallet}
29+
onDisconnect={disconnectWallet}
30+
address={account}
31+
pending={pending}
32+
dataAttribute="get-started-section-connect"
33+
className="h-10 py-3 px-6"
34+
/>
5535
<Button
5636
text={t(pageTranslations.actions.learnMore)}
5737
className="ml-6"

apps/frontend/src/locales/en/translations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@
490490
},
491491
"third": {
492492
"title": "How do I get funds into Sovryn?",
493-
"description": "On BOB, you can use the bridge interface to bring in assets from Ethereum and to bridge in BTC from the bitcoin network.<br/><br/>On Rootstock, you can bridge in BTC from the bitcoin network with FastBTC. You can also bridge in stablecoins with Babelfish and other assets from Ethereum and BSC using the Sovryn bridge."
493+
"description": "On BOB, you can use the bridge interface to bring in assets from Ethereum and to bridge in BTC from the bitcoin network.<br/><br/>On Rootstock, you can bridge in stablecoins with Babelfish and other assets from Ethereum and BSC using the Sovryn bridge."
494494
},
495495
"fourth": {
496496
"title": "What is the native gas token?",
@@ -2108,4 +2108,4 @@
21082108
"invalidNumberFormat": "Invalid number format."
21092109
}
21102110
}
2111-
}
2111+
}

0 commit comments

Comments
 (0)