Description
Handling wallet connections with boolean flags (isConnected, isConnecting) leads to impossible UI states and race conditions during fractional asset purchases.
Architecture & Context
The frontend must implement a deterministic finite state machine (using XState) to manage the wallet lifecycle. This strictly defines transitions between Disconnected, RequestingAccess, Connected, and NetworkMismatch, eliminating unhandled edge cases.
Technical Requirements
- Define a strict XState machine for the Freighter wallet lifecycle.
- Integrate the state machine with the React context provider.
- Handle asynchronous wallet timeouts and user rejections explicitly.
Acceptance Criteria
Description
Handling wallet connections with boolean flags (
isConnected,isConnecting) leads to impossible UI states and race conditions during fractional asset purchases.Architecture & Context
The frontend must implement a deterministic finite state machine (using XState) to manage the wallet lifecycle. This strictly defines transitions between
Disconnected,RequestingAccess,Connected, andNetworkMismatch, eliminating unhandled edge cases.Technical Requirements
Acceptance Criteria
isConnected&&isConnecting) are mathematically prevented.Disconnected.NetworkMismatchstate.