Last active
August 6, 2021 11:26
-
-
Save percybolmer/cbe3c4ba7be7ac4bf29da8d351c3dc07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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