This is applicable to the connection between any dapp that supports more than one network and wallet that doesn't support the first network from the list of supported networks by the previously mentioned dapp.
Expected Behavior
WalletConnect Connector from Wagmi should not pass any chain id to the array of chains during initialization of WalletConnect. In this case all chain ids will be optional. I will allow to initiate the connection even if wallet supports on network from the list of supported networks by the dapp.
Steps To Reproduce
At first let's go to the Revoke Cash:
open revoke.cash in one tab (it uses wagmi)
click "Connect Wallet"
choose "WalletConnect"
The second part:
open app.safe.global
switch to any network supported by revoke.cash, except Ethereum mainnet
Then copy the connection link from Revoke Cash and paste on the pre-opened WalletConnect Safe App.
The error in console says:
Connection refused: This Safe Account is in Goerli but the Wallet Connect session proposal is not valid because it contains: 1) A required chain different than Goerli 2) Does not include Goerli between the optional chains 3) No EVM compatible chain is included
What happened:
WalletConnect Safe App is a safe app that allows to use safe as a wallet. However, each safe exists only on one network. Therefore WalletConnect Safe App initiates the connection with only one allowed network.
While dapp supports multiple networks. During initialization of WalletConnect connector from Wagmi dapp passes all chain ids as an argument. Then Wagmi takes all these networks and passes only the first chain id to the Ethereum provider from WalletConnect package. It is not correct, because this array should include required chain ids (see the comment):
The Chains your app intents to use and the peer MUST support. If the peer does not support these chains, the connection will be rejected.
In our case the first chain id is 1 (Ethereum Mainnet), but we need 5 (Goerli Testnet)
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
Is there an existing issue for this?
Current Behavior
This is applicable to the connection between any dapp that supports more than one network and wallet that doesn't support the first network from the list of supported networks by the previously mentioned dapp.
Expected Behavior
WalletConnect Connector from Wagmi should not pass any chain id to the array of chains during initialization of WalletConnect. In this case all chain ids will be optional. I will allow to initiate the connection even if wallet supports on network from the list of supported networks by the dapp.
Steps To Reproduce
At first let's go to the Revoke Cash:
The second part:
Then copy the connection link from Revoke Cash and paste on the pre-opened WalletConnect Safe App.
The error in console says:
What happened:
WalletConnect Safe App is a safe app that allows to use safe as a wallet. However, each safe exists only on one network. Therefore WalletConnect Safe App initiates the connection with only one allowed network. While dapp supports multiple networks. During initialization of WalletConnect connector from Wagmi dapp passes all chain ids as an argument. Then Wagmi takes all these networks and passes only the first chain id to the Ethereum provider from WalletConnect package. It is not correct, because this array should include required chain ids (see the comment):
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
No response