Commit 8a5045f6 authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: do not test rpc urls before walletconnecting (#5008)

parent c1607bbd
......@@ -52,17 +52,25 @@ export const gnosisSafeConnection: Connection = {
type: ConnectionType.GNOSIS_SAFE,
}
const [web3WalletConnect, web3WalletConnectHooks] = initializeConnector<WalletConnect>(
(actions) =>
new WalletConnect({
actions,
options: {
rpc: RPC_URLS,
qrcode: true,
},
onError,
})
)
const [web3WalletConnect, web3WalletConnectHooks] = initializeConnector<WalletConnect>((actions) => {
// Avoid testing for the best URL by only passing a single URL per chain.
// Otherwise, WC will not initialize until all URLs have been tested (see getBestUrl in web3-react).
const RPC_URLS_WITHOUT_FALLBACKS = Object.entries(RPC_URLS).reduce(
(map, [chainId, urls]) => ({
...map,
[chainId]: urls[0],
}),
{}
)
return new WalletConnect({
actions,
options: {
rpc: RPC_URLS_WITHOUT_FALLBACKS,
qrcode: true,
},
onError,
})
})
export const walletConnectConnection: Connection = {
connector: web3WalletConnect,
hooks: web3WalletConnectHooks,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment