@keypo/synapse-storage-sdk
Version:
TypeScript SDK for encrypted file storage on Filecoin via Synapse
55 lines • 1.93 kB
TypeScript
/**
* Main SDK class for Synapse Storage operations
*/
import type { Synapse } from '@filoz/synapse-sdk';
import type { SDKConfig, UploadOptions, UploadResult, DownloadOptions, DownloadResult, BalanceInfo, ShareOptions, DeleteOptions, DeleteResult, ListOptions, ListPublicOptions, FileListEntry } from './types/index.js';
/**
* Main SDK class for encrypted file storage on Filecoin via Synapse
*/
export declare class SynapseStorageSDK {
private synapse;
private config;
private encryption?;
private contracts?;
private storage;
private privateKey?;
constructor(synapse: Synapse, config: SDKConfig, privateKey?: string);
/**
* Upload a file to Filecoin with optional encryption
*/
upload(data: Uint8Array, options?: UploadOptions): Promise<UploadResult>;
/**
* Download a file from Filecoin and optionally decrypt it
*/
download(pieceCid: string, options?: DownloadOptions): Promise<DownloadResult>;
/**
* Share a file with another user using piece CID
*/
share(pieceCid: string, options: ShareOptions): Promise<void>;
/**
* Delete a file by piece CID (removes from permissions registry)
* Note: File data remains on Filecoin but access is revoked
*/
delete(pieceCid: string, options?: DeleteOptions): Promise<DeleteResult>;
/**
* Check wallet and Synapse balances
*/
checkBalance(): Promise<BalanceInfo>;
/**
* Deposit USDFC to Synapse
*/
deposit(amount: number): Promise<void>;
/**
* List all encrypted files for the current wallet address
*/
list(options?: ListOptions): Promise<FileListEntry[]>;
/**
* List all public encrypted files from all users
*/
listPublic(options?: ListPublicOptions): Promise<FileListEntry[]>;
/**
* Clean up SDK resources
*/
cleanup(): Promise<void>;
}
//# sourceMappingURL=SynapseStorageSDK.d.ts.map