Skip to content

Commit

Permalink
fix: wc rpc and config [skip cypress] (#2262)
Browse files Browse the repository at this point in the history
  • Loading branch information
grothem authored Nov 21, 2024
1 parent 6da2b3f commit 29a44cc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/libs/web3-data-provider/WalletConnectConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from '@walletconnect/ethereum-provider/dist/types/EthereumProvider';
import { AbstractConnector } from '@web3-react/abstract-connector';
import { ConnectorUpdate } from '@web3-react/types';
import { getNetworkConfig, getSupportedChainIds } from 'src/utils/marketsAndNetworksConfig';
import { getSupportedChainIds } from 'src/utils/marketsAndNetworksConfig';
import invariant from 'tiny-invariant';

export const URI_AVAILABLE = 'URI_AVAILABLE';
Expand All @@ -27,18 +27,17 @@ export class WalletConnectConnector extends AbstractConnector {

const supportedChainIds = getSupportedChainIds();

const rpcMap = supportedChainIds.reduce((acc, network) => {
const config = getNetworkConfig(network);
acc[network] = config.privateJsonRPCUrl || config.publicJsonRPCUrl[0];
return acc;
}, {} as { [networkId: number]: string });

this.config = {
chains: [defaultChainId],
optionalChains: supportedChainIds,
rpcMap,
projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID,
showQrModal: true,
metadata: {
name: 'Aave',
description: 'Non-custodial liquidity protocol',
url: 'https://app.aave.com',
icons: ['https://avatars.githubusercontent.com/u/47617460?s=200&v=4'],
},
};

this.handleChainChanged = this.handleChainChanged.bind(this);
Expand Down

0 comments on commit 29a44cc

Please sign in to comment.