Repository navigation
feat(wallet): add shared Freighter connection state machine - #205
Open
woahwhattheheck wants to merge 1 commit into
Open
woahwhattheheck wants to merge 1 commit into
woahwhattheheck wants to merge 1 commit into
Conversation
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.
Closes #7.
Wallet connection now has explicit disconnected, connecting, connected, wrong_network, locked, rejected, unavailable, and error states. The shared store cancels stale extension responses after disconnect/new connection, deduplicates approval prompts, restores previously allowed access without an approval popup, and refreshes network status. Extension failures map to clear, fixed user messages.
Desktop and mobile navigation use the same reusable WalletConnection component. Existing admin and investor consumers retain the shared address/network API, and the network guard remains responsible for blocking signed actions on a mismatch. The documentation explains the pinned Freighter v2 API assumptions and the boundary between wallet identity and protocol permissions.
Validation:
npx vitest run src/hooks/useWallet.test.ts src/features/wallet/components/WalletConnection.test.tsx src/features/wallet/useNetworkGuard.test.tsx— 3 files, 19 tests passed. This includes rejected/unavailable/locked errors, network transitions, silent restoration, stale results, duplicate prompts, shared controls, and the existing signing guard.git diff --checkpassed. Full lint/typecheck/test/build were not run; the commit uses [skip ci] to avoid triggering the broad default workflow. Responsive before/after screenshots could not be captured because the browser executable was absent and its download returned an invalid archive./claim #7
I claim contributor credit and request GrantFox OSS / Official Campaign FWC26 evaluation and compensation for this implementation. Payment is subject to the maintainer and GrantFox evaluation.