-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.js
125 lines (112 loc) · 4.23 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import * as initia from "./src/module/initia/initia.js";
import * as routine from "./src/module/initia/initia_routine.js";
import { account } from "./src/account.js";
import { AppConstant } from "./src/utils/constant.js";
import { Tucana } from "./src/module/tucana/tucana.js";
async function doQuest(walletAddress, privateKey) {
return new Promise(async (resolve, reject) => {
try {
await initia
.initiation(walletAddress, privateKey)
.then(async () => {
await initia
.queryBalance()
.then(async (initBalance) => {
console.log(`Account ${walletAddress} Information`);
console.log();
console.log("Doing daily routine for Account " + walletAddress);
if (initBalance.amount / 1000000 < 10) {
reject(
`Balance < 20 Initia for account ${walletAddress}, Please request initia token from faucet `
);
} else {
// console.log(
// "1. Send 1 Init to Other for Account" + walletAddress
// );
// await routine.sendOneInitToOther();
// console.log();
// console.log(
// "2. Send 1 Init to Other (BLACKWING) for Account" +
// walletAddress
// );
// await routine.sendOneInitToOtherLayer(
// AppConstant.BLACKWINGBRIDGEID
// );
// console.log();
// console.log(
// "3. Send 1 Init to Other (Noon) for Account" + walletAddress
// );
// await routine.sendOneInitToOtherLayer(AppConstant.NOONBRIDGEID);
// console.log();
// console.log(
// "4. Send 1 Init to Other (TUCANA) for Account" + walletAddress
// );
// await routine.sendOneInitToOtherLayer(
// AppConstant.TUCANABRIDGEID
// );
// console.log();
// console.log(
// "5. Send 1 Init to Other (INIT AI) for Account" +
// walletAddress
// );
// await routine.sendOneInitToOtherLayer(
// AppConstant.INITAIBRIDGEID
// );
// console.log();
// console.log(
// "6. Send 1 Init to Other (MINIMOVE) for Account" +
// walletAddress
// );
// await routine.sendOneInitToOtherLayer(
// AppConstant.MINIMOVEBRIDGEID
// );
// console.log();
// console.log(
// "7. Send 1 Init to Other (MINIWASM) for Account" +
// walletAddress
// );
// await routine.sendOneInitToOtherLayer(
// AppConstant.MINIWASMBRIDGEID
// );
// console.log();
// console.log(
// "8. Swap 1 INIT to USDC for Account" + walletAddress
// );
// await routine.swap();
// console.log();
// console.log(
// "9. Stake 0.1 INIT to Omninode Account" + walletAddress
// );
// await routine.stakeInit();
// console.log();
const tucana = new Tucana();
tucana.address = walletAddress;
console.log(
"10. Swap 1 INIT to USDC on TUCANA Account" + walletAddress
);
await routine.stakeInit();
console.log();
resolve(true);
}
})
.then((error) => reject(error));
})
.then((error) => reject(error));
} catch (error) {
reject(error);
}
});
}
(async () => {
try {
account.forEach(async (account) => {
var walletAddress = account[0];
var privateKey = account[1];
await doQuest(walletAddress, privateKey).catch((error) =>
console.error(error)
);
});
} catch (error) {
console.error("Error During executing bot", error);
}
})();