RentSp Update: Show the Available Steem Power to Rent

in steem •  5 months ago 

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🚀!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!
Sort Order:  
  ·  5 months ago  ·  

Greetings
It is a nice opportunity for all token holders
Thank you so much
Peace


Posted from https://blurtlatam.intinte.org

Thank you for sharing such great content!
Congratulations on your post in #blurt-131902 or #blurtconnect
Blurt to the Moon
Most welcome Votes for our community Witness Here
Your publication has been manually upvoted by @oadissinOfficial Blurtconnect-ng Page
Please delegate Blurt power to @blurtconnect-ng and help support this curation account
Also, keep in touch with Blurtconnect-ng family on 

Telegram and Whatsapp