You can add new networks to the user's wallet by calling the addNetwork()
method.
1console.log("Add Network", network);
2const isAdded = await fuel.addNetwork(network);
3console.log("Add Network result", isAdded);
To retrieve the current network of the user, you can use the currentNetwork()
method.
1const networkInfo = await fuel.currentNetwork();
2console.log("Network ", networkInfo);
You can add new networks to the user's wallet by calling the addNetwork()
method.
1const { addNetwork, isPending, error } = useAddNetwork();
2
3async function handleAddNetwork(networkUrl: string) {
4 console.log("Add network", networkUrl);
5 const networkAdded = await addNetwork(networkUrl);
6 console.log("Network added", networkAdded);
7}
You can track the current network of the user by using the currentNetwork()
method.
1const { network } = useNetwork();