@yerofey/cryptowallet-cli 1.33.0 → 1.34.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 CHANGED
@@ -114,21 +114,18 @@ $ cw -l
114
114
 
115
115
  ## Blockchains & tickers supported
116
116
 
117
- - `EVM` (Ethereum, Polygon, Arbitrum, Optimism, L2/L3, etc.)
117
+ - `EVM` (Ethereum, Base, Arbitrum, Optimism, Polygon, L2/L3, etc.) **default**
118
118
  - `BTC` (Bitcoin) [legacy, segwit, bech32, taproot]
119
119
  - `ETH` (Ethereum)
120
120
  - `BNB` (Binance Coin) [BEP2, BEP20, ERC20]
121
121
  - `BSC` (Binance Smart Chain)
122
- - `ARB` (Arbitrum)
123
- - `OP` (Optimism)
124
- - `MATIC` (Polygon)
125
122
  - `SOL` (Solana)
126
- - `TON` (The Open Network)
123
+ - `TRX` (Tron)
124
+ - `TON` (The Open Network) [W5, V2-V5, simple]
127
125
  - `DOGE` (Dogecoin) [legacy, segwit, bech32]
128
126
  - `BCH` (Bitcoin Cash)
129
127
  - `LTC` (Litecoin) [legacy, segwit, bech32]
130
- - `POLYGON` (Polygon)
131
- - `TRX` (Tron)
128
+ - `ETC` (Ethereum Classic)
132
129
  - `XTZ` (Tezos)
133
130
  - `DASH` (Dash)
134
131
  - `DCR` (Decred)
@@ -185,6 +182,8 @@ $ cw -l
185
182
  - [x] v19.x ✅
186
183
  - [x] v20.x ✅
187
184
  - [x] v21.x ✅
185
+ - [x] v22.x ✅
186
+ - [x] v23.x ✅
188
187
 
189
188
  *tested on Ubuntu 22.04 & Mac M1*
190
189
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yerofey/cryptowallet-cli",
3
- "version": "1.33.0",
3
+ "version": "1.34.0",
4
4
  "description": "Crypto wallet generator CLI tool",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/yerofey/cryptowallet-cli",
@@ -80,8 +80,12 @@
80
80
  "bnb",
81
81
  "sol",
82
82
  "solana",
83
+ "sui",
84
+ "sui-blockchain",
85
+ "sui-wallet",
83
86
  "ton",
84
87
  "the-open-network",
88
+ "base",
85
89
  "litecoin",
86
90
  "ltc",
87
91
  "bitcoin-cash",
@@ -105,6 +109,7 @@
105
109
  "dependencies": {
106
110
  "@binance-chain/javascript-sdk": "^4.2.2",
107
111
  "@harmony-js/account": "^0.1.58",
112
+ "@mysten/sui": "^1.18.0",
108
113
  "@solana/web3.js": "^1.98.0",
109
114
  "@ton/core": "^0.59.1",
110
115
  "@ton/crypto": "^3.3.0",
package/src/Method.js CHANGED
@@ -558,7 +558,7 @@ class Method {
558
558
  appsString +=
559
559
  ' and any other wallet app (either using mnemonic or private key)';
560
560
  }
561
- log(greenBright('⬇️ You can import this wallet into ' + appsString));
561
+ log(greenBright('⬇️ You can import this wallet into ' + appsString));
562
562
  }
563
563
 
564
564
  // donation
package/src/Wallet.js CHANGED
@@ -36,6 +36,7 @@ import {
36
36
  mnemonicNew as newTonMnemonic,
37
37
  } from '@ton/crypto';
38
38
  import { WalletContractV5R1 } from '@ton/ton';
39
+ import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
39
40
 
40
41
  config();
41
42
 
@@ -481,6 +482,43 @@ class Wallet {
481
482
  addresses,
482
483
  mnemonic,
483
484
  });
485
+ } else if (chain == 'SUI') {
486
+ // Validate mnemonic
487
+ if (mnemonicString !== '' && !bip39.validateMnemonic(mnemonicString)) {
488
+ return {
489
+ error: 'mnemonic is not valid',
490
+ };
491
+ }
492
+
493
+ // Generate or use provided mnemonic
494
+ const mnemonic = mnemonicString || bip39.generateMnemonic();
495
+
496
+ try {
497
+ // Derive seed from mnemonic
498
+ const seed = bip39.mnemonicToSeedSync(mnemonic);
499
+
500
+ // Derive keypair using Sui's standard derivation path
501
+ const { key } = derivePath("m/44'/784'/0'/0'/0'", seed.toString('hex'));
502
+ const keypair = Ed25519Keypair.fromSecretKey(Buffer.from(key, 'hex'));
503
+
504
+ // Get Sui address from public key
505
+ const address = keypair.getPublicKey().toSuiAddress();
506
+
507
+ Object.assign(result, {
508
+ addresses: [
509
+ {
510
+ index: 0,
511
+ address: address,
512
+ privateKey: keypair.getSecretKey().toString('hex'),
513
+ },
514
+ ],
515
+ mnemonic,
516
+ });
517
+ } catch (error) {
518
+ return {
519
+ error: `Failed to generate SUI wallet: ${error.message} (${error})`,
520
+ };
521
+ }
484
522
  } else if (chain == 'TON') {
485
523
  // Validate mnemonic
486
524
  if (
@@ -0,0 +1,8 @@
1
+ {
2
+ "title": "Sui",
3
+ "network": "SUI",
4
+ "startsWith": "0x",
5
+ "prefixTest": "^[0-9A-Fa-f]+$",
6
+ "apps": ["Sui Wallet"],
7
+ "flags": ["m", "n", "p", "s", "f"]
8
+ }
@@ -1,8 +0,0 @@
1
- {
2
- "title": "Arbitrum",
3
- "network": "EVM",
4
- "startsWith": "0x",
5
- "prefixTest": "[0-9a-fA-F]",
6
- "apps": ["metamask", "trustwallet"],
7
- "flags": ["m", "n", "p", "s"]
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "title": "Polygon",
3
- "network": "EVM",
4
- "startsWith": "0x",
5
- "prefixTest": "[0-9a-fA-F]",
6
- "apps": ["metamask", "trustwallet"],
7
- "flags": ["m", "n", "p", "s"]
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "title": "Optimism",
3
- "network": "EVM",
4
- "startsWith": "0x",
5
- "prefixTest": "[0-9a-fA-F]",
6
- "apps": ["metamask", "trustwallet"],
7
- "flags": ["m", "n", "p", "s"]
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "title": "Polygon",
3
- "network": "EVM",
4
- "startsWith": "0x",
5
- "prefixTest": "[0-9a-fA-F]",
6
- "apps": ["metamask", "trustwallet"],
7
- "flags": ["m", "n", "p", "s"]
8
- }