Skip to content

Commit 5c87893

Browse files
committed
add BIP-0044 path option to generate wallets from mnemonic by path
1 parent e804017 commit 5c87893

File tree

6 files changed

+2306
-2258
lines changed

6 files changed

+2306
-2258
lines changed

Diff for: .ncurc.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
format: [
3+
// 'group',
4+
'repo',
5+
'ownerChanged',
6+
],
7+
reject: [
8+
// breaking change
9+
'ethereum-cryptography',
10+
// https://github.com/jsdom/jsdom/issues/3395
11+
'jest-environment-jsdom',
12+
],
13+
};

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 6.2.0 - 2022-08-31
2+
- add `path` option to generate wallets from mnemonic by specified BIP-0044 HD paths
3+
14
## 6.1.0 - 2021-03-24
25
- add `walletFromMnemonicAsync`, use it to get better performance in browser
36

Diff for: README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,24 @@ const wallet3 = await minterWallet.walletFromMnemonicAsync('...');
4242
## Wallet API
4343

4444
### Construction methods:
45+
Mnemonic wallets are generated by a [BIP-0044 ](https://en.bitcoin.it/wiki/BIP_0044) path, Ethereum path is used by default "m/44'/60'/0'/0/0"
4546

46-
#### `generateWallet()`
47+
#### `generateWallet(path)`
4748
Generates wallet from a random BIP39 mnemonic phrase (uses `bip39.generateMnemonic()` under the hood).
4849
```js
4950
import {generateWallet} from 'minterjs-wallet';
5051
const wallet = generateWallet();
5152
```
5253

53-
#### `walletFromMnemonic(mnemonic)`
54+
#### `walletFromMnemonic(mnemonic, path)`
5455
Create a wallet instance based on BIP39 12 words mnemonic phrase
5556
```js
5657
import {walletFromMnemonic} from 'minterjs-wallet';
5758
const wallet = walletFromMnemonic('surround tape away million into program organ tonight write prefer inform cool');
5859
```
5960

60-
#### `walletFromMnemonicAsync(mnemonic)`
61-
Same as `walletFromMnemonic` but async and has better performance in browser, beacause it uses `window.crypto.subtle` under hood
61+
#### `walletFromMnemonicAsync(mnemonic, path)`
62+
Same as `walletFromMnemonic` but async and has better performance in browser, because it uses `window.crypto.subtle` under hood
6263
```js
6364
import {walletFromMnemonicAsync} from 'minterjs-wallet';
6465
const wallet = await walletFromMnemonicAsync('surround tape away million into program organ tonight write prefer inform cool');

0 commit comments

Comments
 (0)