hodl-wallet 1.5.6 → 1.5.8
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 +1 -0
- package/index.mjs +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,6 +90,7 @@ We've carefully selected trusted and well-maintained dependencies for this proje
|
|
|
90
90
|
- **cli-table3**: For creating formatted CLI tables.
|
|
91
91
|
- **bip39**: For generating and handling mnemonic phrases.
|
|
92
92
|
- **hdkey**: For handling hierarchical deterministic (HD) keys.
|
|
93
|
+
- **ora**: For displaying progress bars.
|
|
93
94
|
|
|
94
95
|
⚠️ **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.
|
|
95
96
|
|
package/index.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import bip39 from 'bip39';
|
|
|
12
12
|
import hdkey from 'hdkey';
|
|
13
13
|
import os from 'os';
|
|
14
14
|
import inquirerFuzzyPath from 'inquirer-fuzzy-path';
|
|
15
|
+
import ora from 'ora';
|
|
15
16
|
|
|
16
17
|
const __filename = fileURLToPath(import.meta.url);
|
|
17
18
|
const __dirname = dirname(__filename);
|
|
@@ -365,7 +366,13 @@ class Wallet {
|
|
|
365
366
|
return;
|
|
366
367
|
}
|
|
367
368
|
|
|
369
|
+
const spinner = ora({
|
|
370
|
+
text: 'Sending transaction...',
|
|
371
|
+
spinner: 'dots'
|
|
372
|
+
}).start();
|
|
373
|
+
|
|
368
374
|
try {
|
|
375
|
+
|
|
369
376
|
let signedTx;
|
|
370
377
|
if (tokens[token] && token !== this.selectedNetwork.nativeToken) {
|
|
371
378
|
signedTx = await this.handleERC20Transfer(token, address, amount);
|
|
@@ -374,6 +381,9 @@ class Wallet {
|
|
|
374
381
|
}
|
|
375
382
|
|
|
376
383
|
const receipt = await this.web3.eth.sendSignedTransaction(signedTx.rawTransaction);
|
|
384
|
+
|
|
385
|
+
spinner.succeed('Transaction confirmed!');
|
|
386
|
+
|
|
377
387
|
this.displayTransactionResult(address, token, amount, receipt.transactionHash);
|
|
378
388
|
|
|
379
389
|
// Add transaction to history
|
|
@@ -384,6 +394,7 @@ class Wallet {
|
|
|
384
394
|
}
|
|
385
395
|
|
|
386
396
|
} catch (error) {
|
|
397
|
+
spinner.fail('Transaction failed');
|
|
387
398
|
this.displayTransactionError(error);
|
|
388
399
|
}
|
|
389
400
|
}
|