Skip to content

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

Conversation

OWK50GA
Copy link
Contributor

@OWK50GA OWK50GA commented Jun 28, 2025

Implement useScaffoldWatchContractEvent

Fixes #569

Types of change

  • Feature
  • Bug
  • Enhancement

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

@OWK50GA OWK50GA marked this pull request as ready for review June 30, 2025 02:45
@metalboyrick metalboyrick changed the title Feat: Create UseScaffoldWatchContractEvent Hook feat: Create UseScaffoldWatchContractEvent Hook Jun 30, 2025
Copy link
Collaborator

@metalboyrick metalboyrick left a 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?

@OWK50GA OWK50GA marked this pull request as draft June 30, 2025 08:16
@OWK50GA OWK50GA marked this pull request as ready for review June 30, 2025 15:36
@OWK50GA OWK50GA requested a review from metalboyrick June 30, 2025 16:12
@metalboyrick metalboyrick requested a review from gianalarcon July 1, 2025 04:23
Copy link
Collaborator

@metalboyrick metalboyrick left a 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

@OWK50GA
Copy link
Contributor Author

OWK50GA commented Jul 1, 2025

https://www.loom.com/share/c53f4244651a4c84addd4b09bfef8569?sid=dc6e0deb-f768-4f2f-8b18-a528b792079e

@metalboyrick
Looks like it's working to me

I'll remove the '.then()' and the commented code though

@OWK50GA OWK50GA requested a review from metalboyrick July 1, 2025 09:14
@metalboyrick metalboyrick linked an issue Jul 2, 2025 that may be closed by this pull request
Copy link
Collaborator

@metalboyrick metalboyrick left a 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

@metalboyrick metalboyrick merged commit f1cd9c8 into Scaffold-Stark:develop Jul 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement useScaffoldWatchContractEvent
2 participants