-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
32 lines (27 loc) · 1.12 KB
/
script.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
async function checkPoints() {
const resultsDiv = document.getElementById("results");
resultsDiv.innerHTML = ""; // Kosongkan hasil sebelumnya
const addresses = document.getElementById("walletAddresses").value
.split('\n')
.map(addr => addr.trim())
.filter(addr => addr);
if (addresses.length === 0) {
resultsDiv.innerHTML = "Masukkan alamat wallet yang valid.";
return;
}
for (let address of addresses) {
try {
const proxyUrl = `/api/proxy?address=${address}`;
const response = await fetch(proxyUrl);
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
const points = data.points || "Tidak ditemukan";
resultsDiv.innerHTML += `<p>Wallet ${address}: ${points} poin</p>`;
} catch (error) {
console.error("Gagal memuat data:", error);
resultsDiv.innerHTML += `<p>Wallet ${address}: Gagal memuat data - ${error.message}</p>`;
}
}
}