Replies: 1 comment
-
Filters only work for contracts, not for EOA (Externally Owned Accounts) controller by private keys. This is because each log in Ethereum optionally pays extra to have a given topic indexed, which includes it in a bloom filter. Since normal transactions are not paying this extra premium, they don't get added. If you want to monitor an EOA, you should set a event listener for each block and check the balance and transactionCount; if they changed, then you can perform your action: function getState(addr) {
return resolveProperties({
balance: provider.getBalance(addr),
nonce: provider.getTransactionCount(addr)
});
}
let lastState = await getState(addr);
provider.on("block", (blockNumber) => {
const { balance, nonce } = await getState(addr);
if (!balance.eq(lastState.balance) || nonce !== lastState.nonce) {
// trigger event here...
}
}) Make sense? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There is no trigger for me to transfer from this address to another address or from another address to this address.
If I'm using it incorrectly, how can I listen for a transaction at an address. My goal is to listen for transactions on an account and update the balance. @ricmoo
Beta Was this translation helpful? Give feedback.
All reactions