@@ -30,20 +30,34 @@ Features not supported:
30
30
31
31
For information about the Wallet's API, please go to [ ./docs/classes/wallet.md] ( ./docs/classes/wallet.md ) .
32
32
33
+ You can import the ` Wallet ` class like this
34
+
35
+ Node.js / ES5:
36
+
37
+ ``` js
38
+ const { Wallet } = require (' ethereumjs-wallet' )
39
+ ```
40
+
41
+ ESM / TypeScript:
42
+
43
+ ``` js
44
+ import { Wallet } from ' ethereumjs-wallet'
45
+ ```
46
+
33
47
## Thirdparty API
34
48
35
49
Importing various third party wallets is possible through the ` thirdparty ` submodule:
36
50
37
51
Node.js / ES5:
38
52
39
53
``` js
40
- const thirdparty = require (' ethereumjs-wallet/thirdparty ' ). default
54
+ const { thirdparty } = require (' ethereumjs-wallet' )
41
55
```
42
56
43
57
ESM / TypeScript:
44
58
45
59
``` js
46
- import thirdparty from ' ethereumjs-wallet/thirdparty '
60
+ import { thirdparty } from ' ethereumjs-wallet'
47
61
```
48
62
49
63
Please go to [ ./docs/README.md] ( ./docs/README.md ) for more info.
@@ -55,13 +69,13 @@ To use BIP32 HD wallets, first include the `hdkey` submodule:
55
69
Node.js / ES5:
56
70
57
71
``` js
58
- const hdkey = require (' ethereumjs-wallet/hdkey ' ). default
72
+ const { hdkey } = require (' ethereumjs-wallet' )
59
73
```
60
74
61
75
ESM / TypeScript:
62
76
63
77
``` js
64
- import hdkey from ' ethereumjs-wallet/hdkey '
78
+ import { hdkey } from ' ethereumjs-wallet'
65
79
```
66
80
67
81
Please go to [ ./docs/classes/ethereumhdkey.md] ( ./docs/classes/ethereumhdkey.md ) for more info.
@@ -73,15 +87,15 @@ The Wallet can be easily plugged into [provider-engine](https://github.com/metam
73
87
Node.js / ES5:
74
88
75
89
``` js
76
- const WalletSubprovider = require (' ethereumjs-wallet/provider-engine ' ). default
90
+ const { WalletSubprovider } = require (' ethereumjs-wallet' )
77
91
78
92
< engine> .addProvider (new WalletSubprovider (< wallet instance> ))
79
93
```
80
94
81
95
ESM / TypeScript:
82
96
83
97
``` js
84
- import WalletSubprovider from ' ethereumjs-wallet/provider-engine '
98
+ import { WalletSubprovider } from ' ethereumjs-wallet'
85
99
86
100
< engine> .addProvider (new WalletSubprovider (< wallet instance> ))
87
101
```
0 commit comments