web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

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

Open paintoshi opened this issue 1 year ago • 1 comments

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 avatar Sep 10 '24 09:09 paintoshi

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

paintoshi avatar Sep 26 '24 19:09 paintoshi

using defaultNetwork should solve this problem in latest version

rtomas avatar Jan 20 '25 15:01 rtomas