Add Network

Once an application is connected to Martian wallet via connect method, it can also request that user to add new network using given api. It takes two parameter listed below:

  • nodeUrl: Node endpoint.

  • faucetUrl?: Faucet endpoint.

Below is an example code describing the way to add a network.

// Add a network
const nodeUrl = "https://fullnode.mainnet.aptoslabs.com";
const faucetUrl = "dummy";
const status = await window.martian.addNetwork(nodeUrl, faucetUrl);
// status: Node url added successfully

Last updated