Methods for managing and interacting with tokens on the Spark network.
getTokenInfo()
Gets information about tokens owned by the wallet.
async getTokenInfo(): Promise<TokenInfo[]>
Returns:
Promise<TokenInfo[]>: Array of token information objects
queryTokenTransactions()
Retrieves token transaction from the network. Can optionally filter by ownerPublicKeys, issuerPublicKeys, tokenTransactionHashes, tokenIdentifiers, or outputIds.
Note: This is archived documentation. In current versions, you can only use one filter type per query - the parameters are mutually exclusive.
async queryTokenTransactions({
ownerPublicKeys,
issuerPublicKeys,
tokenTransactionHashes,
tokenIdentifiers,
outputIds,
}: {
ownerPublicKeys?: string[];
issuerPublicKeys?: string[];
tokenTransactionHashes?: string[];
tokenIdentifiers?: string[];
outputIds?: string[];
}): Promise<TokenTransactionWithStatus[]>
Parameters:
ownerPublicKeys: (Optional) Array of owner public keys to filter by
issuerPublicKeys: (Optional) Array of issuer public keys to filter by
tokenTransactionHashes: (Optional) Array of token transaction hashes to filter by
tokenIdentifiers: (Optional) Array of Bech32m token identifiers to filter by
outputIds: (Optional) Array of output IDs to filter by
Returns:
Promise<TokenTransactionWithStatus[]>: Array of token transactions with status
getTokenL1Address()
Gets the Layer 1 Bitcoin address for token operations.
async getTokenL1Address(): Promise<string>
Returns:
Promise<string>: The Layer 1 Bitcoin address