Skip to content

Commit

Permalink
Merge pull request ccxt#351 from ttodua/bittrex-handleOrderBook
Browse files Browse the repository at this point in the history
Bittrex  - fix handle order book
  • Loading branch information
kroitor authored Jul 1, 2022
2 parents 7dc8b7e + b5d772c commit 92be563
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/bittrex.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,12 @@ module.exports = class bittrex extends ccxt.bittrex {
//
const marketId = this.safeString (message, 'marketSymbol');
const symbol = this.safeSymbol (marketId, undefined, '-');
const orderbook = this.safeValue (this.orderbooks, symbol, {});
const nonce = this.safeInteger (orderbook, 'nonce');
if (nonce !== undefined) {
const limit = this.safeInteger (message, 'depth');
let orderbook = this.safeValue (this.orderbooks, symbol);
if (orderbook === undefined) {
orderbook = this.orderBook ({}, limit);
}
if (orderbook['nonce'] !== undefined) {
this.handleOrderBookMessage (client, message, orderbook);
} else {
orderbook.cache.push (message);
Expand Down

0 comments on commit 92be563

Please sign in to comment.