import type { Bsv21TransactionData, ClientOptions, IndexedOutput, TokenDetailResponse } from "../types"; import { BaseClient } from "./BaseClient"; /** * Query options for /outputs validation endpoints. * All flags default to false on the server. */ export interface OutputQueryOptions { /** Filter for unspent outputs only */ unspent?: boolean; /** Include spend txid */ spend?: boolean; /** Include satoshis */ sats?: boolean; /** Include events array */ events?: boolean; /** Include block info */ block?: boolean; /** Comma-separated data tags to include (e.g. 'bsv21') */ tags?: string; } /** * Client for /1sat/bsv21/* routes. * Provides BSV21 token queries. * * Routes: * - POST /lookup - Bulk lookup token details with funding status * - GET /:tokenId - Get token details with funding status * - GET /:tokenId/tx/:txid - Get token transaction data * - GET /:tokenId/:lockType/:address/balance - Get token balance * - GET /:tokenId/:lockType/:address/unspent - Get unspent token UTXOs * - GET /:tokenId/:lockType/:address/history - Get token transaction history * - POST /:tokenId/:lockType/balance - Multi-address token balance * - POST /:tokenId/:lockType/unspent - Multi-address unspent token UTXOs * - POST /:tokenId/:lockType/history - Multi-address token transaction history */ export declare class Bsv21Client extends BaseClient { private cache; constructor(baseUrl: string, options?: ClientOptions); /** * Bulk lookup token details with funding status. * Returns details and active status for multiple tokens in one request. * @param tokenIds - Array of token IDs (max 100) */ lookupTokens(tokenIds: string[]): Promise; /** * Get token details with funding status. * Results are cached since token deploy data is immutable. */ getTokenDetails(tokenId: string): Promise; /** * Get token transaction data for a specific txid */ getTokenByTxid(tokenId: string, txid: string): Promise; /** * Get token balance for an address */ getBalance(tokenId: string, lockType: string, address: string): Promise<{ balance: number; utxoCount: number; }>; /** * Get unspent token UTXOs for an address */ getUnspent(tokenId: string, lockType: string, address: string): Promise; /** * Get token transaction history for an address */ getHistory(tokenId: string, lockType: string, address: string): Promise; /** * Get token balance for multiple addresses * @param addresses - Array of addresses (max 100) */ getBalanceMulti(tokenId: string, lockType: string, addresses: string[]): Promise<{ balance: number; utxoCount: number; }>; /** * Get unspent token UTXOs for multiple addresses * @param addresses - Array of addresses (max 100) */ getUnspentMulti(tokenId: string, lockType: string, addresses: string[]): Promise; /** * Get token transaction history for multiple addresses * @param addresses - Array of addresses (max 100) */ getHistoryMulti(tokenId: string, lockType: string, addresses: string[]): Promise; /** * Validate specific outpoints against the token's overlay topic. * Returns only those found in the overlay. By default returns minimal data * (outpoint + score). Use opts to include additional fields. * @param tokenId - Token ID (txid_vout format) * @param outpoints - Array of outpoints to validate (max 1000) * @param opts - Optional query flags for additional data */ validateOutputs(tokenId: string, outpoints: string[], opts?: OutputQueryOptions): Promise; /** * Validate a single outpoint against the token's overlay topic. * Returns 404 if not found. By default returns minimal data (outpoint + score). * @param tokenId - Token ID (txid_vout format) * @param outpoint - Outpoint to validate (txid_vout or txid:vout) * @param opts - Optional query flags for additional data */ validateOutput(tokenId: string, outpoint: string, opts?: OutputQueryOptions): Promise; private buildOutputQuery; /** * Clear the token details cache */ clearCache(): void; }