Skip to content

[Frontend] Global Pending Transaction Queue & Transaction Tracker Toast System #1448

Description

@blurbeast

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

  1. 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.
  2. Lost Context on Page Refresh:
    • In-flight transaction state is lost if the user reloads or navigates the Next.js app.
  3. 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

  • Triggering any on-chain transaction immediately registers an entry in the persistent queue.
  • Toast displays live status updates through submission, pending, and final confirmation.
  • Survives page navigation and reloads via local storage synchronization.
  • Links directly to Stellar Expert testnet/mainnet explorer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdrips-wavefrontendFrontend related tasksuiUser interface refinementuxwallet

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions