WalletConnectV2Connector for useDApp
Connector for WalletConnectV2 for useDApp.
Example usage
Update your usedapp
config:
connectors: {
...
walletConnectV2: new WalletConnectV2Connector({
projectId: <YOUR_WALLETCONNECT_PROJECT_ID>,
chains: [Mainnet],
rpcMap: {
1: 'https://mainnet.infura.io/v3/<YOUR_INFURA_KEY>',
},
}),
...
},
Now you can use the connector:
import { useEthers } from '@usedapp/core'
...
const { activateBrowserWallet } = useEthers();
...
<button onClick={() => activateBrowserWallet({ type: 'walletConnectV2' })}>Connect</button>