RentSp Update: Show the Available Steem Power to Rent

I have added the following information in the RentSP

image.png

Here is the code:

                steem.api.getAccounts(["justyy"], function (err, result) {
                    if (err || (!result)) {
                        return;
                    }
                    result = result[0];

                    steem.api.getDynamicGlobalProperties(function (err, result1) {
                        var vesting_shares, delegated_vesting_shares, received_vesting_shares, total_vesting_shares, total_vesting_fund_steem = null;
                        total_vesting_shares = result1.total_vesting_shares;
                        total_vesting_fund = result1.total_vesting_fund_steem;
                        vesting_shares = result.vesting_shares;
                        delegated_vesting_shares = result.delegated_vesting_shares;
                        received_vesting_shares = result.received_vesting_shares;
                        var steem_power = steem.formatter.vestToSteem(vesting_shares, total_vesting_shares, total_vesting_fund).toFixed(3);
                        var delegated_steem_power = steem.formatter.vestToSteem((received_vesting_shares.split(' ')[0] - delegated_vesting_shares.split(' ')[0]) + ' VESTS', total_vesting_shares, total_vesting_fund).toFixed(3);

                        var delegated_steem_powerPlus = steem.formatter.vestToSteem(received_vesting_shares, total_vesting_shares, total_vesting_fund).toFixed(3);
                        var delegated_steem_powerMinus = steem.formatter.vestToSteem(delegated_vesting_shares, total_vesting_shares, total_vesting_fund).toFixed(3);

                        var powerdown_minus = steem.formatter.vestToSteem(result.vesting_withdraw_rate, total_vesting_shares, total_vesting_fund).toFixed(3);

                        var cur = $("#output").val();
                        var s = "Total Steem Power For Rent/Lease: " + steem_power + " SP\n";
                        s += "Rented: " + delegated_steem_powerMinus + " SP\n";
                        s += "Power Down: " + powerdown_minus + " SP\n";
                        s += "Available For Rent: " + (steem_power - powerdown_minus - delegated_steem_powerMinus).toFixed(3) + " SP\n";
                        $("#output").val(cur + "\n" + s);   
                    });           
                }); 

Steem to the Moon🚀!

Sort:  

This post has been featured in the latest edition of Steem News...

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 61110.96
ETH 2649.39
USDT 1.00
SBD 2.58