Skip to content

Commit

Permalink
Updating anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
dmelosantos committed Jan 21, 2019
1 parent ebd6a5b commit 5fc93e5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
30 changes: 22 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@identity.com/credential-commons",
"version": "0.2.33",
"version": "0.2.34",
"author": "Identity.com Community",
"license": "MIT",
"description": "Verifiable Credential and Attestation Library",
Expand Down
16 changes: 15 additions & 1 deletion src/creds/VerifiableCredential.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,24 @@ function VerifiableCredentialBaseConstructor(identifier, issuer, expiryIn, ucas,
* Request that this credential MerkleRoot is anchored on the Blockchain.
* This will return a _temporary_ anchor meaning that the blockchain entry is still not confirmed.
* @param {*} options
*
* @param options options to be passed
* @param options.subject the local signed subject with the user private key
* @param options.subject.label a short description of the subject
* @param options.subject.data hash of the merkle root
* @param options.subject.pub xpub of the signing private key
* @param options.subject.signature the value of the signature of the private key
* @param options.network testnet for test env, bitcoin for production
* @param options.cosigner object containing private and public key for cosigning
* @param options.cosigner.xpub public key of the cosigner
* @param options.cosigner.xprv private key of the cosigner
*
* @returns the json object containing the whole anchor attestation
*
*/
this.requestAnchor = async (options) => {
const anchorService = services.container.AnchorService;
const anchor = await anchorService.anchor(this.identifier, this.proof.merkleRoot, options);
const anchor = await anchorService.anchor(options);
this.proof.anchor = anchor;
return this;
};
Expand Down

0 comments on commit 5fc93e5

Please sign in to comment.