-
-
Notifications
You must be signed in to change notification settings - Fork 205
fix(wallet-connect): allow the first chain id to be optional during connector init #470
Conversation
|
So far LGTM, adding two comments:
|
Smart contract wallet users, like Safe users, are not able to use any dApp that relies on wagmi when using WalletConnect until this fix is implemented. Except on the specific case that they try to use it on the chain that happen to be the More context on the fix: |
@dasanra Wagmi is not UI ready and also WalletConnectConnector offers an option to set selected chains as required on the connect function, I still think it's an issue that needs to be addressed asap though |
If this is merged, this will break a lot of wallets as not all wallets support optional chains (and may also require at least one required chain). For example, MetaMask does not support Optional Chains and they also require at least one required chain: MetaMask/metamask-mobile#6703 Will have to think how we can resolve this appropriately. |
It's great to see so much attention to this issue, guys 🙏 In my opinion, it's not correct to assume that 1st item from the list of passed networks during initialization of connector must be required. If some wallets don't support empty required chain - we should allow devs at least to decide what networks should be required. Existing implementation on Wagmi side already breaks some dapps. Therefore, we cannot just wait. @glitch-txs sorry, probably I'm missing something... What exactly do you wanna to refactor in |
@ElvisKrop if you don't pass a chainId into connect function it still gets populated and used as required chain if I'm not mistaken. This was my previous point, you can still choose which one is required in the connect function. |
As per #470 (comment), we will need to wait. We will get in touch with WalletConnect to see what we can do. |
Once enough popular wallets support this, this PR can be re-opened on the Wagmi repo. Connectors are moving over there. |
Description
Resolves: #469
Additional Information
If dapp supports multiple networks, it is not correct to assume that the first one is required. Therefore, I decided to define chains parameter (required networks for connection) only if there is one network. Otherwise it should be undefined in order to accept connections with wallets that support other networks except the first one from the list of supported networks by the dapp.
Thanks in advance!