Skip to content

feat(wallet): add shared Freighter connection state machine - #205

Open
woahwhattheheck wants to merge 1 commit into
Raegis-RWA:mainfrom
woahwhattheheck:feat/wallet-connection-state-7-20261008-sol61
Open

woahwhattheheck wants to merge 1 commit into
Raegis-RWA:mainfrom
woahwhattheheck:feat/wallet-connection-state-7-20261008-sol61

Conversation

@woahwhattheheck

Copy link
Copy Markdown

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 --check passed. 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.

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.

Add Freighter wallet connection state machine

1 participant