-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.ts
38 lines (31 loc) · 876 Bytes
/
app.ts
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
import { toCsv } from "src/common/csv";
import klay from "src/klay";
import eth from "src/ethereum";
import matic from "src/matic";
const NETWORK = process.argv[2];
const CONTRACT_ADDRESS = process.argv[3];
async function run() {
console.log(`
=== NFT SNAPSHOOTER ===
* Network: ${NETWORK.toUpperCase()}
* Contract Address: ${CONTRACT_ADDRESS}
`);
switch (NETWORK.toUpperCase()) {
case "ETH":
const ownersETH = await eth(CONTRACT_ADDRESS);
toCsv(CONTRACT_ADDRESS, ownersETH);
break;
case "KLAY":
const ownersKLAY = await klay(CONTRACT_ADDRESS);
toCsv(CONTRACT_ADDRESS, ownersKLAY);
break;
case "MATIC":
const ownersMATIC = await matic(CONTRACT_ADDRESS);
toCsv(CONTRACT_ADDRESS, ownersMATIC);
break;
default:
console.log("ERROR: Please check Network.");
break;
}
}
run();