Skip to content

Add wallet handoff for app and extension#271

Merged
macterra merged 11 commits intomainfrom
codex/wallet-handoff-deep-links
Mar 29, 2026
Merged

Add wallet handoff for app and extension#271
macterra merged 11 commits intomainfrom
codex/wallet-handoff-deep-links

Conversation

@macterra
Copy link
Copy Markdown
Collaborator

Summary

Add a single-link wallet handoff flow for auth, credential accept, and alias accept.

The React wallet now treats the HTTPS wallet URL as the canonical entrypoint and chooses the best available handler:

  • desktop web prefers the browser extension when installed
  • mobile web attempts to open the app via archon://...
  • otherwise the web wallet handles the flow locally

Changes

  • add a web page to browser-extension handshake bridge in the content script
  • detect extension availability from the React wallet web app
  • hand off challenge, credential, and alias + did actions to the extension when available
  • on mobile web, attempt app deep-link handoff before falling back to web
  • add alias handling to the React wallet queued deep-link flow so alias accepts work in web fallback too

Supported URL shapes

  • ?challenge=<did>
  • ?credential=<did>
  • ?alias=<name>&did=<did>

Verification

  • npm run build in apps/react-wallet
  • npm run build in apps/browser-extension

Closes #270.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements a canonical HTTPS wallet URL entrypoint that can hand off auth / credential accept / alias accept flows to the best available handler (browser extension on desktop, native app deep-link on mobile, otherwise web fallback).

Changes:

  • React wallet: parse ?challenge=, ?credential=, ?alias=&did= and route via extension handoff (desktop) or app deep-link attempt (mobile) with web fallback.
  • React wallet: add alias deep-link parsing/dispatching so alias accepts work in web fallback.
  • Browser extension: add a content-script bridge to receive wallet-site handoff requests and open the appropriate extension UI.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docker-compose.yml Removes react-wallet Vite service URLs from compose env configuration.
apps/react-wallet/src/main.tsx Adds wallet URL parsing + extension probe/open handshake + mobile deep-link attempt + extension-handoff UI state.
apps/react-wallet/src/contexts/WalletProvider.tsx Adds alias parsing from deep-link queue and dispatches archon:openAlias.
apps/react-wallet/src/contexts/UIContext.tsx Handles archon:openAlias event by switching to aliases UI and pre-filling fields.
apps/browser-extension/src/contentScript/contentScript.ts Adds window.postMessage probe/open handlers to relay wallet handoff requests to extension background.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/browser-extension/src/contentScript/contentScript.ts
Comment thread apps/react-wallet/src/main.tsx Outdated
Comment thread apps/browser-extension/src/contentScript/contentScript.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/browser-extension/src/contentScript/contentScript.ts
Comment thread apps/react-wallet/src/main.tsx Outdated
Comment thread sample.env Outdated
Comment thread apps/browser-extension/src/contentScript/contentScript.ts
Comment thread apps/herald-client/src/App.tsx
@macterra macterra merged commit 479b28b into main Mar 29, 2026
13 checks passed
@macterra macterra deleted the codex/wallet-handoff-deep-links branch March 29, 2026 02:36
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.

React wallet deep-link handoff for Herald auth

2 participants