Skip to content

✨ Add Transaction Status Tracking and History #35

@Mosas2000

Description

@Mosas2000

Description

After submitting transactions, users have no way to track their status or view transaction history within the app.

Current State

  • Transactions show "submitted" but no follow-up
  • No pending transaction indicator
  • No transaction history page
  • Users must manually check Stacks Explorer

Proposed Features

1. Pending Transaction Indicator

  • Global indicator in header showing pending txs
  • Click to see pending transaction details
  • Notification when transaction confirms

2. Transaction Status Polling

// hooks/useTransactionStatus.ts
export function useTransactionStatus(txId: string) {
  // Poll Stacks API for transaction status
  // Return: 'pending' | 'success' | 'failed'
  // Include block confirmation count
}

3. Transaction History Page

  • List all user's transactions with 0xCast contracts
  • Filter by type (stake, claim, create, vote)
  • Link to Stacks Explorer for each tx
  • Show gas fees paid

4. In-App Notifications

// When tx confirms:
toast.success('Your stake of 10 STX on Market #5 confirmed!');

UI Mockup

┌─ Header ─────────────────────────────────┐
│ [0xCast]  Markets  Portfolio  🔔 (2)     │
└──────────────────────────────────────────┘
         │
         ▼
┌─ Pending Transactions ───────────────────┐
│ • Stake 10 STX on Market #5     Pending  │
│   0x1234...abcd              ⏳ 2 mins   │
│                                          │
│ • Claim winnings Market #3    Confirming │
│   0x5678...efgh              ✓ 1/3      │
└──────────────────────────────────────────┘

Files to Create

  • frontend/src/hooks/useTransactionStatus.ts
  • frontend/src/hooks/useTransactionHistory.ts
  • frontend/src/pages/TransactionsPage.tsx
  • frontend/src/components/PendingTxIndicator.tsx
  • frontend/src/components/TransactionToast.tsx

API Endpoints

Use Hiro API for transaction tracking:

  • GET /extended/v1/tx/{tx_id}
  • GET /extended/v1/address/{address}/transactions

Priority

🟡 Medium - Important UX improvement

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions