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

@transmute/did-key-bls12381

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@transmute/did-key-bls12381 - npm Package Compare versions

Comparing version 0.2.1-unstable.3 to 0.2.1-unstable.4

dist/Bls12381G2KeyPair.d.ts

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## 0.2.1-unstable.4 (2020-08-01)
**Note:** Version bump only for package @transmute/did-key-bls12381
## 0.2.1-unstable.3 (2020-07-29)

@@ -8,0 +16,0 @@

63

dist/did-key-bls12381.cjs.development.js

@@ -7,4 +7,6 @@ 'use strict';

var bls12381KeyPair = require('@mattrglobal/bls12381-key-pair');
var bs58 = _interopDefault(require('bs58'));
var mattr = require('@mattrglobal/bls12381-key-pair');
var bs58 = require('bs58');
var bs58__default = _interopDefault(bs58);
var bbsSignatures = require('@mattrglobal/bbs-signatures');

@@ -23,3 +25,3 @@ var keyToDidDoc = function keyToDidDoc(bls12381Key) {

controller: did,
publicKeyBase58: bs58.encode(bls12381Key.publicKeyBuffer)
publicKeyBase58: bs58__default.encode(bls12381Key.publicKeyBuffer)
}],

@@ -45,3 +47,3 @@ authentication: [keyId],

