-
Notifications
You must be signed in to change notification settings - Fork 24
/
config.js
339 lines (333 loc) · 10.3 KB
/
config.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
import { Civitia } from "./src/module/civitia/civitia.js";
import { InitAi } from "./src/module/init_ai/init_ai.js";
import { Initia } from "./src/module/initia/initia.js";
import { Tucana } from "./src/module/tucana/tucana.js";
import { BridgeID } from "./src/utils/enum/bridge.js";
import { COIN } from "./src/utils/enum/coin.js";
import { Pair } from "./src/utils/enum/pair.js";
/**
* Initia daily bot configuration class.
*
* @class
* Configuration class for configuring bot feature
*
* Author : Widiskel
*
*/
class Config {
constructor(initia, civitia, tucana, initAi, userConfig, address) {
/** @type {Civitia} */
this.civitia = civitia;
/** @type {Tucana} */
this.tucana = tucana;
/** @type {Initia} */
this.initia = initia;
/** @type {InitAi} */
this.initAi = initAi;
/** @type {string} */
this.walletAddress = address;
this.config = userConfig;
}
isInConfig = (number) => {
return config.includes(number);
};
async executeConfigCode(number) {
return new Promise(async (resolve, reject) => {
try {
switch (number) {
case 1:
console.log(
"1. Send 1 Init to Other for Account " + this.walletAddress
);
await this.initia.sendOneInitToOther();
console.log();
break;
case 2:
console.log(
"2. Send 1 Init to Other (BLACKWING) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(BridgeID.BLACKWING);
console.log();
break;
case 3:
console.log(
"3. Send 1 Init to Other (NOON) for Account " + this.walletAddress
);
await this.initia.sendTokenToOtherLayer(BridgeID.NOON);
console.log();
break;
case 4:
console.log(
"4. Send 1 Init to Other (TUCANA) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(BridgeID.TUCANA);
console.log();
break;
case 5:
console.log(
"5. Send 1 Init to Other (INIT AI) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(BridgeID.INITAI);
console.log();
break;
case 6:
console.log(
"6. Send 1 Init to Other (MINIMOVE) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(BridgeID.MINIMOVE);
console.log();
break;
case 7:
console.log(
"7. Send 1 Init to Other (MINIWASM) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(BridgeID.MINIWASM);
console.log();
break;
case 8:
console.log(
"8. Send 1 Init to Other (CIVITA) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(BridgeID.CIVITA);
console.log();
break;
case 9:
console.log(
"9. Bridge 1 Init to (CIVITA) for Account " + this.walletAddress
);
await this.initia.sendTokenToOtherLayer(
BridgeID.CIVITA,
COIN.INIT,
1,
"bridge"
);
console.log();
break;
case 10:
console.log(
"10. Bridge 1 Init to (TUCANA) for Account " + this.walletAddress
);
await this.initia.sendTokenToOtherLayer(
BridgeID.TUCANA,
COIN.INIT,
1,
"bridge"
);
console.log();
break;
case 11:
console.log(
"11. Bridge 1 Init to (INIT AI) for Account " + this.walletAddress
);
await this.initia.sendTokenToOtherLayer(
BridgeID.INITAI,
COIN.INIT,
1,
"bridge"
);
console.log();
break;
case 12:
console.log(
"12. Send 0.1 TIA to Other (NOON) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(
BridgeID.NOON,
COIN.TIA,
0.1,
"transfer"
);
console.log();
break;
case 13:
console.log(
"13. Send 1 USDC to Other (BLACKWING) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(
BridgeID.BLACKWING,
COIN.USDC,
1,
"transfer"
);
console.log();
break;
case 14:
console.log(
"14. Send 5 TUC to Other (TUCANA) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(
BridgeID.TUCANA,
COIN.TUCANA,
5,
"transfer"
);
console.log();
break;
case 15:
console.log(
"15. Send 0.0001 ETH to Other (MINIMOVE) for Account " +
this.walletAddress
);
await this.initia.sendTokenToOtherLayer(
BridgeID.MINIMOVE,
COIN.ETH,
0.0001,
"transfer"
);
console.log();
break;
case 16:
console.log(
"16. Swap 1 INIT to USDC for Account " + this.walletAddress
);
await this.initia.swap(false, Pair.INITIAUSDC);
console.log();
break;
case 17:
console.log(
"17. Swap 1 INIT to TIA for Account " + this.walletAddress
);
await this.initia.swap(false, Pair.INITIATIA);
console.log();
break;
case 18:
console.log(
"18. Swap 1 INIT to TUC for Account " + this.walletAddress
);
await this.initia.swap(false, Pair.INITIATUC);
console.log();
break;
case 19:
console.log(
"19. Swap 1 INIT to ETH for Account " + this.walletAddress
);
await this.initia.swap(false, Pair.INITIAETH);
console.log();
break;
case 20:
console.log(
"20. Stake 0.1 INIT to Omninode Account " + this.walletAddress
);
await this.initia.stakeInit();
console.log();
break;
case 21:
console.log(
"21. Stake 0.5 USDC / INITIA LP to Omninode Account " +
this.walletAddress
);
await this.initia.stakeInit(Pair.INITIAUSDC);
console.log();
break;
case 22:
console.log(
"22. Stake 0.01 TIA / INITIA LP to Omninode Account " +
this.walletAddress
);
await this.initia.stakeInit(Pair.INITIAUSDC);
console.log();
break;
case 23:
console.log(
"23. Stake 0.0001 ETH / INITIA LP to Omninode Account " +
this.walletAddress
);
await this.initia.stakeInit(Pair.INITIAETH);
console.log();
break;
case 24:
console.log("24. Request Faucet for Tucana " + this.walletAddress);
await this.tucana.requestFaucet(this.walletAddress);
console.log();
break;
case 25:
console.log(
"25. Add 1 TUC to Tucana Liquidity PERP " + this.walletAddress
);
await this.tucana.tucanaPerpAddLiquidity();
console.log();
break;
case 26:
console.log(
"26. Swap 1 INIT to USDC on TUCANA Account " + this.walletAddress
);
await this.tucana.swap();
console.log();
break;
case 27:
console.log(
"27. Roll Civitia Dice 3x For Account " + this.walletAddress
);
for (let x = 0; x < 3; x++) {
await this.civitia.rollDice();
console.log();
}
break;
case 28:
console.log(
"28. Claim Staking Reward on Omninode for Account " +
this.walletAddress
);
await this.initia.claimStakingReward();
console.log();
break;
case 29:
console.log(
"29. Vote a proposal for Account " + this.walletAddress
);
await this.initia.vote();
console.log();
break;
case 30:
console.log(
"30. Move Initia Stakes from Omninode to Nodes.Guru for Account " +
this.walletAddress
);
await this.initia.moveStake();
console.log();
break;
case 31:
console.log(
"31. Add Liquidity INIT/USDC on Tucana Liquidity Pool for Account " +
this.walletAddress
);
await this.tucana.tucanaPoolAddLiquidity();
console.log();
break;
case 32:
console.log(
"32. Generate Collection on Init AI for Account " +
this.walletAddress
);
await this.initAi.requestCreateCollection();
console.log();
break;
case 33:
console.log(
"33. Mint NFT on Collection Assasin Holding blade NFT Account " +
this.walletAddress
);
await this.initAi.requestMint();
console.log();
break;
default:
console.log("Number " + number + " is not configured.");
break;
}
} catch (error) {
reject(error);
}
resolve();
});
}
}
export { Config };