WalletChainChanged

This event is triggered when the network in the wallet is changed

The event return following parameters

// JavaScript

detail: {
    id: 'WalletChainChanged', // event name
    wallet: 'MetaMask',
    chainId: ''
}

Using

// JavaScript

window.addEventListener("WalletAccountsChanged", (event) => {
    console.log(event.detail.id, event.detail.wallet, event.detail.chainId)
})

Last updated