1.0.2 • Published 6 years ago

bitvalor-api v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago