@yerofey/cryptowallet-cli 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +1 -1
- package/src/Method.js +1 -1
- package/src/Wallet.js +8 -2
package/README.md
CHANGED
|
@@ -46,9 +46,11 @@ $ cw -c btc
|
|
|
46
46
|
# generate random mnemonic string (12 words) to import in any wallet app
|
|
47
47
|
$ cw -m
|
|
48
48
|
|
|
49
|
-
# generate random mnemonic string of a specific length (12, 18, or 24 words)
|
|
49
|
+
# generate random mnemonic string of a specific length (12, 15, 18, 21 or 24 words)
|
|
50
50
|
$ cw -m 12
|
|
51
|
+
$ cw -m 15
|
|
51
52
|
$ cw -m 18
|
|
53
|
+
$ cw -m 21
|
|
52
54
|
$ cw -m 24
|
|
53
55
|
|
|
54
56
|
# generate a wallet from a given mnemonic string
|
|
@@ -145,7 +147,9 @@ $ cw -l
|
|
|
145
147
|
- `-m` or `--mnemonic [value]`: If used without a value or with `12`, `18`, or `24`, it generates a mnemonic string of that length. If a mnemonic string is provided, it generates a wallet from the given mnemonic. For example:
|
|
146
148
|
- `$ cw -m`: Generates a default 12-word mnemonic string.
|
|
147
149
|
- `$ cw -m 12`: Generates a 12-word mnemonic string.
|
|
150
|
+
- `$ cw -m 15`: Generates a 15-word mnemonic string.
|
|
148
151
|
- `$ cw -m 18`: Generates an 18-word mnemonic string.
|
|
152
|
+
- `$ cw -m 21`: Generates a 21-word mnemonic string.
|
|
149
153
|
- `$ cw -m 24`: Generates a 24-word mnemonic string.
|
|
150
154
|
- `$ cw -m "your mnemonic phrase here"`: Generates a wallet from the provided mnemonic string.
|
|
151
155
|
- `-n` or `--number`: Specify number of wallets to display (works for HD wallets only, like BTC/LTC/DOGE)
|
package/package.json
CHANGED
package/src/Method.js
CHANGED
|
@@ -67,7 +67,7 @@ class Method {
|
|
|
67
67
|
|
|
68
68
|
_mnemonic() {
|
|
69
69
|
const mnemonic = this.inputOptions.mnemonic || '12';
|
|
70
|
-
const mnemonicLength = ['12', '18', '24'].includes(mnemonic)
|
|
70
|
+
const mnemonicLength = ['12', '15', '18', '21', '24'].includes(mnemonic)
|
|
71
71
|
? parseInt(mnemonic, 10)
|
|
72
72
|
: 12;
|
|
73
73
|
const mnemonicString = generateMnemonicString(mnemonicLength);
|
package/src/Wallet.js
CHANGED
|
@@ -38,7 +38,7 @@ config();
|
|
|
38
38
|
class Wallet {
|
|
39
39
|
constructor(cw) {
|
|
40
40
|
this.cw = cw;
|
|
41
|
-
this.supportedMnemonicLengths = [12, 18, 24];
|
|
41
|
+
this.supportedMnemonicLengths = [12, 15, 18, 21, 24];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
async init() {
|
|
@@ -553,15 +553,21 @@ function generateMnemonicString(length = 12) {
|
|
|
553
553
|
case 12:
|
|
554
554
|
entropy = 128;
|
|
555
555
|
break;
|
|
556
|
+
case 15:
|
|
557
|
+
entropy = 160;
|
|
558
|
+
break;
|
|
556
559
|
case 18:
|
|
557
560
|
entropy = 192;
|
|
558
561
|
break;
|
|
562
|
+
case 21:
|
|
563
|
+
entropy = 224;
|
|
564
|
+
break;
|
|
559
565
|
case 24:
|
|
560
566
|
entropy = 256;
|
|
561
567
|
break;
|
|
562
568
|
default:
|
|
563
569
|
throw new Error(
|
|
564
|
-
'Invalid mnemonic length. Supported lengths are 12, 18,
|
|
570
|
+
'Invalid mnemonic length. Supported lengths are 12, 15, 18, 21, and 24.'
|
|
565
571
|
);
|
|
566
572
|
}
|
|
567
573
|
|