@yerofey/cryptowallet-cli 1.34.0 → 1.35.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yerofey/cryptowallet-cli",
3
- "version": "1.34.0",
3
+ "version": "1.35.0",
4
4
  "description": "Crypto wallet generator CLI tool",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/yerofey/cryptowallet-cli",
@@ -131,6 +131,7 @@
131
131
  "ed25519-hd-key": "^1.3.0",
132
132
  "eth-lib": "0.1.29",
133
133
  "ethereum-bip84": "0.0.3",
134
+ "ethereum-cryptography": "^3.0.0",
134
135
  "ethereum-mnemonic-privatekey-utils": "1.0.5",
135
136
  "tezos-sign": "1.4.1",
136
137
  "tonweb": "^0.0.66",
package/src/Method.js CHANGED
@@ -537,8 +537,12 @@ class Method {
537
537
  // apps
538
538
  if (cw.row.apps !== undefined) {
539
539
  let apps = {
540
+ coinbase: 'Coinbase Wallet',
540
541
  metamask: 'MetaMask',
541
542
  phantom: 'Phantom',
543
+ suiet: 'Suiet',
544
+ suiwallet: 'Sui Wallet',
545
+ tonhub: 'Tonhub',
542
546
  tonkeeper: 'Tonkeeper',
543
547
  tronlink: 'TronLink',
544
548
  trustwallet: 'Trust Wallet',
package/src/Wallet.js CHANGED
@@ -21,6 +21,7 @@ import { Account } from 'eth-lib/lib/index.js';
21
21
  import { Wallet as HarmonyWallet } from '@harmony-js/account';
22
22
  import pkutils from 'ethereum-mnemonic-privatekey-utils';
23
23
  import bCrypto from '@binance-chain/javascript-sdk/lib/crypto/index.js';
24
+ import { HDKey } from 'ethereum-cryptography/hdkey.js';
24
25
  import tronWeb from 'tronweb';
25
26
  import tezos from 'tezos-sign';
26
27
  import {
@@ -594,7 +595,7 @@ class Wallet {
594
595
  testOnly: false,
595
596
  });
596
597
  addresses.push({
597
- title: 'W5 (V5R1) [UQ]: best for wallets, - non-bounceable',
598
+ title: 'W5 (V5R1) [UQ]: best for wallets (non-bounceable)',
598
599
  address: nonBounceableV5Address,
599
600
  });
600
601
  const bouncableAddressV5 = v5Address.toString({
@@ -603,7 +604,7 @@ class Wallet {
603
604
  testOnly: false,
604
605
  });
605
606
  addresses.push({
606
- title: 'W5 (V5R1) [EQ]: best for smart contracts, - bounceable',
607
+ title: 'W5 (V5R1) [EQ]: best for smart contracts (bounceable)',
607
608
  address: bouncableAddressV5,
608
609
  });
609
610
  break;
@@ -614,22 +615,32 @@ class Wallet {
614
615
  mnemonic: mnemonicString,
615
616
  });
616
617
  } else if (chain == 'TRX') {
617
- // TODO: generate wallet from mnemonic
618
618
  try {
619
- const wallet = await tronWeb.createAccount();
619
+ // Validate mnemonic
620
+ if (mnemonicString !== '' && !bip39.validateMnemonic(mnemonicString)) {
621
+ return {
622
+ error: 'mnemonic is not valid',
623
+ };
624
+ }
625
+
626
+ // Generate mnemonic if not provided
627
+ const mnemonic = mnemonicString || bip39.generateMnemonic();
628
+ // Generate Tron address from private key
629
+ const wallet = tronWeb.utils.accounts.generateAccountWithMnemonic(mnemonic);
620
630
 
621
631
  Object.assign(result, {
622
632
  addresses: [
623
633
  {
624
634
  index: 0,
625
- address: wallet.address.base58,
635
+ address: wallet.address,
626
636
  privateKey: wallet.privateKey,
627
637
  },
628
638
  ],
639
+ mnemonic,
629
640
  });
630
641
  } catch (error) {
631
642
  return {
632
- error,
643
+ error: `Failed to generate TRX wallet: ${error.message} (${error})`,
633
644
  };
634
645
  }
635
646
  } else if (chain == 'XTZ') {
@@ -3,6 +3,6 @@
3
3
  "network": "SUI",
4
4
  "startsWith": "0x",
5
5
  "prefixTest": "^[0-9A-Fa-f]+$",
6
- "apps": ["Sui Wallet"],
6
+ "apps": ["suiwallet", "suiet", "trustwallet"],
7
7
  "flags": ["m", "n", "p", "s", "f"]
8
8
  }
@@ -8,7 +8,7 @@
8
8
  "startsWith": "EQ",
9
9
  "prefixTest": "[0-9a-zA-Z-_]",
10
10
  "rareSymbols": "[0-9]",
11
- "apps": ["tonkeeper", "trustwallet"],
11
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
12
12
  "flags": ["m", "p", "s"]
13
13
  },
14
14
  "simpleR2": {
@@ -16,7 +16,7 @@
16
16
  "startsWith": "EQ",
17
17
  "prefixTest": "[0-9a-zA-Z-_]",
18
18
  "rareSymbols": "[0-9]",
19
- "apps": ["tonkeeper", "trustwallet"],
19
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
20
20
  "flags": ["m", "p", "s"]
21
21
  },
22
22
  "simpleR3": {
@@ -24,7 +24,7 @@
24
24
  "startsWith": "EQ",
25
25
  "prefixTest": "[0-9a-zA-Z-_]",
26
26
  "rareSymbols": "[0-9]",
27
- "apps": ["tonkeeper", "trustwallet"],
27
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
28
28
  "flags": ["m", "p", "s"]
29
29
  },
30
30
  "V2R1": {
@@ -32,7 +32,7 @@
32
32
  "startsWith": "EQ",
33
33
  "prefixTest": "[0-9a-zA-Z-_]",
34
34
  "rareSymbols": "[0-9]",
35
- "apps": ["tonkeeper", "trustwallet"],
35
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
36
36
  "flags": ["m", "p", "s"]
37
37
  },
38
38
  "V2R2": {
@@ -40,7 +40,7 @@
40
40
  "startsWith": "EQ",
41
41
  "prefixTest": "[0-9a-zA-Z-_]",
42
42
  "rareSymbols": "[0-9]",
43
- "apps": ["tonkeeper", "trustwallet"],
43
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
44
44
  "flags": ["m", "p", "s"]
45
45
  },
46
46
  "V3R1": {
@@ -48,7 +48,7 @@
48
48
  "startsWith": "EQ",
49
49
  "prefixTest": "[0-9a-zA-Z-_]",
50
50
  "rareSymbols": "[0-9]",
51
- "apps": ["tonkeeper", "trustwallet"],
51
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
52
52
  "flags": ["m", "p", "s"]
53
53
  },
54
54
  "V3R2": {
@@ -56,7 +56,7 @@
56
56
  "startsWith": "EQ",
57
57
  "prefixTest": "[0-9a-zA-Z-_]",
58
58
  "rareSymbols": "[0-9]",
59
- "apps": ["tonkeeper", "trustwallet"],
59
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
60
60
  "flags": ["m", "p", "s"]
61
61
  },
62
62
  "V4R1": {
@@ -64,7 +64,7 @@
64
64
  "startsWith": "EQ",
65
65
  "prefixTest": "[0-9a-zA-Z-_]",
66
66
  "rareSymbols": "[0-9]",
67
- "apps": ["tonkeeper", "trustwallet"],
67
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
68
68
  "flags": ["m", "p", "s"]
69
69
  },
70
70
  "V4R2": {
@@ -72,7 +72,7 @@
72
72
  "startsWith": "EQ|UQ",
73
73
  "prefixTest": "[0-9a-zA-Z-_]",
74
74
  "rareSymbols": "[0-9]",
75
- "apps": ["tonkeeper", "trustwallet"],
75
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
76
76
  "flags": ["m", "p", "s"]
77
77
  },
78
78
  "V5R1": {
@@ -80,7 +80,7 @@
80
80
  "startsWith": "EQ|UQ",
81
81
  "prefixTest": "[0-9a-zA-Z-_]",
82
82
  "rareSymbols": "[0-9]",
83
- "apps": ["tonkeeper", "trustwallet"],
83
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
84
84
  "flags": ["m", "p", "s"]
85
85
  },
86
86
  "W5": {
@@ -89,7 +89,7 @@
89
89
  "startsWith": "EQ|UQ",
90
90
  "prefixTest": "[0-9a-zA-Z-_]",
91
91
  "rareSymbols": "[0-9]",
92
- "apps": ["tonkeeper", "trustwallet"],
92
+ "apps": ["tonkeeper", "tonhub", "trustwallet"],
93
93
  "flags": ["m", "p", "s"]
94
94
  }
95
95
  },
@@ -4,5 +4,5 @@
4
4
  "prefixTest": "(?![0OI])[1-9a-zA-Z]",
5
5
  "rareSymbols": "[1-9a-z]",
6
6
  "apps": ["tronlink", "trustwallet"],
7
- "flags": ["p", "s"]
7
+ "flags": ["m", "p", "s"]
8
8
  }