-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
48 lines (41 loc) · 1.18 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const readline = require('readline');
const generateWallet = require('./src/generate_wallet');
const sortAddressList = require('./src/sorted_wallet');
const figlet = require("figlet")
require('colors')
// Function to display the menu and get user choice
function displayMenu() {
console.log('Menu:');
console.log('1. Generate Wallet address');
console.log('2. Merge all wallet address');
return new Promise((resolve) => {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question('Enter your choice (1-2): ', (choice) => {
rl.close();
resolve(choice);
});
});
}
// Main function to handle user choice
async function main() {
let userChoice;
const banner = await figlet.text("Sei Gen");
console.log(banner, "\nGithub: https://github.com/Tnodes\n");
userChoice = await displayMenu();
switch (userChoice) {
case '1':
await generateWallet.main();
break;
case '2':
await sortAddressList.main();
break;
default:
console.log('Invalid choice. Please enter a number between 1 and 2.');
break;
}
}
// Run the main function
main();