ethjs-contract icon indicating copy to clipboard operation
ethjs-contract copied to clipboard

get logs in one go (no listening)

Open wighawag opened this issue 8 years ago • 3 comments

ethjs-contract

  • [ ] Feature

Description

For my use case I like to call eth_getLogs to gather past events that match the filter parameter in one go (basically I expect to get an array of matching logs)

If this could be added to ethjs as a general method as well as contract event specific, this would be cool

web3 1.0 does this via getPastEvent for contract :

https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#getpastevents

and getPastLogs for the general case

https://web3js.readthedocs.io/en/1.0/web3-eth.html#getpastlogs

wighawag avatar Oct 03 '17 21:10 wighawag

You may be interested in my PR on eth-js https://github.com/ethjs/ethjs/pull/5 and my comment on eth-js query https://github.com/ethjs/ethjs-query/issues/7 that demonstrates how eth_getLogs is kind of broken. I had to use web3 to serialize the event.

pointtoken avatar Oct 26 '17 17:10 pointtoken

@wighawag we can add something for this, however it would just be using as @pointtoken points out, eth_getLogs.

SilentCicero avatar Dec 05 '17 10:12 SilentCicero

eth_Logs would be good

wighawag avatar Dec 05 '17 12:12 wighawag