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