> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trails.build/llms.txt
> Use this file to discover all available pages before exploring further.

# Intent & Transaction History

> Retrieve account & intent transaction history for an address with the Trails SDK.

Trails comes with a built in high-performant indexer which you can leverage seamlessly to retrieve information about a user's transaction history.

<Note>
  The examples below import `useAccount` from wagmi. Since [`0xtrails@0.16.0`](/sdk/changelog/0xtrails-0.16.0), wagmi is opt-in — install `@0xtrails/adapter-wagmi` and configure `wagmiAdapter` to use wagmi hooks alongside Trails. See [SDK Hooks](/sdk/hooks#apps-with-wagmi).
</Note>

## Wallet Transaction History

Query a user's transaction history for a specific chain using their connected wallet address:

```tsx theme={null}
import { useAccountTransactionHistory } from '0xtrails'
import { useAccount } from 'wagmi'

export const TransactionList = () => {
  const { address } = useAccount()
  
  const { data, isLoading } = useAccountTransactionHistory({
    chainId: 137,
    accountAddress: address,
  })

  if (isLoading) return <div>Loading...</div>

  return (
    <ul>
      {data?.transactions?.map((tx) => (
        <li key={tx.txnHash}>
          {tx.txnHash} | chain {tx.chainId} | block #{tx.blockNumber}
        </li>
      ))}
    </ul>
  )
}
```

## Intent Transaction History

Retrieve the full transaction history for a specific intent:

```tsx theme={null}
import { useIntentTransactionHistory } from '0xtrails'
import { useAccount } from 'wagmi'

export const IntentHistory = ({ intentId }: { intentId: string }) => {
  const { address } = useAccount()

  const {
    transactions,
    loading,
    error,
    refetch,
  } = useIntentTransactionHistory({
    accountAddress: address,
    pageSize: 10,
    enabled: true,
  })

  if (loading) return <div>Loading intent history...</div>
  if (error) return <div>Error: {String(error)}</div>

  return (
    <div>
      <button onClick={refetch}>Refresh</button>
      <ul>
        {transactions?.map((tx) => (
          <li key={tx.txnHash}>
            {tx.txnHash} | {tx.timestamp}
          </li>
        ))}
      </ul>
    </div>
  )
}
```

For more information, see:

* [**Hooks Reference**](/sdk/hooks) — Full documentation for transaction history hooks
* [**Get Intent History API**](/api-reference/endpoints/get-intent-history) — API endpoint reference
