UNPKG

@btc-stamps/tx-builder

Version:

Transaction builder for Bitcoin Stamps and SRC-20 tokens with advanced UTXO selection

63 lines (59 loc) 2.01 kB
import { U as UTXO } from './provider.interface-53Rg30ZJ.js'; /** * Generic Protection Detection Interface * Provides a unified contract for detecting protected UTXOs across different asset types */ /** * Generic protection detection interface * Implementations should check for specific asset types (ordinals, stamps, etc.) */ interface IProtectionDetector { /** * Check if a UTXO contains protected assets * @param utxo The UTXO to check * @returns Promise<boolean> True if the UTXO should be protected */ isProtectedUtxo(utxo: UTXO): Promise<boolean>; /** * Get detailed asset data for a protected UTXO * @param utxo The UTXO to analyze * @returns Promise<ProtectedAssetData | null> Asset data if protected, null otherwise */ getAssetData(utxo: UTXO): Promise<ProtectedAssetData | null>; } /** * Data structure for protected asset information */ interface ProtectedAssetData { /** Type of protected asset */ type: 'ordinal' | 'inscription' | 'stamp' | 'src20' | 'counterparty' | 'unknown'; /** Asset-specific metadata */ metadata?: any; /** Estimated value of the asset (in satoshis) */ value?: number; /** Human-readable identifier for the asset */ identifier?: string; /** Additional properties specific to the asset type */ properties?: Record<string, any>; } /** * Configuration options for protection detectors */ interface ProtectionDetectorConfig { /** Enable/disable protection detection */ enabled: boolean; /** Timeout for detection operations (ms) */ timeout?: number; /** Whether to cache detection results */ enableCache?: boolean; /** Cache TTL in seconds */ cacheTtl?: number; /** Asset-specific configuration */ assetConfig?: { ordinals?: boolean; stamps?: boolean; src20?: boolean; counterparty?: boolean; }; } export type { IProtectionDetector as I, ProtectionDetectorConfig as P, ProtectedAssetData as a };