UNPKG

bitcoin-inscription-viewer

Version:

🔍 A robust, production-ready React/TypeScript library for viewing Bitcoin Ordinals inscriptions with advanced optimization features including LRU caching, LaserEyes wallet integration, virtual scrolling, and performance monitoring

52 lines 1.29 kB
/** * Cache service for inscription content to improve performance * and reduce redundant network requests */ export declare class InscriptionContentCache { private cache; private maxSize; private maxAge; constructor(maxSize?: number, maxAgeMinutes?: number); /** * Get cached content for an inscription */ get(key: string): any | null; /** * Set content in cache */ set(key: string, data: any, contentType?: string): void; /** * Check if key exists in cache (and is not expired) */ has(key: string): boolean; /** * Remove specific entry from cache */ delete(key: string): boolean; /** * Clear all cached entries */ clear(): void; /** * Get cache statistics */ getStats(): { size: number; maxSize: number; maxAge: number; }; /** * Fetch content with proper headers for ordinals.com JSON APIs */ fetchContent(url: string): Promise<{ data: any; contentType: string; }>; /** * Clean up expired entries */ cleanup(): void; } export declare const inscriptionCache: InscriptionContentCache; export default InscriptionContentCache; //# sourceMappingURL=InscriptionContentCache.d.ts.map