@ew-did-registry/did-s3-store
Version:
S3-based implementation of IDidStore
24 lines (23 loc) • 810 B
TypeScript
import { S3ClientConfig } from "@aws-sdk/client-s3";
import { IDidStore } from "@ew-did-registry/did-store-interface";
/**
* Implements decentralized storage in S3 Bucket
*/
export declare class DidStore implements IDidStore {
private s3;
private bucket;
constructor(bucket: string, s3Config: S3ClientConfig);
private computeCid;
/**
* @param claim stringified content
*/
save(claim: string): Promise<string>;
/**
* Looks up content identified by `cid`. If no content found during `timeout`, then `ContentNotFound` error is thrown.
* @param cid CID of the content
* @param timeout time limit for getting response, milliseconds
* @returns stringified content
*/
get(uri: string): Promise<string>;
delete(uri: string): Promise<boolean>;
}