Giter Site home page Giter Site logo

joemccann / async-bittrex-api-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexander-herranz/async-bittrex-api-node

0.0 1.0 0.0 13 KB

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.

JavaScript 100.00%

async-bittrex-api-node's Introduction

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

async-bittrex-api-node's People

Contributors

alexander-herranz avatar bohzio avatar joemccann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.