Skip to content

feat(walletconnect): persist session to localStorage, auto-restore on init, disconnect clears storage (#774) - #826

Open
ZacLou wants to merge 3 commits into
Stellar-split:mainfrom
ZacLou:feat/walletconnect-session-persistence-774
Open

feat(walletconnect): persist session to localStorage, auto-restore on init, disconnect clears storage (#774)#826
ZacLou wants to merge 3 commits into
Stellar-split:mainfrom
ZacLou:feat/walletconnect-session-persistence-774

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown

Closes #774.

WalletConnectAdapter now automatically persists the active session to localStorage and restores it on construction when it has not expired, eliminating the need to re-scan a QR code on every page reload.

Changes:

  • PersistedWalletConnectSession interface captures topic, relayUrl, chainId, address, and expiry.
  • Constructor auto-persists when expiry is supplied alongside topic/chainId/address.
  • When those fields are omitted, the constructor attempts to restore from localStorage and validates the expiry timestamp.
  • Added persist(session) for explicit persistence after an external pairing flow completes.
  • Added disconnect() which clears both in-memory state and localStorage.
  • Added isConnected getter.
  • Updated tests covering persistence, restore, expiry discard, disconnect, and explicit persist usage.

ZacLou added 3 commits September 6, 2026 03:48
…ellar-split#772)

- Add FreighterNotInstalledError with install URL in message
- Check window.freighter presence before connect, sign, and getAddress
- Throw FreighterNotInstalledError instead of raw TypeError
- Existing logic unchanged when extension is present
- Add unit tests for missing extension, error message, and normal flow

Closes Stellar-split#772
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.

Persist WalletConnect session across page reloads

1 participant