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.
@@ -1317,7 +1317,7 @@ class deribit extends deribit$1 {
1317
1317
  request['start_timestamp'] = since;
1318
1318
  }
1319
1319
  if (limit !== undefined) {
1320
- request['count'] = limit; // default 10
1320
+ request['count'] = Math.min(limit, 1000); // default 10
1321
1321
  }
1322
1322
  const response = await this[method](this.extend(request, params));
1323
1323
  //
@@ -1366,7 +1366,7 @@ class digifinex extends digifinex$1 {
1366
1366
  request['symbol'] = market['id'];
1367
1367
  }
1368
1368
  if (limit !== undefined) {
1369
- request['limit'] = limit;
1369
+ request['limit'] = market['swap'] ? Math.min(limit, 100) : limit;
1370
1370
  }
1371
1371
  const response = await this[method](this.extend(request, params));
1372
1372
  //
@@ -1107,7 +1107,7 @@ class hitbtc extends hitbtc$1 {
1107
1107
  request['symbols'] = market['id'];
1108
1108
  }
1109
1109
  if (limit !== undefined) {
1110
- request['limit'] = limit;
1110
+ request['limit'] = Math.min(limit, 1000);
1111
1111
  }
1112
1112
  if (since !== undefined) {
1113
1113
  request['from'] = since;
@@ -4141,7 +4141,7 @@ class kucoin extends kucoin$1 {
4141
4141
  this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
4142
4142
  this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
4143
4143
  this.throwBroadlyMatchedException(this.exceptions['broad'], body, feedback);
4144
- if (errorCode !== '200000') {
4144
+ if (errorCode !== '200000' && errorCode !== '200') {
4145
4145
  throw new errors.ExchangeError(feedback);
4146
4146
  }
4147
4147
  return undefined;
@@ -795,10 +795,10 @@ class latoken extends latoken$1 {
795
795
  'currency': market['baseId'],
796
796
  'quote': market['quoteId'],
797
797
  // 'from': since.toString (), // milliseconds
798
- // 'limit': limit, // default 100, max 1000
798
+ // 'limit': limit, // default 100, limit 100
799
799
  };
800
800
  if (limit !== undefined) {
801
- request['limit'] = limit; // default 100, max 1000
801
+ request['limit'] = Math.min(limit, 100); // default 100, limit 100
802
802
  }
803
803
  const response = await this.publicGetTradeHistoryCurrencyQuote(this.extend(request, params));
804
804
  //
@@ -773,7 +773,7 @@ class probit extends probit$1 {
773
773
  request['start_time'] = this.iso8601(since);
774
774
  }
775
775
  if (limit !== undefined) {
776
- request['limit'] = limit;
776
+ request['limit'] = Math.min(limit, 10000);
777
777
  }
778
778
  const response = await this.publicGetTrade(this.extend(request, params));
779
779
  //
@@ -444,7 +444,7 @@ class wazirx extends wazirx$1 {
444
444
  'symbol': market['id'],
445
445
  };
446
446
  if (limit !== undefined) {
447
- request['limit'] = limit; // Default 500; max 1000.
447
+ request['limit'] = Math.min(limit, 1000); // Default 500; max 1000.
448
448
  }
449
449
  const method = this.safeString(this.options, 'fetchTradesMethod', 'publicGetTrades');
450
450
  const response = await this[method](this.extend(request, params));
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending } from './src/base/errors.js';
7
- declare const version = "4.0.94";
7
+ declare const version = "4.0.96";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.0.95';
41
+ const version = '4.0.97';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -1277,7 +1277,7 @@ export default class bitfinex2 extends Exchange {
1277
1277
  sort = '1';
1278
1278
  }
1279
1279
  if (limit !== undefined) {
1280
- request['limit'] = limit; // default 120, max 5000
1280
+ request['limit'] = Math.min(limit, 10000); // default 120, max 10000
1281
1281
  }
1282
1282
  request['sort'] = sort;
1283
1283
  const response = await this.publicGetTradesSymbolHist(this.extend(request, params));
package/js/src/bitmex.js CHANGED
@@ -1725,7 +1725,7 @@ export default class bitmex extends Exchange {
1725
1725
  request['reverse'] = true;
1726
1726
  }
1727
1727
  if (limit !== undefined) {
1728
- request['count'] = limit;
1728
+ request['count'] = Math.min(limit, 1000); // api maximum 1000
1729
1729
  }
1730
1730
  const response = await this.publicGetTrade(this.extend(request, params));
1731
1731
  //
package/js/src/bitso.js CHANGED
@@ -761,14 +761,24 @@ export default class bitso extends Exchange {
761
761
  const timestamp = this.parse8601(this.safeString(trade, 'created_at'));
762
762
  const marketId = this.safeString(trade, 'book');
763
763
  const symbol = this.safeSymbol(marketId, market, '_');
764
- const side = this.safeString2(trade, 'side', 'maker_side');
764
+ let side = this.safeString(trade, 'side');
765
765
  const makerSide = this.safeString(trade, 'maker_side');
766
766
  let takerOrMaker = undefined;
767
- if (side === makerSide) {
768
- takerOrMaker = 'maker';
767
+ if (side !== undefined) {
768
+ if (side === makerSide) {
769
+ takerOrMaker = 'maker';
770
+ }
771
+ else {
772
+ takerOrMaker = 'taker';
773
+ }
769
774
  }
770
775
  else {
771
- takerOrMaker = 'taker';
776
+ if (makerSide === 'buy') {
777
+ side = 'sell';
778
+ }
779
+ else {
780
+ side = 'buy';
781
+ }
772
782
  }
773
783
  let amount = this.safeString2(trade, 'amount', 'major');
774
784
  if (amount !== undefined) {
package/js/src/bitvavo.js CHANGED
@@ -634,7 +634,7 @@ export default class bitvavo extends Exchange {
634
634
  // 'tradeIdTo': '57b1159b-6bf5-4cde-9e2c-6bd6a5678baf',
635
635
  };
636
636
  if (limit !== undefined) {
637
- request['limit'] = limit;
637
+ request['limit'] = Math.min(limit, 1000);
638
638
  }
639
639
  if (since !== undefined) {
640
640
  request['start'] = since;
@@ -366,6 +366,21 @@ export default class btctradeua extends Exchange {
366
366
  return timestamp - 10800000;
367
367
  }
368
368
  parseTrade(trade, market = undefined) {
369
+ //
370
+ // fetchTrades
371
+ //
372
+ // {
373
+ // "amnt_base": "2220.1204701750",
374
+ // "order_id": 247644861,
375
+ // "unixtime": 1694340398,
376
+ // "price": "1019739.3229211044",
377
+ // "amnt_trade": "0.0021771451",
378
+ // "user": "Vasily1989",
379
+ // "type": "sell",
380
+ // "pub_date": "Sept. 10, 2023, 1:06 p.m.",
381
+ // "id": 7498807
382
+ // }
383
+ //
369
384
  const timestamp = this.parseExchangeSpecificDatetime(this.safeString(trade, 'pub_date'));
370
385
  const id = this.safeString(trade, 'id');
371
386
  const type = 'limit';
@@ -406,6 +421,21 @@ export default class btctradeua extends Exchange {
406
421
  'symbol': market['id'],
407
422
  };
408
423
  const response = await this.publicGetDealsSymbol(this.extend(request, params));
424
+ //
425
+ // [
426
+ // {
427
+ // "amnt_base": "2220.1204701750",
428
+ // "order_id": 247644861,
429
+ // "unixtime": 1694340398,
430
+ // "price": "1019739.3229211044",
431
+ // "amnt_trade": "0.0021771451",
432
+ // "user": "Vasily1989",
433
+ // "type": "sell",
434
+ // "pub_date": "Sept. 10, 2023, 1:06 p.m.",
435
+ // "id": 7498807
436
+ // },
437
+ // ]
438
+ //
409
439
  // they report each trade twice (once for both of the two sides of the fill)
410
440
  // deduplicate trades for that reason
411
441
  const trades = [];
package/js/src/bybit.d.ts CHANGED
@@ -9,7 +9,6 @@ export default class bybit extends Exchange {
9
9
  nonce(): number;
10
10
  addPaginationCursorToResult(response: any): any;
11
11
  isUnifiedEnabled(params?: {}): Promise<any[]>;
12
- upgradeUnifiedAccount(params?: {}): Promise<any>;
13
12
  upgradeUnifiedTradeAccount(params?: {}): Promise<any>;
14
13
  convertExpireDate(date: any): string;
15
14
  convertExpireDateToMarketIdDate(date: any): any;
@@ -60,6 +59,7 @@ export default class bybit extends Exchange {
60
59
  };
61
60
  market(symbol: any): any;
62
61
  safeMarket(marketId?: any, market?: any, delimiter?: any, marketType?: any): any;
62
+ getBybitType(method: any, market: any, params: any): any[];
63
63
  fetchTime(params?: {}): Promise<number>;
64
64
  fetchCurrencies(params?: {}): Promise<{}>;
65
65
  fetchMarkets(params?: {}): Promise<any>;
@@ -102,49 +102,22 @@ export default class bybit extends Exchange {
102
102
  parseOrderStatus(status: any): string;
103
103
  parseTimeInForce(timeInForce: any): string;
104
104
  parseOrder(order: any, market?: any): import("./base/types.js").Order;
105
- parseContractOrder(order: any, market?: any): import("./base/types.js").Order;
106
- parseSpotOrder(order: any, market?: any): import("./base/types.js").Order;
107
105
  fetchOrder(id: string, symbol?: string, params?: {}): Promise<any>;
108
106
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
109
- createUnifiedAccountOrder(symbol: string, type: any, side: any, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
110
- createSpotOrder(symbol: string, type: any, side: any, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
111
- createUnifiedMarginOrder(symbol: string, type: any, side: any, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
112
- createContractV3Order(symbol: string, type: any, side: any, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
113
- createUsdcOrder(symbol: string, type: any, side: any, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
114
- editUnifiedAccountOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
115
- editUnifiedMarginOrder(id: string, symbol: any, type: any, side: any, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
116
- editContractV3Order(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
107
+ createUsdcOrder(symbol: any, type: any, side: any, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
108
+ editUsdcOrder(id: any, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
117
109
  editOrder(id: string, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
118
- cancelUnifiedAccountOrder(id: string, symbol?: string, params?: {}): Promise<import("./base/types.js").Order>;
119
- cancelSpotOrder(id: string, symbol?: string, params?: {}): Promise<import("./base/types.js").Order>;
120
- cancelUnifiedMarginOrder(id: string, symbol?: string, params?: {}): Promise<import("./base/types.js").Order>;
121
- cancelUSDCOrder(id: string, symbol?: string, params?: {}): Promise<import("./base/types.js").Order>;
122
- cancelDerivativesOrder(id: string, symbol?: string, params?: {}): Promise<import("./base/types.js").Order>;
110
+ cancelUsdcOrder(id: any, symbol?: string, params?: {}): Promise<import("./base/types.js").Order>;
123
111
  cancelOrder(id: string, symbol?: string, params?: {}): Promise<import("./base/types.js").Order>;
124
- cancelAllUnifiedAccountOrders(symbol?: string, params?: {}): Promise<any>;
125
- cancelAllSpotOrders(symbol?: string, params?: {}): Promise<any>;
126
- cancelAllUnifiedMarginOrders(symbol?: string, params?: {}): Promise<any>;
127
- cancelAllUSDCOrders(symbol?: string, params?: {}): Promise<any>;
128
- cancelAllDerivativesOrders(symbol?: string, params?: {}): Promise<import("./base/types.js").Order[]>;
112
+ cancelAllUsdcOrders(symbol?: string, params?: {}): Promise<any>;
129
113
  cancelAllOrders(symbol?: string, params?: {}): Promise<any>;
130
- fetchUnifiedAccountOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
131
- fetchUnifiedMarginOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
132
- fetchDerivativesOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
114
+ fetchUsdcOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
133
115
  fetchOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
134
- fetchSpotClosedOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
135
116
  fetchClosedOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
136
117
  fetchCanceledOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
137
- fetchUnifiedAccountOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
138
- fetchSpotOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
139
- fetchUnifiedMarginOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
140
- fetchDerivativesOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
141
- fetchUSDCOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
118
+ fetchUsdcOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
142
119
  fetchOpenOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Order[]>;
143
120
  fetchOrderTrades(id: string, symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
144
- fetchMyUnifiedTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
145
- fetchMySpotTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
146
- fetchMyUnifiedMarginTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
147
- fetchMyContractTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
148
121
  fetchMyUsdcTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
149
122
  fetchMyTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").Trade[]>;
150
123
  parseDepositAddress(depositAddress: any, currency?: any): {
@@ -225,14 +198,10 @@ export default class bybit extends Exchange {
225
198
  fee: any;
226
199
  }>;
227
200
  fetchPosition(symbol: string, params?: {}): Promise<any>;
228
- fetchUnifiedPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
229
- fetchUSDCPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
230
- fetchDerivativesPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
231
- fetchPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
201
+ fetchUsdcPositions(symbols?: string[], params?: {}): Promise<any>;
202
+ fetchPositions(symbols?: string[], params?: {}): Promise<any>;
232
203
  parsePosition(position: any, market?: any): import("./base/types.js").Position;
233
204
  setMarginMode(marginMode: any, symbol?: string, params?: {}): Promise<any>;
234
- setUnifiedMarginMode(marginMode: any, symbol?: string, params?: {}): Promise<any>;
235
- setDerivativesMarginMode(marginMode: any, symbol?: string, params?: {}): Promise<any>;
236
205
  setLeverage(leverage: any, symbol?: string, params?: {}): Promise<any>;
237
206
  setPositionMode(hedged: any, symbol?: string, params?: {}): Promise<any>;
238
207
  fetchDerivativesOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<any>;