diff --git a/src/components/MetaportProvider.tsx b/src/components/MetaportProvider.tsx index 95bd694..05fedfa 100644 --- a/src/components/MetaportProvider.tsx +++ b/src/components/MetaportProvider.tsx @@ -24,7 +24,7 @@ import { ReactElement, useEffect } from 'react' import { RainbowKitProvider, darkTheme, lightTheme } from '@rainbow-me/rainbowkit' import { configureChains, createConfig, WagmiConfig } from 'wagmi' -import { mainnet, goerli } from 'wagmi/chains' +import { mainnet, goerli, holesky } from 'wagmi/chains' import { jsonRpcProvider } from 'wagmi/providers/jsonRpc' import { connectorsForWallets } from '@rainbow-me/rainbowkit' import { PaletteMode } from '@mui/material' @@ -62,7 +62,7 @@ export default function MetaportProvider(props: { constructWagmiChain(props.config.skaleNetwork, chain) ) const { chains, webSocketPublicClient } = configureChains( - [mainnet, goerli, ...skaleChains], + [mainnet, goerli, holesky, ...skaleChains], [ jsonRpcProvider({ rpc: (chain) => ({ diff --git a/src/core/network.ts b/src/core/network.ts index 0507cf1..0d4f932 100644 --- a/src/core/network.ts +++ b/src/core/network.ts @@ -27,6 +27,7 @@ import { JsonRpcProvider } from 'ethers' import { WalletClient } from 'viem' import { Chain } from '@wagmi/core' +import { holesky } from '@wagmi/core/chains' import proxyEndpoints from '../metadata/proxy.json' import { MAINNET_CHAIN_NAME, DEFAULT_ITERATIONS, DEFAULT_SLEEP } from './constants' @@ -164,9 +165,12 @@ export async function enforceNetwork( ) if (currentChainId !== Number(chainId)) { log(`Switching network to ${chainId}...`) - if (chainId !== 1n && chainId !== 5n) { + if (chainId !== 1n && chainId !== 5n && chainId !== 17000n) { await _walletClient.addChain({ chain: constructWagmiChain(skaleNetwork, chainName) }) } + if (chainId === 17000n) { + await _walletClient.addChain({ chain: holesky }) + } try { // tmp fix for coinbase wallet _networkSwitch(chainId, currentChainId, switchNetwork)