-
Notifications
You must be signed in to change notification settings - Fork 164
feat: Create UseScaffoldWatchContractEvent Hook #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Create UseScaffoldWatchContractEvent Hook #584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GM ser is this ready to review?
packages/nextjs/hooks/scaffold-stark/useScaffoldWatchContractEvent.ts
Outdated
Show resolved
Hide resolved
packages/nextjs/hooks/scaffold-stark/useScaffoldWatchContractEvent.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems on my side I cannot watch events
https://www.loom.com/share/21e38e3d5c374186a3339cd354f0ce7e?sid=12287af6-510f-49e6-bc39-6286b6390002
Also might need you to update the documentation with the features you have put in, but let's resolve this feature to be working properly first
packages/nextjs/hooks/scaffold-stark/useScaffoldWatchContractEvent.ts
Outdated
Show resolved
Hide resolved
packages/nextjs/hooks/scaffold-stark/useScaffoldWatchContractEvent.ts
Outdated
Show resolved
Hide resolved
https://www.loom.com/share/c53f4244651a4c84addd4b09bfef8569?sid=dc6e0deb-f768-4f2f-8b18-a528b792079e @metalboyrick I'll remove the '.then()' and the commented code though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me,
I will merge this PR, in the mean time would like your assistance to update this
https://scaffoldstark.com/docs/hooks/useScaffoldWatchContractEvent
Repo: https://github.com/Scaffold-Stark/scaffoldstark-site
Implement useScaffoldWatchContractEvent
Fixes #569
Types of change
Comments (optional)
This PR implements the useScaffoldWatchContractEvent hook, just using the polling mechanism.
The webhook mechanism was not used because for it to work, it would have to import the Webhook-related parameters from context, and #555 is not merged yet.
When it has been resolved, the polling can be used.
This PR has been tested on the ch-0 branch of speedrunstark, and is confirmed to work, the maintainers can test it further