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

# queryTokenTransactionsWithFilters

> Query token transaction history with filter-based, cursor pagination.

Queries token transactions with filters and cursor-based pagination for the `SparkWallet`.

## Method Signature

```typescript theme={null}
async queryTokenTransactionsWithFilters({
  sparkAddresses,
  issuerPublicKeys,
  tokenIdentifiers,
  outputIds,
  pageSize,
  cursor,
  direction,
}: {
  sparkAddresses?: string[];
  issuerPublicKeys?: string[];
  tokenIdentifiers?: string[];
  outputIds?: string[];
  pageSize?: number;
  cursor?: string;
  direction?: "NEXT" | "PREVIOUS";
}): Promise<QueryTokenTransactionsResponse>
```

## Parameters

<Note>
  Request constraints are combined using an **AND** relation by the underlying API.
</Note>

<ResponseField name="sparkAddresses" type="string[]">
  Array of Spark addresses to filter by
</ResponseField>

<ResponseField name="issuerPublicKeys" type="string[]">
  Array of issuer public keys to filter by
</ResponseField>

<ResponseField name="tokenIdentifiers" type="string[]">
  Array of Bech32m token identifiers to filter by
</ResponseField>

<ResponseField name="outputIds" type="string[]">
  Array of output IDs to filter by
</ResponseField>

<ResponseField name="pageSize" type="number">
  Page size (defaults to `50`)
</ResponseField>

<ResponseField name="cursor" type="string">
  Cursor returned from a previous response (`pageResponse.nextCursor` or `pageResponse.prevCursor`)
</ResponseField>

<ResponseField name="direction" type="&#x22;NEXT&#x22; | &#x22;PREVIOUS&#x22;">
  Pagination direction (defaults to `"NEXT"`)
</ResponseField>

## Returns

<ResponseField name="response" type="QueryTokenTransactionsResponse" required>
  Token transactions response object
</ResponseField>

<ResponseField name="response.tokenTransactionsWithStatus" type="TokenTransactionWithStatus[]" required>
  Matching token transactions for the requested page
</ResponseField>

<ResponseField name="response.pageResponse" type="PageResponse">
  Pagination metadata including `nextCursor` / `prevCursor`
</ResponseField>

## Example

```typescript theme={null}
const firstPage = await wallet.queryTokenTransactionsWithFilters({
  tokenIdentifiers: ["btkn1..."],
  pageSize: 25,
  direction: "NEXT",
});

const nextCursor = firstPage.pageResponse?.nextCursor;
if (nextCursor) {
  const secondPage = await wallet.queryTokenTransactionsWithFilters({
    tokenIdentifiers: ["btkn1..."],
    pageSize: 25,
    cursor: nextCursor,
    direction: "NEXT",
  });

  console.log(secondPage.tokenTransactionsWithStatus.length);
}
```
