-
Notifications
You must be signed in to change notification settings - Fork 128
getPastEvents is not a function #81
Comments
My short-term solution was to fork drizzle and add the raw web3Contract instance to the drizzle contract and just use that when calling getPastEvents. I believe the reason the function isn't being added to the DrizzleContract instance has to do with Object.assign, but i'm not sure what the solution would be. I'll leave this open incase someone smarter than myself has the answer. |
I'm using drizzle and drizzle-react packages, and a way to use getPastEvents is to use the "web3" instance that comes with Drizzle, injecting the contract ABI and the deployed contract address to Some pseudocode example, can be wrapped into a function for reusing it:
Could try to recreate a Fiddle for a real React example if you want 😄 Hope it works for you. |
@kartojal answer is correct. To access This Issue can be closed. Related: trufflesuite/drizzle#149 |
@johnmpotter @soundyogi is correct, @kartojal has the right idea. |
What's the best way to access past events for a given contract event? If I call the getPastEvents method on a specific contract from the drizzle context, it throws an error that it's not a function.
Or maybe there's a "Drizzle way" for accessing past events that i'm not aware of. Thank you!
The text was updated successfully, but these errors were encountered: