Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yivlad committed Jul 4, 2023
1 parent b135d16 commit 2ef6b88
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions packages/connectors/wallet-connect-v2/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# WalletConnectV2Connector for useDApp

Connector for [WalletConnectV2](https://docs.walletconnect.com/) for useDApp.

## Example usage

Update your `usedapp` config:

```ts
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:

```tsx
import { useEthers } from '@usedapp/core'

...

const { activateBrowserWallet } = useEthers();

...

<button onClick={() => activateBrowserWallet({ type: 'walletConnectV2' })}>Connect</button>
```
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ It is possible to create multiple instances of WalletConnectV2Connector, in case
```ts
connectors: {
...
walletConnectV2-mainnet: new WalletConnectV2Connector({
walletConnectV2_mainnet: new WalletConnectV2Connector({
projectId: <YOUR_WALLETCONNECT_PROJECT_ID>,
chains: [Mainnet],
rpcMap: {
1: 'https://optimism.infura.io/v3/<YOUR_INFURA_KEY>',
},
}),
walletConnectV2-optimism: new WalletConnectV2Connector({
walletConnectV2_optimism: new WalletConnectV2Connector({
projectId: <YOUR_WALLETCONNECT_PROJECT_ID>,
chains: [Optimism],
rpcMap: {
Expand Down

3 comments on commit 2ef6b88

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.