-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunc.js
More file actions
116 lines (115 loc) · 3.69 KB
/
func.js
File metadata and controls
116 lines (115 loc) · 3.69 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
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
import axios from 'axios';
export const checkEnergy = async (token) => {
try {
const r = await axios.get(
'https://www.mintchain.io/api/tree/energy-list',
{
headers: {
'User-Agent':
'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0',
Accept: 'application/json, text/plain, */*',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
Authorization: token,
Connection: 'keep-alive',
Referer: 'https://www.mintchain.io/mint-forest',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
TE: 'trailers',
},
}
);
return r.data;
} catch (error) {
throw error;
}
};
export async function getUserInfo(token) {
try {
const response = await axios.get(
'https://www.mintchain.io/api/tree/user-info',
{
headers: {
'User-Agent':
'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0',
Accept: 'application/json, text/plain, */*',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
Authorization: token,
Connection: 'keep-alive',
Referer: 'https://www.mintchain.io/mint-forest',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
TE: 'trailers',
},
}
);
return response.data;
} catch (error) {
console.log(error);
}
}
export const claimingEnergy = async (token, amount) => {
try {
const response = await axios.post(
'https://www.mintchain.io/api/tree/claim',
{
uid: [],
amount: amount,
includes: [],
type: 'daily',
freeze: false,
id: '500_',
},
{
headers: {
'User-Agent':
'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
Authorization: token,
Origin: 'https://www.mintchain.io',
Connection: 'keep-alive',
Referer: 'https://www.mintchain.io/mint-forest',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
},
}
);
console.log(response.data.msg);
} catch (error) {
throw error;
}
};
export const injectTree = async (token, energy, address) => {
try {
const response = await axios.post(
'https://www.mintchain.io/api/tree/inject',
{
energy: energy,
address: address,
},
{
headers: {
'User-Agent':
'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
Authorization: token,
Origin: 'https://www.mintchain.io',
Connection: 'keep-alive',
Referer: 'https://www.mintchain.io/mint-forest',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-origin',
},
}
);
return response.data;
} catch (error) {
throw error;
}
};