PollarPollarDemo

Products

AuthenticationWalletTransactions

Integrations

KYCSoonRampNewSwapNewEarnNew

Wallet Adapters

Stellar Wallets KitPrivyNew

Adapters

Trustless Work

Built with Pollar

LumenWipeNew
SendReceiveBalanceAssetsHistoryDistribution

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()hook

    params: 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()sync

    params: No arguments — fetching, pagination and rendering all happen inside the modal.

    returns: void — opens the prebuilt modal; there is nothing to await.

  • txHistoryreactive value

    params: 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.

@pollar/react— hooks & components
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>
  );
}
txHistory.stepidle

Open the modal to load history.