reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.92k stars 1.4k forks source link

[bug] pure EIP6963 wallets are not displayed #2769

Closed bulgakovk closed 1 month ago

bulgakovk commented 2 months ago

Link to minimal reproducible example

https://github.com/ExodusMovement/web3modal-eip6963-bug/tree/master

Summary

Summary

web3modal does not display a pure EIP-6963 wallet (no window.ethereum injection) in the wallets list even though it's been detected

Technical details

The web3modal connection button checks if a wallet is installed before displaying it: https://github.com/WalletConnect/web3modal/blob/543585f87756d242903d9ff48c7e3c7070be0d8e/packages/scaffold-ui/src/partials/w3m-connect-injected-widget/index.ts#L57-L61

checkInstalled internally relies on window.ethereum: https://github.com/WalletConnect/web3modal/blob/e134074d329f1b3a7325245f1ebac3eb0b8f47cd/packages/base/adapters/evm/wagmi/client.ts#L260-L262

which is undefined if a wallet utilizes the EIP-6963 only and does not inject its provider to window.ethereum. That means a wallet like that will be never displayed unless other wallet injects its provider to the ethereum namespace.

Possible solution

I think the condition I mentioned above should be relaxed by checking installation only for non EIP-6963 wallets, e.g.:

          if (connector.info?.rdns === undefined && !ConnectionController.checkInstalled(undefined, connector.chain)) { 
             this.style.cssText = `display: none` 

             return null 
           } 

List of related npm package versions

"@web3modal/wagmi": "5.1.4"

glitch-txs commented 2 months ago

Would you like to open a PR?

Also how can we repro this?

Thanks!

bulgakovk commented 2 months ago

Would you like to open a PR?

Sure, will do on Monday

Also how can we repro this?

https://github.com/ExodusMovement/web3modal-eip6963-bug/tree/master

Thanks for the quick response!

frndxyz commented 1 month ago

i am using appkit 1.0.4 but still have same issue. (metamask,okex,trustwallet) not showing in modal list. also none of social option shows in list. i tried to connect with QR wallet connect. it works but isConnected status not changed. webmodal shows:

"dependencies": { "@reown/appkit": "^1.0.4", "@reown/appkit-adapter-wagmi": "^1.0.4", "@tanstack/react-query": "^5.56.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.26.2", "viem": "^2.21.14", "wagmi": "^2.12.13" },

Screenshot 2024-09-25 at 12 21 31 PM

DobromirKirovLime commented 1 month ago

same here...