Introduction to CoinTools
CoinTools is a handy gadget to Chrome browser that you can launch easily to view the information of cryptocurrency.
Previous Contributions
- CoinTools v0.0.5 Update: Show Full Cryptocurrency Details by Click or Startup, Add Language Handlers
- CoinTools v0.0.4: Conversion Between Two Fiat or Fiat-Coin + 24 Hour Cap Chart
- CoinTools v0.0.3: Adding Total Market Cap USD Chart, Localization and Stock Price Emoji
- v0.0.2 Cryptocurrency Conversion + UI Localization
- v0.0.1 Introduction to CoinTools! A Cryptocurrency Chrome Extension
Technology Stacks
Javascript that runs in Chrome Extension.
Github of CoinTools
https://github.com/DoctorLai/CoinTools
Chrome Webstore
It is available online at Chrome Webstore.
CoinTools v0.0.6 Feature
Along with bug fixes, minor tweaks and code refactoring, the version 0.0.6 has the following updates:
- You can enter coin ID in settings that will show you full details of that particular cryptocurrency in the converter console.
- You can click the coin button at ranking table to show full details.
- Minors: Add a clear console button, Make console readonly, add language hanlders (support traditional Chinese and Portuguese)
Commits
Roadmap of CoinTools
- real-time graphs
- search cryptocurrency
- historical data
Screenshots of CoinTools
You can enter coin ID in settings that will show you full details of that particular cryptocurrency in the converter console.
You can enter coin ID in settings that will show you full details of that particular cryptocurrency in the converter console.
Javascript to handle Cryptocurrency conversions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | // cryptocurrency conversion via coinmarkcap API 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); }); } } } } |
// cryptocurrency conversion via coinmarkcap API 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
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.
Chrome Webstore
Install the CoinTools Now!
–EOF (The Ultimate Computing & Technology Blog) —
Last Post: CoinTools Update: Cryptocurrency Converter Calculator, Support Coin Symbols and Add More Localization
Next Post: Teach Your Kids Programming - The First Logo Interpreter (Turtle Graphics) in Chrome Extension!