/** * UTXO Availability Validation * * Validates that UTXOs referenced in a pre-pegin transaction are still unspent * BEFORE asking the user to sign. This prevents wasted signing effort when * UTXOs have already been spent by unrelated transactions. * * These functions are pure — they accept pre-fetched UTXOs and perform no I/O. * The vault service wrapper is responsible for fetching UTXOs from the mempool. */ /** * Reference to a Bitcoin UTXO by its outpoint (txid + vout). * * Used by the availability check to compare a Pre-PegIn transaction's * declared inputs against the wallet's current spendable set. Txids are * compared case-insensitively; callers should treat the txid as opaque * lowercase hex. */ export interface UtxoRef { txid: string; vout: number; } /** * Information about a missing/spent UTXO. */ export interface MissingUtxoInfo { /** Transaction ID of the missing UTXO */ txid: string; /** Output index of the missing UTXO */ vout: number; } /** * Result of UTXO validation. */ export interface UtxoValidationResult { /** Whether all UTXOs are still available */ allAvailable: boolean; /** List of missing UTXOs (if any) */ missingUtxos: MissingUtxoInfo[]; /** Total number of inputs checked */ totalInputs: number; } /** * Error thrown when UTXOs are not available. */ export declare class UtxoNotAvailableError extends Error { readonly missingUtxos: MissingUtxoInfo[]; constructor(missingUtxos: MissingUtxoInfo[]); } /** * Extract input references (txid:vout) from an unsigned transaction. * * @param unsignedTxHex - Unsigned transaction hex * @returns Array of input references */ export declare function extractInputsFromTransaction(unsignedTxHex: string): Array<{ txid: string; vout: number; }>; /** * Validate that all UTXOs in a transaction are still available. * * Pure function — accepts pre-fetched UTXOs instead of making network calls. * This should be called BEFORE signing to avoid wasting user effort * signing a transaction that will fail to broadcast. * * @param unsignedTxHex - Unsigned transaction hex * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor * @returns Validation result with missing UTXO details */ export declare function validateUtxosAvailable(unsignedTxHex: string, availableUtxos: UtxoRef[]): UtxoValidationResult; /** * Validate UTXOs and throw if any are not available. * * Pure convenience function that combines validation and error throwing. * * @param unsignedTxHex - Unsigned transaction hex * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor * @throws UtxoNotAvailableError if any UTXOs are not available * @throws Error if validation fails */ export declare function assertUtxosAvailable(unsignedTxHex: string, availableUtxos: UtxoRef[]): void; //# sourceMappingURL=availability.d.ts.map