diff --git a/.env.example b/.env.example index b58110df..4c14646e 100644 --- a/.env.example +++ b/.env.example @@ -1,11 +1,15 @@ -NEXT_PUBLIC_OSMOSIS1_RPC='https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-rpc-front/' -NEXT_PUBLIC_OSMOSIS1_REST='https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-lcd-front/' -NEXT_PUBLIC_OSMOSIS_DEVNET_RPC='https://rpc.devnet.osmosis.zone/' -NEXT_PUBLIC_OSMOSIS_DEVNET_REST='https://lcd.devnet.osmosis.zone/' -NEXT_PUBLIC_PION1_RPC='https://rpc-palvus.pion-1.ntrn.tech/' -NEXT_PUBLIC_PION1_REST='https://rest-palvus.pion-1.ntrn.tech/' +NEXT_PUBLIC_NETWORK=mainnet + +NEXT_PUBLIC_OSMOSIS_RPC=https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-rpc-front/ +NEXT_PUBLIC_OSMOSIS_REST=https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-lcd-front/ +NEXT_PUBLIC_OSMOSIS_TEST_RPC=https://rpc.devnet.osmosis.zone/ +NEXT_PUBLIC_OSMOSIS_TEST_REST=https://lcd.devnet.osmosis.zone/ +NEXT_PUBLIC_NEUTRON_TEST_RPC=https://rpc-palvus.pion-1.ntrn.tech/ +NEXT_PUBLIC_NEUTRON_TEST_REST=https://rest-palvus.pion-1.ntrn.tech/ NEXT_PUBLIC_WALLET_CONNECT_ID=d93fdffb159bae5ec87d8fee4cdbb045 -CHARTING_LIBRARY_USERNAME="git_username" -CHARTING_LIBRARY_ACCESS_TOKEN="access_token" -CHARTING_LIBRARY_REPOSITORY="github.com/tradingview/charting_library/" +CHARTING_LIBRARY_USERNAME=git_username +CHARTING_LIBRARY_ACCESS_TOKEN=access_token +CHARTING_LIBRARY_REPOSITORY=github.com/tradingview/charting_library/ + + diff --git a/src/components/Header/ChainSelect.tsx b/src/components/Header/ChainSelect.tsx index f5882f97..957e9752 100644 --- a/src/components/Header/ChainSelect.tsx +++ b/src/components/Header/ChainSelect.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames' -import { useCallback } from 'react' -import { useSWRConfig } from 'swr' +import { useCallback, useMemo } from 'react' import { useLocation, useNavigate, useSearchParams } from 'react-router-dom' +import { useSWRConfig } from 'swr' import Button from 'components/Button' import ChainLogo from 'components/Chain/ChainLogo' @@ -12,6 +12,7 @@ import useCurrentChainId from 'hooks/localStorage/useCurrentChainId' import useChainConfig from 'hooks/useChainConfig' import useToggle from 'hooks/useToggle' import useStore from 'store' +import { NETWORK } from 'types/enums/network' import { getPage, getRoute } from 'utils/route' export default function ChainSelect() { @@ -42,14 +43,23 @@ export default function ChainSelect() { [setCurrentChainId, setShowMenu, mutate, navigate, pathname, searchParams], ) + const currentChains = useMemo(() => { + const currentNetworkType = process.env.NEXT_PUBLIC_NETWORK ?? NETWORK.TESTNET + + return Object.entries(chains).filter(([_, chain]) => chain.network === currentNetworkType) + }, []) + return (