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

@arcblock/vc

Package Overview
Dependencies
Maintainers
4
Versions
491
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/vc - npm Package Compare versions

Comparing version 1.10.16 to 1.10.17

23

lib/index.js

@@ -8,2 +8,3 @@ /**

*/
const isAbsoluteUrl = require('is-absolute-url');
const stringify = require('json-stable-stringify');

@@ -34,5 +35,7 @@ const cloneDeep = require('lodash/cloneDeep');

* @param {Date} params.expirationDate
* @param {String} params.endpoint - Status endpoint url
* @param {String} params.endpointScope - Endpoint scope, either be public or private
* @returns {object}
*/
function create({ type, subject, issuer, issuanceDate, expirationDate }) {
function create({ type, subject, issuer, issuanceDate, expirationDate, endpoint = '', endpointScope = 'public' }) {
if (!type) {

@@ -55,2 +58,10 @@ throw new Error('Can not create verifiable credential without empty type');

if (endpoint && isAbsoluteUrl(endpoint) === false) {
throw new Error('VC Endpoint must be absolute url');
}
if (endpointScope && ['public', 'private'].includes(endpointScope) === false) {
throw new Error('VC Endpoint scope must be either public or private');
}
const { wallet, name: issuerName } = issuer;

@@ -81,2 +92,10 @@ const issuerDid = wallet.toAddress();

if (endpoint) {
vcObj.credentialStatus = {
id: endpoint,
type: 'NFTStatusList2021',
scope: endpointScope || 'public',
};
}
if (!proofTypes[typeInfo.pk]) {

@@ -175,2 +194,4 @@ throw new Error('Unsupported signer type when create verifiable credential');

// TODO: support verify revoked from endpoint
return true;

@@ -177,0 +198,0 @@ }

13

package.json
{
"name": "@arcblock/vc",
"version": "1.10.16",
"version": "1.10.17",
"description": "Javascript lib to work with ArcBlock Verifiable Credentials",

@@ -48,11 +48,12 @@ "keywords": [

"dependencies": {
"@arcblock/did": "^1.10.16",
"@ocap/mcrypto": "^1.10.16",
"@ocap/util": "^1.10.16",
"@ocap/wallet": "^1.10.16",
"@arcblock/did": "^1.10.17",
"@ocap/mcrypto": "^1.10.17",
"@ocap/util": "^1.10.17",
"@ocap/wallet": "^1.10.17",
"debug": "^4.3.1",
"is-absolute-url": "^3.0.3",
"json-stable-stringify": "^1.0.1",
"lodash": "^4.17.20"
},
"gitHead": "5995d961b28d3ccf28aeb17f1f92cf7868f155cb"
"gitHead": "09e642197e21248688bcf6456ea390b611ea48f1"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc