CoinTools Update: Show Full Cryptocurrency Details by Click or Startup, Add Language Handlers

in #utopian-io7 years ago (edited)

Introduction

CoinTools is a handy gadget to Chrome browser that you can launch easily to view the information of cryptocurrency.

Previous Contributions

Technology Stacks

Javascript that runs in Chrome.

Github

https://github.com/DoctorLai/CoinTools

Chrome Webstore

It is available online at Chrome Webstore:
https://chrome.google.com/webstore/detail/coin-tools/fmglcggbdcbkpkfapngjobfeakehpcgj

v0.0.6 Feature

Along with bug fixes, minor tweaks and code refactoring, the version 0.0.6 has the following updates:

  1. You can enter coin ID in settings that will show you full details of that particular cryptocurrency in the converter console.
  2. You can click the coin button at ranking table to show full details
  3. Minors: Add a clear console button, Make console readonly, add language hanlders (support traditional Chinese and Portuguese)

Commits

Here

Roadmap of CoinTools

  1. real-time graphs
  2. search cryptocurrency
  3. historical data

Screenshots

You can enter coin ID in settings that will show you full details of that particular cryptocurrency in the converter console.
image.png

image.png

You can click the coin button at ranking table to show full details
image.png

image.png

Support Traditional Chinese and Portugues **Tasks Requests: UI Translations for CoinTools
**

image.png

Javascript to handle conversion

// conversion
const processConversion = (s) => {
    let arr = s.trim().split("\n");
    for (let i = 0; i < arr.length; i ++) {
        let pair = arr[i].split(" ");
        if (pair.length == 2) {
            let a = pair[0].trim().toLowerCase();
            let b = pair[1].trim().toLowerCase();
            var pat = /^[a-zA-Z\-]+$/;
            if (pat.test(a) && pat.test(b)) {
                let dom = $('div#conversion_results');
                let dom_id = "convert_" + removeInvalid(a) + "_" + removeInvalid(b);
                dom.append('<div id="' + dom_id + '"> </div>');
                getConversion(a, b).then(x => {
                    $('div#' + dom_id).html("<h4>1 " + a.toUpperCase() + " = <span class=yellow>" + x + "</span> " + b.toUpperCase() + "</h4>");
                });
            }
        } else if (pair.length == 1) {
            let a = pair[0].trim().toUpperCase();
            let currency = $('select#currency').val();
            var pat = /^[a-zA-Z\-]+$/;
            if (pat.test(a)) {
                if (a in coinmarkcap) {
                    a = coinmarkcap[a];                    
                }                
                let api = 'https://api.coinmarketcap.com/v1/ticker/' + a.toLowerCase() + '/';
                if (currency != '') {
                    api += '?convert=' + currency;
                }                
                fetch(api, {mode: 'cors'}).then(validateResponse).then(readResponseAsJSON).then(function(result) {
                    result = result[0];
                    $('textarea#convert_result').append(getCoinReport(result, currency));
                }).catch(function(error) {
                    logit('Request failed: ' + api + ": " + error);                    
                });                
            }
        }
    }
}

License

MIT

Contribution Welcome

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

Chrome Webstore

Install the CoinTools Now!



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for sharing this article. Very helpful and full of information for us. This article is very useful for us. Thank you

Thank you for the contribution. It has been approved.

Nice update, keep up the good work.

You can contact us on Discord.
[utopian-moderator]

1UP-Kayrex_tiny.png

You've got upvoted by Utopian-1UP!

You can give up to ten 1UP's to Utopian posts every day after they are accepted by a Utopian moderator and before they are upvoted by the official @utopian-io account. Install the @steem-plus browser extension to use 1UP. By following the 1UP-trail using SteemAuto you support great Utopian authors and earn high curation rewards at the same time.


1UP is neither organized nor endorsed by Utopian.io!