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.
Filter by Spark addresses.
Filter by issuer public keys.
Filter by Bech32m token identifiers.
Number of results per page (default: 50).
Cursor from a previous response for pagination.
Pagination direction (default: "NEXT").
Returns
transactions
TokenTransactionWithStatus[]
required
Array of token transaction objects.
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",
});
}