-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.js
34 lines (29 loc) · 1.05 KB
/
main.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
const axios = require('axios');
const readline = require('readline');
console.log("enjoy your life")
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('seed -> ', async (mnemonicsInput) => {
const mnemonics = mnemonicsInput.split(' ');
async function getkey(mnemonics) {
return 'your_generated_public_key_here';
}
const headers = {
'User-Agent': "okhttp/4.9.2",
'Accept-Encoding': "gzip",
'Content-Type': "application/json",
'Authorization': "Bearer AF77F5JNEUSNXPQAAAAMDXXG7RBQ3IRP6PC2HTHL4KYRWMZYOUQGDEKYFDKBETZ6FDVZJBI",
'Cache-Control': "no-cache"
};
try {
const pk = await getkey(mnemonics);
const walletr = await axios.get(`https://keeper.tonapi.io/v2/pubkeys/${pk}/wallets`, { headers });
const account = walletr.data.accounts[0];
const address = account.address;
const tonr = await axios.get(`https://keeper.tonapi.io/v2/accounts/${address}/jettons`, { headers });
console.log(tonr.data);
} catch (error) { console.error(error); }
rl.close();
});