bitvalor-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i bitvalor-api

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

6.9 kB

Total Files

6

Last publish

Collaborators

  • marcelomorgado