Skip to main content
Retrieves token transactions from the network with flexible filtering options for the SparkWallet.

Method Signature

async queryTokenTransactions({
  ownerPublicKeys,
  issuerPublicKeys,
  tokenTransactionHashes,
  tokenIdentifiers,
  outputIds,
}: {
  ownerPublicKeys?: string[];
  issuerPublicKeys?: string[];
  tokenTransactionHashes?: string[];
  tokenIdentifiers?: string[];
  outputIds?: string[];
}): Promise<TokenTransactionWithStatus[]>

Parameters

ownerPublicKeys
string[]
Array of owner public keys to filter by
issuerPublicKeys
string[]
Array of issuer public keys to filter by
tokenTransactionHashes
string[]
Array of token transaction hashes to filter by
tokenIdentifiers
string[]
Array of Bech32m token identifiers to filter by
outputIds
string[]
Array of output IDs to filter by

Returns

transactions
TokenTransactionWithStatus[]
required
Array of token transactions with status

Example

// Query all token transactions
const transactions = await wallet.queryTokenTransactions({});

// Query transactions for specific tokens
const tokenTransactions = await wallet.queryTokenTransactions({
  tokenIdentifiers: ["btkn1..."]
});

// Query transactions for specific owners
const ownerTransactions = await wallet.queryTokenTransactions({
  ownerPublicKeys: ["pubkey1", "pubkey2"]
});