Skip to content

fix: reconcile WalletContext cached address against live Freighter state (#71) - #166

Open
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/71-wallet-context-reconciliation
Open

fix: reconcile WalletContext cached address against live Freighter state (#71)#166
rafaio1 wants to merge 1 commit into
MergeFi:mainfrom
rafaio1:fix/71-wallet-context-reconciliation

Conversation

@rafaio1

@rafaio1 rafaio1 commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #71.

  • Add getActiveFreighterAddress() passive helper to wallet.ts that reads Freighter's current active account without triggering a permission prompt or connect flow.
  • Replace WalletContext's bare localStorage mount effect with one that reconciles the cached address against Freighter's live state on mount, surfacing a mismatch: boolean on the context when they diverge.
  • Block signing actions in IssueActions.withWallet when mismatch is true, preventing silent identity divergence where the UI shows one address but Freighter signs with another.
  • Clear mismatch state on successful reconnect and on disconnect.
  • Product decision documented: This fix detects and surfaces the divergence rather than silently auto-updating to the new address. The user must explicitly reconnect, ensuring awareness of which account is being used for signing and payout.
  • TypeScript compiles cleanly with npx tsc --noEmit.

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

WalletContext never reconciles its cached address against Freighter's actual active account

1 participant