Overview & Background
Stellar / Soroban transactions take between 3 and 10 seconds to close in a ledger block. When a user creates a stream, withdraws tokens, cancels a stream, or pauses/resumes, they currently lack persistent feedback if they navigate between pages or close the active modal. A global transaction queue with floating status toasts is essential for clear web3 user experience.
Detailed Problem Statement
- Lack of In-Flight Visibility:
- Users who click away from a modal have no way of knowing whether their signed transaction succeeded or failed on-chain.
- Lost Context on Page Refresh:
- In-flight transaction state is lost if the user reloads or navigates the Next.js app.
- No Direct Explorer Link:
- Users are not provided a quick link to inspect their transaction hash on Stellar Expert.
Technical Specification & Architecture
1. Global Transaction Context (TransactionContext.tsx)
Maintain transaction state persisted in localStorage:
export interface TrackedTransaction {
id: string;
txHash?: string;
type: 'CREATE_STREAM' | 'WITHDRAW' | 'TOP_UP' | 'CANCEL' | 'PAUSE' | 'RESUME';
status: 'SUBMITTING' | 'PENDING' | 'SUCCESS' | 'FAILED';
description: string;
submittedAt: number;
errorMessage?: string;
explorerUrl?: string;
}
2. Persistent Floating Toast Component (TransactionTracker.tsx)
- Renders in the bottom-right corner of the application layout.
- Displays animated spinner during
PENDING, green check on SUCCESS, and alert icon on FAILED.
- Clickable link: "View on Stellar Expert ↗".
- Dismissible with auto-hide after 8 seconds on success.
3. Transaction Polling Hook (useTransactionWatcher.ts)
- Periodically checks transaction confirmation status against Horizon / Soroban RPC until confirmed or timed out (60s).
Target Files
frontend/src/context/TransactionContext.tsx
frontend/src/components/TransactionTracker.tsx
frontend/src/hooks/useTransactionWatcher.ts
frontend/src/app/layout.tsx
Acceptance Criteria
Overview & Background
Stellar / Soroban transactions take between 3 and 10 seconds to close in a ledger block. When a user creates a stream, withdraws tokens, cancels a stream, or pauses/resumes, they currently lack persistent feedback if they navigate between pages or close the active modal. A global transaction queue with floating status toasts is essential for clear web3 user experience.
Detailed Problem Statement
Technical Specification & Architecture
1. Global Transaction Context (
TransactionContext.tsx)Maintain transaction state persisted in
localStorage:2. Persistent Floating Toast Component (
TransactionTracker.tsx)PENDING, green check onSUCCESS, and alert icon onFAILED.3. Transaction Polling Hook (
useTransactionWatcher.ts)Target Files
frontend/src/context/TransactionContext.tsxfrontend/src/components/TransactionTracker.tsxfrontend/src/hooks/useTransactionWatcher.tsfrontend/src/app/layout.tsxAcceptance Criteria