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

Commit 20171a9

Browse files
authored
Merge pull request #109 from dmihal/export-modules
Fix deep-imports, export modules from index.ts
2 parents 98a1409 + 1b0f418 commit 20171a9

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Note: `getPublicKey()` only returns uncompressed Ethereum-style public keys.
6161

6262
Importing various third party wallets is possible through the `thirdparty` submodule:
6363

64-
`var thirdparty = require('ethereumjs-wallet/thirdparty')`
64+
`const { thirdparty } = require('ethereumjs-wallet')`
6565

6666
Constructors:
6767

@@ -74,7 +74,7 @@ Constructors:
7474

7575
To use BIP32 HD wallets, first include the `hdkey` submodule:
7676

77-
`var hdkey = require('ethereumjs-wallet/hdkey')`
77+
`const { hdkey } = require('ethereumjs-wallet')`
7878

7979
Constructors:
8080

@@ -96,7 +96,7 @@ Instance methods:
9696
The Wallet can be easily plugged into [provider-engine](https://github.com/metamask/provider-engine) to provide signing:
9797

9898
```js
99-
const WalletSubprovider = require('ethereumjs-wallet/provider-engine')
99+
const { WalletSubprovider } = require('ethereumjs-wallet')
100100

101101
<engine>.addProvider(new WalletSubprovider(<wallet instance>))
102102
```

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"ts-node": "^8.3.0",
7373
"tslint": "^5.12.0",
7474
"typescript": "^3.2.2",
75-
"typestrict": "^1.0.2"
75+
"typestrict": "^1.0.2",
76+
"web3-provider-engine": "^15.0.7"
7677
}
7778
}

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import * as crypto from 'crypto'
22
import * as ethUtil from 'ethereumjs-util'
33

4+
export { default as hdkey } from './hdkey'
5+
export { default as WalletSubprovider } from './provider-engine'
6+
export { default as thirdparty } from './thirdparty'
7+
48
const bs58check = require('bs58check')
59
const randomBytes = require('randombytes')
610
const scryptsy = require('@web3-js/scrypt-shim')

0 commit comments

Comments
 (0)