Skip to content

Allow injecting existing PublicClient into SemaphoreViem #1006

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

Merged

Conversation

ultraviolet10
Copy link
Contributor

Description

This PR refactors the SemaphoreViem class to allow injection of an existing PublicClient instance via the options object. If a publicClient is provided, the class will use it; otherwise, it will instantiate its own as before. This change improves composability and integration with modern dapp frameworks (such as wagmi) that already manage a PublicClient at the application level.

Related Issue(s)

Closes: #1004

Other information

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn format and yarn lint without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Important

We do not accept pull requests for minor grammatical fixes (e.g., correcting typos, rewording sentences) or for fixing broken links, unless they significantly improve clarity or functionality. These contributions, while appreciated, are not a priority for merging. If you notice any of these issues, please create a GitHub Issue to report them so they can be properly tracked and addressed.

Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you very much 🚀

@vplasencia vplasencia merged commit fc1fe4d into semaphore-protocol:main Jul 17, 2025
4 checks passed
Copy link

gitpoap-bot bot commented Jul 17, 2025

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2025 Semaphore Contributor:

GitPOAP: 2025 Semaphore Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

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.

Allow Injecting an Existing Public Client into SemaphoreViem
2 participants