I am creating Ethereum Wallet application & I am using EtherJs for Web wallet development. When I try to listen for Balance Change event for multiple accounts then How do I find account number from the events. Below is the code snipet.
Accounts Address Listener
let provider = ethers.getDefaultProvider('ropsten');
provider.on("address1",(balance) => {
console.log('New Balance address1: ' + balance);
});
provider.on("address2",(balance) => {
console.log('New Balance address2: ' + balance);
});
provider.on("address3",(balance) => {
console.log('New Balance address3: ' + balance);
});
Now when any callback function called then how do I know the event for which address that is "address1" Or "address2" Or "address3"?