reown-com / appkit

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

How to define options (RPC, chainId, URL) for MetaMask? #383

Closed MrsBookik closed 1 year ago

MrsBookik commented 2 years ago

Although I define only Formatic and WalletConnect in providerOptions, MetaMask still appears automatically in the Web3Modal.

        web3Modal = new Web3Modal({
            network: 'matic',
            cacheProvider: false,
            providerOptions: {
                fortmatic: {
                    package: Fortmatic, // required
                    options: {
                    },
                },
                walletconnect: {
                    package: WalletConnectProvider,
                    options: {
                    },
                },
                authereum: {
                    package: Authereum, // required
                },

But it seems to connect with wrong or outdated RPC-URLs to Matic-Network, which I'd like to change.

  1. How can I do that? In the README only other Providers are mentioned, but not MetaMask?
  2. Can I disable MetaMask?
adiled commented 2 years ago

This is not clear anywhere and apparently still a question mark.

Anyone troubled here, you can switch chain after provider is set to mm using wallet_addEthereumChain. It does an add-or-maybeupdate-and-switch in networks.

xzilja commented 1 year ago

With stable version 2.0.0 of Web3Modal now released, we are officially dropping support for version 1.x Due to this this issue/pr was marked for closing. It is highly recommended to upgrade as 2.x will be receiving further updates that will enable functionality for some of our newer sdks like auth and push as well as support for WalletConnect v2 (See this post about WalletConnect v1 being deprecated https://medium.com/walletconnect/walletconnect-v1-0-sunset-notice-and-migration-schedule-8af9d3720d2e)

If you need to continue using Web3Modal 1.x and require this feature/fix implemented, we suggest adding it via forking V1 branch.