Skip to main content

Transaction History

This guide covers querying and paginating transaction history in the Privacy Boost React Native SDK.

Basic Usage

getTransactionHistory is async and returns a paginated result, not a raw array. Iterate over result.data:

Transaction Type

Each Transaction groups the on-chain event with zero or more shielded notes it produced or consumed. Money movement lives in value/tokenId/notes — not in the pre-0.2 amount/tokenAddress/receivers shape.
To resolve a tokenId to a token address/symbol, call sdk.getRegisteredTokens() once and cache the lookup.

Filtering History

By Transaction Type

With Limit

Pagination

The previous page’s next cursor is the third argument:

By Token ID, Direction, or Collapsed Gateway Rows

Token and direction filters are not parameters on getTransactionHistory. Pass a TransactionHistoryQuery to queryTransactionHistory instead. It takes the same txType, limit, and cursor, plus tokenId (the registered token id, from sdk.getRegisteredTokens()), direction (TransactionDirection.Incoming or Outgoing, relative to the wallet), and collapseGateway, which folds each Gateway operation’s two rows into one so an activity list can show a swap as a single entry. undefined fields are unfiltered, and every field is defaulted, so name only the ones you want.
ChainContextHandle exposes the same method for other chains.

Parameters

Token filtering is not a parameter on this method. Use queryTransactionHistory for token id and direction filters, or sdk.getUnspentNotes(tokenAddress) for balance-level queries.

Complete Example

Error Handling

Best Practices

1. Page through results

Always pass a limit and follow the next cursor. Unbounded history fetches get expensive fast for active accounts.

2. Cache token metadata

Transaction.tokenId is a numeric ID. Resolve to display symbol/decimals via sdk.getRegisteredTokens() and cache the result — the registered-token list changes rarely.

3. Refresh after operations

Call getTransactionHistory (with no cursor) after a successful shield / unshield / transfer so the UI reflects the new state.

Next Steps