Bug Fixes
- What was the issue(s)?
The Voting Power and Reputation was showing wrong because it was being pulled from a third party API listed below-
let api = 'https://helloacm.com/api/steemit/account/vp/?id=' + id;
- What was the solution?
I shifted the API call to steemJS it was my first work related to any steem library.
The following code fixed the bug-
steem.api.getAccounts([id], function(err, response) {
if(!err)
{
let result = (response[0].voting_power)/100;
dom.html("@" + id + "'s Voting Power is " + result + "%");
The reputation bug was fixed using Reputation formatter in steemJS for which I needed to read code of steemJS which was quite interesting part.
New Features
- What feature(s) did you add?
I added estimated account value(in USD) using steemjs.
- How did you implement it/them?
The steemJS function was added using following code-
steem.api.getAccounts([id], function(err, response) {
if(!err)
{
var result = steem.formatter.reputation(response[0].reputation);
var steemPower = steem.formatter.estimateAccountValue(response[0]);
steemPower.then(value => dom.html("@" + id + "'s Reputation is " + result + "
@" + id + "'s Total Account Value is $" + value + ""));
logit("API Finished: Reputation - " + id);
}
});
}
- How to contribute?
Link to the Github repository, Click here.
Posted on Utopian.io - Rewarding Open Source Contributors