Skip to content

Instantly share code, notes, and snippets.

@parv3213
Created December 6, 2020 10:09
Show Gist options
  • Save parv3213/c90a227b46bbad633d0e833794dfeea5 to your computer and use it in GitHub Desktop.
Save parv3213/c90a227b46bbad633d0e833794dfeea5 to your computer and use it in GitHub Desktop.
GetPastEvents web3 event function
const eventGetPastEvents = () => {
console.log(`Returns all the past events`);
contractInstance.getPastEvents("Transfer", (error, event) => {
if(!error) console.log(event);
else console.log(`Error: ${error}`);
})
}
eventGetPastEvents();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment