Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

@arcblock/vc

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/vc - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

@@ -6,10 +6,10 @@ /**

* @requires @arcblock/did
* @requires @arcblock/forge-util
* @requires @ocap/util
*/
const stringify = require('json-stable-stringify');
const cloneDeep = require('lodash/cloneDeep');
const { types } = require('@arcblock/mcrypto');
const { fromPublicKey } = require('@arcblock/forge-wallet');
const { types } = require('@ocap/mcrypto');
const { fromPublicKey } = require('@ocap/wallet');
const { toTypeInfo, isValid, isFromPublicKey, fromPublicKeyHash } = require('@arcblock/did');
const { toBase58, toBase64, fromBase64, fromBase58 } = require('@arcblock/forge-util');
const { toBase58, toBase64, fromBase64, fromBase58 } = require('@ocap/util');

@@ -58,3 +58,3 @@ // eslint-disable-next-line

// The { pk, hash } type should be same as issuer, role type must be `ROLE_VC`
const vcType = Object.assign({}, typeInfo, { role: types.RoleType.ROLE_VC });
const vcType = { ...typeInfo, role: types.RoleType.ROLE_VC };
const vcDid = fromPublicKeyHash(wallet.hash(stringify(subject)), vcType);

@@ -92,3 +92,3 @@

// NOTE: we should be able to verify the vc before return
const result = Object.assign({ proof }, vcObj);
const result = { proof, ...vcObj };

@@ -146,3 +146,3 @@ debug('create', result);

const issuers = Array.isArray(trustedIssuers) ? trustedIssuers : [trustedIssuers];
const issuerDid = issuers.find(x => x === vc.issuer.id);
const issuerDid = issuers.find((x) => x === vc.issuer.id);
if (!issuerDid) {

@@ -203,5 +203,5 @@ throw new Error('Verifiable credential not issued by trusted issuers');

vcList.forEach(vcStr => {
vcList.forEach((vcStr) => {
const vcObj = JSON.parse(vcStr);
const proof = proofList.find(x => isFromPublicKey(vcObj.credentialSubject.id, x.pk));
const proof = proofList.find((x) => isFromPublicKey(vcObj.credentialSubject.id, x.pk));

@@ -208,0 +208,0 @@ if (!proof) {

{
"name": "@arcblock/vc",
"version": "1.6.0",
"version": "1.6.1",
"description": "Javascript lib to work with ArcBlock Verifiable Credentials",

@@ -20,3 +20,3 @@ "keywords": [

},
"homepage": "https://github.com/ArcBlock/forge-js/tree/master/did/vc",
"homepage": "https://github.com/ArcBlock/ocap-js/tree/master/did/vc",
"license": "Apache-2.0",

@@ -32,3 +32,3 @@ "main": "lib/index.js",

"type": "git",
"url": "git+https://github.com/ArcBlock/forge-js.git"
"url": "git+https://github.com/ArcBlock/ocap-js.git"
},

@@ -38,20 +38,18 @@ "scripts": {

"lint:fix": "eslint --fix tests lib",
"docs": "yarn generate-dts && yarn generate-docs && yarn cleanup-docs && yarn format-docs",
"docs": "yarn gen-dts && yarn gen-docs && yarn cleanup-docs && yarn format-docs",
"cleanup-docs": "node ../../tools/cleanup-docs.js docs/README.md $npm_package_name",
"generate-docs": "jsdoc2md lib/index.js > docs/README.md",
"generate-dts": "j2d lib/index.js",
"gen-docs": "jsdoc2md lib/index.js > docs/README.md",
"gen-dts": "j2d lib/index.js",
"format-docs": "remark . -o",
"precommit": "CI=1 yarn test",
"prepush": "CI=1 yarn test",
"test": "yarn lint && node tools/jest.js",
"coverage": "yarn lint && yarn test -- --coverage"
"test": "node tools/jest.js",
"coverage": "yarn test -- --coverage"
},
"bugs": {
"url": "https://github.com/ArcBlock/forge-js/issues"
"url": "https://github.com/ArcBlock/ocap-js/issues"
},
"dependencies": {
"@arcblock/did": "^1.6.0",
"@arcblock/forge-util": "^1.6.0",
"@arcblock/forge-wallet": "^1.6.0",
"@arcblock/mcrypto": "^1.6.0",
"@arcblock/did": "^1.6.1",
"@ocap/mcrypto": "^1.6.1",
"@ocap/util": "^1.6.1",
"@ocap/wallet": "^1.6.1",
"debug": "^4.3.1",

@@ -61,3 +59,3 @@ "json-stable-stringify": "^1.0.1",

},
"gitHead": "d57fa0e7110d95e971729e38cef41d7d5c477f90"
"gitHead": "c07e321ce16f899909f51eb7345456e3e133db49"
}

@@ -9,3 +9,2 @@ ![Verifiable Credentials](https://www.arcblock.io/.netlify/functions/badge/?text=Verifiable+Credentials)

## Usage

@@ -41,5 +40,4 @@

## Documentation
For full documentation, checkout [https://forge-js.netlify.com](https://forge-js.netlify.com/)
For full documentation, checkout [https://ocap-js.netlify.com](https://ocap-js.netlify.com/)