@yerofey/cryptowallet-cli 1.39.0 → 1.40.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/package.json +1 -1
- package/src/Method.js +51 -23
- package/src/Wallet.js +5 -4
- package/src/chains/TON.json +9 -6
package/package.json
CHANGED
package/src/Method.js
CHANGED
|
@@ -99,7 +99,7 @@ class Method {
|
|
|
99
99
|
log();
|
|
100
100
|
log(
|
|
101
101
|
greenBright(
|
|
102
|
-
'
|
|
102
|
+
'💾 You can import it into your favorite wallet app or use it to generate a wallet with "-m" flag'
|
|
103
103
|
)
|
|
104
104
|
);
|
|
105
105
|
|
|
@@ -159,7 +159,7 @@ class Method {
|
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
let linesCount = 0;
|
|
162
|
+
let linesCount = 0; // count of lines to add empty line before the next message
|
|
163
163
|
const outputFormats = ['csv'];
|
|
164
164
|
const displayAsText =
|
|
165
165
|
cw.options.output === undefined ||
|
|
@@ -247,24 +247,45 @@ class Method {
|
|
|
247
247
|
linesCount += 1;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
// wallets
|
|
250
251
|
if (displayAsText) {
|
|
252
|
+
// show all addresses if flag is set or if prefix or suffix is not found
|
|
253
|
+
let showAllAddresses = cw.options.number !== undefined;
|
|
254
|
+
if (cw.suffixFound) {
|
|
255
|
+
showAllAddresses = false;
|
|
256
|
+
}
|
|
257
|
+
if (cw.prefixFound) {
|
|
258
|
+
showAllAddresses = false;
|
|
259
|
+
}
|
|
260
|
+
// show private key only for the first wallet or the one that matches the prefix or/and suffix
|
|
261
|
+
let showPrivateKey = false;
|
|
262
|
+
// add empty line before the next message
|
|
263
|
+
let emptyLineAdded = false;
|
|
251
264
|
// display addresses
|
|
252
265
|
let index = 0;
|
|
253
266
|
for (const item of cw.wallet.addresses) {
|
|
254
267
|
if (cw.wallet.addresses.length > 1) {
|
|
255
|
-
log();
|
|
256
|
-
|
|
257
268
|
// Display index
|
|
258
|
-
if (item.index !== undefined) {
|
|
269
|
+
if (item.index !== undefined && (showAllAddresses || !showAllAddresses && index == 0 || (cw.prefixFoundInWallets.includes(item.address) || cw.suffixFoundInWallets.includes(item.address)))) {
|
|
270
|
+
log();
|
|
259
271
|
log(`🆔 ${item.index}`);
|
|
272
|
+
emptyLineAdded = true;
|
|
260
273
|
}
|
|
261
274
|
|
|
262
275
|
// Display address details
|
|
263
276
|
if (item.title) {
|
|
277
|
+
if (!emptyLineAdded) {
|
|
278
|
+
log();
|
|
279
|
+
emptyLineAdded = true;
|
|
280
|
+
}
|
|
264
281
|
log(`🏷 ${item.title}`);
|
|
265
282
|
}
|
|
266
283
|
}
|
|
267
284
|
|
|
285
|
+
// in multi-wallets mode, hide private key for all wallets except the first one and the one that matches the prefix or/and suffix
|
|
286
|
+
showPrivateKey = false;
|
|
287
|
+
|
|
288
|
+
// highlight prefix and suffix
|
|
268
289
|
if (
|
|
269
290
|
cw.prefixFound &&
|
|
270
291
|
cw.prefixFoundInWallets.includes(item.address) &&
|
|
@@ -317,6 +338,7 @@ class Method {
|
|
|
317
338
|
log(`👛 ${item.address}`);
|
|
318
339
|
}
|
|
319
340
|
matchingWalletsIndexes.push(index);
|
|
341
|
+
showPrivateKey = true;
|
|
320
342
|
} else if (
|
|
321
343
|
cw.prefixFound &&
|
|
322
344
|
cw.prefixFoundInWallets.includes(item.address)
|
|
@@ -363,6 +385,7 @@ class Method {
|
|
|
363
385
|
log(`👛 ${item.address}`);
|
|
364
386
|
}
|
|
365
387
|
matchingWalletsIndexes.push(index);
|
|
388
|
+
showPrivateKey = true;
|
|
366
389
|
} else if (
|
|
367
390
|
cw.suffixFound &&
|
|
368
391
|
cw.suffixFoundInWallets.includes(item.address)
|
|
@@ -386,10 +409,14 @@ class Method {
|
|
|
386
409
|
log(`👛 ${item.address}`);
|
|
387
410
|
}
|
|
388
411
|
matchingWalletsIndexes.push(index);
|
|
412
|
+
showPrivateKey = true;
|
|
389
413
|
} else {
|
|
390
|
-
|
|
414
|
+
if (showAllAddresses || !showAllAddresses && index == 0) {
|
|
415
|
+
log(`👛 ${item.address}`);
|
|
416
|
+
}
|
|
391
417
|
}
|
|
392
|
-
|
|
418
|
+
// display private key
|
|
419
|
+
if (item.privateKey !== undefined && (showAllAddresses || !showAllAddresses && index == 0 || showPrivateKey)) {
|
|
393
420
|
log(`🔑 ${item.privateKey}`);
|
|
394
421
|
}
|
|
395
422
|
// copy to clipboard if flag is set
|
|
@@ -483,21 +510,21 @@ class Method {
|
|
|
483
510
|
}
|
|
484
511
|
|
|
485
512
|
// matching wallets
|
|
486
|
-
if (
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
513
|
+
// if (
|
|
514
|
+
// cw.options.number &&
|
|
515
|
+
// cw.options.number > 1 &&
|
|
516
|
+
// matchingWalletsIndexes.length > 0
|
|
517
|
+
// ) {
|
|
518
|
+
// const foundCount = matchingWalletsIndexes.length;
|
|
519
|
+
// const foundMany = foundCount !== 1;
|
|
520
|
+
// log(
|
|
521
|
+
// cyan(
|
|
522
|
+
// `🔍 Found ${foundCount} matching wallet${
|
|
523
|
+
// foundMany ? 's' : ''
|
|
524
|
+
// }: 🆔 ${matchingWalletsIndexes.join(',')}`
|
|
525
|
+
// )
|
|
526
|
+
// );
|
|
527
|
+
// }
|
|
501
528
|
|
|
502
529
|
// attempts
|
|
503
530
|
if (cw.attempts !== undefined && cw.attempts > 1 && cw.options.geek) {
|
|
@@ -578,7 +605,7 @@ class Method {
|
|
|
578
605
|
appsString +=
|
|
579
606
|
' and any other wallet app (either using mnemonic or private key)';
|
|
580
607
|
}
|
|
581
|
-
log(greenBright('
|
|
608
|
+
log(greenBright('💾 You can import this wallet into ' + appsString));
|
|
582
609
|
}
|
|
583
610
|
|
|
584
611
|
// donation
|
|
@@ -604,6 +631,7 @@ class Method {
|
|
|
604
631
|
- BTC: bc1qcwamquntxshqsjcra6vryftrfd9z57j02g3ywq
|
|
605
632
|
- ETH: 0xe3e3ed78d9f8A935a9a0fCE2a7305F2f5DBabAD8
|
|
606
633
|
- SOL: CWsbNQRxNzAasLd2zfwkEkbBZXKxfoxva14pe8wawUju
|
|
634
|
+
- SUI: 0x1b27883fefacd14a19df37f2fc2e9fa1ccbf03823413f5edc315c164ef90a4f3
|
|
607
635
|
- TON: UQCWDwqtvC_jml2hSf8laNQu4chYVCbHBpkbKbyDdxzM7Ma0
|
|
608
636
|
- DOGE: DMAkWQKx1H6ESG3beDBssn5mAAZcwkrYVh
|
|
609
637
|
|
package/src/Wallet.js
CHANGED
|
@@ -571,16 +571,17 @@ class Wallet {
|
|
|
571
571
|
// when UQ was implemented (non-bounceable addresses)
|
|
572
572
|
const nonBounceableAddress = address.toString(true, true, false);
|
|
573
573
|
addresses.push({
|
|
574
|
-
title: '
|
|
574
|
+
title: 'v4R2 (UQ): best for wallets (non-bounceable)',
|
|
575
575
|
address: nonBounceableAddress,
|
|
576
576
|
});
|
|
577
577
|
const bouncableAddress = address.toString(true, true, true);
|
|
578
578
|
addresses.push({
|
|
579
|
-
title: '
|
|
579
|
+
title: 'v4R2 (EQ): best for smart contracts (bounceable)',
|
|
580
580
|
address: bouncableAddress,
|
|
581
581
|
});
|
|
582
582
|
} else {
|
|
583
583
|
addresses.push({
|
|
584
|
+
title: _tonwebFormat,
|
|
584
585
|
address: address.toString(true, true, true),
|
|
585
586
|
});
|
|
586
587
|
}
|
|
@@ -602,7 +603,7 @@ class Wallet {
|
|
|
602
603
|
testOnly: false,
|
|
603
604
|
});
|
|
604
605
|
addresses.push({
|
|
605
|
-
title: 'W5 (
|
|
606
|
+
title: 'W5 - v5R1 (UQ): best for wallets (non-bounceable)',
|
|
606
607
|
address: nonBounceableV5Address,
|
|
607
608
|
});
|
|
608
609
|
const bouncableAddressV5 = v5Address.toString({
|
|
@@ -611,7 +612,7 @@ class Wallet {
|
|
|
611
612
|
testOnly: false,
|
|
612
613
|
});
|
|
613
614
|
addresses.push({
|
|
614
|
-
title: 'W5 (
|
|
615
|
+
title: 'W5 - v5R1 (EQ): best for smart contracts (bounceable)',
|
|
615
616
|
address: bouncableAddressV5,
|
|
616
617
|
});
|
|
617
618
|
break;
|
package/src/chains/TON.json
CHANGED
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
"prefixTest": "[0-9a-zA-Z-_]",
|
|
66
66
|
"rareSymbols": "[0-9]",
|
|
67
67
|
"apps": ["tonkeeper", "tonhub", "trustwallet"],
|
|
68
|
-
"flags": ["m", "p", "s"]
|
|
68
|
+
"flags": ["m", "p", "s"],
|
|
69
|
+
"requiresActivation": true
|
|
69
70
|
},
|
|
70
71
|
"V4R2": {
|
|
71
72
|
"format": "V4R2",
|
|
@@ -73,7 +74,8 @@
|
|
|
73
74
|
"prefixTest": "[0-9a-zA-Z-_]",
|
|
74
75
|
"rareSymbols": "[0-9]",
|
|
75
76
|
"apps": ["tonkeeper", "tonhub", "trustwallet"],
|
|
76
|
-
"flags": ["m", "p", "s"]
|
|
77
|
+
"flags": ["m", "p", "s"],
|
|
78
|
+
"requiresActivation": true
|
|
77
79
|
},
|
|
78
80
|
"V5R1": {
|
|
79
81
|
"format": "V5R1",
|
|
@@ -81,7 +83,8 @@
|
|
|
81
83
|
"prefixTest": "[0-9a-zA-Z-_]",
|
|
82
84
|
"rareSymbols": "[0-9]",
|
|
83
85
|
"apps": ["tonkeeper", "tonhub", "trustwallet"],
|
|
84
|
-
"flags": ["m", "p", "s"]
|
|
86
|
+
"flags": ["m", "p", "s"],
|
|
87
|
+
"requiresActivation": true
|
|
85
88
|
},
|
|
86
89
|
"W5": {
|
|
87
90
|
"comment": "This is the same as V5R1",
|
|
@@ -90,8 +93,8 @@
|
|
|
90
93
|
"prefixTest": "[0-9a-zA-Z-_]",
|
|
91
94
|
"rareSymbols": "[0-9]",
|
|
92
95
|
"apps": ["tonkeeper", "tonhub", "trustwallet"],
|
|
93
|
-
"flags": ["m", "p", "s"]
|
|
96
|
+
"flags": ["m", "p", "s"],
|
|
97
|
+
"requiresActivation": true
|
|
94
98
|
}
|
|
95
|
-
}
|
|
96
|
-
"requiresActivation": true
|
|
99
|
+
}
|
|
97
100
|
}
|