hodl-wallet 1.4.6 β†’ 1.5.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
@@ -41,9 +41,19 @@ Keep your favorite addresses handy. No more copy-pasting!
41
41
 
42
42
  ### 🌐 Multi-Network Support
43
43
 
44
- Seamlessly manage your assets on both BEP-20 (Binance Smart Chain) and ERC-20 (Ethereum and Polygon) networks. Switch between networks with ease!
44
+ Seamlessly manage your assets on multiple networks. HODL Wallet supports the following networks:
45
45
 
46
- ### πŸ’Ύ Export and Import HODL Files
46
+ - Binance Smart Chain
47
+ - Ethereum
48
+ - Polygon
49
+ - Optimism
50
+ - Arbitrum One
51
+ - Fantom
52
+ - Avalanche C-Chain
53
+
54
+ Each network supports its native token and popular tokens like USDT. You can easily add more tokens as needed.
55
+
56
+ ## πŸ’Ύ Export and Import HODL Files
47
57
 
48
58
  HODL Wallet now supports exporting and importing encrypted .HODL files, which securely store your wallet information.
49
59
 
@@ -83,6 +93,18 @@ We've carefully selected trusted and well-maintained dependencies for this proje
83
93
 
84
94
  ⚠️ **Important Notice**: HODL Wallet is a personal project created with the best intentions. While we strive for security, it may contain security flaws or vulnerabilities. Use at your own risk and always exercise caution with your crypto assets.
85
95
 
96
+ ## πŸ“˜ What HODL means
97
+
98
+ The term "HODL" is a cornerstone of crypto culture, and it's worth understanding its origins:
99
+
100
+ - πŸŽ‚ Born on December 18, 2013, in a Bitcoin Talk forum post
101
+ - 🍺 Originally a typo for "HOLD" in a drunk, impassioned rant about not selling Bitcoin
102
+ - πŸ”€ Later backronymed to mean "Hold On for Dear Life"
103
+ - πŸ’Ž Symbolizes a long-term investment strategy and resistance to panic selling
104
+ - 🌍 Now used across various cryptocurrency communities as a rallying cry
105
+
106
+ HODL embodies the belief in the long-term potential of cryptocurrencies, often in the face of short-term market volatility. It's more than just a misspelling; it's a philosophy that has shaped the crypto landscape.
107
+
86
108
  ## 🀝 Contributing
87
109
 
88
110
  Found a bug? Want to add a feature? We're all ears! Open an issue or submit a PR. Let's make crypto easier together.
package/index.mjs CHANGED
@@ -36,6 +36,7 @@ class Wallet {
36
36
  this.web3 = null;
37
37
  this.selectedNetwork = null;
38
38
  this.account = null;
39
+ this.networkUsage = this.db.get('networkUsage') || {};
39
40
  }
40
41
 
