remove not used networks (#1933)

This commit is contained in:
Bogdan Fazakas 2023-06-16 17:34:15 +03:00 committed by GitHub
parent 31c8b17ff2
commit 9db01b6a30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 100 deletions

View File

@ -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.

View File

@ -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()
}

View File

@ -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]
})
)

View File

@ -15,18 +15,6 @@ describe('@shared/NetworkName', () => {
render(<NetworkName networkId={137} />)
})
it('renders BSC', () => {
render(<NetworkName networkId={56} />)
})
it('renders Energy Web', () => {
render(<NetworkName networkId={246} />)
})
it('renders Moonriver', () => {
render(<NetworkName networkId={1285} />)
})
it('renders icon fallback', () => {
render(<NetworkName networkId={99999} />)
})