History
List the connected wallet's past transactions with pagination. The loading state is exposed reactively, so your UI can react as the data arrives.
Drop-in button that opens a prebuilt modal — the list, pagination, loading and empty states are all rendered for you.
openTxHistoryModal() takes no arguments — pagination is handled inside the modal.
Hook & values used
All of these come from the usePollar() hook — the react layer built on top of getClient().
usePollar()hookparams: No arguments. Call it at the top level of a component — it reads React context, so it must run during render.
returns: PollarContextValue — the whole SDK surface: reactive state values, modal openers, and getClient() to drop down to core.
openTxHistoryModal()syncparams: No arguments — fetching, pagination and rendering all happen inside the modal.
returns: void — opens the prebuilt modal; there is nothing to await.
txHistoryreactive valueparams: Not a function — a value of type TxHistoryState read from usePollar().
returns: Re-renders your component whenever it changes. Mirrors getClient().getTxHistoryState(): step plus data when loaded.
import { usePollar } from '@pollar/react'; export function HistoryButton() { const { openTxHistoryModal, txHistory, isAuthenticated } = usePollar(); // txHistory mirrors client.getTxHistoryState(): // 'idle' | 'loading' | 'loaded' | 'error' // when loaded, txHistory.data.records holds the rows. return ( <button onClick={openTxHistoryModal} disabled={!isAuthenticated} > Transaction history </button> ); }
Open the modal to load history.