Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 61cdfbd

Browse files
committed
Update dependencies
1 parent 52ff33f commit 61cdfbd

File tree

11 files changed

+4188
-2833
lines changed

11 files changed

+4188
-2833
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = function(config) {
22
config.set({
33
frameworks: ['mocha', 'karma-typescript'],
4-
files: ['src/**/*.ts', 'test/**/*.ts'],
4+
files: ['src/**/*.ts', 'test/**/*.spec.ts'],
55
preprocessors: {
66
'**/*.ts': ['karma-typescript'],
77
},

package-lock.json

Lines changed: 3991 additions & 2642 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,49 @@
1010
"dist",
1111
"dist.browser"
1212
],
13+
"homepage": "https://github.com/ethereumjs/ethereumjs-wallet",
14+
"dependencies": {
15+
"@ethereumjs/util": "^8.0.0-beta.1",
16+
"@scure/base": "^1.1.1",
17+
"ethereum-cryptography": "^1.1.0",
18+
"js-md5": "0.7.3",
19+
"uuid": "8.3.2"
20+
},
21+
"devDependencies": {
22+
"@ethereumjs/config-coverage": "^2.0.0",
23+
"@ethereumjs/config-typescript": "^2.0.0",
24+
"@ethereumjs/eslint-config-defaults": "^2.0.0",
25+
"@types/js-md5": "^0.4.3",
26+
"@types/lodash.zip": "4.2.7",
27+
"@types/mocha": "9.1.1",
28+
"@types/node": "18.0.0",
29+
"ethers": "5.6.9",
30+
"husky": "4.2.5",
31+
"karma": "6.4.0",
32+
"karma-chrome-launcher": "3.1.1",
33+
"karma-firefox-launcher": "2.1.2",
34+
"karma-mocha": "2.0.1",
35+
"karma-typescript": "5.5.3",
36+
"lodash.zip": "4.2.0",
37+
"mocha": "10.0.0",
38+
"nyc": "15.1.0",
39+
"prettier": "2.6.2",
40+
"ts-node": "10.9.1",
41+
"typedoc": "0.23.9",
42+
"typedoc-plugin-markdown": "3.13.4",
43+
"typescript": "4.7.3"
44+
},
1345
"scripts": {
1446
"postinstall": "npm run build",
15-
"build": "tsc -p ./tsconfig.prod.json && tsc -p tsconfig.browser.json",
47+
"build": "tsc -p tsconfig.prod.json",
1648
"prepublishOnly": "npm run lint && npm run build && npm run test",
1749
"docs:build": "typedoc --out docs --mode file --readme none --theme markdown --mdEngine github --excludeNotExported src",
1850
"coverage": "npm run build && nyc --reporter=lcov npm run test:unit",
19-
"tsc": "tsc -p ./tsconfig.prod.json --noEmit",
51+
"tsc": "tsc -p tsconfig.prod.json --noEmit",
2052
"lint": "ethereumjs-config-lint",
2153
"lint:fix": "ethereumjs-config-lint-fix",
2254
"test": "npm run test:unit && npm run test:browser",
23-
"test:unit": "mocha --require ts-node/register ./test/**/*.ts",
55+
"test:unit": "mocha --require ts-node/register ./test/**/*.spec.ts",
2456
"test:browser": "karma start karma.conf.js"
2557
},
2658
"husky": {
@@ -41,40 +73,5 @@
4173
"license": "MIT",
4274
"bugs": {
4375
"url": "https://github.com/ethereumjs/ethereumjs-wallet/issues"
44-
},
45-
"homepage": "https://github.com/ethereumjs/ethereumjs-wallet",
46-
"dependencies": {
47-
"aes-js": "^3.1.2",
48-
"bs58check": "^2.1.2",
49-
"ethereum-cryptography": "^0.1.3",
50-
"ethereumjs-util": "^7.1.2",
51-
"randombytes": "^2.1.0",
52-
"scrypt-js": "^3.0.1",
53-
"utf8": "^3.0.0",
54-
"uuid": "^8.3.2"
55-
},
56-
"devDependencies": {
57-
"@ethereumjs/eslint-config-defaults": "^2.0.0",
58-
"@ethereumjs/config-coverage": "^2.0.0",
59-
"@ethereumjs/config-typescript": "^2.0.0",
60-
"@types/bn.js": "^5.1.0",
61-
"@types/lodash.zip": "^4.2.6",
62-
"@types/mocha": "^9.0.0",
63-
"@types/node": "^12.0.10",
64-
"ethers": "^4.0.33",
65-
"husky": "^4.2.5",
66-
"karma": "^6.3.4",
67-
"karma-chrome-launcher": "^3.1.0",
68-
"karma-firefox-launcher": "^2.1.1",
69-
"karma-mocha": "^2.0.1",
70-
"karma-typescript": "^5.5.2",
71-
"lodash.zip": "^4.2.0",
72-
"mocha": "^9.1.2",
73-
"nyc": "^15.1.0",
74-
"prettier": "^2.4.1",
75-
"ts-node": "^10.2.1",
76-
"typedoc": "^0.22.5",
77-
"typedoc-plugin-markdown": "^3.11.3",
78-
"typescript": "^4.4.3"
7976
}
8077
}

src/hdkey.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import Wallet from './index'
2-
31
import { HDKey } from 'ethereum-cryptography/hdkey'
2+
import Wallet from './index'
43

54
export default class EthereumHDKey {
65
/**
@@ -20,22 +19,24 @@ export default class EthereumHDKey {
2019
return new EthereumHDKey(HDKey.fromExtendedKey(base58Key))
2120
}
2221

23-
constructor(private readonly _hdkey?: any) {}
22+
constructor(private readonly _hdkey: HDKey) {}
2423

2524
/**
2625
* Returns a BIP32 extended private key (xprv)
2726
*/
28-
public privateExtendedKey(): Buffer {
27+
public privateExtendedKey(): string {
2928
if (!this._hdkey.privateExtendedKey) {
3029
throw new Error('This is a public key only wallet')
3130
}
31+
// return Buffer.from(this._hdkey.privateExtendedKey, 'hex')
3232
return this._hdkey.privateExtendedKey
3333
}
3434

3535
/**
3636
* Return a BIP32 extended public key (xpub)
3737
*/
38-
public publicExtendedKey(): Buffer {
38+
public publicExtendedKey(): string {
39+
// return Buffer.from(this._hdkey.publicExtendedKey, 'hex')
3940
return this._hdkey.publicExtendedKey
4041
}
4142

@@ -57,9 +58,10 @@ export default class EthereumHDKey {
5758
* Return a `Wallet` instance as seen above
5859
*/
5960
public getWallet(): Wallet {
60-
if (this._hdkey._privateKey) {
61-
return Wallet.fromPrivateKey(this._hdkey._privateKey)
61+
if (this._hdkey.privateKey) {
62+
return Wallet.fromPrivateKey(Buffer.from(this._hdkey.privateKey))
6263
}
63-
return Wallet.fromPublicKey(this._hdkey._publicKey, true)
64+
if (!this._hdkey.publicKey) throw new Error('No hdkey')
65+
return Wallet.fromPublicKey(Buffer.from(this._hdkey.publicKey), true)
6466
}
6567
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy