Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
Source by ethereum.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #detect #account #change #metamask
ADD COMMENT
Topic
Name
3+7 =