ccxt 4.1.20 → 4.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -577,7 +577,6 @@ export default class bitfinex2 extends bitfinex2Rest {
577
577
  const messageHash = channel + ':' + marketId;
578
578
  const prec = this.safeString(subscription, 'prec', 'P0');
579
579
  const isRaw = (prec === 'R0');
580
- const id = this.safeString(message, 0);
581
580
  // if it is an initial snapshot
582
581
  let orderbook = this.safeValue(this.orderbooks, symbol);
583
582
  if (orderbook === undefined) {
@@ -616,6 +615,7 @@ export default class bitfinex2 extends bitfinex2Rest {
616
615
  bookside.store(price, size, counter);
617
616
  }
618
617
  }
618
+ orderbook['symbol'] = symbol;
619
619
  client.resolve(orderbook, messageHash);
620
620
  }
621
621
  else {
@@ -628,7 +628,8 @@ export default class bitfinex2 extends bitfinex2Rest {
628
628
  const bookside = orderbookItem[side];
629
629
  // price = 0 means that you have to remove the order from your book
630
630
  const amount = Precise.stringGt(price, '0') ? size : '0';
631
- bookside.store(this.parseNumber(price), this.parseNumber(amount), id);
631
+ const idString = this.safeString(deltas, 0);
632
+ bookside.store(this.parseNumber(price), this.parseNumber(amount), idString);
632
633
  }
633
634
  else {
634
635
  const amount = this.safeString(deltas, 2);
@@ -658,16 +659,19 @@ export default class bitfinex2 extends bitfinex2Rest {
658
659
  const stringArray = [];
659
660
  const bids = book['bids'];
660
661
  const asks = book['asks'];
662
+ const prec = this.safeString(subscription, 'prec', 'P0');
663
+ const isRaw = (prec === 'R0');
664
+ const idToCheck = isRaw ? 2 : 0;
661
665
  // pepperoni pizza from bitfinex
662
666
  for (let i = 0; i < depth; i++) {
663
667
  const bid = this.safeValue(bids, i);
664
668
  const ask = this.safeValue(asks, i);
665
669
  if (bid !== undefined) {
666
- stringArray.push(this.numberToString(bids[i][0]));
670
+ stringArray.push(this.numberToString(bids[i][idToCheck]));
667
671
  stringArray.push(this.numberToString(bids[i][1]));
668
672
  }
669
673
  if (ask !== undefined) {
670
- stringArray.push(this.numberToString(asks[i][0]));
674
+ stringArray.push(this.numberToString(asks[i][idToCheck]));
671
675
  stringArray.push(this.numberToString(-asks[i][1]));
672
676
  }
673
677
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.1.20",
3
+ "version": "4.1.23",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 130+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",
package/skip-tests.json CHANGED
@@ -174,7 +174,7 @@
174
174
  }
175
175
  },
176
176
  "bitfinex2": {
177
- "skipWs": true,
177
+ "//skipWs": true,
178
178
  "skipMethods": {
179
179
  "loadMarkets": {
180
180
  "currencyIdAndCode": "broken currencies"
@@ -509,6 +509,7 @@
509
509
  }
510
510
  },
511
511
  "btcalpha": {
512
+ "skip": true,
512
513
  "skipMethods": {
513
514
  "fetchOrderBook": "bids[0][0] is not < asks[0][0]",
514
515
  "fetchL2OrderBook": "same",