1.3.0 • Published 3 years ago
test-bomser v1.3.0
Reading events from Smart Contracts
In this example we will learn how to read events generated by smart contracts.
We are reading events from DAI token.
As you can see in the code below we are reading events from block number 13081417 to the latest block. You may want to change the values of these block depending on when you run this code so that you dont get over flooded with events
const events = await contract.getPastEvents('AllEvents',{fromBlock:13081417,toBlock:'latest'})
npm link typescript
npm start
or
tsc
node index