Closed AroyewonTemitope closed 1 month ago
related issue https://github.com/superhero-com/superhero-wallet/issues/3090#issuecomment-2335160559
Firstly I would say that wallets and apps are expected to work on the mainnet by default. We may agree that network switching is an advanced feature and the user needs to do that explicitly.
If the aepp wants to switch the current network, it shouldn't happen without the user's confirmation because other aepps may be connected to the same wallet, making it unclear to which network they should be connected.
On the other side, we may need an api to add a network to the wallet to simplify connecting to demo setups of hyperchain nodes or so.
found issues https://github.com/superhero-com/superhero-wallet/issues/3269 https://github.com/aeternity/aeternity/issues/4419
So, I propose adding an "ask to switch to network" api. Which MAY be implemented by a wallet. It should accept a network id or node url. In the first case, the wallet should look for a predefined network with this id or communicate to aepp that there is no such network. In the second case, the wallet should add/switch to a network, getting the necessary details from the node.
Alternatively, this flow can be combined with a connection, but we are not sure how useful is it, so I would prefer to have it separate to don't complicate the existing stuff.
cc: @CedrikNikita
I noticed Metamask and other ETH wallets have this feature. However, switching the network requires the user's consent.
Is your feature request related to a problem? Please describe. I want the Superhero wallet to automatically switch networks when the network changes in my application.
Describe the solution you'd like
Describe alternatives you've considered An alternative considered is to instruct the user to manually change their network on super hero wallet once their account is switched successfully on our application.