@keypo/synapse-storage-sdk
Version:
TypeScript SDK for encrypted file storage on Filecoin via Synapse
62 lines • 1.79 kB
TypeScript
/**
* Lit Protocol encryption module for Synapse Storage SDK
*/
import type { DataMetadata, EncryptedPayload } from '../../types/index.js';
export interface EncryptionConfig {
privateKey: string;
registryAddress: string;
validationAddress: string;
bundlerRpcUrl: string;
}
export declare const TIME: {
/** Milliseconds in one second */
readonly SECOND_MS: 1000;
/** Milliseconds in one minute */
readonly MINUTE_MS: number;
/** Milliseconds in one hour */
readonly HOUR_MS: number;
/** Milliseconds in one day */
readonly DAY_MS: number;
/** Timestamp conversion factor (seconds to milliseconds) */
readonly TIMESTAMP_TO_MS: 1000;
};
export declare const AUTH_EXPIRATION: {
/** Default auth expiration time (24 hours in milliseconds) */
readonly DEFAULT_MS: number;
};
export declare class LitEncryption {
private config;
private litClient;
private account;
private authManager;
constructor(config: EncryptionConfig);
/**
* Initialize Lit Protocol client
*/
private initializeLitClient;
/**
* Get or create account from private key
*/
private getAccount;
/**
* Create authentication context for Lit Protocol operations
*/
private createAuthContext;
/**
* Create access control conditions for the encrypted data
*/
private createAccessControlConditions;
/**
* Encrypt data with Lit Protocol
*/
encrypt(data: Uint8Array, metadata: DataMetadata): Promise<EncryptedPayload>;
/**
* Decrypt data with Lit Protocol
*/
decrypt(encryptedPayload: EncryptedPayload): Promise<Uint8Array>;
/**
* Clean up resources
*/
cleanup(): Promise<void>;
}
//# sourceMappingURL=LitEncryption.d.ts.map