UNPKG

734 BTypeScriptView Raw
1import { type Client } from '../client';
2export declare enum IpfsContentFormat {
3 FormData = "formdata",
4 ArrayBuffer = "arraybuffer",
5 Blob = "blob",
6 Text = "text",
7 JSON = "json"
8}
9export declare class IpfsService {
10 private readonly client;
11 constructor(client: Client);
12 upload: (obj: object) => Promise<any>;
13 /**
14 * Get IPFS Content in JSON, without caching, to be in getIpfsContent.
15 * @param {string} hash - hash of the IPFS content you want to fetch
16 * @param {IpfsContentFormat} format - format of the content you are fetching,
17 * @returns content of the ipfs hash in your preferred format
18 */
19 fetch: (hash: string, ipfsContentForm?: IpfsContentFormat) => Promise<any>;
20}