UNPKG

@storacha/encrypt-upload-client

Version:

Client for upload and download encrypted files

44 lines 1.88 kB
/** @implements {Type.EncryptedClient} */ export class EncryptedClient implements Type.EncryptedClient { /** * @param {import('@storacha/client').Client} storachaClient * @param {Type.CryptoAdapter} cryptoAdapter * @param {URL} gatewayURL */ constructor(storachaClient: import("@storacha/client").Client, cryptoAdapter: Type.CryptoAdapter, gatewayURL: URL); /** * @type {Type.CryptoAdapter} * @protected */ protected _cryptoAdapter: Type.CryptoAdapter; /** * @type {import('@storacha/client').Client} * @protected */ protected _storachaClient: import("@storacha/client").Client; /** * @type {URL} * @protected */ protected _gatewayURL: URL; /** * Encrypt and upload a file to the Storacha network * * @param {Type.BlobLike} file - The file to upload * @param {Type.EncryptionConfig} encryptionConfig - User-provided encryption configuration * @param {Type.UploadOptions} [uploadOptions] - User-provided upload options * @returns {Promise<Type.AnyLink>} - The link to the uploaded file */ encryptAndUploadFile(file: Type.BlobLike, encryptionConfig: Type.EncryptionConfig, uploadOptions?: Type.UploadOptions): Promise<Type.AnyLink>; /** * Retrieve and decrypt a file from the Storacha network * * @param {Type.AnyLink} cid - The link to the file to retrieve * @param {Type.DecryptionConfig} decryptionConfig - User-provided decryption config * @returns {Promise<Type.DecryptionResult>} - The decrypted file with metadata */ retrieveAndDecryptFile(cid: Type.AnyLink, decryptionConfig: Type.DecryptionConfig): Promise<Type.DecryptionResult>; } export function create(options: Type.EncryptedClientOptions): Promise<EncryptedClient>; import * as Type from '../types.js'; //# sourceMappingURL=client.d.ts.map