BigBlocks
Received from 1A1zP...DivfNa
a1b2c3d4...f0a1b2
+250,000 sat15m ago
Sent to 1BitcoinEaterAddress
b2c3d4e5...a1b2c3
-50,000 sat2h ago
NFT inscription
c3d4e5f6...b2c3d4
-1,500 sat5h ago
Token transfer PEPE
d4e5f6a7...c3d4e5
-100,000 sat1d ago
Ordinal purchase
e5f6a7b8...d4e5f6
-500,000 sat2d ago
Compact
Received from 1A1zP...DivfNa
+250,000 sat
Sent to 1BitcoinEaterAddress
-50,000 sat
NFT inscription
-1,500 sat
Loading
Empty
No transactions yet
Installation
bunx shadcn@latest add https://registry.bigblocks.dev/r/transaction-history.jsonUsage
Pass a BSV address to auto-fetch from the 1sat API, or provide pre-loaded entries directly.
import { TransactionHistory } from "@/components/blocks/transaction-history"
export function WalletActivity() {
return (
<TransactionHistory
address="1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
onRowClick={(txid) => console.log("Clicked:", txid)}
onExternalLink={(txid) =>
window.open(`https://whatsonchain.com/tx/${txid}`, "_blank")
}
/>
)
}Variants
Default
Full transaction rows with status badge, description, amount, and relative date.
<TransactionHistory address={address} variant="default" />Compact
Condensed rows showing description and amount only.
<TransactionHistory address={address} variant="compact" />Props
TransactionHistory
| Prop | Type | Default | Description |
|---|---|---|---|
address | string | null | -- | BSV address to fetch history for |
entries | HistoryEntry[] | -- | Pre-loaded entries (bypasses API) |
apiUrl | string | "https://api.1sat.app" | Custom API base URL |
pageSize | number | 20 | Entries per page |
autoFetch | boolean | true | Auto-fetch on mount |
onRowClick | (txid: string) => void | -- | Row click callback |
onExternalLink | (url: string) => void | -- | External link callback |
onSuccess | (entries: HistoryEntry[]) => void | -- | Called on successful fetch |
onError | (error: Error) => void | -- | Called on fetch error |
variant | "default" | "compact" | "default" | Visual variant |
skeletonCount | number | 5 | Skeleton rows while loading |
className | string | -- | Additional CSS classes |
HistoryEntry
interface HistoryEntry {
txid: string
description: string
satoshis: number // Positive = inbound, negative = outbound
status: TransactionStatus
dateCreated: string // ISO date string
}
type TransactionStatus = "completed" | "unproven" | "sending" | "failed"Hook
useTransactionHistory manages fetching, pagination, and entry state.
import { useTransactionHistory } from "@/components/blocks/transaction-history"
function CustomHistory() {
const { entries, isLoading, error, hasMore, loadMore } =
useTransactionHistory({ address: "1A1zP1eP..." })
return (
<div>
{entries.map((e) => (
<div key={e.txid}>{e.description}: {e.satoshis} sats</div>
))}
{hasMore && <button onClick={loadMore}>Load more</button>}
</div>
)
}