-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add WalletConnect Provider #775
Comments
I need to look more into Wallet Connect, but this seems like a good idea, adding a WalletConnectSigner. I'll look into it next week. :) |
How to instantiate a provider from walletConnect Docs Seems to work, but didn't tested yet |
I’d love to help with this... I was actually looking into the Provider documentation to actually make the WalletConnect provider based on ethers instead of web3-provider-engine. Do you think that would be doable? The reason I’ve depended on web3-provider-engine until now is because it was the most stable solution for web3.js but I wonder if you had success with getting compatibility accross libraries |
@pedrouid I 'm trying to implement your lib into my dapp. |
Have you tried wrapping the @walletconnect/web3-provider with ethers Web3Provider? Example import { providers } from "ethers"
import WalletConnectProvider from "@walletconnect/web3-provider"
const provider = new providers.Web3Provider(
new WalletConnectProvider({
infuraId: "27e484dcd9e3efcfd25a83a78777cdf1" // Required
})
) PS - please use the version |
can't somehow make the web3-provider work since the qr-image lib is throwing an error when I want to serve app. Seems an issue about recent releases. @pedrouid As you can see above I already was able to implement the web3provider from ethers with walletconnect. |
What is the error? Ethers should certainly not be interfering with a QR code library... |
It's a wallet connect error, not a ethers error. The qr-image module doesn't have the zlib module exported anymore, didn't investigate in that too much |
Hey @fritzschoff, there was a report about a weird issue with qrcode-modal from one of the dependencies reported here: I've published |
Nice work!! Thanks, I will test it |
I'm closing this issue, since it is working like a charm now with the method above. |
Great to hear 🙌 I will go ahead and publish 1.2.0 then |
any update on how to get a signer with this approach? |
|
My goal is to use ethers (and all my configured keys for that provider's APIs) and the web3modal to connect to walletconnect.
My confusion is around the |
@fritzschoff Did you get ethers working with web3modal? If so, can you post your code? I've been struggling with this for months. |
It has been a while but you should be able to |
Hello :) I've just opened a discussion #1966 about this. The solution found in this thread forces users to have an infuraId However, the standalone client already allows things like eth_sendTransaction, signTransaction etc... so I would like to know if it would be possible to actually have a WalletConnect Provider in ethers.js that uses those and completely saves us from the obligation to have a centralized (infura) dependency? |
Super-sad to run into the same problem months later, google, and find myself in the thread 🤪. const providerOptions = {
walletconnect: {
package: window.WalletConnectProvider.default,
options: {
infuraId: 'xxx'
}
}
};
web3Modal = new window.Web3Modal.default({
cacheProvider: true,
providerOptions,
disableInjectedProvider: false
});
provider = await web3Modal.connect();
const wallet = new ethers.providers.Web3Provider(provider); This is using: |
This seems like an issue with Web3Modal. Is it passing the |
Unclear. |
I have apparently solved the issue, somehow as I am not seeing any calls out to infura or any other service in my network tab, but everything is working as expected, and quickly. I hate computers. |
I've also run into this problem and it doesn't seem like any of the above solutions has helped me. This is my connection code:
I see the I get errors when I call functions like this: I wonder what @EvilJordan's solution was... Dependencies: |
It was that I was double-injecting the provider and using two sets of keys: mine and the default ethers’. 100% user-error (which shouldn’t be a surprise because I am an idiot).
|
I figured it out. I was using the wrong key. I went to infura's website and got a key there and everything worked. |
Hi all, I was trying to follow this for my React Native project. I have |
I'm using this from a member of DeveloperDAO. It has a bunch of shims and allows me to create a web3-provider instance. |
Thanks, I also found a solution which is a bit different.
where Also for expo users: unfortunately to get walletconnect working on Android 11+ you need at least to
Otherwise your app can't see which apps are installed that support wallet connect and can't also send websocket requests (this last part I am not too sure, but at least you need the wc intent) |
this works for me. |
@shawnmitchell @giovanni-caiazzo I tried following what you have done but getting the below error. Have you seen this before? |
@intergalacticspacehighway I'm facing the same issue. Did you found any solution?
|
The same case I need toimplement in my Dapp . The above is Complex!!.. I need to implement both Metamask connection and WalletConnect Connection using Ether.js. Need to implement the Provider for Metamask and WalletConnect Dynamically!. if the user Connected via metamask, ether.js provider will be for Metamask and getSigner() too. if user Connected via WalletConnect means now provider in Ether.js will be WalletConnect! Dynamically. How Do I achieve this using Ether.js?? |
I'm supporting MetaMask and WalletConnect in my Angular 9 DApp. And I was asking myself, is there a way for ethers.js to instantiate a provider/signer which fits the need of WalletConnect?
You need this npm package: walletconnect
And then you can do the following:
It is a bit annoying to have two "connectors to web3". Would be nice if ethers.js can handle this case.
For instance. React has such a wrapper lib that can work with ethers.js and web3.js web3react
I guess this is the provider they create depending on the lib you are using(ethers.js, web3.js): WalletConnectProvider
I'm not an expert ethers.js so this seems a bit random. But maybe some experienced devs have an idea.
The text was updated successfully, but these errors were encountered: