-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathGet15Points.js
56 lines (50 loc) · 1.36 KB
/
Get15Points.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
const axios = require('axios');
const fs = require('fs');
const readline = require('readline');
let readStream = readline.createInterface({
input: fs.createReadStream('./Address.txt'),
output: process.stdout,
terminal: false
});
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
readStream.on('line', async function (address) {
let data = JSON.stringify({
"address": address
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.noobysswap.io/api/swap',
headers: {
'Content-Type': 'application/json'
},
data: data
};
let config2 = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.noobysswap.io/api/liquidity',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios.request(config)
.then((response) => {
console.log(address + '---swap---' + response.statusText);
})
.catch((error) => {
console.log(error);
});
await sleep(3000);
axios.request(config2)
.then((response) => {
console.log(address + '---liquidity---' + response.statusText);
})
.catch((error) => {
console.log(error);
});
await sleep(3000);
});