ccxt 4.0.96 → 4.0.98

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.96';
183
+ const version = '4.0.98';
184
184
  Exchange["default"].ccxtVersion = version;
185
185
  const exchanges = {
186
186
  'ace': ace,
@@ -31,6 +31,7 @@ class bigone extends bigone$1 {
31
31
  'cancelAllOrders': true,
32
32
  'cancelOrder': true,
33
33
  'createOrder': true,
34
+ 'createPostOnlyOrder': true,
34
35
  'createStopLimitOrder': true,
35
36
  'createStopMarketOrder': true,
36
37
  'createStopOrder': true,
@@ -132,6 +133,7 @@ class bigone extends bigone$1 {
132
133
  },
133
134
  },
134
135
  'options': {
136
+ 'createMarketBuyOrderRequiresPrice': true,
135
137
  'accountsByType': {
136
138
  'spot': 'SPOT',
137
139
  'fund': 'FUND',
@@ -1088,30 +1090,39 @@ class bigone extends bigone$1 {
1088
1090
  //
1089
1091
  return this.parseBalance(response);
1090
1092
  }
1093
+ parseType(type) {
1094
+ const types = {
1095
+ 'STOP_LIMIT': 'limit',
1096
+ 'STOP_MARKET': 'market',
1097
+ 'LIMIT': 'limit',
1098
+ 'MARKET': 'market',
1099
+ };
1100
+ return this.safeString(types, type, type);
1101
+ }
1091
1102
  parseOrder(order, market = undefined) {
1092
1103
  //
1093
1104
  // {
1094
- // "id": 10,
1095
- // "asset_pair_name": "EOS-BTC",
1096
- // "price": "10.00",
1097
- // "amount": "10.00",
1098
- // "filled_amount": "9.0",
1099
- // "avg_deal_price": "12.0",
1100
- // "side": "ASK",
1101
- // "state": "FILLED",
1102
- // "created_at":"2019-01-29T06:05:56Z",
1103
- // "updated_at":"2019-01-29T06:05:56Z",
1105
+ // "id": '42154072251',
1106
+ // "asset_pair_name": 'SOL-USDT',
1107
+ // "price": '20',
1108
+ // "amount": '0.5',
1109
+ // "filled_amount": '0',
1110
+ // "avg_deal_price": '0',
1111
+ // "side": 'ASK',
1112
+ // "state": 'PENDING',
1113
+ // "created_at": '2023-09-13T03:42:00Z',
1114
+ // "updated_at": '2023-09-13T03:42:00Z',
1115
+ // "type": 'LIMIT',
1116
+ // "stop_price": '0',
1117
+ // "immediate_or_cancel": false,
1118
+ // "post_only": false,
1119
+ // "client_order_id": ''
1104
1120
  // }
1105
1121
  //
1106
1122
  const id = this.safeString(order, 'id');
1107
1123
  const marketId = this.safeString(order, 'asset_pair_name');
1108
1124
  const symbol = this.safeSymbol(marketId, market, '-');
1109
1125
  const timestamp = this.parse8601(this.safeString(order, 'created_at'));
1110
- const price = this.safeString(order, 'price');
1111
- const amount = this.safeString(order, 'amount');
1112
- const average = this.safeString(order, 'avg_deal_price');
1113
- const filled = this.safeString(order, 'filled_amount');
1114
- const status = this.parseOrderStatus(this.safeString(order, 'state'));
1115
1126
  let side = this.safeString(order, 'side');
1116
1127
  if (side === 'BID') {
1117
1128
  side = 'buy';
@@ -1119,28 +1130,48 @@ class bigone extends bigone$1 {
1119
1130
  else {
1120
1131
  side = 'sell';
1121
1132
  }
1122
- const lastTradeTimestamp = this.parse8601(this.safeString(order, 'updated_at'));
1133
+ let triggerPrice = this.safeString(order, 'stop_price');
1134
+ if (Precise["default"].stringEq(triggerPrice, '0')) {
1135
+ triggerPrice = undefined;
1136
+ }
1137
+ const immediateOrCancel = this.safeValue(order, 'immediate_or_cancel');
1138
+ let timeInForce = undefined;
1139
+ if (immediateOrCancel) {
1140
+ timeInForce = 'IOC';
1141
+ }
1142
+ const type = this.parseType(this.safeString(order, 'type'));
1143
+ const price = this.safeString(order, 'price');
1144
+ let amount = undefined;
1145
+ let filled = undefined;
1146
+ let cost = undefined;
1147
+ if (type === 'market' && side === 'buy') {
1148
+ cost = this.safeString(order, 'filled_amount');
1149
+ }
1150
+ else {
1151
+ amount = this.safeString(order, 'amount');
1152
+ filled = this.safeString(order, 'filled_amount');
1153
+ }
1123
1154
  return this.safeOrder({
1124
1155
  'info': order,
1125
1156
  'id': id,
1126
- 'clientOrderId': undefined,
1157
+ 'clientOrderId': this.safeString(order, 'client_order_id'),
1127
1158
  'timestamp': timestamp,
1128
1159
  'datetime': this.iso8601(timestamp),
1129
- 'lastTradeTimestamp': lastTradeTimestamp,
1160
+ 'lastTradeTimestamp': this.parse8601(this.safeString(order, 'updated_at')),
1130
1161
  'symbol': symbol,
1131
- 'type': undefined,
1132
- 'timeInForce': undefined,
1133
- 'postOnly': undefined,
1162
+ 'type': type,
1163
+ 'timeInForce': timeInForce,
1164
+ 'postOnly': this.safeValue(order, 'post_only'),
1134
1165
  'side': side,
1135
1166
  'price': price,
1136
- 'stopPrice': undefined,
1137
- 'triggerPrice': undefined,
1167
+ 'stopPrice': triggerPrice,
1168
+ 'triggerPrice': triggerPrice,
1138
1169
  'amount': amount,
1139
- 'cost': undefined,
1140
- 'average': average,
1170
+ 'cost': cost,
1171
+ 'average': this.safeString(order, 'avg_deal_price'),
1141
1172
  'filled': filled,
1142
1173
  'remaining': undefined,
1143
- 'status': status,
1174
+ 'status': this.parseOrderStatus(this.safeString(order, 'state')),
1144
1175
  'fee': undefined,
1145
1176
  'trades': undefined,
1146
1177
  }, market);
@@ -1150,46 +1181,79 @@ class bigone extends bigone$1 {
1150
1181
  * @method
1151
1182
  * @name bigone#createOrder
1152
1183
  * @description create a trade order
1184
+ * @see https://open.big.one/docs/spot_orders.html#create-order
1153
1185
  * @param {string} symbol unified symbol of the market to create an order in
1154
1186
  * @param {string} type 'market' or 'limit'
1155
1187
  * @param {string} side 'buy' or 'sell'
1156
1188
  * @param {float} amount how much of currency you want to trade in units of base currency
1157
1189
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
1158
1190
  * @param {object} [params] extra parameters specific to the bigone api endpoint
1191
+ * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
1192
+ * @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
1193
+ * @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
1194
+ *
1195
+ * EXCHANGE SPECIFIC PARAMETERS
1196
+ * @param {string} operator *stop order only* GTE or LTE (default)
1197
+ * @param {string} client_order_id must match ^[a-zA-Z0-9-_]{1,36}$ this regex. client_order_id is unique in 24 hours, If created 24 hours later and the order closed, it will be released and can be reused
1159
1198
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
1160
1199
  */
1161
1200
  await this.loadMarkets();
1162
1201
  const market = this.market(symbol);
1163
- const requestSide = (side === 'buy') ? 'BID' : 'ASK';
1164
- const uppercaseType = type.toUpperCase();
1202
+ const isBuy = (side === 'buy');
1203
+ const requestSide = isBuy ? 'BID' : 'ASK';
1204
+ let uppercaseType = type.toUpperCase();
1205
+ const isLimit = uppercaseType === 'LIMIT';
1206
+ const exchangeSpecificParam = this.safeValue(params, 'post_only');
1207
+ let postOnly = undefined;
1208
+ [postOnly, params] = this.handlePostOnly((uppercaseType === 'MARKET'), exchangeSpecificParam, params);
1209
+ const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
1165
1210
  const request = {
1166
1211
  'asset_pair_name': market['id'],
1167
1212
  'side': requestSide,
1168
- 'amount': this.amountToPrecision(symbol, amount),
1213
+ 'amount': this.amountToPrecision(symbol, amount), // order amount, string, required
1169
1214
  // 'price': this.priceToPrecision (symbol, price), // order price, string, required
1170
- 'type': uppercaseType,
1171
1215
  // 'operator': 'GTE', // stop orders only, GTE greater than and equal, LTE less than and equal
1172
1216
  // 'immediate_or_cancel': false, // limit orders only, must be false when post_only is true
1173
1217
  // 'post_only': false, // limit orders only, must be false when immediate_or_cancel is true
1174
1218
  };
1175
- if (uppercaseType === 'LIMIT') {
1219
+ if (isLimit || (uppercaseType === 'STOP_LIMIT')) {
1176
1220
  request['price'] = this.priceToPrecision(symbol, price);
1221
+ if (isLimit) {
1222
+ const timeInForce = this.safeString(params, 'timeInForce');
1223
+ if (timeInForce === 'IOC') {
1224
+ request['immediate_or_cancel'] = true;
1225
+ }
1226
+ if (postOnly) {
1227
+ request['post_only'] = true;
1228
+ }
1229
+ }
1177
1230
  }
1178
1231
  else {
1179
- const isStopLimit = (uppercaseType === 'STOP_LIMIT');
1180
- const isStopMarket = (uppercaseType === 'STOP_MARKET');
1181
- if (isStopLimit || isStopMarket) {
1182
- const stopPrice = this.safeNumber2(params, 'stop_price', 'stopPrice');
1183
- if (stopPrice === undefined) {
1184
- throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a stop_price parameter');
1232
+ const createMarketBuyOrderRequiresPrice = this.safeValue(this.options, 'createMarketBuyOrderRequiresPrice');
1233
+ if (createMarketBuyOrderRequiresPrice && (side === 'buy')) {
1234
+ if (price === undefined) {
1235
+ throw new errors.InvalidOrder(this.id + ' createOrder() requires price argument for market buy orders on spot markets to calculate the total amount to spend (amount * price), alternatively set the createMarketBuyOrderRequiresPrice option to false and pass in the cost to spend into the amount parameter');
1185
1236
  }
1186
- request['stop_price'] = this.priceToPrecision(symbol, stopPrice);
1187
- params = this.omit(params, ['stop_price', 'stopPrice']);
1237
+ else {
1238
+ const amountString = this.numberToString(amount);
1239
+ const priceString = this.numberToString(price);
1240
+ amount = this.parseNumber(Precise["default"].stringMul(amountString, priceString));
1241
+ }
1242
+ }
1243
+ }
1244
+ request['amount'] = this.amountToPrecision(symbol, amount);
1245
+ if (triggerPrice !== undefined) {
1246
+ request['stop_price'] = this.priceToPrecision(symbol, triggerPrice);
1247
+ request['operator'] = isBuy ? 'GTE' : 'LTE';
1248
+ if (isLimit) {
1249
+ uppercaseType = 'STOP_LIMIT';
1188
1250
  }
1189
- if (isStopLimit) {
1190
- request['price'] = this.priceToPrecision(symbol, price);
1251
+ else if (uppercaseType === 'MARKET') {
1252
+ uppercaseType = 'STOP_MARKET';
1191
1253
  }
1192
1254
  }
1255
+ request['type'] = uppercaseType;
1256
+ params = this.omit(params, ['stop_price', 'stopPrice', 'triggerPrice', 'timeInForce']);
1193
1257
  const response = await this.privatePostOrders(this.extend(request, params));
1194
1258
  //
1195
1259
  // {
@@ -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));
@@ -80,15 +80,14 @@ class bithumb extends bithumb$1 {
80
80
  'api': {
81
81
  'public': {
82
82
  'get': [
83
- 'ticker/{currency}',
84
- 'ticker/all',
85
- 'ticker/ALL_BTC',
86
- 'ticker/ALL_KRW',
87
- 'orderbook/{currency}',
88
- 'orderbook/all',
89
- 'transaction_history/{currency}',
90
- 'transaction_history/all',
91
- 'candlestick/{currency}/{interval}',
83
+ 'ticker/ALL_{quoteId}',
84
+ 'ticker/{baseId}_{quoteId}',
85
+ 'orderbook/ALL_{quoteId}',
86
+ 'orderbook/{baseId}_{quoteId}',
87
+ 'transaction_history/{baseId}_{quoteId}',
88
+ 'assetsstatus/ALL',
89
+ 'assetsstatus/{baseId}',
90
+ 'candlestick/{baseId}_{quoteId}/{interval}',
92
91
  ],
93
92
  },
94
93
  'private': {
@@ -107,6 +106,7 @@ class bithumb extends bithumb$1 {
107
106
  'trade/krw_withdrawal',
108
107
  'trade/market_buy',
109
108
  'trade/market_sell',
109
+ 'trade/stop_limit',
110
110
  ],
111
111
  },
112
112
  },
@@ -195,8 +195,10 @@ class bithumb extends bithumb$1 {
195
195
  const quote = quotes[i];
196
196
  const quoteId = quote;
197
197
  const extension = this.safeValue(quoteCurrencies, quote, {});
198
- const method = 'publicGetTickerALL' + quote;
199
- const response = await this[method](params);
198
+ const request = {
199
+ 'quoteId': quoteId,
200
+ };
201
+ const response = await this.publicGetTickerALLQuoteId(this.extend(request, params));
200
202
  const data = this.safeValue(response, 'data');
201
203
  const currencyIds = Object.keys(data);
202
204
  for (let j = 0; j < currencyIds.length; j++) {
@@ -307,12 +309,13 @@ class bithumb extends bithumb$1 {
307
309
  await this.loadMarkets();
308
310
  const market = this.market(symbol);
309
311
  const request = {
310
- 'currency': market['base'] + '_' + market['quote'],
312
+ 'baseId': market['baseId'],
313
+ 'quoteId': market['quoteId'],
311
314
  };
312
315
  if (limit !== undefined) {
313
316
  request['count'] = limit; // default 30, max 30
314
317
  }
315
- const response = await this.publicGetOrderbookCurrency(this.extend(request, params));
318
+ const response = await this.publicGetOrderbookBaseIdQuoteId(this.extend(request, params));
316
319
  //
317
320
  // {
318
321
  // "status":"0000",
@@ -400,8 +403,11 @@ class bithumb extends bithumb$1 {
400
403
  const quotes = Object.keys(quoteCurrencies);
401
404
  for (let i = 0; i < quotes.length; i++) {
402
405
  const quote = quotes[i];
403
- const method = 'publicGetTickerALL' + quote;
404
- const response = await this[method](params);
406
+ const quoteId = quote;
407
+ const request = {
408
+ 'quoteId': quoteId,
409
+ };
410
+ const response = await this.publicGetTickerALLQuoteId(this.extend(request, params));
405
411
  //
406
412
  // {
407
413
  // "status":"0000",
@@ -451,9 +457,10 @@ class bithumb extends bithumb$1 {
451
457
  await this.loadMarkets();
452
458
  const market = this.market(symbol);
453
459
  const request = {
454
- 'currency': market['base'],
460
+ 'baseId': market['baseId'],
461
+ 'quoteId': market['quoteId'],
455
462
  };
456
- const response = await this.publicGetTickerCurrency(this.extend(request, params));
463
+ const response = await this.publicGetTickerBaseIdQuoteId(this.extend(request, params));
457
464
  //
458
465
  // {
459
466
  // "status":"0000",
@@ -511,10 +518,11 @@ class bithumb extends bithumb$1 {
511
518
  await this.loadMarkets();
512
519
  const market = this.market(symbol);
513
520
  const request = {
514
- 'currency': market['base'],
521
+ 'baseId': market['baseId'],
522
+ 'quoteId': market['quoteId'],
515
523
  'interval': this.safeString(this.timeframes, timeframe, timeframe),
516
524
  };
517
- const response = await this.publicGetCandlestickCurrencyInterval(this.extend(request, params));
525
+ const response = await this.publicGetCandlestickBaseIdQuoteIdInterval(this.extend(request, params));
518
526
  //
519
527
  // {
520
528
  // 'status': '0000',
@@ -633,12 +641,13 @@ class bithumb extends bithumb$1 {
633
641
  await this.loadMarkets();
634
642
  const market = this.market(symbol);
635
643
  const request = {
636
- 'currency': market['base'] + '_' + market['quote'],
644
+ 'baseId': market['baseId'],
645
+ 'quoteId': market['quoteId'],
637
646
  };
638
647
  if (limit !== undefined) {
639
648
  request['count'] = limit; // default 20, max 100
640
649
  }
641
- const response = await this.publicGetTransactionHistoryCurrency(this.extend(request, params));
650
+ const response = await this.publicGetTransactionHistoryBaseIdQuoteId(this.extend(request, params));
642
651
  //
643
652
  // {
644
653
  // "status":"0000",
@@ -85,7 +85,7 @@ class bitmart extends bitmart$1 {
85
85
  'fetchWithdrawals': true,
86
86
  'reduceMargin': false,
87
87
  'repayMargin': true,
88
- 'setLeverage': false,
88
+ 'setLeverage': true,
89
89
  'setMarginMode': false,
90
90
  'transfer': true,
91
91
  'withdraw': true,
@@ -148,6 +148,9 @@ class bitmart extends bitmart$1 {
148
148
  'account/sub-account/v1/transfer-history': 7.5,
149
149
  'account/sub-account/main/v1/wallet': 5,
150
150
  'account/sub-account/main/v1/subaccount-list': 7.5,
151
+ 'account/contract/sub-account/main/v1/wallet': 5,
152
+ 'account/contract/sub-account/main/v1/transfer-list': 7.5,
153
+ 'account/contract/sub-account/v1/transfer-history': 7.5,
151
154
  // account
152
155
  'account/v1/wallet': 5,
153
156
  'account/v1/currencies': 30,
@@ -173,9 +176,11 @@ class bitmart extends bitmart$1 {
173
176
  'spot/v1/user_fee': 6,
174
177
  // contract
175
178
  'contract/private/assets-detail': 5,
176
- 'contract/private/order': 2,
179
+ 'contract/private/order': 1.2,
177
180
  'contract/private/order-history': 10,
178
181
  'contract/private/position': 10,
182
+ 'contract/private/get-open-orders': 1.2,
183
+ 'contract/private/trades': 10,
179
184
  },
180
185
  'post': {
181
186
  // sub-account endpoints
@@ -184,6 +189,9 @@ class bitmart extends bitmart$1 {
184
189
  'account/sub-account/main/v1/main-to-sub': 30,
185
190
  'account/sub-account/sub/v1/sub-to-sub': 30,
186
191
  'account/sub-account/main/v1/sub-to-sub': 30,
192
+ 'account/contract/sub-account/main/v1/sub-to-main': 7.5,
193
+ 'account/contract/sub-account/main/v1/main-to-sub': 7.5,
194
+ 'account/contract/sub-account/sub/v1/sub-to-main': 7.5,
187
195
  // account
188
196
  'account/v1/withdraw/apply': 7.5,
189
197
  // transaction and trading
@@ -207,7 +215,14 @@ class bitmart extends bitmart$1 {
207
215
  'spot/v1/margin/isolated/repay': 6,
208
216
  'spot/v1/margin/isolated/transfer': 6,
209
217
  // contract
210
- 'contract/private/trades': 10,
218
+ 'account/v1/transfer-contract-list': 60,
219
+ 'account/v1/transfer-contract': 60,
220
+ 'contract/private/submit-order': 2.5,
221
+ 'contract/private/cancel-order': 1.5,
222
+ 'contract/private/cancel-orders': 30,
223
+ 'contract/private/submit-plan-order': 2.5,
224
+ 'contract/private/cancel-plan-order': 1.5,
225
+ 'contract/private/submit-leverage': 2.5,
211
226
  },
212
227
  },
213
228
  },
@@ -2052,6 +2067,9 @@ class bitmart extends bitmart$1 {
2052
2067
  }
2053
2068
  const [marginMode, query] = this.handleMarginModeAndParams('createOrder', params);
2054
2069
  if (marginMode !== undefined) {
2070
+ if (marginMode !== 'isolated') {
2071
+ throw new errors.NotSupported(this.id + ' only isolated margin is supported');
2072
+ }
2055
2073
  method = 'privatePostSpotV1MarginSubmitOrder';
2056
2074
  }
2057
2075
  const response = await this[method](this.extend(request, query));
@@ -3204,22 +3222,33 @@ class bitmart extends bitmart$1 {
3204
3222
  'info': interest,
3205
3223
  };
3206
3224
  }
3207
- handleMarginModeAndParams(methodName, params = {}, defaultValue = undefined) {
3225
+ async setLeverage(leverage, symbol = undefined, params = {}) {
3208
3226
  /**
3209
- * @ignore
3210
3227
  * @method
3211
- * @description marginMode specified by params["marginMode"], this.options["marginMode"], this.options["defaultMarginMode"], params["margin"] = true or this.options["defaultType"] = 'margin'
3212
- * @param {object} [params] extra parameters specific to the exchange api endpoint
3213
- * @returns {array} the marginMode in lowercase
3228
+ * @name bitmart#setLeverage
3229
+ * @description set the level of leverage for a market
3230
+ * @see https://developer-pro.bitmart.com/en/futures/#submit-leverage-signed
3231
+ * @param {float} leverage the rate of leverage
3232
+ * @param {string} symbol unified market symbol
3233
+ * @param {object} [params] extra parameters specific to the bitmart api endpoint
3234
+ * @param {string} [params.marginMode] 'isolated' or 'cross'
3235
+ * @returns {object} response from the exchange
3214
3236
  */
3237
+ this.checkRequiredSymbol('setLeverage', symbol);
3215
3238
  let marginMode = undefined;
3216
- [marginMode, params] = super.handleMarginModeAndParams(methodName, params, defaultValue);
3217
- if (marginMode !== undefined) {
3218
- if (marginMode !== 'isolated') {
3219
- throw new errors.NotSupported(this.id + ' only isolated margin is supported');
3220
- }
3239
+ [marginMode, params] = this.handleMarginModeAndParams('setLeverage', params);
3240
+ this.checkRequiredArgument('setLeverage', marginMode, 'marginMode', ['isolated', 'cross']);
3241
+ await this.loadMarkets();
3242
+ const market = this.market(symbol);
3243
+ if (!market['swap']) {
3244
+ throw new errors.BadSymbol(this.id + ' setLeverage() supports swap contracts only');
3221
3245
  }
3222
- return [marginMode, params];
3246
+ const request = {
3247
+ 'symbol': market['id'],
3248
+ 'leverage': leverage.toString(),
3249
+ 'open_type': marginMode,
3250
+ };
3251
+ return await this.privatePostContractPrivateSubmitLeverage(this.extend(request, params));
3223
3252
  }
3224
3253
  nonce() {
3225
3254
  return this.milliseconds();
@@ -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
  //
@@ -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;