export declare class CidCalculatorService { constructor(); /** * Calculate IPFS CID v0 for the given data * CID v0 uses base58btc encoding and dag-pb format with sha256 hash * Uses simple raw data approach to match Pinata's CID calculation */ calculateCidV0(data: Buffer): Promise; /** * Calculate CIDs for multiple buffers in batch */ calculateBatch(dataArray: Buffer[]): Promise; /** * Convert string to Buffer using UTF-8 encoding */ stringToBuffer(input: string): Buffer; /** * Helper method to calculate CID from a JSON object * Converts the object to canonical JSON string first */ calculateCidFromJson(json: unknown): Promise; /** * Calculate CID v1 for DAG-JSON data * This is the proper format for IPLD linked data */ calculateCidV1ForDagJson(data: any): Promise; /** * Calculate IPFS CID v1 for the given data (UnixFS format) * CID v1 uses base32 encoding and dag-pb format with sha256 hash */ calculateCidV1(data: Buffer): Promise; /** * Calculate CID for data, automatically choosing the appropriate format * Uses DAG-JSON for data with IPLD links, UnixFS for everything else */ calculateCidAutoFormat(data: any): Promise; /** * Calculate CID from canonical JSON string * This ensures the CID is calculated from the exact canonical representation * Always uses raw codec for consistency */ calculateCidFromCanonicalJson(canonicalJson: string): Promise; /** * Check if data contains IPLD links */ hasIPLDLinks(data: any): boolean; /** * Calculate CID v1 for raw binary data (e.g., images) * Uses raw codec (0x55) instead of UnixFS */ calculateCidV1ForRawData(data: Buffer): Promise; /** * Calculate CID for a directory structure containing multiple files * Uses DAG-PB format with UnixFS directory type * Returns a CID v1 in base32 encoding (starts with "bafybei...") * * When directoryName is provided, this exactly mimics Pinata's directory upload: * - Creates a root directory with the given name * - All files are placed directly in this directory * - The CID returned is for the root that contains this named directory */ calculateDirectoryCid(files: Array<{ name: string; content: Buffer; }>, directoryName?: string): Promise; /** * Calculate directory CID using UnixFS importer (matches IPFS/Pinata exactly) * This uses the same importer that IPFS nodes use, ensuring matching CIDs */ private calculateDirectoryCidWithImporter; /** * Calculate CID for a directory structure with a named subdirectory * This matches Pinata's structure when using manual directory prefixes */ private calculateDirectoryCidWithSubdir; /** * Calculate CID for a flat directory structure (no wrapper) * Internal helper method */ private calculateDirectoryCidFlat; /** * Create a DAG-PB node for a directory with files * Internal helper method that exactly matches IPFS/Pinata's approach */ private createDirectoryDagPbNode; } //# sourceMappingURL=cid-calculator.service.d.ts.map