import { LogTypes, StorageTypes } from '@requestnetwork/types'; export type IpfsOptions = { ipfsUrl?: string; ipfsTimeout?: number; ipfsErrorHandling?: StorageTypes.IIpfsErrorHandlingConfiguration; logger?: LogTypes.ILogger; }; /** * Manages Ipfs communication used as storage */ export default class IpfsManager { private readonly logger; private readonly httpOptions; private readonly ipfsErrorHandling; readonly BASE_PATH: string; /** * Constructor * @param options.ipfsConnection Object to connect to the ipfs gateway * If no values are provided default values from config are used * Private network is used for default values */ constructor(options?: IpfsOptions); private ipfs; /** * Get the IPFS node ID * @returns Promise resolving the node ID data */ getIpfsNodeId(): Promise; /** * Add the content to ipfs and return ipfs hash * @param content Content to add to ipfs * @returns Promise resolving the hash of the new added content */ add(content: string): Promise; /** * Pin content on ipfs node from its hash * @param hashes Array of hashes of the content * @param [timeout] An optional timeout for the IPFS pin request * @returns Promise resolving the hash pinned after pinning the content */ pin(hashes: string[], timeout?: number): Promise; /** * Get the size of a content from ipfs from its hash * @param hash Hash of the content * @returns Promise resolving size of the content */ getContentLength(hash: string): Promise; /** * Get the list of the bootstrap nodes * @returns Promise resolving an array of the bootstrap nodes */ getBootstrapList(): Promise; /** * Gets current configuration * * @return the current configuration attributes */ getConfig(): Promise; } //# sourceMappingURL=ipfs-manager.d.ts.map