fix: split web and native wallet connectors#233
Open
andrascodes wants to merge 5 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of a stack created with Aviator.
mainCloses FS-2252
Summary
Origin: https://${rpId}from the connector config.rpIdas a required prop fromZeroDevExportWebView; it now reads it from the ZeroDev wagmi connector.Why
The connector now has platform-specific API needs. On React Native, consumers must provide native adapters and the SDK must send an
Originheader that matchesrpIdso Turnkey and AA requests pass ACL checks. On web, browsers own theOriginheader, so exposingfetchOptionsfor this path is misleading and does not solve the same problem.Splitting the connector keeps the public API accurate for each platform while preserving one shared implementation for the actual wagmi connector behavior. The native wrapper can require the RN-only adapter fields and derive the Origin header automatically, while the web wrapper can keep the browser API smaller and avoid exposing options that do not apply there.
If Passkeys are used
rpIdneeds to be a domain associated with the app - the KMS also enforces that the Passkey requests come from the same domain. So it makes sense to default the Origin header and the PasskeyrpIdto the same domain and have 1 source of truth.http://localhost:3000) as therpIdand that will work for basic KMS requests (OTP email, Google OAuth). To use Passkeys or OTP Magic Link the user needs to set up Universal Links (with a domain association) and then the developer should use the same domain as therpIdas well. This way requests coming from the app, on the KMS's side will look like they're coming from the associated domain (Originis set to the domain).Testing
zerodev-signer-demoon web, theexpo-exampleon both web and Android. All working.