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

Commit ac5ba8a

Browse files
committed
Fix imports in the README file
1 parent f90caf1 commit ac5ba8a

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,34 @@ Features not supported:
3030

3131
For information about the Wallet's API, please go to [./docs/classes/wallet.md](./docs/classes/wallet.md).
3232

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+
3347
## Thirdparty API
3448

3549
Importing various third party wallets is possible through the `thirdparty` submodule:
3650

3751
Node.js / ES5:
3852

3953
```js
40-
const thirdparty = require('ethereumjs-wallet/thirdparty').default
54+
const { thirdparty } = require('ethereumjs-wallet')
4155
```
4256

4357
ESM / TypeScript:
4458

4559
```js
46-
import thirdparty from 'ethereumjs-wallet/thirdparty'
60+
import { thirdparty } from 'ethereumjs-wallet'
4761
```
4862

4963
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:
5569
Node.js / ES5:
5670

5771
```js
58-
const hdkey = require('ethereumjs-wallet/hdkey').default
72+
const { hdkey } = require('ethereumjs-wallet')
5973
```
6074

6175
ESM / TypeScript:
6276

6377
```js
64-
import hdkey from 'ethereumjs-wallet/hdkey'
78+
import { hdkey } from 'ethereumjs-wallet'
6579
```
6680

6781
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
7387
Node.js / ES5:
7488

7589
```js
76-
const WalletSubprovider = require('ethereumjs-wallet/provider-engine').default
90+
const { WalletSubprovider } = require('ethereumjs-wallet')
7791

7892
<engine>.addProvider(new WalletSubprovider(<wallet instance>))
7993
```
8094

8195
ESM / TypeScript:
8296

8397
```js
84-
import WalletSubprovider from 'ethereumjs-wallet/provider-engine'
98+
import { WalletSubprovider } from 'ethereumjs-wallet'
8599

86100
<engine>.addProvider(new WalletSubprovider(<wallet instance>))
87101
```

0 commit comments

Comments
 (0)