41
42
  async initialize() {
@@ -84,14 +85,23 @@ class Wallet {
84
85
  }
85
86
 
86
87
  async selectNetwork(networkPlugins) {
88
+ // Sort networks by usage count (descending)
89
+ const sortedNetworks = networkPlugins.sort((a, b) =>
90
+ (this.networkUsage[b.name] || 0) - (this.networkUsage[a.name] || 0)
91
+ );
92
+
87
93
  const { network } = await inquirer.prompt({
88
94
  type: 'list',
89
95
  name: 'network',
90
96
  message: 'Select the network:',
91
- choices: networkPlugins.map(plugin => plugin.name),
97
+ choices: sortedNetworks.map(plugin => plugin.name),
92
98
  });
93
99
 
94
- const selectedNetwork = networkPlugins.find(plugin => plugin.name === network);
100
+ const selectedNetwork = sortedNetworks.find(plugin => plugin.name === network);
101
+
102
+ // Increment usage count for the selected network
103
+ this.networkUsage[network] = (this.networkUsage[network] || 0) + 1;
104
+ this.db.set('networkUsage', this.networkUsage);
95
105
 
96
106
  this.selectedNetwork = selectedNetwork;
97
107
  }
@@ -327,7 +337,7 @@ class Wallet {
327
337
  const { amount } = await inquirer.prompt({
328
338
  type: 'input',
329
339
  name: 'amount',
330
- message: `Amount to transfer [${token}] (leave empty to cancel):`,
340
+ message: `Amount to transfer:`,
331
341
  validate: value => {
332
342
  if (value === '') return true;
333
343
  return !isNaN(value) && Number(value) > 0 ? true : 'Please enter a valid number or leave empty to cancel.';
@@ -338,6 +348,18 @@ class Wallet {
338
348
  return;
339
349
  }
340
350
 
351
+ // Add confirmation step
352
+ const { confirmTransaction } = await inquirer.prompt({
353
+ type: 'confirm',
354
+ name: 'confirmTransaction',
355
+ message: `Confirm transfer?`,
356
+ default: true
357
+ });
358
+
359
+ if (!confirmTransaction) {
360
+ return;
361
+ }
362
+
341
363
  try {
342
364
  let signedTx;
343
365
  if (tokens[token] && token !== this.selectedNetwork.nativeToken) {
package/network/arb.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ name: '[ERC-20] Arbitrum One',
3
+ explorer: 'https://arbiscan.io/tx/',
4
+ rpcUrl: 'https://arb1.arbitrum.io/rpc',
5
+ nativeToken: 'ETH',
6
+ tokens: {
7
+ 'USDT': '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', // USDT on Arbitrum
8
+ 'ARB': '0x0000000000000000000000000000000000000000', // Native ETH on Arbitrum
9
+ },
10
+ };
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ name: '[ERC-20] Avalanche C-Chain',
3
+ explorer: 'https://snowtrace.io/tx/',
4
+ rpcUrl: 'https://api.avax.network/ext/bc/C/rpc',
5
+ nativeToken: 'AVAX',
6
+ tokens: {
7
+ 'USDT': '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', // USDT.e on Avalanche C-Chain
8
+ 'AVAX': '0x0000000000000000000000000000000000000000', // Native AVAX
9
+ },
10
+ };
package/network/ftm.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ name: '[ERC-20] Fantom',
3
+ explorer: 'https://ftmscan.com/tx/',
4
+ rpcUrl: 'https://rpc.ftm.tools/',
5
+ nativeToken: 'FTM',
6
+ tokens: {
7
+ 'USDT': '0x049d68029688eAbF473097a2fC38ef61633A3C7A', // USDT on Fantom
8
+ 'FTM': '0x0000000000000000000000000000000000000000', // Native FTM
9
+ },
10
+ };
package/network/op.js ADDED
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ name: '[ERC-20] Optimism',
3
+ explorer: 'https://optimistic.etherscan.io/tx/',
4
+ rpcUrl: 'https://mainnet.optimism.io',
5
+ nativeToken: 'ETH',
6
+ tokens: {
7
+ 'USDT': '0x94b008aA00579c1307B0EF2c499aD98a8ce58e58', // USDT on Optimism
8
+ 'OP': '0x0000000000000000000000000000000000000000',
9
+ },
10
+ };
package/network/pol.js CHANGED
@@ -5,6 +5,7 @@ module.exports = {
5
5
  rpcUrl: 'https://polygon-rpc.com/',
6
6
  nativeToken: 'POL',
7
7
  tokens: {
8
- 'USDT': '0xc2132D05D31c914a87C6611C10748AEb04B58e8F', // DirecciΓ³n del contrato USDT en Polygon
8
+ 'USDT': '0xc2132D05D31c914a87C6611C10748AEb04B58e8F',
9
+ 'POL': '0x0000000000000000000000000000000000000000',
9
10
  },
10
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hodl-wallet",
3
- "version": "1.4.6",
3
+ "version": "1.5.2",
4
4
  "description": "🧊 HODL Wallet - Fast CLI crypto wallet!",
5
5
  "author": "Martin Clasen",
6
6
  "repository": {
@@ -39,7 +39,11 @@
39
39
  "evm",
40
40
  "polygon",
41
41
  "matic",
42
- "pol",
42
+ "arbitrum",
43
+ "fantom",
44
+ "optimism",
45
+ "avalanche",
46
+ "avax",
43
47
  "clasen"
44
48
  ],
45
49
  "dependencies": {
@@ -53,4 +57,4 @@
53
57
  "inquirer-fuzzy-path": "^2.3.0",
54
58
  "web3": "^4.13.0"
55
59
  }
56
- }
60
+ }