Skip to content

Commit 2ef6b88

Browse files
committed
Add readme
1 parent b135d16 commit 2ef6b88

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
11
# WalletConnectV2Connector for useDApp
2+
3+
Connector for [WalletConnectV2](https://docs.walletconnect.com/) for useDApp.
4+
5+
## Example usage
6+
7+
Update your `usedapp` config:
8+
9+
```ts
10+
connectors: {
11+
...
12+
walletConnectV2: new WalletConnectV2Connector({
13+
projectId: <YOUR_WALLETCONNECT_PROJECT_ID>,
14+
chains: [Mainnet],
15+
rpcMap: {
16+
1: 'https://mainnet.infura.io/v3/<YOUR_INFURA_KEY>',
17+
},
18+
}),
19+
...
20+
},
21+
```
22+
23+
Now you can use the connector:
24+
25+
```tsx
26+
import { useEthers } from '@usedapp/core'
27+
28+
...
29+
30+
const { activateBrowserWallet } = useEthers();
31+
32+
...
33+
34+
<button onClick={() => activateBrowserWallet({ type: 'walletConnectV2' })}>Connect</button>
35+
```

packages/docs/docs/02-Guides/01-Connecting/05-Wallet Connect.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ It is possible to create multiple instances of WalletConnectV2Connector, in case
7272
```ts
7373
connectors: {
7474
...
75-
walletConnectV2-mainnet: new WalletConnectV2Connector({
75+
walletConnectV2_mainnet: new WalletConnectV2Connector({
7676
projectId: <YOUR_WALLETCONNECT_PROJECT_ID>,
7777
chains: [Mainnet],
7878
rpcMap: {
7979
1: 'https://optimism.infura.io/v3/<YOUR_INFURA_KEY>',
8080
},
8181
}),
82-
walletConnectV2-optimism: new WalletConnectV2Connector({
82+
walletConnectV2_optimism: new WalletConnectV2Connector({
8383
projectId: <YOUR_WALLETCONNECT_PROJECT_ID>,
8484
chains: [Optimism],
8585
rpcMap: {

0 commit comments

Comments
 (0)