Transaction List

Wallet activity grouped by day. Direction is derived against the connected account, not passed in — the same transfer is a send for one wallet and a receive for another, and a self-transfer is both.

src/components/ui/transaction-list.tsx

About

From the component's own source, where it was written.

Wallet activity, grouped by day.

Direction is relative to the connected wallet, not a property of the transaction. The same transfer is a send for one account and a receive for another, and a self-transfer is both — which is why account is required and the direction is derived rather than passed in. Components that take a type: 'send' | 'receive' prop get this wrong the moment two of your own addresses transact.

A failed transaction still appears. It consumed gas and it is on-chain; hiding it makes the balance look unexplained.

Install

npx astralyx-ui add transaction-list

Usage

import { TransactionList } from '@/components/ui/transaction-list'

<TransactionList transactions={txs} account={address} />

Composer

Change the props and the source below follows.

Wednesday 2 September

  • Swap

    0x1111…0582

    +1,638.40 USDCUS$1,638.40
  • Sent

    0x68b3…Fc45

    −0.5 ETHUS$1,642.25
  • Self transfer

    0x742d…f44e

    12.0 SOL

Tuesday 1 September

  • Failed

    0x7a25…488D

    250 DAI
Props
tsx
<TransactionList transactions={txs} account={address} />

Examples

Activity

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

TransactionList

Extends ComponentProps<'div'>.

PropTypeDefaultDescription
transactionsWalletTx[]required{ hash, from, to, amount?, fiat?, time, kind?, failed?, href? }.
accountstringrequiredRequired. Direction is computed against it, which is the only way a self-transfer renders correctly.
localestring'en-GB'—
currencystring'USD'—
nowDate——
emptyLabelReactNode'No activity yet'—
explorerLabelstring'View on block explorer'—

Types

WalletTx

Wallet activity, grouped by day.

FieldTypeDescription
hashstring—
fromstringSender. Compared against account to derive direction.
tostring—
amount?ReactNodeFormatted amount with symbol.
fiat?number—
timeDate—
kind?'transfer' | 'swap' | 'approve' | 'contract'—
failed?booleanStill shown — it consumed gas and is on-chain; hiding it leaves the balance unexplained.
href?string—