Created
July 8, 2022 14:20
-
-
Save 0xCourtney/c0508346edc139306d96e2edb82768aa to your computer and use it in GitHub Desktop.
Get event and event arguements emitted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getEvent(tx: any, event: string) { | |
let receipt = await tx.wait(); | |
return receipt.events?.filter((x) => { | |
return x.event == event; | |
}); | |
} | |
async function getEventArgs(tx: any, event: string) { | |
return (await getEvent(tx, event))[0].args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment