@yerofey/cryptowallet-cli 1.7.4 → 1.8.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 +59 -66
- package/cli.js +4 -0
- package/package.json +8 -6
- package/src/CW.js +10 -1
- package/src/Method.js +6 -19
package/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# cryptowallet-cli
|
|
2
|
-
|
|
3
2
|
> Crypto wallet generator CLI tool (currently works only on Mac and Linux, sorry Windows users)
|
|
4
3
|
|
|
5
4
|

|
|
@@ -7,7 +6,6 @@
|
|
|
7
6
|
---
|
|
8
7
|
|
|
9
8
|
## Install
|
|
10
|
-
|
|
11
9
|
```bash
|
|
12
10
|
# via NPM
|
|
13
11
|
$ npm i -g @yerofey/cryptowallet-cli
|
|
@@ -20,7 +18,6 @@ $ yarn global add @yerofey/cryptowallet-cli
|
|
|
20
18
|
```
|
|
21
19
|
|
|
22
20
|
## Usage
|
|
23
|
-
|
|
24
21
|
```bash
|
|
25
22
|
# generate random ERC-like wallet (ETH, BNB, POLYGON, ...)
|
|
26
23
|
$ cw
|
|
@@ -58,8 +55,11 @@ $ cw -c BNB -f BEP2 -m "radio bright pizza pluck family crawl palm flame forget
|
|
|
58
55
|
# generate BNB (BEP20) wallet from mnemonic string
|
|
59
56
|
$ cw -c BNB -f BEP20 -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"
|
|
60
57
|
|
|
61
|
-
# generate
|
|
62
|
-
$ cw -c btc
|
|
58
|
+
# generate wallet and save the output into CSV file ("cw-output.csv" by default)
|
|
59
|
+
$ cw -c btc --csv
|
|
60
|
+
|
|
61
|
+
# generate few wallets and save the output into CSV file with custom name "new.csv"
|
|
62
|
+
$ cw -c btc -n 10 -D new
|
|
63
63
|
|
|
64
64
|
# generate just a mnemonic string (12 words) to import in any wallet app
|
|
65
65
|
$ cw -m
|
|
@@ -69,77 +69,70 @@ $ cw -l
|
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
## Blockchains supported
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
- `NBT` (NIX Bridge Token)
|
|
97
|
-
|
|
72
|
+
- `BTC` (Bitcoin) [legacy, segwit, bech32]
|
|
73
|
+
- `ETH` (Ethereum)
|
|
74
|
+
- `BNB` (Binance Coin) [BEP2, BEP20, ERC20]
|
|
75
|
+
- `DOGE` (Dogecoin) [legacy, segwit, bech32]
|
|
76
|
+
- `BCH` (Bitcoin Cash)
|
|
77
|
+
- `LTC` (Litecoin) [legacy, segwit, bech32]
|
|
78
|
+
- `POLYGON` (Polygon)
|
|
79
|
+
- `TRX` (Tron)
|
|
80
|
+
- `XTZ` (Tezos)
|
|
81
|
+
- `DASH` (Dash)
|
|
82
|
+
- `DCR` (Decred)
|
|
83
|
+
- `ZEC` (Zcash)
|
|
84
|
+
- `QTUM` (Qtum)
|
|
85
|
+
- `BTG` (Bitcoin Gold)
|
|
86
|
+
- `ONE` (Harmony)
|
|
87
|
+
- `DGB` (DigiByte)
|
|
88
|
+
- `RDD` (ReddCoin)
|
|
89
|
+
- `VTC` (Vertcoin)
|
|
90
|
+
- `MONA` (MonaCoin)
|
|
91
|
+
- `NMC` (NameCoin)
|
|
92
|
+
- `PPC` (PeerCoin)
|
|
93
|
+
- `BLK` (BlackCoin)
|
|
94
|
+
- `VIA` (Viacoin)
|
|
95
|
+
- `NBT` (NIX Bridge Token)
|
|
98
96
|
_\*all other cryptos that are tokens in the ecosystems like Ethereum, Binance Smart Chain or Polygon and others (EVM compatible) are supported too, you just need to create ERC wallet (that is set by default)_
|
|
99
97
|
|
|
100
98
|
## Options
|
|
101
|
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
##
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
* [x] v16.12.0
|
|
121
|
-
* [x] v16.16.0
|
|
99
|
+
- `-b` or `-c` or `--chain`: Specify the blockchain ticker to generate a wallet for
|
|
100
|
+
- `-f` or `--format`: Specify the blockchain wallet format (for BTC: legacy, segwit, bech32)
|
|
101
|
+
- `-F` or `--filename`: Specify a filename (without extension) to output the data (works only with `-o` argument)
|
|
102
|
+
- `-D` or `--csv`: Save output into CSV file with custom or default name ("`cw-output.csv`") - this is a shorthand for `-o csv -F filename`
|
|
103
|
+
- `-g` or `--geek`: Display some additional "geeky" info
|
|
104
|
+
- `-l` or `--list`: List all supported blockchains
|
|
105
|
+
- `-m` or `--mnemonic`: Use a bip39 mnemonic phrase (if is set) to generate wallet, or leave it empty to generate new one
|
|
106
|
+
- `-n` or `--number`: Specify number of wallets to display (works for HD wallets only, like BTC/LTC/DOGE)
|
|
107
|
+
- `-o` or `--output`: Specify a file format (currently only `csv` supported) to output the generated data
|
|
108
|
+
- `-p` or `--prefix`: Specify desired prefix for the wallet address (**case-insensitive**)
|
|
109
|
+
- `-P` or `--prefix-sensitive`: Specify desired prefix of the wallet address (**case-sensitive**)
|
|
110
|
+
- `-s` or `--suffix`: Specify desired suffix for the wallet address (**case-insensitive**)
|
|
111
|
+
- `-S` or `--suffix-sensitive`: Specify desired suffix for the wallet address (**case-sensitive**)
|
|
112
|
+
- `-v` or `--version`: Display current version of CW tool
|
|
113
|
+
|
|
114
|
+
## Node.js supported versions
|
|
115
|
+
- ✅ v16.0-v16.x
|
|
116
|
+
- ⛔ v17.x-v18.x
|
|
122
117
|
|
|
123
118
|
## Highlights
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
- Works fully offline
|
|
119
|
+
- 24+ blockchains supported
|
|
120
|
+
- Generate wallet with desired prefix/suffix
|
|
121
|
+
- Generate wallet from mnemonic
|
|
122
|
+
- Generate just a mnemonic
|
|
123
|
+
- Works fully offline
|
|
130
124
|
|
|
131
125
|
## TODO
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
- tests
|
|
126
|
+
- Windows support
|
|
127
|
+
- Show SegWit Bech32 BTC change addresses with additional flag
|
|
128
|
+
- SegWit Bech32 wallet address support for all Bitcoin forks
|
|
129
|
+
- More EVM compatible cryptos
|
|
130
|
+
- tests
|
|
138
131
|
|
|
139
132
|
## Author
|
|
140
|
-
|
|
141
133
|
[Yerofey S.](https://github.com/yerofey)
|
|
142
134
|
|
|
143
|
-
|
|
135
|
+
Contact me: [Email](mailto:pm@yerofey.dev), [Telegram](https://t.me/cryptofey)
|
|
144
136
|
|
|
137
|
+
## License
|
|
145
138
|
[MIT](https://github.com/yerofey/cryptowallet-cli/blob/master/LICENSE)
|
package/cli.js
CHANGED
|
@@ -8,6 +8,10 @@ import Method from './src/Method.js';
|
|
|
8
8
|
|
|
9
9
|
program.option('-b, --chain <ticker>', 'Wallet for specific blockchain', 'ERC');
|
|
10
10
|
program.option('-c, --chain <ticker>', 'Wallet for specific blockchain', 'ERC');
|
|
11
|
+
program.option(
|
|
12
|
+
'-D, --csv [filename]',
|
|
13
|
+
'Save result into CSV file'
|
|
14
|
+
);
|
|
11
15
|
program.option(
|
|
12
16
|
'-f, --format <format>',
|
|
13
17
|
'Wallet format type (for cryptos with multiple wallet formats)'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yerofey/cryptowallet-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://github.com/yerofey/cryptowallet-cli",
|
|
6
6
|
"author": "Yerofey S. <pm@yerofey.dev> (https://github.com/yerofey)",
|
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
"cw": "cli.js"
|
|
11
11
|
},
|
|
12
12
|
"engines": {
|
|
13
|
-
"node": ">=
|
|
13
|
+
"node": ">=16.0.0 <17.0.0"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build:release": "./bin/generate.sh",
|
|
17
16
|
"lint": "pnpm exec eslint src/*.js",
|
|
18
17
|
"test": "ava"
|
|
19
18
|
},
|
|
@@ -56,11 +55,14 @@
|
|
|
56
55
|
"trust-wallet",
|
|
57
56
|
"tronlink",
|
|
58
57
|
"bip39",
|
|
59
|
-
"bip84"
|
|
58
|
+
"bip84",
|
|
59
|
+
"multiple wallets",
|
|
60
|
+
"crypto wallets",
|
|
61
|
+
"wallet generation"
|
|
60
62
|
],
|
|
61
63
|
"dependencies": {
|
|
62
64
|
"@binance-chain/javascript-sdk": "^4.2.0",
|
|
63
|
-
"@harmony-js/account": "^0.1.
|
|
65
|
+
"@harmony-js/account": "^0.1.58",
|
|
64
66
|
"@yerofey/dogecoin-bip84": "^0.0.5",
|
|
65
67
|
"@yerofey/litecoin-bip84": "^0.0.5",
|
|
66
68
|
"bip39": "3.0.4",
|
|
@@ -69,7 +71,7 @@
|
|
|
69
71
|
"coininfo": "5.2.1",
|
|
70
72
|
"coinkey": "3.0.0",
|
|
71
73
|
"columnify": "1.6.0",
|
|
72
|
-
"commander": "9.4.
|
|
74
|
+
"commander": "9.4.1",
|
|
73
75
|
"csv-writer": "^1.6.0",
|
|
74
76
|
"eth-lib": "0.1.29",
|
|
75
77
|
"ethereum-bip84": "0.0.3",
|
package/src/CW.js
CHANGED
|
@@ -3,9 +3,18 @@ import { Wallet } from './Wallet.js';
|
|
|
3
3
|
|
|
4
4
|
class CW {
|
|
5
5
|
constructor(chain, options = {}) {
|
|
6
|
+
const csvFilename = 'cw-output';
|
|
7
|
+
if (options.csv !== undefined) {
|
|
8
|
+
options.output = 'csv';
|
|
9
|
+
|
|
10
|
+
if (typeof options.csv === 'string' && (options.csv).length > 0) {
|
|
11
|
+
options.filename = options.csv;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
6
15
|
const defaultValues = {
|
|
7
16
|
chain: chain || options.chain || '',
|
|
8
|
-
filename:
|
|
17
|
+
filename: csvFilename,
|
|
9
18
|
format: '',
|
|
10
19
|
geek: false,
|
|
11
20
|
mnemonic: '',
|
package/src/Method.js
CHANGED
|
@@ -176,8 +176,8 @@ class Method {
|
|
|
176
176
|
linesCount += 1;
|
|
177
177
|
}
|
|
178
178
|
// addresses
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
if (displayAsText) {
|
|
180
|
+
for (const item of cw.wallet.addresses) {
|
|
181
181
|
if (cw.wallet.addresses.length > 1) {
|
|
182
182
|
log();
|
|
183
183
|
log(`🆔 ${item.index}`);
|
|
@@ -241,22 +241,9 @@ class Method {
|
|
|
241
241
|
log(`👛 ${item.address}`);
|
|
242
242
|
}
|
|
243
243
|
log(`🔑 ${item.privateKey}`);
|
|
244
|
-
|
|
245
|
-
// const createCsvWriter = csvWriter.createObjectCsvWriter;
|
|
246
|
-
// const csvWriter = createCsvWriter({
|
|
247
|
-
// path: 'out.csv',
|
|
248
|
-
// header: [
|
|
249
|
-
// {id: 'name', title: 'Name'},
|
|
250
|
-
// {id: 'surname', title: 'Surname'},
|
|
251
|
-
// {id: 'age', title: 'Age'},
|
|
252
|
-
// {id: 'gender', title: 'Gender'},
|
|
253
|
-
// ]
|
|
254
|
-
// });
|
|
255
|
-
// // TODO: build output into file
|
|
256
|
-
// log('TODO_BUILD_OUTPUT_INTO_FILE', item.address);
|
|
244
|
+
|
|
257
245
|
}
|
|
258
|
-
}
|
|
259
|
-
if (!displayAsText) {
|
|
246
|
+
} else {
|
|
260
247
|
outputData.wallets = cw.wallet.addresses;
|
|
261
248
|
}
|
|
262
249
|
|
|
@@ -268,7 +255,7 @@ class Method {
|
|
|
268
255
|
|
|
269
256
|
// generate csv
|
|
270
257
|
if (!displayAsText) {
|
|
271
|
-
const filename = cw.options.filename.split('.')[0] || 'output';
|
|
258
|
+
const filename = cw.options.csvOutputFilename || cw.options.filename.split('.')[0] || 'cw-output';
|
|
272
259
|
// eslint-disable-next-line no-undef
|
|
273
260
|
const createCsvWriter = CsvWriter.createObjectCsvWriter;
|
|
274
261
|
const csvWriter = createCsvWriter({
|
|
@@ -295,7 +282,7 @@ class Method {
|
|
|
295
282
|
`${linesCount > 0 ? '\n' : ''}🟠 ${yellow(
|
|
296
283
|
`Don't forget to save the data above manually, because it is not in the output file`
|
|
297
284
|
)} \n✨ ${green('Done!')} ${blueBright(
|
|
298
|
-
`The output successfully saved into "
|
|
285
|
+
`The output successfully saved into "./${filename}.csv" file`
|
|
299
286
|
)}`
|
|
300
287
|
)
|
|
301
288
|
)
|