Modal with Browser wallets + ethers? #3823
-
|
Hey there, I was using WalletConnect v1 before and I'm still trying to understand how can I migrate to a more updated version and have the same functionality, use your modal with ethers and have the max compatibility with other wallets, mobile and browser. I've noticed that's possible with '@walletconnect/ethereum-provider', however it looks like it isn't compatible with metamask in browser, even though Coinbase in browser works. Is it possible to edit the modal to add a custom button so I can integrate metamask (browser) in the modal? I've also tried Web3Modal SDK with React but it works with hooks instead of raw functions, if I want to make a transaction to buy X hooks aren't the thing I would like to use. What should I go for in this case? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Hooks are important if you're using react because the provider will change depending on the users connection state. However we could expose a getter for the provider/signer. Would that be helpful? Could you show a code snippet on how you would like it to work? |
Beta Was this translation helpful? Give feedback.
-
|
Hey @glitch-txs, Exposing the provider/signer would solve my issue, yes! My project is a decentralized dApp and therefore we make a lot of contract calls, both view and transactional. By exposing the provider/signer I'd only need to do small changes to keep the exact same functionality, I'd only need to use the signer from web3modal. |
Beta Was this translation helpful? Give feedback.
can you try this:
then use these
https://docs.walletconnect.com/web3modal/javascript/actions?platform=ethers#subscribe-to-theme-changes