Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

metamask event disconnect

web3.ethereum.on("accountsChanged", accounts => {
  if (accounts.length > 0)
    console.log(`Account connected: ${accounts[0]}`);
  else
    console.log("Account disconnected");
});
 
PREVIOUS NEXT
Tagged: #metamask #event #disconnect
ADD COMMENT
Topic
Name
3+2 =