Skip to main content
Query the full transaction history for your token. Filter by address, status, issuer key, or output ID to understand how your token moves through the network.
Analytics

Query Transactions

Get all transactions for your token:
const [tokenIdentifier] = await wallet.getIssuerTokenIdentifiers();
if (!tokenIdentifier) throw new Error("No token identifiers found for this issuer");

const response = await wallet.queryTokenTransactionsWithFilters({
  tokenIdentifiers: [tokenIdentifier],
  pageSize: 50,
  direction: "NEXT",
});

console.log("Total transactions in page:", response.tokenTransactionsWithStatus.length);

Filter by Address

Get transactions for a specific Spark address:
const response = await wallet.queryTokenTransactionsWithFilters({
  sparkAddresses: ["spark1abc..."],
  pageSize: 50,
});
Filter constraints can be combined (AND semantics). For example, you can filter by both tokenIdentifiers and sparkAddresses in a single request.

Transaction Status

Each transaction has a status:
StatusMeaning
TOKEN_TRANSACTION_STARTEDCreated, not yet signed
TOKEN_TRANSACTION_SIGNEDSigned by all parties
TOKEN_TRANSACTION_REVEALEDReveal stage completed
TOKEN_TRANSACTION_FINALIZEDConfirmed
TOKEN_TRANSACTION_STARTED_CANCELLEDCancelled before signing
TOKEN_TRANSACTION_SIGNED_CANCELLEDCancelled after signing
Filter by status:
const finalized = response.tokenTransactionsWithStatus.filter(
  tx => tx.status === "TOKEN_TRANSACTION_FINALIZED"
);

console.log("Completed transactions:", finalized.length);

Pagination

For tokens with many transactions, use cursor pagination:
const [tokenIdentifier] = await wallet.getIssuerTokenIdentifiers();
if (!tokenIdentifier) throw new Error("No token identifiers found for this issuer");

const firstPage = await wallet.queryTokenTransactionsWithFilters({
  tokenIdentifiers: [tokenIdentifier],
  pageSize: 50,
  direction: "NEXT",
});

console.log("Transactions in first page:", firstPage.tokenTransactionsWithStatus.length);

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

  console.log("Transactions in next page:", secondPage.tokenTransactionsWithStatus.length);
}