Hook for fetching and paginating through transaction history
UseGetTransactionHistoryReturnType
UseInfiniteQueryResult
with transaction history data. Here’s the detailed structure:
InfiniteData<GetTransactionHistoryReturn> | undefined
The paginated transaction history data containing multiple pages. Each page includes:
txnHash
: Transaction hashblockNumber
: Block number where transaction was minedblockHash
: Hash of the blockchainId
: Chain ID where transaction occurredmetaTxnID
: Optional meta transaction IDtransfers
: Optional array of transaction transferstimestamp
: Transaction timestamppage
: Next page numbermore
: Whether more results exist in the next pagepageSize
: Number of results per page() => Promise<unknown>
Function to load the next page of transactions.
boolean
Boolean indicating if more transactions are available to load.
boolean
Loading state for the initial data fetch.
boolean
Loading state for any data fetch (initial or subsequent).
boolean
Loading state specifically for next page fetch.
Error | null
Any error that occurred during data fetching.
UseGetTransactionHistoryArgs
Parameter | Type | Description |
---|---|---|
chainId | number | The chain ID to fetch transactions from |
accountAddresses | string[] | The addresses to fetch transaction history for |
contractAddress | string | (Optional) Filter transactions by contract address |
tokenId | string | (Optional) Filter transactions by token ID |
page | object | (Optional) Pagination configuration |
HooksOptions
Parameter | Type | Description |
---|---|---|
disabled | boolean | (Optional) Disable the query from automatically running |
retry | boolean | (Optional) Whether to retry failed queries |
@tanstack/react-query
internally for data fetching and caching, with a stale time of 30 seconds.