queryFilter doesn't return any transactions #3233
Replies: 5 comments 4 replies
-
You can checkout docs for queryFilter here. const abi = ["event Transfer(bytes32 indexed node, address owner)"]
const contract = new ethers.Contract('0x55d398326f99059ff775485246999027b3197955', abi, provider)
const filter = contract.filters.Transfer();
const events = await contract.queryFilter(filter) Also from your snipper seems you want to filter by If you use low level API and forcefully pass in a topic, it won't match to any logs hence it will give you empty array. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. Why the owner is not indexed? What's it the best way to filter all the transaction by sender address? |
Beta Was this translation helpful? Give feedback.
-
@arnaudjnn That is not possible with a normal Ethereum node. You would need to use a service like Etherscan, which provides a history API (I.E. |
Beta Was this translation helpful? Give feedback.
-
Also keep in mind BSC does not correctly implement consistent query execution; you just wait some amount of time after a block before events are index and will be returned in a query. The built-in event querying (I.e. But if your event does not index a field, it cannot be filtered on that field. |
Beta Was this translation helpful? Give feedback.
-
What if I want to listen to a custom event and not "Transfer"? I can't seem to get it to work when I pass it the positional parameters |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Ethers Version
5.x.x
Search Terms
queryFilter
Describe the Problem
expect query results with BSC but there are not
i want to filter topics by "to" address, but after add "to" to topics param, then no results return
Code Snippet
Errors
no results return
Environment
node.js (v12 or newer)
Environment (Other)
No response
Beta Was this translation helpful? Give feedback.
All reactions