CoinTools Update: v0.0.8: Add Coinbase API + Customized History Data

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.8 Feature

This version adds the following features:

  1. Add Coinbase API to convert from FIAT to FIAT.
  2. Customize Period of History Data
  3. Adds Russian UI translation.
  4. Support single FIAT command

Screenshots

image.png

image.png

image.png

image.png

Commits

Here and here

Roadmap of CoinTools

Any good suggestions, please shout at @justyy.

Coinbase API

Get Exchange Rate from two Fiats.

// ajax calling coinbase to return fiat conversion
const getPriceOf_Coinbase_Fiat = (a, b) => {
    return new Promise((resolve, reject) => {
        let api = 'https://api.coinbase.com/v2/exchange-rates/?currency=' + a.toUpperCase();
        fetch(api, {mode: 'cors'}).then(validateResponse).then(readResponseAsJSON).then(function(result) {
            let data = result.data.rates;
            resolve(data[b.toUpperCase()]);
        }).catch(function(error) {
            logit('Request failed: ' + api + ": " + error);
            reject(error);
        });
    });
}

Then, you can use it:

    // both are currencies e.g. USD to CNY
    if ((!is_coin1) && (!is_coin2)) {
        try {
            return await getPriceOf_Coinbase_Fiat(coin1, coin2);
        } catch (e) { // if anything goes wrong with above coinbase, then use coinmarkecap (two API calls)
            let api1 = getPriceOf1BTC(coin1);        
            let api2 = getPriceOf1BTC(coin2);
            return await api2 / await api1;
        }
    }

If anything goes wrong with above coinbase, then use coinmarkecap (two API calls)

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:  

I like this tool very much!

Actually it is the best tool I have ever used!

Voted and support.

nice gadget... it works anda very useful.. thanks @justyy

Good post

Thank you for the contribution. It has been approved.

You can contact us on Discord.

[utopian-moderator]

Hey @justyy I am @utopian-io. I have just upvoted you!

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.17
TRX 0.16
JST 0.029
BTC 60637.64
ETH 2405.36
USDT 1.00
SBD 2.60