forked from munris-vlad/wallet-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
82 lines (77 loc) · 3.4 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import {chooiceNetwork, entryPoint, evmNetwork} from "./utils/common.js"
import {zkSyncFetchDataAndPrintTable} from "./checkers/zksync.js"
import {aptosFetchDataAndPrintTable} from "./checkers/aptos.js"
import {starknetFetchDataAndPrintTable} from "./checkers/starknet.js"
import {zoraFetchDataAndPrintTable} from "./checkers/zora.js"
import {lineaFetchDataAndPrintTable} from "./checkers/linea.js"
import {balancesFetchDataAndPrintTable} from "./checkers/balances.js"
import {evmFetchDataAndPrintTable} from "./checkers/evm.js"
import {filterFetchDataAndPrintTable} from "./checkers/filter.js"
import {nftFetchDataAndPrintTable} from "./checkers/nft.js"
import {exec} from "child_process"
import {layerzeroFetchDataAndPrintTable} from "./checkers/layerzero.js";
function startExpressServer() {
const expressServer = exec('node server.js', (error, stdout, stderr) => {
if (error) {
console.error(`[Express Server Error]: ${error}`)
}
console.log(`[Express Server]: ${stdout}`)
})
expressServer.stdout.on('data', (data) => {
console.log(`[Express Server]: ${data}`)
})
expressServer.stderr.on('data', (data) => {
console.error(`[Express Server Error]: ${data}`)
})
}
async function startMenu() {
let mode = await entryPoint()
switch (mode) {
case "web":
startExpressServer()
break
case "zksync":
await zkSyncFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "starknet":
await starknetFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "layerzero":
await layerzeroFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "zora":
await zoraFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "aptos":
await aptosFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "linea":
await lineaFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "evm":
let chain = await evmNetwork()
await evmFetchDataAndPrintTable(chain).catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "balances":
let network = await chooiceNetwork()
await balancesFetchDataAndPrintTable(network).catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "filter":
await filterFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
case "nft":
await nftFetchDataAndPrintTable().catch(error => { console.error('Произошла ошибка:', error)})
await startMenu()
break
}
}
await startMenu()