Skip to content
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: add onMissingSigner callback #538

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

normanzb
Copy link
Contributor

@normanzb normanzb commented Jan 27, 2025

Change Summary

Previously in order to determine when the signer is missing but required by the button action, it requires the devs to add callback onMissingIdentity to useFarcasterMultiIdentity to determine such event, which is not very straight forward.
(when signer is missing the hook calls into frameStae.signerState.onSignerlessFramePress, which in turns triggers onMissingIdentity callback on the useFarcasterMultiIdentity)

The PR adds a dedicated onMissingSigner callback for useFrame_unstable. The callback will be called when the button action requires a signer but signer is not found.

@michalkvasnicak by looking at the code, it feels to me that adding onTransactionButtonError/onPostButtonError could be confusing, I am worrying the naming could give developers a false impression that all errors happened within transaction/post button action will be caught by the callbacks. (unless we change all errors within button action to also trigger the callbacks?). hence in this PR I renamed the callback name to be more specific.

Merge Checklist

  • PR has a Changeset
  • PR includes documentation if necessary
  • PR updates the boilerplates if necessary

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frames-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 4:21pm
framesjs-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 4:21pm
framesjs-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 27, 2025 4:21pm

@normanzb
Copy link
Contributor Author

@michalkvasnicak do we want to add it into stable useFrame as well to keep it consistent?

@stephancill stephancill merged commit 227fd9a into fix/missing-onsig Jan 28, 2025
8 checks passed
@stephancill stephancill deleted the feat/callback-signerless branch January 28, 2025 08:02
stephancill pushed a commit that referenced this pull request Jan 28, 2025
…537)

* feat: expose onSignature related callbacks for eth_signTypedData_v4 request

* feat: add onMissingSigner callback to useFrame_unstable hook (#538)
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.

3 participants