I used the parameter "filter" in the option that I pass to contract events like explained here:
https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#contract-events
It seems like this functionality broke between 33 and 49.
What is the proper replacement to filter events based on an array of addresses?
1. update `web3`
2.Add options:
const options = {
filter: {
to: addressArray
},
fromBlock: 'latest'
};
3. subscribe to events with
contract.events.Transfer(options, (error, event) => {
stuff
}
Error: Provider error: Error: Node error: {"code":-32602,"message":"Invalid params: Invalid Pub-Sub parameters: unknown field `filter`, expected one of `fromBlock`, `toBlock`, `blockHash`, `address`, `topics`, `limit`."}
at /home/user/project/node_modules/web3-providers/dist/web3-providers.cjs.js:320:15
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
Thanks for opening this issue! I'll test and fix it asap.
@gnorbsl FYI: It will get released today or tomorrow.
Most helpful comment
@gnorbsl FYI: It will get released today or tomorrow.