forked from CloudhGamer/OG-Lab-Auto-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.js
More file actions
42 lines (37 loc) · 2.62 KB
/
utils.js
File metadata and controls
42 lines (37 loc) · 2.62 KB
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
require('colors');
const fs = require('fs');
const readlineSync = require('readline-sync');
function loadNetworkConfig(networkType) {
const filePath = `./chains/${networkType}.json`;
try {
const rawData = fs.readFileSync(filePath);
return JSON.parse(rawData);
} catch (error) {
console.error(`Error loading network configuration: ${error.message}`.red);
process.exit(1);
}
}
function getUserInput() {
const name = readlineSync.question('Enter token name: '.cyan);
const symbol = readlineSync.question('Enter token symbol: '.cyan);
const supply = readlineSync.question('Enter token supply: '.cyan);
return { name, symbol, supply };
}
function displayHeader() {
process.stdout.write('\x1Bc');
console.log('================================================================================'.rainbow);
console.log('= 🚀🎮 EVM Auto Deploy 🎮🚀 ='.cyan.bold);
console.log('= Created by Kazuha ='.magenta);
console.log('= https://t.me/Offical_Im_kazuha ='.blue);
console.log('= GitHub: https://github.com/Kazuha787 ='.blue);
console.log('= ██╗ ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗ █████╗ ='.yellow);
console.log('= ██║ ██╔╝██╔══██╗╚══███╔╝██║ ██║██║ ██║██╔══██╗ ='.yellow);
console.log('= █████╔╝ ███████║ ███╔╝ ██║ ██║███████║███████║ ='.yellow);
console.log('= ██╔═██╗ ██╔══██║ ███╔╝ ██║ ██║██╔══██║██╔══██║ ='.yellow);
console.log('= ██║ ██╗██║ ██║███████╗╚██████╔╝██║ ██║██║ ██║ ='.yellow);
console.log('= ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ='.yellow);
console.log('================================================================================'.rainbow);
console.log();
}
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
module.exports = { loadNetworkConfig, getUserInput, displayHeader, delay };