bitvalor-api

A BitValor API Node.js module

Usage no npm install needed!

<script type="module">
  import bitvalorApi from 'https://cdn.skypack.dev/bitvalor-api';
</script>

README

bitvalor-api

A BitValor API Node.js module

Installation

npm install bitvalor-api

Usage

var BitValor = require('bitvalor-api');

// Last Bitcoin price
BitValor.ticker().then(t => {
    let last = t.ticker_24h.total.last;
    return last;
}).then(console.log);

// Cheapest maker order fee among all exchanges
BitValor.exchanges().then(exchanges => {
    let cheapest = { exchange: undefined, price: undefined };

    for(let e in exchanges) {
        let ex = String(e);
        let p = exchanges[e].fees.trade_book[0];

        if(cheapest.price == undefined || p < cheapest.price) {
            cheapest.exchange = ex;
            cheapest.price = p;
        }
    }

    return cheapest;

}).then(console.log);

Test

npm run test