I was reading the docs and found it recommends to remove ‘accountsChanged’ event listener for ‘eth_requestAccounts’ instead, my question is how should we track account changes without the event and why is this recommended?
Hello @Glitch-txs, Welcome to the forum community!
Yes, it’s recommended to remove ethereum.on("accountsChanged")
, and obtain addresses with EIP-1102 callbacks instead. It was removed to improve compatibility with the latest web3.js .
Additionally, you may refer to this: EIPs/eip-1102.md at master · ethereum/EIPs · GitHub
We hope this helps. Thank you, and have a great day!