You are viewing a single comment's thread from:

RE: Musing Posts

in #musing-threads6 years ago

You could try this:

totalVestingShares = 0;
totalVestingFundSteem = 0;

steem.api.getDynamicGlobalProperties((err, result) => {
totalVestingShares = result.total_vesting_shares;
totalVestingFundSteem = result.total_vesting_fund_steem;
});

steem.api.getAccounts(['rishi556', 'clauxklein'], function(err, result) {
if (!err) {
for (let i = 0; i < result.length; ++ i) {
var steemPower = steem.formatter.vestToSteem(result[i].vesting_shares, totalVestingShares, totalVestingFundSteem);
log(result[i].name + "'s SteemPower is " + steemPower);

}

} else {
log("Steem API Error: ", err);
}
});

Sort:  

Thanks, this worked exactly like I needed it to.