/**
 * Bitcoin Provider Utilities
 * Handles multi-provider consensus for Bitcoin blockchain queries
 */
import type { BitcoinProviderConfig } from '../interfaces/chunks/config.i';
import type { BitcoinBalanceResult } from '../interfaces/chunks/position-query.i';
/**
 * Bitcoin Provider with consensus support
 */
export declare class BitcoinProvider {
    private providers;
    private consensusMode;
    private debug;
    constructor(configs: BitcoinProviderConfig[], consensusMode?: 'single' | 'majority', debug?: boolean);
    /**
     * Get UTXOs for a Bitcoin address with consensus
     */
    getUnspentsFor(address: string): Promise<BitcoinBalanceResult>;
    /**
     * Get UTXOs from a single provider
     */
    private getUnspentsSingle;
    /**
     * Check if a provider error is retryable
     */
    private isRetryableProviderError;
    /**
     * Get UTXOs with 2-of-3 consensus
     */
    private getUnspentsWithConsensus;
    /**
     * Find consensus among multiple provider results
     */
    private findConsensus;
    /**
     * Create a signature for a UTXO set (for comparison)
     */
    private getUTXOSetSignature;
    private fetchUtxosFromProvider;
    /**
     * Get balance for an address (sum of UTXOs)
     */
    getBalance(address: string): Promise<bigint>;
    /**
     * Check if an address has received at least a specific amount
     */
    hasReceivedAmount(address: string, expectedAmount: bigint): Promise<boolean>;
    /**
     * Fetch a Bitcoin transaction by txid.
     *
     * Audit CRIT-2: used to verify that a Phase-2 BTC withdrawal the server
     * claimed broadcast actually exists and matches the user's authorization.
     * Returns `null` if no provider has the tx yet — the caller may retry to
     * allow for propagation/indexing delay.
     *
     * Esplora response shape: `{ txid, vin: [{txid, vout, ...}], vout: [{value, scriptpubkey_address, ...}], status: {confirmed, ...} }`
     */
    getTransaction(txid: string): Promise<BitcoinTransactionInfo | null>;
    /**
     * Try each candidate path on the provider. Returns `null` on 404 (tx not
     * yet visible) but throws on other errors so the outer loop can move to
     * the next provider.
     */
    private fetchTxFromProvider;
}
/**
 * Normalized Bitcoin transaction information returned by `getTransaction`.
 * Only the fields used by post-broadcast verification are populated; we
 * deliberately do NOT echo full witness / scriptpubkey data to keep the
 * surface small.
 */
export interface BitcoinTransactionInfo {
    txid: string;
    vin: Array<{
        txid: string;
        vout: number;
    }>;
    vout: Array<{
        value: number;
        address?: string;
    }>;
    /** True if the tx is in a block, false if still in mempool, undefined unknown. */
    confirmed?: boolean;
}
