Skip to content

Commit

Permalink
Merge pull request #251 from skalenetwork/beta
Browse files Browse the repository at this point in the history
Merge beta to develop
  • Loading branch information
dmytrotkk authored Feb 26, 2024
2 parents eae5ec2 + 07d38b9 commit d9c5655
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/MetaportProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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) => ({
Expand Down
6 changes: 5 additions & 1 deletion src/core/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d9c5655

Please sign in to comment.