Filtering logs on list of addresses #2168
Unanswered
georgeroman
asked this question in
Q&A
Replies: 1 comment
-
AFAIK, Etherscan also does not support it directly. Just to mention, you can use the following when working with address array const formatter = new ethers.providers.Formatter();
const rawLogs = await provider.send('eth_getLogs', [{address: ['0xabc', '0xdef'], ... }])
const logs = Formatter.arrayOf(formatter.filterLog.bind(formatter))(rawLogs); |
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.
-
The
eth_getLogs
RPC API accepts either a single address (eg.string
) or a list of addresses (eg.string[]
) that you can filter events on (eg. https://eth.wiki/json-rpc/API#eth_getLogs). I see that ethers only supports passing a single address (eg. https://github.com/ethers-io/ethers.js/blob/master/packages/abstract-provider/src.ts/index.ts#L129). Probably not all providers support this (Alchemy does while Infura doesn't seem to support it), it would be nice if ethers allowed passing a list of addresses as well.Beta Was this translation helpful? Give feedback.
All reactions