-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (35 loc) · 930 Bytes
/
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
const axios = require('axios');
const main = async () => {
const rpcUrl = "";
const underdogUrl = "";
const underdogApiKey = "";
const tokenAddress = "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"; // Bonk
const nftName = "GigaMint";
const nftImage = "https://i.ytimg.com/vi/Ux5cQbO_ybw/maxresdefault.jpg";
const batch = [];
const response = await axios.post(`${rpcUrl}`,
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenLargestAccounts",
"params": [
tokenAddress,
]
}
)
response.data.result.value.forEach((res) => {
batch.push({ receiverAddress: res.address });
});
const udogResponse = await axios.post(`${underdogUrl}/v2/projects/1/nfts/batch`, {
name: nftName,
image: nftImage,
batch: batch,
},
{
headers: {
Authorization: `Bearer ${underdogApiKey}`
}
})
console.log(udogResponse.data);
};
main();