Open
Conversation
Move the host-agnostic browser-wallet session manager (PXE per chainId-version, wallet pair per appId, RUNNING_SESSIONS map) out of the web flavor and into shared so a future browser-extension wallet flavor can consume it without dragging cookie-sync along. Web-specific concerns (IS_IFRAME gate, encrypted-cookie bootstrap and sync, passphrase state) stay in web/wallet-service.ts and are wired in via a new wrapper, getOrCreateSessionWithCookieSync, which forwards to the lifted getOrCreateSession and intercepts wallet-update events to schedule the appropriate cookie syncs. Existing call sites in IframeShell and wallet-api are updated to use the wrapper. Adds shared/src/wallet/session/session.test.ts with three tests for session keying and wallet-pair caching. The lifted module accepts test seams (__setSharedResourcesFactoryForTests, __setNodeClientFactoryForTests) so the routing logic can be exercised without a live Aztec node — the plan's original test code would have required a real PXE init. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Restrict barrel to public API; test seams now require relative import - getOrCreateSession returns resolved sessionId; drop version-0 fallback in getSharedResources - Hoist module-level logger; drop unused chainInfo arg from factory Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move the full wallet UI shell from web/ into shared/ui/ so the upcoming extension flavor's expanded view can share it. The web's cookie-passphrase auth (hasAccountsCookie / readAccountsCookie / setCookiePassphrase) and WalletApi transport are now injected via props (hasExistingVault, verifyPin, setPin, walletApiFactory). Also lifts PinDialog to shared/ui/components/ since the shared shell needs it; PinDialog had no web-specific imports (just MUI). Updates IframeShell to import PinDialog from @demo-wallet/shared/ui.
Forward-compat for the upcoming extension flavor where PIN/password persistence will hit chrome.storage.local (async). Web wrapper still passes a sync setCookiePassphrase; that's assignable to the new union type without changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.