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.
aptos
sui
window.martian.onNetworkChange((name) => console.log(name));
// above code output
Testnet or Devnet or Custom
window.martian.sui.onNetworkChange((name) => console.log(name));
// above code output
Devnet
Last modified 6mo ago