Pin dependencies version

pull/548/head
Yannick Huard 3 years ago
parent 5eb1f540c2
commit a2458d1f0f
  1. 10
      dist/es/create-identity.js
  2. 8
      dist/lib/create-identity.js
  3. 4
      package.json
  4. 10
      src/create-identity.js

@ -1,7 +1,7 @@
import { ethers } from 'ethers';
import { utils as ethersUtils, Wallet } from 'ethers';
import { stripHexPrefix } from 'ethereumjs-util';
var MIN_ENTROPY_SIZE = 128;
var keccak256 = ethers.utils.keccak256;
var keccak256 = ethersUtils.keccak256;
/**
* create a privateKey from the given entropy or a new one
* @param {Buffer} entropy
@ -15,8 +15,8 @@ export function createPrivateKey(entropy) {
var outerHex = keccak256(entropy);
return outerHex;
} else {
var innerHex = keccak256(ethers.utils.concat([ethers.utils.randomBytes(32), ethers.utils.randomBytes(32)]));
var middleHex = ethers.utils.concat([ethers.utils.concat([ethers.utils.randomBytes(32), innerHex]), ethers.utils.randomBytes(32)]);
var innerHex = keccak256(ethersUtils.concat([ethersUtils.randomBytes(32), ethersUtils.randomBytes(32)]));
var middleHex = ethersUtils.concat([ethersUtils.concat([ethersUtils.randomBytes(32), innerHex]), ethersUtils.randomBytes(32)]);
var _outerHex = keccak256(middleHex);
@ -31,7 +31,7 @@ export function createPrivateKey(entropy) {
export default function createIdentity(entropy) {
var privateKey = createPrivateKey(entropy);
var wallet = new ethers.Wallet(privateKey);
var wallet = new Wallet(privateKey);
var identity = {
privateKey: privateKey,
// remove trailing '0x04'

@ -11,7 +11,7 @@ var _ethers = require("ethers");
var _ethereumjsUtil = require("ethereumjs-util");
var MIN_ENTROPY_SIZE = 128;
var keccak256 = _ethers.ethers.utils.keccak256;
var keccak256 = _ethers.utils.keccak256;
/**
* create a privateKey from the given entropy or a new one
* @param {Buffer} entropy
@ -25,9 +25,9 @@ function createPrivateKey(entropy) {
var outerHex = keccak256(entropy);
return outerHex;
} else {
var innerHex = keccak256(_ethers.ethers.utils.concat([_ethers.ethers.utils.randomBytes(32), _ethers.ethers.utils.randomBytes(32)]));
var innerHex = keccak256(_ethers.utils.concat([_ethers.utils.randomBytes(32), _ethers.utils.randomBytes(32)]));
var middleHex = _ethers.ethers.utils.concat([_ethers.ethers.utils.concat([_ethers.ethers.utils.randomBytes(32), innerHex]), _ethers.ethers.utils.randomBytes(32)]);
var middleHex = _ethers.utils.concat([_ethers.utils.concat([_ethers.utils.randomBytes(32), innerHex]), _ethers.utils.randomBytes(32)]);
var _outerHex = keccak256(middleHex);
@ -43,7 +43,7 @@ function createPrivateKey(entropy) {
function createIdentity(entropy) {
var privateKey = createPrivateKey(entropy);
var wallet = new _ethers.ethers.Wallet(privateKey);
var wallet = new _ethers.Wallet(privateKey);
var identity = {
privateKey: privateKey,
// remove trailing '0x04'

@ -95,10 +95,10 @@
},
"dependencies": {
"@babel/runtime": "7.16.7",
"@ethereumjs/tx": "^3.4.0",
"@ethereumjs/tx": "3.4.0",
"@types/bn.js": "5.1.0",
"eccrypto": "1.1.6",
"ethereumjs-util": "^7.1.3",
"ethereumjs-util": "7.1.3",
"ethers": "5.5.4",
"secp256k1": "4.0.3"
}

@ -1,8 +1,8 @@
import { ethers } from 'ethers';
import { utils as ethersUtils, Wallet } from 'ethers';
import { stripHexPrefix } from 'ethereumjs-util';
const MIN_ENTROPY_SIZE = 128;
const { keccak256 } = ethers.utils;
const { keccak256 } = ethersUtils;
/**
* create a privateKey from the given entropy or a new one
@ -19,8 +19,8 @@ export function createPrivateKey(entropy) {
const outerHex = keccak256(entropy);
return outerHex;
} else {
const innerHex = keccak256(ethers.utils.concat([ethers.utils.randomBytes(32), ethers.utils.randomBytes(32)]));
const middleHex = ethers.utils.concat([ethers.utils.concat([ethers.utils.randomBytes(32), innerHex]), ethers.utils.randomBytes(32)]);
const innerHex = keccak256(ethersUtils.concat([ethersUtils.randomBytes(32), ethersUtils.randomBytes(32)]));
const middleHex = ethersUtils.concat([ethersUtils.concat([ethersUtils.randomBytes(32), innerHex]), ethersUtils.randomBytes(32)]);
const outerHex = keccak256(middleHex);
return outerHex;
}
@ -33,7 +33,7 @@ export function createPrivateKey(entropy) {
*/
export default function createIdentity(entropy) {
const privateKey = createPrivateKey(entropy);
const wallet = new ethers.Wallet(privateKey);
const wallet = new Wallet(privateKey);
const identity = {
privateKey: privateKey,
// remove trailing '0x04'

Loading…
Cancel
Save