import { IPFSClient } from '8004-solana'; import type { IPFSClientConfig, RegistrationFile } from '8004-solana'; export interface McpIPFSConfig extends IPFSClientConfig { uploadUrl?: string; } export interface IIPFSService { isConfigured(): boolean; configure(config: McpIPFSConfig): void; clearConfig(): void; getConfig(): McpIPFSConfig | undefined; hasUploadBackend(): boolean; getGatewayUrl(): string; addJson(data: Record, name?: string): Promise; addFile(filepath: string): Promise; addBuffer(data: Uint8Array, mimeType: string, filename?: string): Promise; getJson>(cid: string): Promise; addRegistrationFile(registrationFile: RegistrationFile, chainId?: number, identityRegistryAddress?: string): Promise; getRegistrationFile(cid: string): Promise; } export declare class IPFSService implements IIPFSService { private _client?; private _config?; private _opTimestamps; /** * Check if IPFS is configured with valid credentials */ isConfigured(): boolean; /** * Configure the IPFS service with provider settings */ configure(config: McpIPFSConfig): void; /** * Clear IPFS configuration */ clearConfig(): void; /** * Get current configuration (redacted for safe display) */ getConfig(): McpIPFSConfig | undefined; hasUploadBackend(): boolean; getGatewayUrl(): string; /** * Check if Pinata JWT is configured (without exposing the value) */ hasPinataJwt(): boolean; /** * Add JSON data to IPFS and return CID */ addJson(data: Record, _name?: string): Promise; /** * Add file to IPFS and return CID */ addFile(filepath: string): Promise; /** * Add binary data to IPFS and return CID */ addBuffer(data: Uint8Array, mimeType: string, filename?: string): Promise; /** * Validate CID format (CIDv0 or CIDv1) */ private checkRateLimit; private validateCid; /** * Get JSON data from IPFS by CID */ getJson>(cid: string): Promise; /** * Add registration file to IPFS */ addRegistrationFile(registrationFile: RegistrationFile, chainId?: number, identityRegistryAddress?: string): Promise; /** * Get registration file from IPFS by CID */ getRegistrationFile(cid: string): Promise; /** * Get raw Pinata JWT for internal use (e.g., direct API calls). * Do NOT expose this value in tool responses. */ getPinataJwt(): string | undefined; private hasDirectClientConfig; private uploadJson; private uploadFile; private uploadBuffer; private uploadPinataFile; private fetchGatewayJson; private extractCidFromUploadResponse; private extractCidFromUri; private requireUploadUrl; private guessMimeType; /** * Get the underlying IPFSClient (for advanced usage) * @throws Error if not configured */ getClient(): IPFSClient; } export type { IPFSClientConfig, RegistrationFile }; //# sourceMappingURL=ipfs-service.d.ts.map