-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
33 lines (31 loc) · 1.35 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Polymath Circulating Supply</title>
<script type="text/javascript">
var url = 'https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec&address=0x105b2b74fe6de95b68d435f3a3bc8ace03cf1658&tag=latest&apikey=XS38QQM4VVG3E6UQKPXH38PPYX4SGYY1PI'
var xhttp = new XMLHttpRequest();
var url2 = 'https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec&address=0xcda3b86c000d910e30ddb32119cd182d8c983056&tag=latest&apikey=XS38QQM4VVG3E6UQKPXH38PPYX4SGYY1PI'
var xhttp2 = new XMLHttpRequest();
var initialLockedBalance = 0;
var newLockedBalance = 0
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
initialLockedBalance = JSON.parse(xhttp.responseText).result/1000000000000000000;
xhttp2.open("GET", url2, true);
xhttp2.send();
}
};
xhttp2.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
newLockedBalance = JSON.parse(xhttp2.responseText).result/1000000000000000000;
document.getElementById("c").innerHTML = 1000000000 - (initialLockedBalance + newLockedBalance);
}
};
xhttp.open("GET", url, true);
xhttp.send();
</script>
</head>
<body id="c">
</body>
</html>