⌘K

Icon SunFilledIcon MoonStars
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, isLoading, 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();