Skip to content
Merged
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
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
Loading