var fingerprint = did.split('#')[0].split('did:key:').pop();
return Promise.resolve(bls12381KeyPair.Bls12381G2KeyPair.fromFingerprint({
return Promise.resolve(mattr.Bls12381G2KeyPair.fromFingerprint({
fingerprint: fingerprint

@@ -63,11 +65,50 @@ })).then(function (publicKey) {

Object.keys(bls12381KeyPair).forEach(function (k) {
if (k !== 'default') Object.defineProperty(exports, k, {
enumerable: true,
get: function () {
return bls12381KeyPair[k];
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
});
});
return target;
};
return _extends.apply(this, arguments);
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
var Bls12381G2KeyPair = /*#__PURE__*/function (_mattr$Bls12381G2KeyP) {
_inheritsLoose(Bls12381G2KeyPair, _mattr$Bls12381G2KeyP);
function Bls12381G2KeyPair() {
return _mattr$Bls12381G2KeyP.apply(this, arguments) || this;
}
Bls12381G2KeyPair.generate = function generate(options) {
try {
var keyPair = bbsSignatures.generateBls12381KeyPair();
return Promise.resolve(new mattr.Bls12381G2KeyPair(_extends({}, options, {
privateKeyBase58: bs58.encode(keyPair.secretKey),
publicKeyBase58: bs58.encode(keyPair.publicKey)
})));
} catch (e) {
return Promise.reject(e);
}
};
return Bls12381G2KeyPair;
}(mattr.Bls12381G2KeyPair);
exports.Bls12381G2KeyPair = Bls12381G2KeyPair;
exports.driver = driver;
//# sourceMappingURL=did-key-bls12381.cjs.development.js.map

2

dist/did-key-bls12381.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("@mattrglobal/bls12381-key-pair"),t=(e=require("bs58"))&&"object"==typeof e&&"default"in e?e.default:e,i=function(e){var r="did:key:"+e.fingerprint(),i="#"+e.fingerprint();return{"@context":["https://www.w3.org/ns/did/v1",{"@base":r}],id:r,publicKey:[{id:i,type:e.type,controller:r,publicKeyBase58:t.encode(e.publicKeyBuffer)}],authentication:[i],assertionMethod:[i],capabilityDelegation:[i],capabilityInvocation:[i]}},n={__proto__:null,keyToDidDoc:i,get:function(e){var t=void 0===e?{}:e,n=t.did,o=t.url;try{if(!(n=n||o))throw new TypeError('"did" must be a string.');var a=n.split("#")[0].split("did:key:").pop();return Promise.resolve(r.Bls12381G2KeyPair.fromFingerprint({fingerprint:a})).then((function(e){return i(e)}))}catch(e){return Promise.reject(e)}}};Object.keys(r).forEach((function(e){"default"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})})),exports.driver=n;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("@mattrglobal/bls12381-key-pair"),t=require("bs58"),i=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("@mattrglobal/bbs-signatures"),o=function(e){var r="did:key:"+e.fingerprint(),t="#"+e.fingerprint();return{"@context":["https://www.w3.org/ns/did/v1",{"@base":r}],id:r,publicKey:[{id:t,type:e.type,controller:r,publicKeyBase58:i.encode(e.publicKeyBuffer)}],authentication:[t],assertionMethod:[t],capabilityDelegation:[t],capabilityInvocation:[t]}},a={__proto__:null,keyToDidDoc:o,get:function(e){var t=void 0===e?{}:e,i=t.did,n=t.url;try{if(!(i=i||n))throw new TypeError('"did" must be a string.');var a=i.split("#")[0].split("did:key:").pop();return Promise.resolve(r.Bls12381G2KeyPair.fromFingerprint({fingerprint:a})).then((function(e){return o(e)}))}catch(e){return Promise.reject(e)}}};function s(){return(s=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}exports.Bls12381G2KeyPair=function(e){var i,o;function a(){return e.apply(this,arguments)||this}return o=e,(i=a).prototype=Object.create(o.prototype),i.prototype.constructor=i,i.__proto__=o,a.generate=function(e){try{var i=n.generateBls12381KeyPair();return Promise.resolve(new r.Bls12381G2KeyPair(s({},e,{privateKeyBase58:t.encode(i.secretKey),publicKeyBase58:t.encode(i.publicKey)})))}catch(e){return Promise.reject(e)}},a}(r.Bls12381G2KeyPair),exports.driver=a;
//# sourceMappingURL=did-key-bls12381.cjs.production.min.js.map

@@ -1,4 +0,4 @@

import { Bls12381G2KeyPair } from '@mattrglobal/bls12381-key-pair';
export * from '@mattrglobal/bls12381-key-pair';
import bs58 from 'bs58';
import { Bls12381G2KeyPair as Bls12381G2KeyPair$1 } from '@mattrglobal/bls12381-key-pair';
import bs58__default, { encode } from 'bs58';
import { generateBls12381KeyPair } from '@mattrglobal/bbs-signatures';

@@ -17,3 +17,3 @@ var keyToDidDoc = function keyToDidDoc(bls12381Key) {

controller: did,
publicKeyBase58: bs58.encode(bls12381Key.publicKeyBuffer)
publicKeyBase58: bs58__default.encode(bls12381Key.publicKeyBuffer)
}],

@@ -39,3 +39,3 @@ authentication: [keyId],

var fingerprint = did.split('#')[0].split('did:key:').pop();
return Promise.resolve(Bls12381G2KeyPair.fromFingerprint({
return Promise.resolve(Bls12381G2KeyPair$1.fromFingerprint({
fingerprint: fingerprint

@@ -57,3 +57,49 @@ })).then(function (publicKey) {

export { driver };
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
var Bls12381G2KeyPair = /*#__PURE__*/function (_mattr$Bls12381G2KeyP) {
_inheritsLoose(Bls12381G2KeyPair, _mattr$Bls12381G2KeyP);
function Bls12381G2KeyPair() {
return _mattr$Bls12381G2KeyP.apply(this, arguments) || this;
}
Bls12381G2KeyPair.generate = function generate(options) {
try {
var keyPair = generateBls12381KeyPair();
return Promise.resolve(new Bls12381G2KeyPair$1(_extends({}, options, {
privateKeyBase58: encode(keyPair.secretKey),
publicKeyBase58: encode(keyPair.publicKey)
})));
} catch (e) {
return Promise.reject(e);
}
};
return Bls12381G2KeyPair;
}(Bls12381G2KeyPair$1);
export { Bls12381G2KeyPair, driver };
//# sourceMappingURL=did-key-bls12381.esm.js.map
import * as driver from './driver';
export * from '@mattrglobal/bls12381-key-pair';
export * from './Bls12381G2KeyPair';
export { driver };

@@ -5,3 +5,3 @@ {

"module": "dist/bls12381.esm.js",
"version": "0.2.1-unstable.3",
"version": "0.2.1-unstable.4",
"license": "Apache-2.0",

@@ -39,6 +39,7 @@ "main": "dist/index.js",

"dependencies": {
"@mattrglobal/bbs-signatures": "^0.3.0",
"@mattrglobal/bls12381-key-pair": "^0.3.1-unstable.046a371",
"bs58": "^4.0.1"
},
"gitHead": "713cbd19a034f221e0ee937d1fb86d2323961dd1"
"gitHead": "a208be7f81f30c9233aa533832cc3c8aead930a7"
}
import * as driver from './driver';
export * from '@mattrglobal/bls12381-key-pair';
export * from './Bls12381G2KeyPair';
export { driver };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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