mercadobitcoin

0.0.4 • Public • Published

#Mercado Bitcoin API client Mercado Bitcoin is a cryptocurrency exchange in Brazil.

Install

npm install mercadobitcoin

Usage

There are 2 API endpoints. One for general info (public) and a trade API (require credentials)

var MercadoBitcoin = require('mercadobitcoin').MercadoBitcoin;

// The options for currency are: 'BTC' or 'LTC'
var mb = new MercadoBitcoin({ currency: 'BTC' });

// Call ticker method to get last price
mb.ticker(function (res) { console.log(res.ticker.last) });

// Call orderBook method
mb.orderBook(console.log);

TRADE API - documentation

Get your credentials at Mercado Bitcoin website

You will need the following info: Chave, Código (here) and PIN (here)

var MercadoBitcoinTrade = require('mercadobitcoin').MercadoBitcoinTrade;

// Credentials
var chave  = '<CHAVE>',
	codigo = '<CODIGO>',
	pin    = '<PIN>';

var mbt = new MercadoBitcoinTrade({ key: chave, secret: codigo,	pin: pin });

// Call getInfo method and print amount of BTC funds in your account
mbt.getInfo(function(res) { console.log(res.funds.btc) }, console.log);

// Call orderList method
mbt.orderList({ pair: 'btc_brl' }, console.log, console.log);

Donations are welcome!

1MarcE3uXebneDH81k26QPm5imMEo2PCSP

Dependents (0)

Package Sidebar

Install

npm i mercadobitcoin

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • marcbarbosa