@yerofey/cryptowallet-cli 1.21.0 → 1.22.1
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 +12 -6
- package/package.json +1 -1
- package/src/Method.js +1 -1
- package/src/Wallet.js +8 -2
package/README.md
CHANGED
|
@@ -10,14 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- [x] Generate new crypto wallet offline
|
|
14
|
-
- [x] Generate wallet address with prefix (string at the start): [`-p`]
|
|
15
|
-
- [x] Generate wallet address with suffix (string at the end): [`-s`]
|
|
13
|
+
- [x] Generate brand new crypto wallet address (offline)
|
|
14
|
+
- [x] Generate wallet address with prefix (string at the start): [`-p`] or [`-P`] (case-sensitive)
|
|
15
|
+
- [x] Generate wallet address with suffix (string at the end): [`-s`] or [`-S`] (case-sensitive)
|
|
16
16
|
- [x] Generate wallet with different formats (for Bitcoin: Legacy, SegWit, Bech32; for BNB: BEP2, BEP20): [`-f`]
|
|
17
17
|
- [x] Generate wallet from your desired mnemonic string: [`-m`]
|
|
18
|
-
- [x] Generate
|
|
18
|
+
- [x] Generate mnemonic string: [`-m`] or [`-m 12`] or [`-m 15`] or [`-m 18`] or [`-m 21`] or [`-m 24`]
|
|
19
19
|
- [x] Generate a lot of wallets at once: [`-n`]
|
|
20
20
|
- [x] Save result into a CSV file: [`--csv`]
|
|
21
|
+
- [x] Copy the generated mnemonic to the clipboard: [`-C` or `--copy`]
|
|
22
|
+
- [x] Display some additional "geeky" info: [`-g`]
|
|
21
23
|
|
|
22
24
|
*check the Options section for all supported commands*
|
|
23
25
|
|
|
@@ -37,7 +39,7 @@ $ yarn global add @yerofey/cryptowallet-cli
|
|
|
37
39
|
## Usage
|
|
38
40
|
|
|
39
41
|
```bash
|
|
40
|
-
# generate random
|
|
42
|
+
# generate random EVM-compatible wallet (for Ethereum, Polygon, any L1/L2 EVM-compatible chain, etc.)
|
|
41
43
|
$ cw
|
|
42
44
|
|
|
43
45
|
# generate random BTC wallet (default format: bech32 - "bc1q...")
|
|
@@ -46,9 +48,11 @@ $ cw -c btc
|
|
|
46
48
|
# generate random mnemonic string (12 words) to import in any wallet app
|
|
47
49
|
$ cw -m
|
|
48
50
|
|
|
49
|
-
# generate random mnemonic string of a specific length (12, 18, or 24 words)
|
|
51
|
+
# generate random mnemonic string of a specific length (12, 15, 18, 21 or 24 words)
|
|
50
52
|
$ cw -m 12
|
|
53
|
+
$ cw -m 15
|
|
51
54
|
$ cw -m 18
|
|
55
|
+
$ cw -m 21
|
|
52
56
|
$ cw -m 24
|
|
53
57
|
|
|
54
58
|
# generate a wallet from a given mnemonic string
|
|
@@ -145,7 +149,9 @@ $ cw -l
|
|
|
145
149
|
- `-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
150
|
- `$ cw -m`: Generates a default 12-word mnemonic string.
|
|
147
151
|
- `$ cw -m 12`: Generates a 12-word mnemonic string.
|
|
152
|
+
- `$ cw -m 15`: Generates a 15-word mnemonic string.
|
|
148
153
|
- `$ cw -m 18`: Generates an 18-word mnemonic string.
|
|
154
|
+
- `$ cw -m 21`: Generates a 21-word mnemonic string.
|
|
149
155
|
- `$ cw -m 24`: Generates a 24-word mnemonic string.
|
|
150
156
|
- `$ cw -m "your mnemonic phrase here"`: Generates a wallet from the provided mnemonic string.
|
|
151
157
|
- `-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
|
|