Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tx panel rendering #1918

Open
wants to merge 2 commits into
base: feat-dynamic-meta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
localL1Network,
localL2Network,
localL3Network
} from '../util/wagmi/wagmiAdditionalNetworks'
} from './wagmi/wagmiAdditionalNetworks'
import { ChainKeyQueryParam } from '../types/ChainQueryParam'
import { getOrbitChains } from './orbitChainsList'
import { chainToWagmiChain } from '../util/wagmi/wagmiAdditionalNetworks'
Expand Down
3 changes: 1 addition & 2 deletions packages/arb-token-bridge-ui/src/util/wagmi/getWagmiChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import {
localL2Network,
localL3Network
} from './wagmiAdditionalNetworks'
import { ChainId } from '../networks'
import { getCustomChainFromLocalStorageById } from '../networks'
import { ChainId, getCustomChainFromLocalStorageById } from '../networks'
import { orbitChains } from '../orbitChainsList'

export function getWagmiChain(chainId: number): Chain {
Expand Down
13 changes: 11 additions & 2 deletions packages/arb-token-bridge-ui/src/util/wagmi/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createClient, configureChains } from 'wagmi'
import { mainnet, arbitrum } from '@wagmi/core/chains'
import { publicProvider } from 'wagmi/providers/public'
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'
import { connectorsForWallets, getDefaultWallets } from '@rainbow-me/rainbowkit'
import { trustWallet, okxWallet } from '@rainbow-me/rainbowkit/wallets'

Expand All @@ -14,7 +15,7 @@ import {
holesky
} from './wagmiAdditionalNetworks'
import { isTestingEnvironment } from '../CommonUtils'
import { getCustomChainsFromLocalStorage, ChainId } from '../networks'
import { getCustomChainsFromLocalStorage, ChainId, rpcURLs } from '../networks'
import { getOrbitChains } from '../orbitChainsList'
import { getWagmiChain } from './getWagmiChain'
import { customInfuraProvider } from '../infura'
Expand Down Expand Up @@ -124,7 +125,15 @@ export function getProps(targetChainKey: string | null) {
//
// https://github.com/wagmi-dev/references/blob/main/packages/connectors/src/walletConnect.ts#L114
getChains(sanitizeTargetChainKey(targetChainKey)),
[customInfuraProvider(), publicProvider()]
[
customInfuraProvider(),
publicProvider(),
jsonRpcProvider({
rpc: chain => ({
http: rpcURLs[chain.id]!
})
})
Comment on lines +131 to +135
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i put a try catch in this getProps function and it was throwing an error of invalid provider for Ethereum Local

somehow it was never an issue until wagmiAdditonalNetworks.ts are imported by the other files simultaneously on the metadata PR

]
)

const { wallets } = getDefaultWallets({
Expand Down