Skip to content

Instantly share code, notes, and snippets.

@tpmccallum
Created May 18, 2021 05:58
Show Gist options
  • Save tpmccallum/29d2db0765f273075c0de183bb0a170c to your computer and use it in GitHub Desktop.
Save tpmccallum/29d2db0765f273075c0de183bb0a170c to your computer and use it in GitHub Desktop.
Javascript for simple_dapp_001
function getBalance() {
var address, wei, balance
address = document.getElementById("account_address_input").value;
console.log(address);
try {
web3.ss.getBalance(address, function(error, wei) {
if (!error) {
document.getElementById("account_address_output_wei").innerHTML = wei + " Wei";
}
});
} catch (err) {
console.log(err);
document.getElementById("account_address_output").innerHTML = err;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment