diff --git a/index.html b/index.html index 6025a39..8b13589 100644 --- a/index.html +++ b/index.html @@ -7,8 +7,11 @@ 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 url3 = 'https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec&address=0x5c60610ee8E502d8cE830Ba189c075b5f39472Df&tag=latest&apikey=XS38QQM4VVG3E6UQKPXH38PPYX4SGYY1PI' + var xhttp3 = new XMLHttpRequest(); var initialLockedBalance = 0; var newLockedBalance = 0 + var newBridgedBalance = 0 xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { initialLockedBalance = JSON.parse(xhttp.responseText).result/1000000000000000000; @@ -19,7 +22,14 @@ xhttp2.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { newLockedBalance = JSON.parse(xhttp2.responseText).result/1000000000000000000; - document.getElementById("c").innerHTML = 1000000000 - (initialLockedBalance + newLockedBalance); + xhttp3.open("GET", url3, true); + xhttp3.send(); + } + }; + xhttp3.onreadystatechange = function() { + if (this.readyState == 4 && this.status == 200) { + newBridgedBalance = JSON.parse(xhttp3.responseText).result/1000000000000000000; + document.getElementById("c").innerHTML = 1000000000 - (initialLockedBalance + newLockedBalance + newBridgedBalance); } }; xhttp.open("GET", url, true);