This sdk is an implementation of proposed DID framework by the W3C Credential Community Group
git submodule update --init --recursive
cd libs/vc-js && npm i && cd -
npm i
npm run build
npm run test
Install
npm i hs-ssi-sdk --save
Use
// import
import HypersignSsiSDK from 'hs-ssi-sdk';
// initialise
const hsSdk = new HypersignSsiSDK(
{ nodeUrl: "http://localhost:5000" } // Hypersign node url
);
const { did, schema, credential } = hsSdk;
didUrl: string;
generateKeys(): object;
getDidDocAndKeys(user: object): Promise<any>;
getDid(options: IDIDOptions): Promise<any>;
register(didDoc: object): Promise<any>;
resolve(did: string): Promise<any>;
verify(params: IParams): Promise<any>;
sign(params: IParams): Promise<any>;
schemaUrl: string;
generateSchema({ name, author, description, properties }: ISchema): Promise<ISchemaTemplate>;
registerSchema(schema: ISchemaTemplate): Promise<any>;
getSchema(options: {schemaId?: string, author?: string}): Promise<any>;
generateCredential(schemaUrl, params: { subjectDid, issuerDid, expirationDate, attributesMap: Object }): Promise<any>;
signCredential(credential, issuerDid, privateKey): Promise<any>;
verifyCredential(credential: object, issuerDid: string): Promise<any>;
generatePresentation(verifiableCredential, holderDid): Promise<any> ;
signPresentation(presentation, holderDid, privateKey, challenge): Promise<any>
verifyPresentation({ presentation, challenge, domain, issuerDid, holderDid }) : Promise<any>
This sdk is in highly under development. In case you find any bug, kindly report it ASAP. Thank You!