Skip to content

[sdk] Add Freighter wallet auto-reconnect on page reload #858

Description

@Otaiki1

Summary

sdk/src/wallet/freighter.adapter.ts connects to the Freighter extension. After a page reload, the SDK loses the wallet connection and the user must click "Connect" again. Freighter supports an isConnected check that can be used to auto-reconnect.

What to do

  1. On FreighterAdapter construction (or in connect()), call Freighter's isConnected() API.
  2. If already connected, retrieve the public key and set the internal state without showing a permission prompt.
  3. Emit a reconnected event on the adapter so the client's WalletProvider can update state.
  4. Store the last connected wallet type (e.g. 'freighter') in localStorage and attempt auto-reconnect on AppProviders mount.
  5. Write a test that simulates a page reload scenario with a pre-connected Freighter.

Acceptance criteria

  • After a page reload, a previously connected Freighter wallet reconnects without user interaction.
  • Auto-reconnect does not show a Freighter permission prompt.

Metadata

Metadata

Assignees

Labels

Stellar WaveFull ecosystem refactor initiative

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions