Skip to content

marcbarbosa/mercadobitcoin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stories in Ready #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

About

Mercado Bitcoin API client in Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published