reown-com / appkit

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

[bug] Adding default chain to the web3modal config reduces amount of wallets available #2835

Open paintoshi opened 2 weeks ago

paintoshi commented 2 weeks ago

Link to minimal reproducible example

https://codesandbox.io/p/devbox/heuristic-antonelli-t9dj5g

Summary

When adding defaultChain like this:

createWeb3Modal({ wagmiConfig, projectId, defaultChain: fantom });

The amount of wallets available drops, depending on the chain. Default number of wallets are 430 while the fantom chain drops it to 80. If you are on mobile you can't even use Metamask as it's not in the list. But using Metamask with fantom works just fine (if not including defaultChain).

I get that some wallets maybe can't set the default chain, but removing them from the list seems a bit overkill. It could just try to use the default one and ignore if the feature is not supported. Which makes it look like a bug in my opinion.

In my demo, select the dev preview on port 5173 if not opened automatically. Then just click the button and see available wallets. It's in the src/main.tsx.

image

Without using defaultChain: image

List of related npm package versions

"@tanstack/react-query": "5.53.1", "@web3modal/wagmi": "5.1.6", "viem": "2.21.0", "wagmi": "2.12.8", "@wagmi/core": "2.13.4"

paintoshi commented 3 days ago

Update: Migrated to @reown/appkit 1.0.4 and now it's even worse.

  1. It shows only 80 wallets when defining fantom as network and even when NOT using the defaultNetwork param that was the workaround before
  2. Defining defaultNetwork: mainnet does not help either
  3. Adding mainnet to networks like [mainnet, fantom] show all wallets but we can't have that in our app. Plus switching from chrome to metamask on iPhone does not work anyway with appkit, only with the old web3modal. So it's kind of broken. Need to use the built-in wallet browsers only