Skip to main content
The TransactionHistory component displays a chronological list of a user’s transactions with the Compound III protocol, including supplies, withdrawals, borrows, and repayments.

Usage

Props

Example

Displayed Information

The component displays the following information for each transaction:
  • Transaction Type: Supply, Withdraw, Borrow, Repay, Liquidation, etc.
  • Asset: The asset involved in the transaction (e.g., USDC, ETH)
  • Amount: The amount of the asset involved
  • Date: The date and time when the transaction occurred
  • Transaction Hash: A link to view the transaction on a block explorer
  • Status: The status of the transaction (Confirmed, Pending, Failed)

Transaction Types

The component supports displaying the following transaction types:
  • Supply: Adding collateral to the protocol
  • Withdraw: Removing collateral from the protocol
  • Borrow: Borrowing assets from the protocol
  • Repay: Repaying borrowed assets
  • Liquidation: When a position is liquidated
  • Transfer: Transferring collateral between accounts
  • Claim Rewards: Claiming COMP rewards

Filtering and Sorting

The component includes features for filtering and sorting transactions:
  • Filter by Type: Filter transactions by type (e.g., only show supplies)
  • Filter by Asset: Filter transactions by asset (e.g., only show USDC transactions)
  • Sort by Date: Sort transactions by date (newest first or oldest first)

Loading and Error States

The component handles loading and error states automatically:
  • While data is being fetched, a loading indicator is displayed
  • If an error occurs during data fetching, an error message is displayed
  • If the user has no transactions, an appropriate message is shown

Pagination

For users with many transactions, the component supports pagination:
  • Load More: Button to load more transactions
  • Page Navigation: Navigate between pages of transactions

Customization

You can customize the appearance of the component using the className prop: