Skip to content

Commit 2bf7683

Browse files
feat: remove experimental chain filtering (#83)
* feat: remove experimental chain filtering * feat: use arbitrum-mainnet as default network * fix: correct indentation in subgraph URLs for Arbitrum chains
1 parent 9aa51c0 commit 2bf7683

File tree

3 files changed

+22
-52
lines changed

3 files changed

+22
-52
lines changed

src/components/navbar/ChainSelector.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import { LOCAL_STORAGE_PREFIX } from '@/config.ts';
2-
import { useSearch } from '@tanstack/react-router';
3-
import { useEffect } from 'react';
4-
import useLocalStorageState from 'use-local-storage-state';
51
import { useChainSwitch } from '@/hooks/useChainSwitch.ts';
62
import useUserStore from '@/stores/useUser.store.ts';
73
import { getSupportedChains } from '@/utils/chain.utils.ts';
@@ -16,19 +12,8 @@ import {
1612
export function ChainSelector({ className }: { className?: string }) {
1713
const { chainId } = useUserStore();
1814
const { requestChainChange } = useChainSwitch();
19-
const search = useSearch({ strict: false });
20-
const [, setExperimental] = useLocalStorageState<boolean>(
21-
`${LOCAL_STORAGE_PREFIX}_experimental`,
22-
{ defaultValue: false }
23-
);
24-
25-
useEffect(() => {
26-
if (search?.feature === 'experimental') {
27-
setExperimental(true);
28-
}
29-
}, [search?.feature, setExperimental]);
3015

31-
const filteredChains = getSupportedChains();
16+
const chains = getSupportedChains();
3217

3318
const handleChainChange = async (value: string) => {
3419
requestChainChange(Number(value));
@@ -44,7 +29,7 @@ export function ChainSelector({ className }: { className?: string }) {
4429
<SelectValue placeholder="Select Chain" />
4530
</SelectTrigger>
4631
<SelectContent className={className}>
47-
{filteredChains.map((chain) => (
32+
{chains.map((chain) => (
4833
<SelectItem
4934
key={chain.id}
5035
value={chain.id.toString()}

src/config.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,6 @@ export const IPFS_GATEWAY_URL = 'https://ipfs.iex.ec';
1414
export const API_COINGECKO_URL = 'https://api.coingecko.com/api/v3/simple/';
1515

1616
export const SUPPORTED_CHAINS = [
17-
{
18-
id: 134,
19-
name: 'Bellecour',
20-
slug: 'bellecour',
21-
color: '#95A4FC',
22-
icon: iexecLogo,
23-
blockExplorerUrl: 'https://blockscout-bellecour.iex.ec',
24-
subgraphUrl: {
25-
poco: 'https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5',
26-
dataprotector:
27-
'https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2',
28-
},
29-
bridge: 'https://bridge-bellecour.iex.ec/',
30-
bridgeInformation:
31-
'Move your xRLC in your wallet between bellecour and Ethereum Mainnet with our bridge.',
32-
wagmiNetwork: bellecour,
33-
tokenSymbol: 'xRLC',
34-
},
3517
{
3618
id: 42161,
3719
name: 'Arbitrum',
@@ -61,7 +43,24 @@ export const SUPPORTED_CHAINS = [
6143
},
6244
wagmiNetwork: arbitrumSepolia,
6345
tokenSymbol: 'RLC',
64-
isExperimental: true,
46+
},
47+
{
48+
id: 134,
49+
name: 'Bellecour',
50+
slug: 'bellecour',
51+
color: '#95A4FC',
52+
icon: iexecLogo,
53+
blockExplorerUrl: 'https://blockscout-bellecour.iex.ec',
54+
subgraphUrl: {
55+
poco: 'https://thegraph.iex.ec/subgraphs/name/bellecour/poco-v5',
56+
dataprotector:
57+
'https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2',
58+
},
59+
bridge: 'https://bridge-bellecour.iex.ec/',
60+
bridgeInformation:
61+
'Move your xRLC in your wallet between bellecour and Ethereum Mainnet with our bridge.',
62+
wagmiNetwork: bellecour,
63+
tokenSymbol: 'xRLC',
6564
},
6665
];
6766

src/utils/chain.utils.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
import { SUPPORTED_CHAINS, LOCAL_STORAGE_PREFIX } from '@/config';
2-
3-
function isExperimentalEnabled(): boolean {
4-
if (typeof window === 'undefined') return false;
5-
try {
6-
return (
7-
localStorage.getItem(`${LOCAL_STORAGE_PREFIX}_experimental`) === 'true'
8-
);
9-
} catch {
10-
return false;
11-
}
12-
}
1+
import { SUPPORTED_CHAINS } from '@/config';
132

143
export function getSupportedChains() {
15-
const experimental = isExperimentalEnabled();
16-
return SUPPORTED_CHAINS.filter(
17-
(chain) => !chain.isExperimental || experimental
18-
);
4+
return SUPPORTED_CHAINS;
195
}
206

217
export function getSubgraphUrl(chainId: number) {

0 commit comments

Comments
 (0)