Skip to content

feat: persist Freighter sessions#38

Closed
kaycke1337 wants to merge 1 commit into
wraith-protocol:developfrom
kaycke1337:add-freighter-session-persistence
Closed

feat: persist Freighter sessions#38
kaycke1337 wants to merge 1 commit into
wraith-protocol:developfrom
kaycke1337:add-freighter-session-persistence

Conversation

@kaycke1337

Copy link
Copy Markdown

Summary

  • restore allowed Freighter sessions on load without prompting again
  • persist and synchronize the preferred Stellar network across tabs
  • watch Freighter address/network changes and clear cached Stellar stealth keys when wallet state changes
  • add install/approve CTA states with 30s retry polling after opening the Freighter install page

No wallet signatures or sensitive key material are cached; Stellar stealth keys are cleared on disconnect, address changes, and network changes.

Closes #4

Validation

  • npx prettier --check .
  • npx tsc --noEmit
  • git diff --check
  • npx vite build
  • npx pnpm@10 build

Build completed successfully. Vite still reports existing dependency/chunk-size warnings from bundled wallet SDK dependencies.

@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

@kaycke1337 is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@truthixify truthixify changed the base branch from main to develop June 1, 2026 15:46
@truthixify

Copy link
Copy Markdown
Contributor

The Freighter session persistence work in StellarWalletContext.tsx and WalletConnect.tsx is what #4 asked for: isConnected/isAllowed restoration, network change listener, install detection, BroadcastChannel cross-tab sync.

GitHub marks the PR mergeable, but a local test merge shows your branch (off pre-develop main) would silently revert the sponsored-withdrawal hooks from #29 in StellarReceive.tsx (the feeBumpHash, showSponsorPrompt state your diff removes was just added). Rebase needed:

git fetch origin
git rebase origin/develop
git push --force-with-lease

Keep your context changes; drop the StellarReceive.tsx and StellarSend.tsx reverts during the rebase (they were stale-base artifacts, not intentional). Thanks @kaycke1337.

@truthixify

Copy link
Copy Markdown
Contributor

The Freighter session restore + network change listener + install detection + BroadcastChannel cross-tab sync are the right shape for issue #4.

Conflicts now in just two files:

  • src/components/WalletConnect.tsx
  • src/context/StellarWalletContext.tsx

These came from #34 (payment link) and #35 (web worker) adding small touches to the same files since you opened this.

git fetch origin
git rebase origin/develop
git push --force-with-lease

For StellarWalletContext.tsx keep develop's small additions (any new exports the payment-link or worker flows added) and layer your isAllowed / isConnected restore, network listener, and BroadcastChannel logic in. For WalletConnect.tsx keep develop's structure and add your install-detection / reconnect UI bits.

Thanks @kaycke1337.

@truthixify

Copy link
Copy Markdown
Contributor

Closing as we wrap up this round of the Wraith × Drips × Stellar Wave program.

Thanks for the contribution. The work and review history stays on this PR for reference. A new set of issues will go up shortly under the same Stellar Wave label if you want to pick something fresh next round.

If you specifically want to land the work that's already in this PR (post-wave), feel free to reopen and rebase against develop. Otherwise, no action needed.

@truthixify truthixify closed this Jun 18, 2026
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.

Freighter session persistence + auto-reconnect

2 participants