Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    mercadobitcoinpublic

    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)

    API - documentation

    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

    install

    npm i mercadobitcoin

    Downloadsweekly downloads

    9

    version

    0.0.4

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar