0

I can read events as they happen with:

const eventsWatch = myContract.allEvents();
    eventsWatch.watch((err, res) => {
      if (err) return;
      console.log("Event:", res.event, res.args);
    });

This even shows the last event after I refresh the page, but I would like a list of all the past events.

Anyone know how to get this?

I've tried changing watch to get but then i get undefined objects back...

Thanks!

1

Create your filter by:

const eventsWatch = myContract.allEvents({fromBlock: 0, toBlock: 'latest'});
| improve this answer | |

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