Skip to content

Commit

Permalink
Update packages/walletconnect-v2/src/index.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
  • Loading branch information
JFrankfurt and zzmp committed Aug 4, 2023
1 parent f998eee commit 0977b59
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/walletconnect-v2/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,13 @@ export class WalletConnect extends Connector {
private async initializeProvider(
desiredChainId: number | undefined = this.defaultChainId
): Promise<WalletConnectProvider> {
const ethProviderModule = await import('@walletconnect/ethereum-provider')
const rpcMap = this.rpcMap ? await getBestUrlMap(this.rpcMap, this.timeout) : undefined
const rpcMap = this.rpcMap ? getBestUrlMap(this.rpcMap, this.timeout) : undefined
const chainProps = this.getChainProps(this.chains, this.optionalChains, desiredChainId)

this.provider = await ethProviderModule.default.init({
this.provider = (await import('@walletconnect/ethereum-provider')).default.init({
...this.options,
...chainProps,
rpcMap,
rpcMap: await rpcMap,
})

return this.handleProviderEvents(this.provider)
Expand Down

0 comments on commit 0977b59

Please sign in to comment.