From 9db01b6a30e6042f1e651fa161e87ef52b6b3771 Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Fri, 16 Jun 2023 17:34:15 +0300 Subject: [PATCH] remove not used networks (#1933) --- app.config.js | 4 +- src/@utils/wallet/chains.ts | 84 ------------------- src/@utils/wallet/index.ts | 3 +- .../@shared/NetworkName/index.test.tsx | 12 --- 4 files changed, 3 insertions(+), 100 deletions(-) delete mode 100644 src/@utils/wallet/chains.ts diff --git a/app.config.js b/app.config.js index 07308bdf81..f429c90281 100644 --- a/app.config.js +++ b/app.config.js @@ -11,10 +11,10 @@ module.exports = { // List of chainIds which metadata cache queries will return by default. // This preselects the Chains user preferences. - chainIds: [1, 137, 56, 246, 1285], + chainIds: [1, 137], // List of all supported chainIds. Used to populate the Chains user preferences list. - chainIdsSupported: [1, 137, 56, 246, 1285, 5, 80001], + chainIdsSupported: [1, 137, 5, 80001], defaultDatatokenTemplateIndex: 2, // The ETH address the marketplace fee will be sent to. diff --git a/src/@utils/wallet/chains.ts b/src/@utils/wallet/chains.ts deleted file mode 100644 index 150821cdcd..0000000000 --- a/src/@utils/wallet/chains.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { Chain } from 'wagmi' -import * as wagmiChains from 'wagmi/chains' - -export const energyWeb = { - id: 246, - name: 'Energy Web Chain', - network: 'energyweb', - nativeCurrency: { - decimals: 18, - name: 'EWT', - symbol: 'EWT' - }, - rpcUrls: { - public: { - http: ['https://rpc.energyweb.org'], - webSocket: ['wss://rpc.energyweb.org/ws'] - }, - default: { - http: ['https://rpc.energyweb.org'], - webSocket: ['wss://rpc.energyweb.org/ws'] - } - }, - blockExplorers: { - default: { - name: 'Energy Web Chain', - url: 'https://explorer.energyweb.org/' - }, - blockscout: { - name: 'Energy Web Chain', - url: 'https://explorer.energyweb.org/' - } - }, - testnet: false -} as Chain - -// TODO: remove once moonriver is shipped in wagmi as it is already in codebase -// https://github.com/wagmi-dev/references/blob/main/packages/chains/src/moonriver.ts -export const moonriver = { - id: 1285, - name: 'Moonriver', - network: 'moonriver', - nativeCurrency: { - decimals: 18, - name: 'MOVR', - symbol: 'MOVR' - }, - rpcUrls: { - public: { - http: ['https://moonriver.public.blastapi.io'], - webSocket: ['wss://moonriver.public.blastapi.io'] - }, - default: { - http: ['https://moonriver.public.blastapi.io'], - webSocket: ['wss://moonriver.public.blastapi.io'] - } - }, - blockExplorers: { - default: { - name: 'Moonscan', - url: 'https://moonriver.moonscan.io' - }, - etherscan: { - name: 'Moonscan', - url: 'https://moonriver.moonscan.io' - } - }, - contracts: { - multicall3: { - address: '0xcA11bde05977b3631167028862bE2a173976CA11', - blockCreated: 1597904 - } - }, - testnet: false -} as Chain - -export const getSupportedChains = (chainIdsSupported: number[]): Chain[] => { - const chains = [wagmiChains, energyWeb, moonriver].map((chain) => { - return Object.values(chain).filter((chain) => - chainIdsSupported.includes(chain.id) - ) - }) - console.log(chains.flat()) - return chains.flat() -} diff --git a/src/@utils/wallet/index.ts b/src/@utils/wallet/index.ts index 765afcd14d..8e59246364 100644 --- a/src/@utils/wallet/index.ts +++ b/src/@utils/wallet/index.ts @@ -4,7 +4,6 @@ import { mainnet, polygon, bsc, goerli, polygonMumbai } from 'wagmi/chains' import { ethers, Contract, Signer, providers } from 'ethers' import { formatEther } from 'ethers/lib/utils' import { getDefaultClient } from 'connectkit' -import { energyWeb, moonriver } from './chains' import { getNetworkDisplayName } from '@hooks/useNetworkMetadata' import { getOceanConfig } from '../ocean' @@ -31,7 +30,7 @@ export const wagmiClient = createClient( appName: 'Ocean Market', infuraId: process.env.NEXT_PUBLIC_INFURA_PROJECT_ID, // TODO: mapping between appConfig.chainIdsSupported and wagmi chainId - chains: [mainnet, polygon, bsc, energyWeb, moonriver, goerli, polygonMumbai] + chains: [mainnet, polygon, goerli, polygonMumbai] }) ) diff --git a/src/components/@shared/NetworkName/index.test.tsx b/src/components/@shared/NetworkName/index.test.tsx index 4065c2379e..3ab48e3db3 100644 --- a/src/components/@shared/NetworkName/index.test.tsx +++ b/src/components/@shared/NetworkName/index.test.tsx @@ -15,18 +15,6 @@ describe('@shared/NetworkName', () => { render() }) - it('renders BSC', () => { - render() - }) - - it('renders Energy Web', () => { - render() - }) - - it('renders Moonriver', () => { - render() - }) - it('renders icon fallback', () => { render() })