Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Networks

Icon LinkNetworks

Icon LinkAdd custom networks

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);

Icon LinkGet current network

To retrieve the current network of the user, you can use the currentNetwork() method.

const networkInfo = await fuel.currentNetwork();
console.log("Network ", networkInfo);

Icon LinkWith React

Icon LinkAdd custom networks

You can add new networks to the user's wallet by calling the addNetwork() method.

const { addNetwork, isPending, error } = useAddNetwork();
 
async function handleAddNetwork(networkUrl: string) {
  console.log("Add network", networkUrl);
  const networkAdded = await addNetwork(networkUrl);
  console.log("Network added", networkAdded);
}

Icon LinkCurrent network

You can track the current network of the user by using the currentNetwork() method.

const { network } = useNetwork();