Horje
how to detect account change in metamask Code Example
how to detect account change in metamask
var account = web3.eth.accounts[0];
var accountInterval = setInterval(function() {
  if (web3.eth.accounts[0] !== account) {
    account = web3.eth.accounts[0];
    updateInterface();
  }
}, 100);
how to detect account change in metamask
window.ethereum.on('accountsChanged', function (accounts) {
  // Time to reload your interface with accounts[0]!
})

window.ethereum.on('networkChanged', function (networkId) {
  // Time to reload your interface with the new networkId
})




Javascript

Related
how to concat nested array in javascript Code Example how to concat nested array in javascript Code Example
Unable to load schema from https json SchemaStore org eslintrc Code Example Unable to load schema from https json SchemaStore org eslintrc Code Example
how to check if a kendo drop down is enabled js Code Example how to check if a kendo drop down is enabled js Code Example
erpnext date difference client script Code Example erpnext date difference client script Code Example
POO javascript heritage Code Example POO javascript heritage Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9