FuelLabs / fuels-wallet

💳 The official Fuel wallet.
https://wallet.fuel.network
Apache License 2.0
917 stars 403 forks source link

[wallet sdk] A `switchNetwork` method #1163

Open Dhaiwat10 opened 5 months ago

Dhaiwat10 commented 5 months ago

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

arboleya commented 2 months ago

@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

LuizAsFight commented 2 months ago

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:

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