Overview
TheTransactionStatus component provides a persistent, user-friendly display of transaction progress and completion status. It shows real-time updates for swaps and transfers, including transaction hashes and blockchain explorer links for both origin and destination chains.
Import
Props
The current status of the transaction. Set to
null to hide the component.Indicates whether the transaction status is currently being polled. Used for displaying loading states.
Optional callback function that is triggered once when the transaction reaches a terminal state (
COMPLETED or FAILED).Features
Status Persistence
The component internally persists the status even when thestatus prop becomes null. This ensures users can still view completed transaction details after polling stops.
Visual Status Indicators
- COMPLETED: Green checkmark icon with success message
- FAILED: Red X icon with error message
- REFUNDED: Orange warning icon
- PENDING/IN_PROGRESS: Yellow clock icon
Chain Operations
Displays transaction hashes and explorer links for:- Origin Chain: Where the transaction was initiated
- Destination Chain: Where the tokens were received (for cross-chain operations)
Usage Example
Behavior
Automatic Dismissal Prevention
The component uses an internal ref to prevent theonComplete callback from being called multiple times, even if the component re-renders.
User Dismissal
Users can manually dismiss the status card by clicking the X button in the top-right corner. This resets the internal state and hides the component.Status Messages
- Success
- Failed
Styling
The component uses:Cardcomponent for the container- Color-coded status indicators with dark mode support
- Responsive text sizing
- External link icons for blockchain explorers
Integration Points
Typically used with:useQuoteStatushook for polling transaction statusSwapFormorTransferFormcomponents- Quote execution flows
Related Components
- TransactionHistory - View historical transactions
- QuoteDetails - Display quote information before execution
Notes
The component automatically handles the transition from polling to completed states. You don’t need to manually manage the visibility logic.