Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WalletConnect integration - any idea guys? #292

Closed
eliotmess opened this issue Aug 3, 2021 · 4 comments
Closed

WalletConnect integration - any idea guys? #292

eliotmess opened this issue Aug 3, 2021 · 4 comments

Comments

@eliotmess
Copy link

Hello,

I'm struggling with WalletConnect integration in my useDApp based app. Any of you tried it?
The thing is to change provider -> https://docs.walletconnect.org/quick-start/dapps/web3-provider

Do you think it's possible with useDApp?

@lcamargof
Copy link
Contributor

lcamargof commented Aug 4, 2021

With the useEthers hook get the activate method and just send the WalletConnect connector, it works for any wallet

Example:

import { useEthers } from '@usedapp/core'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'

const walletconnect = new WalletConnectConnector({
  rpc: { ...yourconfig },
  qrcode: true
})

const Component = () => {
    const { activate } = useEthers()
    
    const connectToWallet = () => {
          // this could be any wallet
          activate(walletconnect)
    }
}

@niconiahi
Copy link

niconiahi commented Sep 13, 2021

would be nice to be able to do something like this (see example). That way, we wouldn't lose the good error handling useDapp already does on the activateBrowserWallet method. This new method, in essence, would be a flexible activateBrowserWallet, which is tightly attached to Injected web3-react connector

Also, it should handle auto-reconnecting on page refresh, right? In other words, remember the last activation

import { useEthers } from '@usedapp/core'
import { WalletConnectConnector } from '@web3-react/walletconnect-connector'

const walletconnect = new WalletConnectConnector({
  rpc: { ...yourconfig },
  qrcode: true
})

const WalletConnectorSelection = () => {
    const { activateWallet } = useEthers()
    
    const handleSelection = () => {
      activateWallet(walletconnect)
    }
}

@roughpandaz
Copy link

That would be dope. Could some create some technical notes and estimates on how long something like this could take. This could be help me or others to see if there is enough time to contribute. I think the biggest challenge is just setting up the local testing/development environment. @tt-marek @niconiahi

@mj426382
Copy link
Contributor

mj426382 commented May 17, 2022

https://usedapp-docs.netlify.app/docs/Guides/Connecting/Wallet%20Connect
Here is full tutorial with WalletConnect integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants