<h3>Bug Fixes
<ul>
<li>What was the issue(s)?
<p dir="auto">The Voting Power and Reputation was showing wrong because it was being pulled from a third party API listed below-
<pre><code> let api = 'https://helloacm.com/api/steemit/account/vp/?id=' + id;
<ul>
<li>What was the solution?
<p dir="auto">I shifted the API call to steemJS it was my first work related to any steem library.<br />
The following code fixed the bug-
<pre><code>steem.api.getAccounts([id], function(err, response) {
if(!err)
{
let result = (response[0].voting_power)/100;
dom.html("<i>@" + id + "'s Voting Power is</i> <B>" + result + "%</B>");
<p dir="auto">The reputation bug was fixed using Reputation formatter in steemJS for which I needed to read code of steemJS which was quite interesting part.
<h3>New Features
<ul>
<li>What feature(s) did you add?
<p dir="auto">I added estimated account value(in USD) using steemjs.
<ul>
<li>How did you implement it/them?<br />
The steemJS function was added using following code-
<pre><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("<i>@" + id + "'s Reputation is</i> <B>" + result + "</B><br><i>@" + id + "'s Total Account Value is</i> <B>$" + value + "</B>"));
logit("API Finished: Reputation - " + id);
}
});
}
<ul>
<li>How to contribute?
<p dir="auto">Link to the Github repository, Click <a href="https://github.com/DoctorLai/utopian-moderator" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here.
<p dir="auto"><br /><hr /><em>Posted on <a href="https://utopian.io/utopian-io/@ms10398/voting-power-and-reputation-bug-fix-and-estimated-account-value-feature-added" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Utopian.io - Rewarding Open Source Contributors<hr /><p>
Thank you for the contribution. It has been approved.
Thanks for the nice fixes and new feature! I'll include your changes in version 0.0.9 ^_^
You can contact us on Discord.
[utopian-moderator]
Hey @justyy, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!
Hey @ms10398 I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Your voting power is very interesting I like it very much
please help me in making like you