ccxt 4.0.95 → 4.0.97

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.
package/dist/cjs/ccxt.js CHANGED
@@ -180,7 +180,7 @@ var woo$1 = require('./src/pro/woo.js');
180
180
 
181
181
  //-----------------------------------------------------------------------------
182
182
  // this is updated by vss.js when building
183
- const version = '4.0.95';
183
+ const version = '4.0.97';
184
184
  Exchange["default"].ccxtVersion = version;
185
185
  const exchanges = {
186
186
  'ace': ace,
@@ -1274,7 +1274,7 @@ class bitfinex2 extends bitfinex2$1 {
1274
1274
  sort = '1';
1275
1275
  }
1276
1276
  if (limit !== undefined) {
1277
- request['limit'] = limit; // default 120, max 5000
1277
+ request['limit'] = Math.min(limit, 10000); // default 120, max 10000
1278
1278
  }
1279
1279
  request['sort'] = sort;
1280
1280
  const response = await this.publicGetTradesSymbolHist(this.extend(request, params));
@@ -1722,7 +1722,7 @@ class bitmex extends bitmex$1 {
1722
1722
  request['reverse'] = true;
1723
1723
  }
1724
1724
  if (limit !== undefined) {
1725
- request['count'] = limit;
1725
+ request['count'] = Math.min(limit, 1000); // api maximum 1000
1726
1726
  }
1727
1727
  const response = await this.publicGetTrade(this.extend(request, params));
1728
1728
  //
@@ -758,14 +758,24 @@ class bitso extends bitso$1 {
758
758
  const timestamp = this.parse8601(this.safeString(trade, 'created_at'));
759
759
  const marketId = this.safeString(trade, 'book');
760
760
  const symbol = this.safeSymbol(marketId, market, '_');
761
- const side = this.safeString2(trade, 'side', 'maker_side');
761
+ let side = this.safeString(trade, 'side');
762
762
  const makerSide = this.safeString(trade, 'maker_side');
763
763
  let takerOrMaker = undefined;
764
- if (side === makerSide) {
765
- takerOrMaker = 'maker';
764
+ if (side !== undefined) {
765
+ if (side === makerSide) {
766
+ takerOrMaker = 'maker';
767
+ }
768
+ else {
769
+ takerOrMaker = 'taker';
770
+ }
766
771
  }
767
772
  else {
768
- takerOrMaker = 'taker';
773
+ if (makerSide === 'buy') {
774
+ side = 'sell';
775
+ }
776
+ else {
777
+ side = 'buy';
778
+ }
769
779
  }
770
780
  let amount = this.safeString2(trade, 'amount', 'major');
771
781
  if (amount !== undefined) {
@@ -631,7 +631,7 @@ class bitvavo extends bitvavo$1 {
631
631
  // 'tradeIdTo': '57b1159b-6bf5-4cde-9e2c-6bd6a5678baf',
632
632
  };
633
633
  if (limit !== undefined) {
634
- request['limit'] = limit;
634
+ request['limit'] = Math.min(limit, 1000);
635
635
  }
636
636
  if (since !== undefined) {
637
637
  request['start'] = since;
@@ -363,6 +363,21 @@ class btctradeua extends btctradeua$1 {
363
363
  return timestamp - 10800000;
364
364
  }
365
365
  parseTrade(trade, market = undefined) {
366
+ //
367
+ // fetchTrades
368
+ //
369
+ // {
370
+ // "amnt_base": "2220.1204701750",
371
+ // "order_id": 247644861,
372
+ // "unixtime": 1694340398,
373
+ // "price": "1019739.3229211044",
374
+ // "amnt_trade": "0.0021771451",
375
+ // "user": "Vasily1989",
376
+ // "type": "sell",
377
+ // "pub_date": "Sept. 10, 2023, 1:06 p.m.",
378
+ // "id": 7498807
379
+ // }
380
+ //
366
381
  const timestamp = this.parseExchangeSpecificDatetime(this.safeString(trade, 'pub_date'));
367
382
  const id = this.safeString(trade, 'id');
368
383
  const type = 'limit';
@@ -403,6 +418,21 @@ class btctradeua extends btctradeua$1 {
403
418
  'symbol': market['id'],
404
419
  };
405
420
  const response = await this.publicGetDealsSymbol(this.extend(request, params));
421
+ //
422
+ // [
423
+ // {
424
+ // "amnt_base": "2220.1204701750",
425
+ // "order_id": 247644861,
426
+ // "unixtime": 1694340398,
427
+ // "price": "1019739.3229211044",
428
+ // "amnt_trade": "0.0021771451",
429
+ // "user": "Vasily1989",
430
+ // "type": "sell",
431
+ // "pub_date": "Sept. 10, 2023, 1:06 p.m.",
432
+ // "id": 7498807
433
+ // },
434
+ // ]
435
+ //
406
436
  // they report each trade twice (once for both of the two sides of the fill)
407
437
  // deduplicate trades for that reason
408
438
  const trades = [];