Skip to content

Instantly share code, notes, and snippets.

@vlzhr
Created February 10, 2020 11:59
Show Gist options
  • Save vlzhr/b2b455a4de8e19d44ccff03b90478dfe to your computer and use it in GitHub Desktop.
Save vlzhr/b2b455a4de8e19d44ccff03b90478dfe to your computer and use it in GitHub Desktop.
certificado example
function checkData() {
const text = document.querySelector(".data").value.split("\n")[0];
const certificateId = text.split(" ")[0];
const xhr = new XMLHttpRequest();
xhr.open("GET", "https://testnodes.wavesnodes.com/addresses/data/3N6EmqqQ1pZderX8sNMrfVuEo85ocPoqs2M/"+certificateId);
xhr.onload = function() {
const doesExist = JSON.parse(xhr.response).value === text;
document.querySelector(".result").innerHTML = doesExist ? "<span style='color: green'><strong>certificado</strong> exists</span>" : "<span style='color: red'><strong>certificado</strong> does not exist</span>";
return doesExist;
};
xhr.send();
}
@yoyoyoheyheyhey
Copy link

@sadorect
Copy link

https://testnodes.wavesnodes.com is not available. Use this instead.

https://nodes-testnet.wavesnodes.com

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment