UNPKG

nucypher-experimental-taco-storage

Version:

TypeScript SDK for encrypted data storage with TACo (Threshold Access Control), supporting multiple storage providers including IPFS and SQLite

81 lines 2.54 kB
/** * Helia IPFS storage adapter implementation using embedded IPFS node */ import { BaseIPFSAdapter } from './base'; import { AdapterConfig, StorageMetadata, StorageResult } from '../../types'; /** * Configuration interface for Helia IPFS adapter */ export interface HeliaAdapterConfig extends AdapterConfig { /** Optional timeout for IPFS operations in milliseconds */ timeout?: number; /** Whether to start the Helia node immediately on initialization */ autoStart?: boolean; /** Custom Helia configuration options */ heliaOptions?: { /** Custom libp2p configuration */ libp2p?: any; /** Custom datastore configuration */ datastore?: any; /** Custom blockstore configuration */ blockstore?: any; }; } /** * Helia IPFS storage adapter for embedded IPFS node functionality */ export declare class HeliaAdapter extends BaseIPFSAdapter { private helia; private fs; private readonly heliaConfig; constructor(config?: HeliaAdapterConfig); /** * Initialize the Helia adapter by creating and starting the embedded IPFS node */ initialize(): Promise<void>; protected generateReference(id: string): string; /** * Ensure Helia node and filesystem are initialized before use */ private ensureHeliaReady; protected addContent(data: Uint8Array): Promise<string>; protected getContent(hash: string): Promise<Uint8Array>; protected pinContent(hash: string): Promise<void>; protected unpinContent(hash: string): Promise<void>; protected contentExists(hash: string): Promise<boolean>; protected getIPFSHealth(): Promise<{ connected: boolean; nodeId?: string; }>; /** * Store encrypted data and metadata using Helia */ store(encryptedData: Uint8Array, metadata: StorageMetadata): Promise<StorageResult>; /** * Retrieve encrypted data and metadata using Helia */ retrieve(id: string): Promise<{ encryptedData: Uint8Array; metadata: StorageMetadata; }>; /** * Delete data from IPFS (unpin) */ delete(id: string): Promise<boolean>; /** * Check if data exists in Helia */ exists(id: string): Promise<boolean>; /** * Get Helia node health status */ getHealth(): Promise<{ healthy: boolean; details?: Record<string, unknown>; }>; /** * Clean up Helia node resources */ cleanup(): Promise<void>; } //# sourceMappingURL=helia.d.ts.map