-
Notifications
You must be signed in to change notification settings - Fork 374
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
An "official" example of using useDapp with "Web3Modal" in the useDapp docs would increase adoption a lot #345
Comments
+1 this would be extremely helpful! |
cc: @nezouse @quagliero @marekkirejczyk Seems to be some interest here, just letting you know. 🌈 🙏 |
It is in the backlog, no specific target date thou |
Thanks a lot @tt-marek ! |
I am trying to make this work but am having issues with it. Here is the minimal code. It works for MetaMask but not for WalletConnect or Formatic.
I think the issue is with the |
+1 |
You shouldn't be connecting Web3Provider to // import { TorusConnector } from '@web3-react/torus-connector'
// import { FortmaticConnector } from '@web3-react/fortmatic-connector'
if (wallet.type === 'injected') {
const injected = new InjectedConnector({
supportedChainIds: [
ChainId.Mainnet,
ChainId.Kovan,
ChainId.Localhost
]
})
activate(injected)
} else if (wallet.type === 'hardware') {
if (wallet.name === 'walletConnect') {
const walletconnect = new WalletConnectConnector({
rpc: { 1: RPC_URLS[1] },
qrcode: true,
pollingInterval: POLLING_INTERVAL
})
activate(walletconnect)
}
}
} I pray and hope you get the idea, but that works for me in various other cases, you still have to persist the connection onLoad somehow. If you can't get it to work, i can check out web3Modal and post a full example here in Typescript |
Hey would be interested in having the full example :) Thanks in advance for your help |
Checked web3Modal, it prefers Providers instead which is somehow difficult to implement directly with this current useDapp version... FYI, just yesterday i noticed a merge that might change the problem, especially in regards to setting provider and connector aside using |
Hi All, We recognise this as important feature. We are working now on a series of cross-dependent features and refactorings, including:
There might be major changes to framework and it might take a bit more time. Thank you for your patience. |
Hi Thanks for the answers @noobshow @marekkirejczyk For now I created my own model with web3-react for multi wallet connexion Thanks for your help |
There is a new version released: 0.10 with working example with web3Modal. App here: Source here: |
Take a look at Connector example that uses web3react connectors to connect to various different wallets: |
@vanruch Would you investigate? |
Do you install and import the Connector you were activating? #320 (comment) |
Firstly, thanks so much for making this change! I think this is going to help a lot with the adoption of useDapp! I just wanted to raise that it seems that there might be one small thing worth looking into, consider the following situation (assume that this is using Web3ModalButton.tsx from the example implementation):
Closing the WalletConnect modal in this fashion leads to an unhandled error (in the example implementation you can see the error printed out into the console), it seems that this error needs to be handled within Thanks again! Peace. |
Another thing I would like to add is that when using the Web3ModalButton.tsx, even when connecting to MetaMask through it, when switching networks (e.g. Rinkeby <-> Mainnet), the client now shows an error (it handles network switches smoothly with the original "connect" button on https://example.usedapp.io/balance). |
Hi @JayWelsh! Web3Modal UI errors should be handled, but I don't think @usedapp/core is a good place for it - at the moment it's decoupled from Web3Modal or any other wallet library. It simply accepts a generic EIP-1193 compatible provider that Web3Modal returns. Error when switching networks looks like a bug, feel free to open an issue! |
@vanruch Perhaps a better error handling in example? |
I think having this would enable a lot more adoption of useDapp
The text was updated successfully, but these errors were encountered: