Last active
August 13, 2017 17:41
-
-
Save josephros/8878325a376f12971ebc201ae3062fd2 to your computer and use it in GitHub Desktop.
Query ERC20 token
This file contains 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
// 1. get the total supply | |
token.totalSupply.call(function (err, totalSupply) { | |
// 2. get the number of decimal places used to represent this token | |
token.decimals.call(function (err, decimals) { | |
// 3. get the name of the token | |
token.name.call(function (err, name) { | |
// 3. get the balance of the account holder | |
var accountAddress = $('#accountAddress').val(); | |
token.balanceOf.call(accountAddress, function (err, balance) { | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment