Skip to main content
Queries token transactions with optional filters and cursor-based pagination.

Method Signature

async getTokenTransactions(
  params?: QueryTokenTransactionsParams,
): Promise<{
  transactions: TokenTransactionWithStatus[];
  pageResponse: {
    nextCursor?: string;
    prevCursor?: string;
  };
}>

interface QueryTokenTransactionsParams {
  sparkAddresses?: string[];
  issuerPublicKeys?: string[];
  tokenIdentifiers?: string[];
  outputIds?: string[];
  pageSize?: number;            // default: 50
  cursor?: string;
  direction?: "NEXT" | "PREVIOUS";
}

Parameters

Filters are combined using AND logic.
sparkAddresses
string[]
Filter by Spark addresses.
issuerPublicKeys
string[]
Filter by issuer public keys.
tokenIdentifiers
string[]
Filter by Bech32m token identifiers.
outputIds
string[]
Filter by output IDs.
pageSize
number
Number of results per page (default: 50).
cursor
string
Cursor from a previous response for pagination.
direction
"NEXT" | "PREVIOUS"
Pagination direction (default: "NEXT").

Returns

transactions
TokenTransactionWithStatus[]
required
Array of token transaction objects.
pageResponse
object
required
Pagination metadata with nextCursor and prevCursor.

Example

// First page
const page = await client.getTokenTransactions({
  sparkAddresses: ["sp1..."],
  pageSize: 25,
});

console.log(`${page.transactions.length} transactions`);

// Next page
if (page.pageResponse?.nextCursor) {
  const next = await client.getTokenTransactions({
    sparkAddresses: ["sp1..."],
    cursor: page.pageResponse.nextCursor,
    direction: "NEXT",
  });
}