fuels-wallet icon indicating copy to clipboard operation
fuels-wallet copied to clipboard

[wallet sdk] A `switchNetwork` method

Open Dhaiwat10 opened this issue 11 months ago • 2 comments

Motivation

Currently we do not have a switchNetwork method that would prompt a popup that would let users switch to a different network in the wallet.

Would be nice if we can have a counterpart React Hook for this as well.

Usage example

No response

Possible implementations

No response

Dhaiwat10 avatar Mar 21 '24 10:03 Dhaiwat10

@LuizAsFight Do you think we could prioritize this?

This will help increase the experience on the dApp we generate via create fuels CLI.

cc @Dhaiwat10 @petertonysmith94

arboleya avatar Jun 10 '24 16:06 arboleya

one idea here is:

to avoid changing connectors spec with a new method and avoid create new hooks, we can:

instead of adding a new method switchNetwork, we can make the addNetwork work on this way:

  • if the network inputted to add doesn't exist, it will be added
  • if the network inputted to add exists, we start a switchNetwork flow inside of the application

on this way, the change would be only on application level, to support this new flow. connectors / hooks would not need changes

LuizAsFight avatar Jun 14 '24 14:06 LuizAsFight