Skip to content

Bittrex node js REST API client returing pure Promises, easy to use with (native or not) Async/Await features of node v8 or extern helpers of these methods.

Notifications You must be signed in to change notification settings

Alexander-Herranz/async-bittrex-api-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

You can just install in your project and use it with:

$npm install async-bittrex-api-node --save

async-bittrex-api-node

async-bittrex-api-node is an open and clean ES6 class to connect with Bittrex, the famous cryptocurrency exchange API, that you can easily use and even extend, to use with async/await features available natively in node v8.

API of functions:

Functions are pretty descriptive by their name. Same name as Bittrex endpoints.

Functions:

  • getmarkets()
  • getcurrencies()
  • getticker (pair1, pair2)
  • getmarketsummaries()
  • getmarketsummary(pair1, pair2)
  • getorderbook(pair1, pair2, type)
  • getmarkethistory(pair1, pair2)
  • getmarkethistory(pair1, pair2, tickInterval, startTime)

Params

  • pair1/pair2: Example: 'btc', 'eth', 'letc'...
  • type: Example: "buy", "sell" or "both"

Test the module yourself

In testBittrexAPi.js you can see the basic use of the app. You can run this example with:

$npm install

if you want to use the private api:

Rename .env-test in .env and add your private and secret keys .

  let pair1 = 'btc';
  let pair2 = 'eth';
  let type  = 'both';


  console.log('PUBLIC');


  console.log('TEST 1: ');
  console.log( await bittrex.getmarkets() );

  console.log('TEST 2: ');
  console.log( await bittrex.getcurrencies() );

  console.log('TEST 3: ');
  console.log( await bittrex.getticker(pair1, pair2) );

  console.log('TEST 4: ');
  console.log( await bittrex.getmarketsummaries() );

  console.log('TEST 5: ');
  console.log( await bittrex.getmarketsummary(pair1, pair2) );

  console.log('TEST 6: ');
  console.log( await bittrex.getorderbook(pair1, pair2, type) );

  console.log('TEST 7: ');
  console.log( await bittrex.getmarkethistory(pair1, pair2) );


  console.log('PRIVATE');


  console.log('TEST 8: ');
  console.log(await bittrex.getbalance({currency:'BTC'}));

  console.log('TEST 9: ');
  console.log(await bittrex.getbalances());

  console.log('TEST 10: ');
  console.log(await bittrex.getorderhistory());

Todos

  • Any contribution will be appreciated.

License

MIT

About

Bittrex node js REST API client returing pure Promises, easy to use with (native or not) Async/Await features of node v8 or extern helpers of these methods.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •