Coder Social home page Coder Social logo

bittrex-orderbook's People

Contributors

gtklocker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bittrex-orderbook's Issues

Detect disconnections

Hello,

How can I detect a disconnection of the websocket?

Is it only a single websocket for all streams or multiple websockets?

Thanks

Bittrex V3

Any chance of support bittrex v3 coming up soon?

Doesn't work on client side

screen shot 2017-12-26 at 5 57 49 am

To reproduce:

app/package.json

{
  "dependencies": {
    "bittrex-orderbook": "2.0.5",
    "react": "16.2.0",
    "react-dom": "16.2.0",
    "react-scripts": "1.0.17"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build"
  }
}

app/src/index.js

import { render } from 'react-dom';

render(null, document.getElementById('root'));

// ..

const Book = require('bittrex-orderbook');

const book = new Book();

book
  .market('USDT-BTC')
  .on('bidUpdate', market => console.log('bids', market.bids.top(5)));

book
  .market('USDT-BTC')
  .on('askUpdate', market => console.log('asks', market.asks.top(5)));

app/public/index.html

<div id="root"></div>

cd app && yarn && yarn start or cd app && npm i && npm start

UnhandledPromiseRejectionWarning

i get this error,
my code=>

const BittrexOrderBook = require('bittrex-orderbook');
const bit = new BittrexOrderBook;

bit.market('BTC-XRP').on('bidUpdate', (market) => {
    console.log('XRP bids', market.bids.top(5));
});
bit.market('BTC-XRP').on('askUpdate', (market) => {
    console.log('XRP asks', market.asks.top(5));
});


bit.market('BTC-ETH').on('bidUpdate', (market) => {
    console.log('ETH bids', market.bids.top(5));
});
bit.market('BTC-ETH').on('askUpdate', (market) => {
    console.log('ETH asks', market.asks.top(5));
});

Error Data: 503

Today I started to get the following error:

Error Message: Negotiate Unknown
Exception: undefined
Error Data: 503

Even the demo code provided throws the same error.

const BittrexOrderBook = require('bittrex-orderbook');
const bit = new BittrexOrderBook;

bit.market('BTC-XMR').on('bidUpdate', (market) => {
console.log('XMR bids', market.bids.top(5));
});
bit.market('BTC-ETH').on('askUpdate', (market) => {
console.log('ETH asks', market.asks.top(5));
});

Reconnect

I'm using your library and it seems it has no reconnection functionality with restarting orderbook stream. Do you plan to add it, or could you suggest what should be updated if I will implement it on my own?

Subscribe to multiple markets concurrently

We want to allow subscribing to multiple markets concurrently. This will require some API changes, detailed below:

  • The constructor of the BittrexOrderBook would change from bit = new BittrexOrderBook(market) to bit = new BittrexOrderBook([market]).
  • Each market would keep its own ask/bid OrderBook.
  • We would allow subscribing and unsubscribing to markets in realtime with:
    • bit.followMarket(market)
    • bit.unfollowMarket(market)
  • Orderbook update events would have to change. For example, when we receive an askUpdate we have to know which market it refers to:
    • bit.on('askUpdate', (market) => { console.log(market.getTopAsk(...)); })
    • Our market objects should have a .id or .name property so that we can differentiate between them.
  • But we will also have market-specific update events, like so:
    • bit.getMarket('BTC-XMR').on('askUpdate', (market) => { console.log(market.getTopAsk(...)); })

cc @askmike

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.