Network Change Event

This method can be used to detect network change in the account. It takes one parameter listed below.

  • cb: callback function which will be called when network change occurs.

Below is an example code describing the way to check for network change.

window.martian.onNetworkChange((name) => console.log(name));
// above code output
Testnet or Devnet or Custom

Last updated