SteemMe - Displaying STEEM & SBD Prices for multiple currencies

in utopian-io •  7 years ago  (edited)

wallpaper.png

SteemMe V0.0.5 (Commit)

What feature(s) did you add?

SteemMe V0.0.5 brings a new big update and code refactoring with it. First of all does SteemMe now fully uses jQuery for DOM manipulation. The new big update SteemMe brings with it, is the display of STEEM / SBD Prices according to your selected currency in the options page. The prices are always displayed at the bottom of the extension.

You can change the currency in the extension option panel (Chrome Settings -> More Tools -> Extensions -> Extension Options).

Current available currencies are:

  • EUR
  • USD
  • AUD
  • CAD
  • GBP

If you are missing one, please comment !

Screen Shot 2018-03-05 at 11.44.23.png
Screen Shot 2018-03-05 at 11.44.48.png

How did you implement them?

Layout is all done with bootstrap. To get the latest price feed the CoinMarketCap's API is used. For that the Utils.js file got 2 new methods added:

function getSteemPrice(coinName, currency) {
    var xhr = new XMLHttpRequest();

    xhr.open("GET", "https://api.coinmarketcap.com/v1/ticker/"+ coinName +"/?convert="+ currency, false);
    xhr.send();

    var result = JSON.parse(xhr.responseText);

    return result[0]["price_" + currency];
}

function getCurrencySymbol(currency) {
    switch (currency) {
        case 'eur':
            return '\u20AC';
        case 'cad':
            return 'CAD';
        case 'gbp':
            return '&#163';
        case 'aud':
            return 'AUD';
        default:
            return '$'
    }
}

To save the selected currency the options.js got a new method which is automatically called when the selected value changes:

function selectCurrency() {
    const currency = selectCur.val();

    chrome.storage.sync.set({
        currency: currency,
    }, function() {
        var status = document.getElementById('status');
        status.textContent = 'Options saved.';
        setTimeout(function() {
            status.textContent = '';
        }, 750);
    });
}

Roadmap

  • V.0.0.5:
    • SBD / STEEM Price
  • Next: V.0.0.6:
    • Wallet Details page
  • V.0.1:
    • UI
    • More...

Contribute

Feel free to contribute by forking the GitHub Repo and creating Pull Requests. You can check the Roadmaps to find ideas, or you can implement your own stuff.

How to install it?

Please visit the Google Chrome Webstore and download the extension!

Go to your Extensions Tab and click options to set your Steemit Username
Screen Shot 2018-02-27 at 12.46.46.png

Proof for GitHub

Screen Shot 2018-02-23 at 10.47.12.png

benediktveith is my main GitHub account.
Check here for another proof



Posted on Utopian.io - Rewarding Open Source Contributors

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 STEEM!
Sort Order:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.

[utopian-moderator]

Hey @ms10398, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

@moonrise, I like your contribution to open source project, so I upvote to support you.

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

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • 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