@chainsafe/bls-keygen
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -0,1 +1,7 @@ | ||
## 0.3.0 (2020-11-06) | ||
### BREAKING CHANGES | ||
* update bls-hd-key ([0febb0](https://github.com/chainsafe/bls-keygen/commit/0febb0)) | ||
## 0.2.1 (2020-08-11) | ||
@@ -2,0 +8,0 @@ |
@@ -13,10 +13,8 @@ "use strict"; | ||
var _random = require("bcrypto/lib/random"); | ||
var _bip = require("bip39"); | ||
var _assert = _interopRequireDefault(require("assert")); | ||
var _buffer = require("buffer"); | ||
var _randombytes = _interopRequireDefault(require("randombytes")); | ||
var _blsHdKey = require("@chainsafe/bls-hd-key"); | ||
@@ -31,3 +29,3 @@ | ||
function generateRandomSecretKey(entropy) { | ||
let ikm = (0, _random.randomBytes)(32); | ||
let ikm = (0, _randombytes.default)(32); | ||
@@ -48,3 +46,5 @@ if (entropy) { | ||
function deriveKeyFromMnemonic(mnemonic, path) { | ||
(0, _assert.default)((0, _bip.validateMnemonic)(mnemonic), "invalid mnemonic"); | ||
if (!(0, _bip.validateMnemonic)(mnemonic)) { | ||
throw new Error("invalid mnemonic"); | ||
} | ||
@@ -51,0 +51,0 @@ const ikm = _buffer.Buffer.from((0, _bip.mnemonicToSeedSync)(mnemonic)); |
{ | ||
"name": "@chainsafe/bls-keygen", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Typescript key management tool that works in the browser", | ||
@@ -40,2 +40,3 @@ "main": "lib/index.js", | ||
"@types/node": "^12.0.10", | ||
"@types/randombytes": "^2.0.0", | ||
"@typescript-eslint/eslint-plugin": "^1.3.0", | ||
@@ -60,8 +61,7 @@ "@typescript-eslint/parser": "^1.3.0", | ||
"dependencies": { | ||
"@chainsafe/bls-hd-key": "^0.1.0", | ||
"assert": "^2.0.0", | ||
"bcrypto": "^5.0.4", | ||
"@chainsafe/bls-hd-key": "^0.2.0", | ||
"bip39": "^3.0.2", | ||
"buffer": "^5.4.3" | ||
"buffer": "^5.4.3", | ||
"randombytes": "^2.1.0" | ||
} | ||
} |
@@ -1,5 +0,4 @@ | ||
import {randomBytes} from "bcrypto/lib/random"; | ||
import {mnemonicToSeedSync, validateMnemonic} from "bip39"; | ||
import assert from "assert"; | ||
import {Buffer} from "buffer"; | ||
import randomBytes from "randombytes"; | ||
import {deriveChildSKMultiple, deriveMasterSK, pathToIndices} from "@chainsafe/bls-hd-key"; | ||
@@ -25,3 +24,5 @@ | ||
export function deriveKeyFromMnemonic(mnemonic: string, path?: string): Buffer { | ||
assert(validateMnemonic(mnemonic), "invalid mnemonic"); | ||
if(!validateMnemonic(mnemonic)) { | ||
throw new Error("invalid mnemonic"); | ||
} | ||
const ikm = Buffer.from(mnemonicToSeedSync(mnemonic)); | ||
@@ -28,0 +29,0 @@ return deriveKeyFromEntropy(ikm, path); |
@@ -42,6 +42,2 @@ { | ||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ | ||
"typeRoots": [ | ||
"./node_modules/@types", | ||
"./src/@types" | ||
], /* List of folders to include type definitions from. */ | ||
// "types": [], /* Type declaration files to be included in compilation. */ | ||
@@ -65,2 +61,2 @@ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
4
40319
27
21
438
+ Addedrandombytes@^2.1.0
+ Added@chainsafe/bls-hd-key@0.2.1(transitive)
+ Addedrandombytes@2.1.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
- Removedassert@^2.0.0
- Removedbcrypto@^5.0.4
- Removed@chainsafe/bls-hd-key@0.1.0(transitive)
Updated@chainsafe/bls-hd-key@^0.2.0