Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Last active August 6, 2021 11:26
Show Gist options
  • Save percybolmer/cbe3c4ba7be7ac4bf29da8d351c3dc07 to your computer and use it in GitHub Desktop.
Save percybolmer/cbe3c4ba7be7ac4bf29da8d351c3dc07 to your computer and use it in GitHub Desktop.
// getUserProfile will fetch account information from the block chain network
function getUserProfile() {
// Let's grab the token total supply, the method is named the same as in the Solidity code, and add call() to execute it.
// We can also get the response using a callback. I do recommend this method most times as we dont know how long the executions can take.
devToken.methods.totalSupply().call()
.then((result) => {
console.log(result);
})
.catch((error) => {
throw new Error(error);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment