5

I know that you can filter logs in web3 by topic using:

web3.eth.filter({
   topics: ["0x00..."]
}).watch(console.log)

Is it possible to filter for a topic value greater than a given value?

1

web3.eth.filter converts the topics to hex values and passes them to the JSON RPC call eth_newFilter.

From the specification for the JSON RPC call eth_newFilter:

Topics are order-dependent. Each topic can also be an array of DATA with "or" options.

Looks like it only checks if the topics in the log match with the topic or set of topics you pass it.

You would have to do any further filtering in your callback function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.