Algorithms, Blockchain and Cloud

SteemTools Update: Adding Account Witness Data, Option to Save Key and Bug Fixes


Introduction to SteemTools

SteemTools is a Chrome Extension that aims to provide useful tools and data for Steem/SteemIt Users.

SteemTools Open Source

Github: https://github.com/DoctorLai/SteemTools/

Previous Versions

Technology Stack

Javascript that runs in the Chrome Browser (Chrome Extension)

New Features of SteemTools v0.0.10

This commit adds the following changes:

  • Account Witness Tab, which allows you to view a list of witnesses that you vote
  • Option to Save Private Key so the users don’t have to worry about the security. Use it once and Dispose it.
  • Bug fixes

SteemTools Screenshots

steemit-account-witness-list

steemit-option-save-key

Javascript to call Account Witness API

The API is provided at here and below is the Javascript that integrates the API.

const handleAccountWitness = () => {
    textPressEnterButtonClick($('input#witness_id2'), $('button#witness_btn2'));
    $('button#witness_btn2').click(function() {        
        let id = prepareId($('input#witness_id2').val());
        let server = getServer();        
        server = server || default_server;
        $('div#witness_div2').html('<img src="images/loading.gif"/>');
        if (validId(id)) {
            // disable the button while API is not finished yet.
            $('button#witness_id2').attr("disabled", true);
            $.ajax({ 
                dataType: "json",
                url: "https://" + server + "/api/steemit/account/witness/?cached&id="+id,
                cache: false,
                success: function (response) {
                    let result = response;
                    if (result && result.length > 0) {
                      let s = '<h4><B>' + result.length + '</B> Witnesses (Your Votes) - <a target=_blank href="https://steemyy.com/witness/?id=' + id + '">View Complete Data</a></h4>';
                      s += '<table id="dvlist_witness2" class="sortable">';
                      s += '<thead><tr><th>Witness</th><th>Status</th><th>Votes (MV)</th><th>Votes Count</th><th>Total Produced</th><th>Miss Rate %</th><th>Missed</th><th>Last Block</th></tr></thead><tbody>';
                      for (let i = 0; i < result.length; i ++) {
                            s += '<tr>';
                            s += '<td>' + getSteemUrl(result[i]['name']) + ' <BR/>(';
                            s += '<a rel=nofollow target=_blank href="' + result[i]['url'] + '">Post</a>)</td>';
                            let status = "<font color='green'>Yes</font>";
                            if (result[i]['signing_key'].includes("1111111111")) {
                                status = "<font color='red'>No</font><BR/><a target=_blank rel=nofollow href='https://steemlogin.com/sign/account_witness_vote?approve=0&witness=" + result[i]['name'] + "'><font color=red><B>Unvote</B></font></a>";
                            }
                            s += '<td>' + status + ' (<a rel="nofollow" target=_blank href="https://helloacm.com/api/echo/?s=' + result[i]['signing_key'] + '" title="' + result[i]['signing_key'] + '">Signing Key</a>)</td>';
                            s += '<td>' + Math.round(result[i]['votes']/1000000000000) + '</td>';
                            s += '<td>' + result[i]['votes_count'] + '</td>';
                            s += '<td>' + result[i]['total'] + '</td>';
                            s += '<td>' + result[i]['miss_rate'].toFixed(2) + '</td>';                
                            s += '<td>' + result[i]['total_missed'] + '</td>';
                            s += '<td>' + result[i]['last_aslot'] + '</td>';
                            s += '</tr>';
                          }              
                          s += '</tbody>';
                          s += '</table>';
                        $('div#witness_div2').html(s);
                        sorttable.makeSortable(document.getElementById("dvlist_witness2"));
                    } else {
                        $('div#witness_div2').html("<font color=blue>It could be any of these: (1) No Voted Witnesses or You are set using Witness Proxy (2) Invalid ID (3) API/SteemSQL server failed. Contact <a rel=nofollow target=_blank href='https://steemit.com/@justyy/'>@justyy</a> if you are not sure. Thanks!</font>");
                    }          
                },
                error: function(request, status, error) {
                    $('div#witness_div2').html('<font color=red>API/SteemSQL Server (' + server + error + ') is currently offline. Please try again later!' + request.responseText + '</font>');
                },          
                complete: function(data) {
                    // re-enable the button
                    $('button#witness_btn2').attr("disabled", false);
                }
            });
        } else {
            alert('Not a Valid Steem ID.');
            $('div#witness_div2').html('');
        }        
    });      
}

Roadmap of Steem Tools

License

MIT

Chrome Webstore

Install the SteemTools Chrome Extension Now!

Contribution Welcome

Github: https://github.com/DoctorLai/SteemTools

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am ‘Add some feature’
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request.

–EOF (The Ultimate Computing & Technology Blog) —

1477 words
Last Post: JobTools Update: Adding Pagination and Show Job Details
Next Post: Steem Blockchain Information: API, Discord and Wechat!

The Permanent URL is: SteemTools Update: Adding Account Witness Data, Option to Save Key and Bug Fixes (AMP Version)

Exit mobile version