@yerofey/cryptowallet-cli 1.25.0 → 1.26.2

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 CHANGED
@@ -88,6 +88,9 @@ $ cw -c BTC -f bech32 -m "radio bright pizza pluck family crawl palm flame forge
88
88
  # generate N of BTC bech32 wallets from mnemonic string
89
89
  $ cw -c BTC -f bech32 -n 10 -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"
90
90
 
91
+ # generate BTC Taproot wallet ("bc1q...")
92
+ $ cw -c BTC -f taproot
93
+
91
94
  # generate ERC-like wallet from mnemonic string
92
95
  $ cw -m "radio bright pizza pluck family crawl palm flame forget focus stock stadium"
93
96
 
@@ -112,7 +115,7 @@ $ cw -l
112
115
  ## Blockchains & tickers supported
113
116
 
114
117
  - `EVM` (Ethereum, Polygon, Arbitrum, Optimism, L2/L3, etc.)
115
- - `BTC` (Bitcoin) [legacy, segwit, bech32]
118
+ - `BTC` (Bitcoin) [legacy, segwit, bech32, taproot]
116
119
  - `ETH` (Ethereum)
117
120
  - `BNB` (Binance Coin) [BEP2, BEP20, ERC20]
118
121
  - `BSC` (Binance Smart Chain)
@@ -272,7 +275,7 @@ If you find this tool useful and would like to support its development, consider
272
275
  - Ethereum (ETH): `0xe3e3ed78d9f8A935a9a0fCE2a7305F2f5DBabAD8`
273
276
  - BNB (BEP20): `0xe3e3ed78d9f8A935a9a0fCE2a7305F2f5DBabAD8`
274
277
  - BNB (BEP2): `bnb1gtxfz4kllltaeekw3edfd496gpa3ukpakvzncq`
275
- - SON: `CWsbNQRxNzAasLd2zfwkEkbBZXKxfoxva14pe8wawUju`
278
+ - SOL: `CWsbNQRxNzAasLd2zfwkEkbBZXKxfoxva14pe8wawUju`
276
279
  - TON: `UQCWYNjNQdRp7lfmehDWA-RgPqipbI3crX3qFN1MDLpgkyCS`
277
280
  - DOGE (DOGE): `DMAkWQKx1H6ESG3beDBssn5mAAZcwkrYVh`
278
281
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yerofey/cryptowallet-cli",
3
- "version": "1.25.0",
3
+ "version": "1.26.2",
4
4
  "description": "Crypto wallet generator CLI tool",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/yerofey/cryptowallet-cli",
@@ -105,15 +105,14 @@
105
105
  "dependencies": {
106
106
  "@binance-chain/javascript-sdk": "^4.2.2",
107
107
  "@harmony-js/account": "^0.1.58",
108
- "@solana/web3.js": "^1.89.1",
109
- "@ton/core": "^0.54.0",
108
+ "@solana/web3.js": "^1.90.0",
110
109
  "@ton/crypto": "^3.2.0",
111
110
  "@yerofey/dogecoin-bip84": "^0.0.5",
112
111
  "@yerofey/litecoin-bip84": "^0.0.5",
113
112
  "bip39": "3.1.0",
114
113
  "bip84": "0.2.7",
114
+ "bip86": "^0.0.3",
115
115
  "bs58": "^5.0.0",
116
- "buffer": "^6.0.3",
117
116
  "chalk": "5.3.0",
118
117
  "clipboardy": "^4.0.0",
119
118
  "coininfo": "5.2.1",
package/src/Wallet.js CHANGED
@@ -7,6 +7,8 @@ import CoinInfo from 'coininfo';
7
7
  import bip39 from 'bip39';
8
8
  import bip84 from 'bip84';
9
9
  const { fromMnemonic, fromZPrv } = bip84;
10
+ import bip86 from 'bip86';
11
+ const { fromMnemonic: fromMnemonicBip86, fromXPrv } = bip86;
10
12
  import ethereumBip from 'ethereum-bip84';
11
13
  const { fromMnemonic: fromMnemonicEthereum, fromZPrv: fromZPrvEthereum } =
12
14
  ethereumBip;
@@ -94,7 +96,10 @@ class Wallet {
94
96
  ) {
95
97
  if (badSymbolsArray.length === 0) {
96
98
  // suggest to generate multiple wallets addresses (if it is supported by the settings)
97
- if (row.flags.includes('n') && (!options.number || options.number == 1)) {
99
+ if (
100
+ row.flags.includes('n') &&
101
+ (!options.number || options.number == 1)
102
+ ) {
98
103
  log(
99
104
  yellow(
100
105
  '💡 You can speed up the process significantly by generating multiple addresses for each wallet. Example: cw -n 10'
@@ -279,9 +284,15 @@ class Wallet {
279
284
  }
280
285
 
281
286
  const mnemonic = mnemonicString || bip39.generateMnemonic();
282
- const root = new fromMnemonic(mnemonic, '');
283
- const child = root.deriveAccount(0);
284
- const account = new fromZPrv(child);
287
+
288
+ const root =
289
+ row.format == 'taproot'
290
+ ? new fromMnemonicBip86(mnemonic, '')
291
+ : new fromMnemonic(mnemonic, '');
292
+ const child =
293
+ row.format == 'taproot' ? root.deriveAccount(0) : root.deriveAccount(0);
294
+ const account =
295
+ row.format == 'taproot' ? new fromXPrv(child) : new fromZPrv(child);
285
296
 
286
297
  let addresses = [];
287
298
  if (number >= 1) {
@@ -29,6 +29,15 @@
29
29
  "path": "m/49'/0",
30
30
  "purpose": 49,
31
31
  "flags": ["f", "g", "m", "n", "p", "s"]
32
+ },
33
+ "taproot": {
34
+ "format": "taproot",
35
+ "startsWith": "bc1p",
36
+ "prefixTest": "[0-9a-z]",
37
+ "rareSymbols": "[0-9]",
38
+ "path": "m/86'/0",
39
+ "purpose": 86,
40
+ "flags": ["f", "g", "m", "n", "p", "s"]
32
41
  }
33
42
  }
34
43
  }