Account Change Event

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

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

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

window.martian.onAccountChange((address) => console.log("Changed address", address));
// above code output
Changed address: 0x34c1e7efa0808b7b0113d71b722f483585e4c4b47ba2b0e703b090937f0c63a1

Last updated