Subscribe to income logs from blockchain with filtering #3376
Replies: 1 comment
-
Some various defi protocols can also trigger the pair sync for internal purposes, and the transaction hash that you'd get in the sync log would not be directly sent to the pair address since it's a transaction to the defi protocol (which makes an internal tx/message call to the pair contract).
The provider keeps track of block number by polling the eth node in an interval (default 4 secs). When it detects a change in block number, it uses
Atm ethers.js does not support suppling a list of contract addresses, you can only listen on a single address (though the low-level RPC calls support a list of addresses). You may just add multiple listeners if number of requests is not an issue or you may try this workaround. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In order to subscribe to income logs it was recommended to use the following function, but I have a doubt about the addresses filtering. The transactions that appear to me have the provided topic, but this doesn't seem to happen with the provided list of addresses.
So, I want to understand what it's supposed to happen when executing the following function.
My goal is to be able to listen to all events with the same topic triggered in a list of contract addresses. The idea is to listen to all sync events from all watched Pair contracts.
Beta Was this translation helpful? Give feedback.
All reactions