anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
85 lines • 2.21 kB
TypeScript
import { AgentActivity, ActivityBatch } from './types';
export interface IPFSStorageConfig {
url?: string;
encryptionKey?: Uint8Array;
pinningServices?: string[];
}
export interface StoredActivity {
ipfsHash: string;
encrypted: boolean;
timestamp: Date;
checksum: string;
}
export interface ActivityManifest {
agentDID: string;
parentDID: string;
created: Date;
lastUpdated: Date;
totalActivities: number;
ipfsHashes: string[];
encrypted: boolean;
}
export declare class IPFSActivityStorage {
private ipfs;
private encryption;
private encryptionKey?;
private manifests;
constructor(config?: IPFSStorageConfig);
/**
* Store a single activity to IPFS
*/
storeActivity(activity: AgentActivity): Promise<StoredActivity>;
/**
* Store a batch of activities
*/
storeActivityBatch(batch: ActivityBatch): Promise<StoredActivity>;
/**
* Retrieve an activity from IPFS
*/
retrieveActivity(ipfsHash: string): Promise<AgentActivity>;
/**
* Retrieve a batch of activities
*/
retrieveActivityBatch(ipfsHash: string): Promise<ActivityBatch>;
/**
* Pin an activity to ensure it stays available
*/
pinActivity(ipfsHash: string): Promise<void>;
/**
* Unpin an activity (for cleanup/archival)
*/
unpinActivity(ipfsHash: string): Promise<void>;
/**
* Get all pinned activities
*/
getPinnedActivities(): Promise<string[]>;
/**
* Update the manifest for an agent
*/
private updateManifest;
/**
* Store manifest to IPFS
*/
private storeManifest;
/**
* Get manifest for an agent
*/
getManifest(agentDID: string, parentDID: string): Promise<ActivityManifest | null>;
/**
* Get storage statistics
*/
getStorageStats(): Promise<{
totalPinned: number;
totalSize: number;
manifests: number;
}>;
/**
* Check if IPFS node is connected
*/
isConnected(): Promise<boolean>;
/**
* Set or update encryption key
*/
setEncryptionKey(key: Uint8Array): void;
}
//# sourceMappingURL=ipfs-activity-storage.d.ts.map