hodl-wallet 1.8.8 → 1.9.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 +3 -9
- package/index.js +22 -3
- package/package.json +19 -24
- package/test/test-all.js +3 -3
- package/test/test-integration.js +3 -3
- package/network/disabled/rsk.js +0 -14
- /package/network/{ton.js → disabled/ton.js} +0 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Let's face it, Trust Wallet's sluggishness and annoying ads are so last season.
|
|
|
17
17
|
- 🚫 Zero ads, zero BS
|
|
18
18
|
- 🔒 Create wallets offline (because paranoia is just good sense in crypto)
|
|
19
19
|
- 🔍 Fully transparent, open-source code
|
|
20
|
-
- 🌐 Support for Bitcoin and Ethereum. Binance Smart Chain,
|
|
20
|
+
- 🌐 Support for Bitcoin and Ethereum. Binance Smart Chain, Polygon, Avalanche, Optimism, Arbitrum, and Fantom.
|
|
21
21
|
|
|
22
22
|
That's it! Follow the prompts and you're in crypto heaven.
|
|
23
23
|
|
|
@@ -44,9 +44,6 @@ Keep your favorite addresses handy. No more copy-pasting!
|
|
|
44
44
|
Seamlessly manage your assets on multiple networks. HODL Wallet supports the following networks:
|
|
45
45
|
|
|
46
46
|
- Bitcoin
|
|
47
|
-
- TON (The Open Network)
|
|
48
|
-
- Native TON transfers
|
|
49
|
-
- Jetton support (USDT)
|
|
50
47
|
- EVM
|
|
51
48
|
- Ethereum
|
|
52
49
|
- Binance Smart Chain
|
|
@@ -75,6 +72,8 @@ The main advantage of exporting a HODL file is that to access the private key, y
|
|
|
75
72
|
|
|
76
73
|
We encourage users to perform their own security audits. One easy way to do this is to copy the entire codebase into ChatGPT or another AI assistant and ask if the code appears secure or if there are any malicious intentions. This is a good practice for any open-source project you're considering using.
|
|
77
74
|
|
|
75
|
+
**For a deeper understanding**: [HODL DeepWiki](https://deepwiki.com/clasen/HODL)
|
|
76
|
+
|
|
78
77
|
### 🔑 Private Key Storage
|
|
79
78
|
|
|
80
79
|
Your private key is securely stored in a JSON file, encrypted with a password of your choice. The encryption adds an extra layer of security, making it significantly harder for unauthorized parties to access your private key even if they gain access to the JSON file.
|
|
@@ -98,11 +97,6 @@ We've carefully selected trusted and well-maintained dependencies for this proje
|
|
|
98
97
|
- Web3
|
|
99
98
|
- **web3**: The Ethereum JavaScript API for blockchain interactions.
|
|
100
99
|
- **hdkey**: For handling hierarchical deterministic (HD) keys.
|
|
101
|
-
- TON
|
|
102
|
-
- **@ton/ton**: The TON JavaScript SDK for blockchain interactions.
|
|
103
|
-
- **@ton/core**: Core TON blockchain operations and data structures.
|
|
104
|
-
- **@ton/crypto**: Cryptographic functions for TON blockchain.
|
|
105
|
-
- **@orbs-network/ton-access**: For reliable TON network access.
|
|
106
100
|
- Bitcoin
|
|
107
101
|
- **bitcoinjs-lib**: For Bitcoin-specific operations.
|
|
108
102
|
- **bip32**: For handling hierarchical deterministic (HD) keys.
|
package/index.js
CHANGED
|
@@ -56,7 +56,26 @@ class Wallet {
|
|
|
56
56
|
|
|
57
57
|
async initialize() {
|
|
58
58
|
try {
|
|
59
|
-
|
|
59
|
+
const rawNetworkUsage = await this.db.get('networkUsage') || {};
|
|
60
|
+
|
|
61
|
+
// Validate and clean networkUsage data
|
|
62
|
+
this.networkUsage = {};
|
|
63
|
+
for (const [networkName, usage] of Object.entries(rawNetworkUsage)) {
|
|
64
|
+
if (typeof usage === 'number') {
|
|
65
|
+
// Old format - convert to new format
|
|
66
|
+
this.networkUsage[networkName] = {
|
|
67
|
+
count: usage,
|
|
68
|
+
lastUsed: 0
|
|
69
|
+
};
|
|
70
|
+
} else if (typeof usage === 'object' && usage !== null && !Array.isArray(usage) && typeof usage.count === 'number') {
|
|
71
|
+
// Valid new format
|
|
72
|
+
this.networkUsage[networkName] = {
|
|
73
|
+
count: usage.count,
|
|
74
|
+
lastUsed: usage.lastUsed || 0
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Skip corrupted entries (they'll be recreated when needed)
|
|
78
|
+
}
|
|
60
79
|
|
|
61
80
|
const networkPlugins = await this.loadNetworkPlugins();
|
|
62
81
|
if (networkPlugins.length === 0) {
|
|
@@ -171,8 +190,8 @@ class Wallet {
|
|
|
171
190
|
// Handle migration from old format (number) to new format (object)
|
|
172
191
|
const currentUsage = this.networkUsage[selectedNetwork.name];
|
|
173
192
|
|
|
174
|
-
if (!currentUsage || typeof currentUsage === 'number') {
|
|
175
|
-
// Old format (number)
|
|
193
|
+
if (!currentUsage || typeof currentUsage === 'number' || typeof currentUsage !== 'object' || currentUsage === null || Array.isArray(currentUsage)) {
|
|
194
|
+
// Old format (number), doesn't exist, or corrupted data - create new object
|
|
176
195
|
this.networkUsage[selectedNetwork.name] = {
|
|
177
196
|
count: typeof currentUsage === 'number' ? currentUsage + 1 : 1,
|
|
178
197
|
lastUsed: Date.now()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hodl-wallet",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "🧊 HODL Wallet - Fast CLI crypto wallet!",
|
|
5
5
|
"author": "Martin Clasen",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"bep20",
|
|
33
33
|
"bnb",
|
|
34
34
|
"eth",
|
|
35
|
-
"ton",
|
|
36
35
|
"binance",
|
|
37
36
|
"trust",
|
|
38
37
|
"blockchain",
|
|
@@ -51,30 +50,26 @@
|
|
|
51
50
|
"clasen"
|
|
52
51
|
],
|
|
53
52
|
"dependencies": {
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"ora": "^8.1.1",
|
|
72
|
-
"tiny-secp256k1": "^2.2.3",
|
|
73
|
-
"tmp": "^0.2.4",
|
|
74
|
-
"web3": "^4.14.0"
|
|
53
|
+
"axios": "^1.13.2",
|
|
54
|
+
"bip32": "^4.0.0",
|
|
55
|
+
"bip39": "3.1.0",
|
|
56
|
+
"bitcoinjs-lib": "6.1.7",
|
|
57
|
+
"cli-table3": "0.6.5",
|
|
58
|
+
"crypto-js": "4.2.0",
|
|
59
|
+
"deepbase": "1.5.2",
|
|
60
|
+
"ecpair": "2.1.0",
|
|
61
|
+
"external-editor": "3.1.0",
|
|
62
|
+
"hdkey": "^0.6.0",
|
|
63
|
+
"inquirer": "9.3.7",
|
|
64
|
+
"inquirer-autocomplete-prompt": "3.0.1",
|
|
65
|
+
"inquirer-fuzzy-path": "2.3.0",
|
|
66
|
+
"ora": "8.1.1",
|
|
67
|
+
"tiny-secp256k1": "2.2.3",
|
|
68
|
+
"tmp": "0.2.4",
|
|
69
|
+
"web3": "4.14.0"
|
|
75
70
|
},
|
|
76
71
|
"overrides": {
|
|
77
|
-
"tmp": "
|
|
72
|
+
"tmp": "0.2.4"
|
|
78
73
|
},
|
|
79
74
|
"type": "module"
|
|
80
75
|
}
|
package/test/test-all.js
CHANGED
|
@@ -14,9 +14,9 @@ class ComprehensiveTester {
|
|
|
14
14
|
displayWelcome() {
|
|
15
15
|
console.log('\x1b[32m'); // Set text color to green
|
|
16
16
|
console.log(`
|
|
17
|
-
|
|
18
|
-
░░░░░░░░░░░░░░ 🧊 HODL WALLET - COMPREHENSIVE TEST SUITE
|
|
19
|
-
|
|
17
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
18
|
+
░░░░░░░░░░░░░░ 🧊 HODL WALLET - COMPREHENSIVE TEST SUITE ░░░░░░░░░░░░░░░
|
|
19
|
+
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
|
|
20
20
|
`);
|
|
21
21
|
console.log('\x1b[0m'); // Reset text color
|
|
22
22
|
console.log('This test suite will validate all network implementations and integrations.\n');
|
package/test/test-integration.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import path from 'path';
|
|
5
3
|
import { fileURLToPath } from 'url';
|
|
6
4
|
import { dirname } from 'path';
|
|
7
5
|
import Table from 'cli-table3';
|
|
@@ -99,7 +97,9 @@ class IntegrationTester extends NetworkTester {
|
|
|
99
97
|
this.crossNetworkResults.push({
|
|
100
98
|
test: 'Network Type Distribution',
|
|
101
99
|
status: totalNetworks === allNetworks.length ? 'PASS' : 'FAIL',
|
|
102
|
-
message:
|
|
100
|
+
message: tonNetworks.length === 0 ?
|
|
101
|
+
`Found ${totalNetworks} categorized networks out of ${allNetworks.length} total (TON network disabled)` :
|
|
102
|
+
`Found ${totalNetworks} categorized networks out of ${allNetworks.length} total`,
|
|
103
103
|
details: results
|
|
104
104
|
});
|
|
105
105
|
|
package/network/disabled/rsk.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Web3Network from './lib/Web3Network.js';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
NetworkClass: Web3Network,
|
|
5
|
-
name: '[ERC-20] Rootstock',
|
|
6
|
-
url: 'https://public-node.rsk.co',
|
|
7
|
-
nativeToken: 'RBTC',
|
|
8
|
-
explorer: 'https://explorer.rootstock.io/tx/',
|
|
9
|
-
tokens: {
|
|
10
|
-
// 'USDT': {
|
|
11
|
-
// address: '0x833589fCD6eDb6E08B1Daf2d5F90D7ae4Dfd9F59',
|
|
12
|
-
// }
|
|
13
|
-
}
|
|
14
|
-
};
|
|
File without changes
|