safe-wallet-web
safe-wallet-web copied to clipboard
Display a Switch Network button if wallet is connected to a different chain
What is the feature about
The connected wallet needs to be on the same network as the safe in order for the user to sign/execute transactions. The current implementation to ensure this consists of multiple parts:
- We display a
WrongChainWarning
in some transaction modals - We call
assertWalletChain
in somedispatch
functions
This approach is not consistent e.g. we don't call assertWalletChain
when creating a safe apps transactions and its easy to miss when adding a new feature. Another issue is that we combine switching the chain and executing/signing a transaction. While this "saves" the user a click, it can also be confusing if one click leads to the wallet popping up twice.
The list of requirements
Ideally, we would have this in one place like CheckWallet
and don't show a warning at all but instead show a different button than the action button to prompt the user to switch their network.