ccxt 4.0.110 → 4.0.112

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.
@@ -15742,7 +15742,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15742
15742
  'fetchFundingRateHistory': true,
15743
15743
  'fetchFundingRates': true,
15744
15744
  'fetchIndexOHLCV': true,
15745
- 'fetchL3OrderBook': undefined,
15745
+ 'fetchL3OrderBook': false,
15746
15746
  'fetchLastPrices': true,
15747
15747
  'fetchLedger': true,
15748
15748
  'fetchLeverage': false,
@@ -15781,6 +15781,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
15781
15781
  'fetchTransfers': true,
15782
15782
  'fetchUnderlyingAssets': false,
15783
15783
  'fetchVolatilityHistory': false,
15784
+ 'fetchWithdrawAddresses': false,
15784
15785
  'fetchWithdrawal': false,
15785
15786
  'fetchWithdrawals': true,
15786
15787
  'fetchWithdrawalWhitelist': false,
@@ -45157,7 +45158,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
45157
45158
  // "type": "buy"
45158
45159
  // }
45159
45160
  //
45160
- // private fetchMyTrades spot
45161
+ // spot: fetchMyTrades
45161
45162
  //
45162
45163
  // {
45163
45164
  // "tradeId":"182342999769370687",
@@ -45176,28 +45177,42 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
45176
45177
  // "createTime":1695658457836,
45177
45178
  // }
45178
45179
  //
45179
- const id = this.safeString(trade, 'tradeId');
45180
- const timestamp = this.safeInteger2(trade, 'order_time', 'createTime');
45181
- const side = this.safeStringLower2(trade, 'side', 'type');
45182
- const takerOrMaker = this.safeString(trade, 'tradeRole');
45180
+ // swap: fetchMyTrades
45181
+ //
45182
+ // {
45183
+ // "order_id": "230930336848609",
45184
+ // "trade_id": "6212604014",
45185
+ // "symbol": "BTCUSDT",
45186
+ // "side": 3,
45187
+ // "price": "26910.4",
45188
+ // "vol": "1",
45189
+ // "exec_type": "Taker",
45190
+ // "profit": false,
45191
+ // "create_time": 1695961596692,
45192
+ // "realised_profit": "-0.0003",
45193
+ // "paid_fees": "0.01614624"
45194
+ // }
45195
+ //
45196
+ const timestamp = this.safeIntegerN(trade, ['order_time', 'createTime', 'create_time']);
45183
45197
  const isPublicTrade = ('order_time' in trade);
45184
- const price = this.safeString(trade, 'price');
45185
45198
  let amount = undefined;
45186
45199
  let cost = undefined;
45187
45200
  let type = undefined;
45201
+ let side = undefined;
45188
45202
  if (isPublicTrade) {
45189
45203
  amount = this.safeString(trade, 'count');
45190
45204
  cost = this.safeString(trade, 'amount');
45205
+ side = this.safeString(trade, 'type');
45191
45206
  }
45192
45207
  else {
45193
- amount = this.safeString(trade, 'size');
45208
+ amount = this.safeString2(trade, 'size', 'vol');
45194
45209
  cost = this.safeString(trade, 'notional');
45195
45210
  type = this.safeString(trade, 'type');
45211
+ side = this.parseOrderSide(this.safeString(trade, 'side'));
45196
45212
  }
45197
- const orderId = this.safeString(trade, 'orderId');
45198
45213
  const marketId = this.safeString(trade, 'symbol');
45199
- market = this.safeMarket(marketId, market, '_');
45200
- const feeCostString = this.safeString(trade, 'fee');
45214
+ market = this.safeMarket(marketId, market);
45215
+ const feeCostString = this.safeString2(trade, 'fee', 'paid_fees');
45201
45216
  let fee = undefined;
45202
45217
  if (feeCostString !== undefined) {
45203
45218
  const feeCurrencyId = this.safeString(trade, 'feeCoinName');
@@ -45212,17 +45227,17 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
45212
45227
  }
45213
45228
  return this.safeTrade({
45214
45229
  'info': trade,
45215
- 'id': id,
45216
- 'order': orderId,
45230
+ 'id': this.safeString2(trade, 'tradeId', 'trade_id'),
45231
+ 'order': this.safeString2(trade, 'orderId', 'order_id'),
45217
45232
  'timestamp': timestamp,
45218
45233
  'datetime': this.iso8601(timestamp),
45219
45234
  'symbol': market['symbol'],
45220
45235
  'type': type,
45221
45236
  'side': side,
45222
- 'price': price,
45237
+ 'price': this.safeString(trade, 'price'),
45223
45238
  'amount': amount,
45224
45239
  'cost': cost,
45225
- 'takerOrMaker': takerOrMaker,
45240
+ 'takerOrMaker': this.safeStringLower2(trade, 'tradeRole', 'exec_type'),
45226
45241
  'fee': fee,
45227
45242
  }, market);
45228
45243
  }
@@ -45425,6 +45440,7 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
45425
45440
  * @method
45426
45441
  * @name bitmart#fetchMyTrades
45427
45442
  * @see https://developer-pro.bitmart.com/en/spot/#account-trade-list-v4-signed
45443
+ * @see https://developer-pro.bitmart.com/en/futures/#get-order-trade-keyed
45428
45444
  * @description fetch all trades made by the user
45429
45445
  * @param {string} symbol unified market symbol
45430
45446
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -45439,32 +45455,46 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
45439
45455
  const request = {};
45440
45456
  if (symbol !== undefined) {
45441
45457
  market = this.market(symbol);
45458
+ request['symbol'] = market['id'];
45442
45459
  }
45443
45460
  let type = undefined;
45461
+ let response = undefined;
45444
45462
  [type, params] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
45445
- if (type !== 'spot') {
45446
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchMyTrades() does not support ' + type + ' orders, only spot orders are accepted');
45447
- }
45448
- let marginMode = undefined;
45449
- [marginMode, params] = this.handleMarginModeAndParams('fetchMyTrades', params);
45450
- if (marginMode === 'isolated') {
45451
- request['orderMode'] = 'iso_margin';
45452
- }
45453
- const options = this.safeValue(this.options, 'fetchMyTrades', {});
45454
- const defaultLimit = this.safeInteger(options, 'limit', 200);
45455
- if (limit === undefined) {
45456
- limit = defaultLimit;
45463
+ const until = this.safeIntegerN(params, ['until', 'endTime', 'end_time']);
45464
+ params = this.omit(params, ['until']);
45465
+ if (type === 'spot') {
45466
+ let marginMode = undefined;
45467
+ [marginMode, params] = this.handleMarginModeAndParams('fetchMyTrades', params);
45468
+ if (marginMode === 'isolated') {
45469
+ request['orderMode'] = 'iso_margin';
45470
+ }
45471
+ const options = this.safeValue(this.options, 'fetchMyTrades', {});
45472
+ const defaultLimit = this.safeInteger(options, 'limit', 200);
45473
+ if (limit === undefined) {
45474
+ limit = defaultLimit;
45475
+ }
45476
+ request['limit'] = limit;
45477
+ if (since !== undefined) {
45478
+ request['startTime'] = since;
45479
+ }
45480
+ if (until !== undefined) {
45481
+ request['endTime'] = until;
45482
+ }
45483
+ response = await this.privatePostSpotV4QueryTrades(this.extend(request, params));
45457
45484
  }
45458
- request['limit'] = limit;
45459
- if (symbol !== undefined) {
45460
- request['symbol'] = market['id'];
45485
+ else if (type === 'swap') {
45486
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
45487
+ if (since !== undefined) {
45488
+ request['start_time'] = since;
45489
+ }
45490
+ if (until !== undefined) {
45491
+ request['end_time'] = until;
45492
+ }
45493
+ response = await this.privateGetContractPrivateTrades(this.extend(request, params));
45461
45494
  }
45462
- const until = this.safeInteger2(params, 'until', 'endTime');
45463
- if (until !== undefined) {
45464
- params = this.omit(params, ['endTime']);
45465
- request['endTime'] = until;
45495
+ else {
45496
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' fetchMyTrades() does not support ' + type + ' orders, only spot and swap orders are accepted');
45466
45497
  }
45467
- const response = await this.privatePostSpotV4QueryTrades(this.extend(request, params));
45468
45498
  //
45469
45499
  // spot
45470
45500
  //
@@ -45493,7 +45523,30 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
45493
45523
  // "trace":"fbaee9e0e2f5442fba5b3262fc86b0ac.65.16956593456523085"
45494
45524
  // }
45495
45525
  //
45496
- const data = this.safeValue(response, 'data', {});
45526
+ // swap
45527
+ //
45528
+ // {
45529
+ // "code": 1000,
45530
+ // "message": "Ok",
45531
+ // "data": [
45532
+ // {
45533
+ // "order_id": "230930336848609",
45534
+ // "trade_id": "6212604014",
45535
+ // "symbol": "BTCUSDT",
45536
+ // "side": 3,
45537
+ // "price": "26910.4",
45538
+ // "vol": "1",
45539
+ // "exec_type": "Taker",
45540
+ // "profit": false,
45541
+ // "create_time": 1695961596692,
45542
+ // "realised_profit": "-0.0003",
45543
+ // "paid_fees": "0.01614624"
45544
+ // },
45545
+ // ],
45546
+ // "trace": "4cad855074634097ac6ba5257c47305d.62.16959616054873723"
45547
+ // }
45548
+ //
45549
+ const data = this.safeValue(response, 'data', []);
45497
45550
  return this.parseTrades(data, market, since, limit);
45498
45551
  }
45499
45552
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -45862,10 +45915,10 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
45862
45915
  }
45863
45916
  parseOrderSide(side) {
45864
45917
  const sides = {
45865
- '1': 'open long',
45866
- '2': 'close short',
45867
- '3': 'close long',
45868
- '4': 'open short',
45918
+ '1': 'buy',
45919
+ '2': 'buy',
45920
+ '3': 'sell',
45921
+ '4': 'sell',
45869
45922
  };
45870
45923
  return this.safeString(sides, side, side);
45871
45924
  }
@@ -46004,25 +46057,47 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
46004
46057
  /**
46005
46058
  * @method
46006
46059
  * @name bitmart#cancelOrder
46060
+ * @see https://developer-pro.bitmart.com/en/futures/#cancel-order-signed
46061
+ * @see https://developer-pro.bitmart.com/en/spot/#cancel-order-v3-signed
46062
+ * @see https://developer-pro.bitmart.com/en/futures/#cancel-plan-order-signed
46007
46063
  * @description cancels an open order
46008
46064
  * @param {string} id order id
46009
46065
  * @param {string} symbol unified symbol of the market the order was made in
46010
46066
  * @param {object} [params] extra parameters specific to the bitmart api endpoint
46067
+ * @param {string} [params.clientOrderId] *spot only* the client order id of the order to cancel
46068
+ * @param {boolean} [params.stop] *swap only* whether the order is a stop order
46011
46069
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
46012
46070
  */
46013
- if (symbol === undefined) {
46014
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
46015
- }
46071
+ this.checkRequiredSymbol('cancelOrder', symbol);
46016
46072
  await this.loadMarkets();
46017
46073
  const market = this.market(symbol);
46018
- if (!market['spot']) {
46019
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported(this.id + ' cancelOrder() does not support ' + market['type'] + ' orders, only spot orders are accepted');
46020
- }
46021
46074
  const request = {
46022
- 'order_id': id.toString(),
46023
46075
  'symbol': market['id'],
46024
46076
  };
46025
- const response = await this.privatePostSpotV3CancelOrder(this.extend(request, params));
46077
+ const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_order_id');
46078
+ if (clientOrderId !== undefined) {
46079
+ request['client_order_id'] = clientOrderId;
46080
+ }
46081
+ else {
46082
+ request['order_id'] = id.toString();
46083
+ }
46084
+ params = this.omit(params, ['clientOrderId']);
46085
+ let response = undefined;
46086
+ if (market['spot']) {
46087
+ response = await this.privatePostSpotV3CancelOrder(this.extend(request, params));
46088
+ }
46089
+ else {
46090
+ const stop = this.safeValue(params, 'stop');
46091
+ params = this.omit(params, ['stop']);
46092
+ if (!stop) {
46093
+ response = await this.privatePostContractPrivateCancelOrder(this.extend(request, params));
46094
+ }
46095
+ else {
46096
+ response = await this.privatePostContractPrivateCancelPlanOrder(this.extend(request, params));
46097
+ }
46098
+ }
46099
+ // swap
46100
+ // {"code":1000,"message":"Ok","trace":"7f9c94e10f9d4513bc08a7bfc2a5559a.55.16959817848001851"}
46026
46101
  //
46027
46102
  // spot
46028
46103
  //
@@ -46044,6 +46119,9 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
46044
46119
  // "data": true
46045
46120
  // }
46046
46121
  //
46122
+ if (market['swap']) {
46123
+ return response;
46124
+ }
46047
46125
  const data = this.safeValue(response, 'data');
46048
46126
  if (data === true) {
46049
46127
  return this.parseOrder(id, market);
@@ -70785,6 +70863,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
70785
70863
  'v5/market/insurance': 2.5,
70786
70864
  'v5/market/risk-limit': 2.5,
70787
70865
  'v5/market/delivery-price': 2.5,
70866
+ 'v5/market/account-ratio': 2.5,
70788
70867
  // spot leverage token
70789
70868
  'v5/spot-lever-token/info': 2.5,
70790
70869
  'v5/spot-lever-token/reference': 2.5,
@@ -71186,6 +71265,7 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
71186
71265
  // c2c lending
71187
71266
  'v5/lending/purchase': 2.5,
71188
71267
  'v5/lending/redeem': 2.5,
71268
+ 'v5/lending/redeem-cancel': 2.5,
71189
71269
  },
71190
71270
  'delete': {
71191
71271
  // spot
@@ -74601,16 +74681,16 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
74601
74681
  triggerPrice = isStopLossTriggerOrder ? stopLossTriggerPrice : takeProfitTriggerPrice;
74602
74682
  }
74603
74683
  if (triggerPrice !== undefined) {
74604
- request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
74684
+ request['triggerPrice'] = triggerPrice;
74605
74685
  }
74606
74686
  if (isStopLoss || isTakeProfit) {
74607
74687
  if (isStopLoss) {
74608
74688
  const slTriggerPrice = this.safeValue2(stopLoss, 'triggerPrice', 'stopPrice', stopLoss);
74609
- request['stopLoss'] = this.priceToPrecision(symbol, slTriggerPrice);
74689
+ request['stopLoss'] = slTriggerPrice;
74610
74690
  }
74611
74691
  if (isTakeProfit) {
74612
74692
  const tpTriggerPrice = this.safeValue2(takeProfit, 'triggerPrice', 'stopPrice', takeProfit);
74613
- request['takeProfit'] = this.priceToPrecision(symbol, tpTriggerPrice);
74693
+ request['takeProfit'] = tpTriggerPrice;
74614
74694
  }
74615
74695
  }
74616
74696
  const clientOrderId = this.safeString(params, 'clientOrderId');
@@ -77157,9 +77237,8 @@ class bybit extends _abstract_bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
77157
77237
  // "time": 1670988271677
77158
77238
  // }
77159
77239
  //
77160
- const data = this.safeValue(response, 'result', {});
77161
- const transfers = this.safeValue(data, 'list', []);
77162
- return this.parseTransfers(transfers, currency, since, limit);
77240
+ const data = this.addPaginationCursorToResult(response);
77241
+ return this.parseTransfers(data, currency, since, limit);
77163
77242
  }
77164
77243
  async borrowMargin(code, amount, symbol = undefined, params = {}) {
77165
77244
  /**
@@ -83107,6 +83186,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83107
83186
  /**
83108
83187
  * @method
83109
83188
  * @name coinbasepro#fetchOrderBook
83189
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductbook
83110
83190
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
83111
83191
  * @param {string} symbol unified symbol of the market to fetch the order book for
83112
83192
  * @param {int} [limit] the maximum amount of order book entries to return
@@ -83272,6 +83352,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83272
83352
  /**
83273
83353
  * @method
83274
83354
  * @name coinbasepro#fetchTicker
83355
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductticker
83275
83356
  * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
83276
83357
  * @param {string} symbol unified symbol of the market to fetch the ticker for
83277
83358
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
@@ -83385,17 +83466,16 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83385
83466
  /**
83386
83467
  * @method
83387
83468
  * @name coinbasepro#fetchMyTrades
83469
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getfills
83388
83470
  * @description fetch all trades made by the user
83389
83471
  * @param {string} symbol unified market symbol
83390
83472
  * @param {int} [since] the earliest time in ms to fetch trades for
83391
83473
  * @param {int} [limit] the maximum number of trades structures to retrieve
83392
83474
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
83475
+ * @param {int} [params.until] the latest time in ms to fetch trades for
83393
83476
  * @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
83394
83477
  */
83395
- // as of 2018-08-23
83396
- if (symbol === undefined) {
83397
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
83398
- }
83478
+ this.checkRequiredSymbol('fetchMyTrades', symbol);
83399
83479
  await this.loadMarkets();
83400
83480
  const market = this.market(symbol);
83401
83481
  const request = {
@@ -83404,6 +83484,14 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83404
83484
  if (limit !== undefined) {
83405
83485
  request['limit'] = limit;
83406
83486
  }
83487
+ if (since !== undefined) {
83488
+ request['start_date'] = this.iso8601(since);
83489
+ }
83490
+ const until = this.safeValue2(params, 'until', 'end_date');
83491
+ if (until !== undefined) {
83492
+ params = this.omit(params, ['until']);
83493
+ request['end_date'] = this.iso8601(until);
83494
+ }
83407
83495
  const response = await this.privateGetFills(this.extend(request, params));
83408
83496
  return this.parseTrades(response, market, since, limit);
83409
83497
  }
@@ -83411,6 +83499,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83411
83499
  /**
83412
83500
  * @method
83413
83501
  * @name coinbasepro#fetchTrades
83502
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproducttrades
83414
83503
  * @description get the list of most recent trades for a particular symbol
83415
83504
  * @param {string} symbol unified symbol of the market to fetch trades for
83416
83505
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -83497,12 +83586,14 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83497
83586
  /**
83498
83587
  * @method
83499
83588
  * @name coinbasepro#fetchOHLCV
83589
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getproductcandles
83500
83590
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
83501
83591
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
83502
83592
  * @param {string} timeframe the length of time each candle represents
83503
83593
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
83504
83594
  * @param {int} [limit] the maximum amount of candles to fetch
83505
83595
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
83596
+ * @param {int} [params.until] the latest time in ms to fetch trades for
83506
83597
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
83507
83598
  */
83508
83599
  await this.loadMarkets();
@@ -83517,6 +83608,8 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83517
83608
  else {
83518
83609
  request['granularity'] = timeframe;
83519
83610
  }
83611
+ const until = this.safeValue2(params, 'until', 'end');
83612
+ params = this.omit(params, ['until']);
83520
83613
  if (since !== undefined) {
83521
83614
  request['start'] = this.iso8601(since);
83522
83615
  if (limit === undefined) {
@@ -83526,12 +83619,17 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83526
83619
  else {
83527
83620
  limit = Math.min(300, limit);
83528
83621
  }
83529
- const parsedTimeframeMilliseconds = parsedTimeframe * 1000;
83530
- if (since % parsedTimeframeMilliseconds === 0) {
83531
- request['end'] = this.iso8601(this.sum((limit - 1) * parsedTimeframeMilliseconds, since));
83622
+ if (until === undefined) {
83623
+ const parsedTimeframeMilliseconds = parsedTimeframe * 1000;
83624
+ if (since % parsedTimeframeMilliseconds === 0) {
83625
+ request['end'] = this.iso8601(this.sum((limit - 1) * parsedTimeframeMilliseconds, since));
83626
+ }
83627
+ else {
83628
+ request['end'] = this.iso8601(this.sum(limit * parsedTimeframeMilliseconds, since));
83629
+ }
83532
83630
  }
83533
83631
  else {
83534
- request['end'] = this.iso8601(this.sum(limit * parsedTimeframeMilliseconds, since));
83632
+ request['end'] = this.iso8601(until);
83535
83633
  }
83536
83634
  }
83537
83635
  const response = await this.publicGetProductsIdCandles(this.extend(request, params));
@@ -83651,6 +83749,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83651
83749
  /**
83652
83750
  * @method
83653
83751
  * @name coinbasepro#fetchOrder
83752
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorder
83654
83753
  * @description fetches information on an order made by the user
83655
83754
  * @param {string} symbol not used by coinbasepro fetchOrder
83656
83755
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
@@ -83699,11 +83798,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83699
83798
  /**
83700
83799
  * @method
83701
83800
  * @name coinbasepro#fetchOrders
83801
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
83702
83802
  * @description fetches information on multiple orders made by the user
83703
83803
  * @param {string} symbol unified market symbol of the market orders were made in
83704
83804
  * @param {int} [since] the earliest time in ms to fetch orders for
83705
83805
  * @param {int} [limit] the maximum number of orde structures to retrieve
83706
83806
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
83807
+ * @param {int} [params.until] the latest time in ms to fetch open orders for
83707
83808
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
83708
83809
  */
83709
83810
  const request = {
@@ -83715,11 +83816,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83715
83816
  /**
83716
83817
  * @method
83717
83818
  * @name coinbasepro#fetchOpenOrders
83819
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
83718
83820
  * @description fetch all unfilled currently open orders
83719
83821
  * @param {string} symbol unified market symbol
83720
83822
  * @param {int} [since] the earliest time in ms to fetch open orders for
83721
83823
  * @param {int} [limit] the maximum number of open orders structures to retrieve
83722
83824
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
83825
+ * @param {int} [params.until] the latest time in ms to fetch open orders for
83723
83826
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
83724
83827
  */
83725
83828
  await this.loadMarkets();
@@ -83732,6 +83835,14 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83732
83835
  if (limit !== undefined) {
83733
83836
  request['limit'] = limit; // default 100
83734
83837
  }
83838
+ if (since !== undefined) {
83839
+ request['start_date'] = this.iso8601(since);
83840
+ }
83841
+ const until = this.safeValue2(params, 'until', 'end_date');
83842
+ if (until !== undefined) {
83843
+ params = this.omit(params, ['until']);
83844
+ request['end_date'] = this.iso8601(until);
83845
+ }
83735
83846
  const response = await this.privateGetOrders(this.extend(request, params));
83736
83847
  return this.parseOrders(response, market, since, limit);
83737
83848
  }
@@ -83739,11 +83850,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83739
83850
  /**
83740
83851
  * @method
83741
83852
  * @name coinbasepro#fetchClosedOrders
83853
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getorders
83742
83854
  * @description fetches information on multiple closed orders made by the user
83743
83855
  * @param {string} symbol unified market symbol of the market orders were made in
83744
83856
  * @param {int} [since] the earliest time in ms to fetch orders for
83745
83857
  * @param {int} [limit] the maximum number of orde structures to retrieve
83746
83858
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
83859
+ * @param {int} [params.until] the latest time in ms to fetch open orders for
83747
83860
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
83748
83861
  */
83749
83862
  const request = {
@@ -83755,6 +83868,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83755
83868
  /**
83756
83869
  * @method
83757
83870
  * @name coinbasepro#createOrder
83871
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postorders
83758
83872
  * @description create a trade order
83759
83873
  * @param {string} symbol unified symbol of the market to create an order in
83760
83874
  * @param {string} type 'market' or 'limit'
@@ -83850,6 +83964,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83850
83964
  /**
83851
83965
  * @method
83852
83966
  * @name coinbasepro#cancelOrder
83967
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorder
83853
83968
  * @description cancels an open order
83854
83969
  * @param {string} id order id
83855
83970
  * @param {string} symbol unified symbol of the market the order was made in
@@ -83882,6 +83997,7 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
83882
83997
  /**
83883
83998
  * @method
83884
83999
  * @name coinbasepro#cancelAllOrders
84000
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_deleteorders
83885
84001
  * @description cancel all open orders
83886
84002
  * @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
83887
84003
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
@@ -84068,11 +84184,13 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
84068
84184
  /**
84069
84185
  * @method
84070
84186
  * @name coinbasepro#fetchLedger
84187
+ * @see https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
84071
84188
  * @description fetch the history of changes, actions done by the user or operations that altered balance of the user
84072
84189
  * @param {string} code unified currency code, default is undefined
84073
84190
  * @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
84074
84191
  * @param {int} [limit] max number of ledger entrys to return, default is undefined
84075
84192
  * @param {object} [params] extra parameters specific to the coinbasepro api endpoint
84193
+ * @param {int} [params.until] the latest time in ms to fetch trades for
84076
84194
  * @returns {object} a [ledger structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ledger-structure}
84077
84195
  */
84078
84196
  // https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountledger
@@ -84102,6 +84220,11 @@ class coinbasepro extends _abstract_coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/
84102
84220
  if (limit !== undefined) {
84103
84221
  request['limit'] = limit; // default 100
84104
84222
  }
84223
+ const until = this.safeValue2(params, 'until', 'end_date');
84224
+ if (until !== undefined) {
84225
+ params = this.omit(params, ['until']);
84226
+ request['end_date'] = this.iso8601(until);
84227
+ }
84105
84228
  const response = await this.privateGetAccountsIdLedger(this.extend(request, params));
84106
84229
  for (let i = 0; i < response.length; i++) {
84107
84230
  response[i]['currency'] = code;
@@ -152352,6 +152475,10 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
152352
152475
  'cancelAllOrders': true,
152353
152476
  'cancelOrder': true,
152354
152477
  'createOrder': true,
152478
+ 'createPostOnlyOrder': false,
152479
+ 'createStopOrder': true,
152480
+ 'createStopLimitOrder': true,
152481
+ 'createStopMarketOrder': false,
152355
152482
  'fetchBalance': true,
152356
152483
  'fetchBorrowRate': false,
152357
152484
  'fetchBorrowRateHistories': false,
@@ -153274,16 +153401,16 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153274
153401
  //
153275
153402
  // createOrder
153276
153403
  //
153277
- // {
153278
- // "orderId":"1563460093.134037.704945@0370:2",
153279
- // "cliOrdId":"",
153280
- // "pairId":370,
153281
- // "symbol":"ETHBTC",
153282
- // "side":"sell",
153283
- // "orderType":"limit",
153284
- // "price":1.0,
153285
- // "amount":1.0
153286
- // }
153404
+ // {
153405
+ // "baseCurrency": "f7dac554-8139-4ff6-841f-0e586a5984a0",
153406
+ // "quoteCurrency": "a5a7a7a9-e2a3-43f9-8754-29a02f6b709b",
153407
+ // "side": "BID",
153408
+ // "clientOrderId": "my-wonderful-order-number-71566",
153409
+ // "price": "10103.19",
153410
+ // "stopPrice": "10103.19",
153411
+ // "quantity": "3.21",
153412
+ // "timestamp": 1568185507
153413
+ // }
153287
153414
  //
153288
153415
  // fetchOrder, fetchOpenOrders, fetchOrders
153289
153416
  //
@@ -153351,6 +153478,7 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153351
153478
  }
153352
153479
  const clientOrderId = this.safeString(order, 'clientOrderId');
153353
153480
  const timeInForce = this.parseTimeInForce(this.safeString(order, 'condition'));
153481
+ const triggerPrice = this.safeString(order, 'stopPrice');
153354
153482
  return this.safeOrder({
153355
153483
  'id': id,
153356
153484
  'clientOrderId': clientOrderId,
@@ -153365,8 +153493,8 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153365
153493
  'postOnly': undefined,
153366
153494
  'side': side,
153367
153495
  'price': price,
153368
- 'stopPrice': undefined,
153369
- 'triggerPrice': undefined,
153496
+ 'stopPrice': triggerPrice,
153497
+ 'triggerPrice': triggerPrice,
153370
153498
  'cost': cost,
153371
153499
  'amount': amount,
153372
153500
  'filled': filled,
@@ -153381,22 +153509,33 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153381
153509
  * @method
153382
153510
  * @name latoken#fetchOpenOrders
153383
153511
  * @description fetch all unfilled currently open orders
153512
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/getMyActiveOrdersByPair
153513
+ * @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getMyActiveStopOrdersByPair // stop
153384
153514
  * @param {string} symbol unified market symbol
153385
153515
  * @param {int} [since] the earliest time in ms to fetch open orders for
153386
153516
  * @param {int} [limit] the maximum number of open orders structures to retrieve
153387
153517
  * @param {object} [params] extra parameters specific to the latoken api endpoint
153518
+ * @param {boolean} [params.trigger] true if fetching trigger orders
153388
153519
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
153389
- */
153390
- if (symbol === undefined) {
153391
- throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
153392
- }
153520
+ */
153393
153521
  await this.loadMarkets();
153394
- const market = this.market(symbol);
153522
+ let response = undefined;
153523
+ let market = undefined;
153524
+ const isTrigger = this.safeValue2(params, 'trigger', 'stop');
153525
+ params = this.omit(params, 'stop');
153526
+ this.checkRequiredSymbol('fetchOpenOrders', symbol);
153527
+ // privateGetAuthOrderActive doesn't work even though its listed at https://api.latoken.com/doc/v2/#tag/Order/operation/getMyActiveOrders
153528
+ market = this.market(symbol);
153395
153529
  const request = {
153396
153530
  'currency': market['baseId'],
153397
153531
  'quote': market['quoteId'],
153398
153532
  };
153399
- const response = await this.privateGetAuthOrderPairCurrencyQuoteActive(this.extend(request, params));
153533
+ if (isTrigger) {
153534
+ response = await this.privateGetAuthStopOrderPairCurrencyQuoteActive(this.extend(request, params));
153535
+ }
153536
+ else {
153537
+ response = await this.privateGetAuthOrderPairCurrencyQuoteActive(this.extend(request, params));
153538
+ }
153400
153539
  //
153401
153540
  // [
153402
153541
  // {
@@ -153426,10 +153565,15 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153426
153565
  * @method
153427
153566
  * @name latoken#fetchOrders
153428
153567
  * @description fetches information on multiple orders made by the user
153568
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/getMyOrders
153569
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/getMyOrdersByPair
153570
+ * @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getMyStopOrders // stop
153571
+ * @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getMyStopOrdersByPair // stop
153429
153572
  * @param {string} symbol unified market symbol of the market orders were made in
153430
153573
  * @param {int} [since] the earliest time in ms to fetch orders for
153431
153574
  * @param {int} [limit] the maximum number of orde structures to retrieve
153432
153575
  * @param {object} [params] extra parameters specific to the latoken api endpoint
153576
+ * @param {boolean} [params.trigger] true if fetching trigger orders
153433
153577
  * @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
153434
153578
  */
153435
153579
  await this.loadMarkets();
@@ -153439,18 +153583,32 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153439
153583
  // 'from': this.milliseconds (),
153440
153584
  // 'limit': limit, // default '100'
153441
153585
  };
153442
- let method = 'privateGetAuthOrder';
153443
153586
  let market = undefined;
153587
+ const isTrigger = this.safeValue2(params, 'trigger', 'stop');
153588
+ params = this.omit(params, ['stop', 'trigger']);
153589
+ if (limit !== undefined) {
153590
+ request['limit'] = limit; // default 100
153591
+ }
153592
+ let response = undefined;
153444
153593
  if (symbol !== undefined) {
153445
153594
  market = this.market(symbol);
153446
153595
  request['currency'] = market['baseId'];
153447
153596
  request['quote'] = market['quoteId'];
153448
- method = 'privateGetAuthOrderPairCurrencyQuote';
153597
+ if (isTrigger) {
153598
+ response = await this.privateGetAuthStopOrderPairCurrencyQuote(this.extend(request, params));
153599
+ }
153600
+ else {
153601
+ response = await this.privateGetAuthOrderPairCurrencyQuote(this.extend(request, params));
153602
+ }
153449
153603
  }
153450
- if (limit !== undefined) {
153451
- request['limit'] = limit; // default 100
153604
+ else {
153605
+ if (isTrigger) {
153606
+ response = await this.privateGetAuthStopOrder(this.extend(request, params));
153607
+ }
153608
+ else {
153609
+ response = await this.privateGetAuthOrder(this.extend(request, params));
153610
+ }
153452
153611
  }
153453
- const response = await this[method](this.extend(request, params));
153454
153612
  //
153455
153613
  // [
153456
153614
  // {
@@ -153480,15 +153638,26 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153480
153638
  * @method
153481
153639
  * @name latoken#fetchOrder
153482
153640
  * @description fetches information on an order made by the user
153483
- * @param {string} symbol not used by latoken fetchOrder
153641
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/getOrderById
153642
+ * @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/getStopOrderById
153643
+ * @param {string} [symbol] not used by latoken fetchOrder
153484
153644
  * @param {object} [params] extra parameters specific to the latoken api endpoint
153645
+ * @param {boolean} [params.trigger] true if fetching a trigger order
153485
153646
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
153486
153647
  */
153487
153648
  await this.loadMarkets();
153488
153649
  const request = {
153489
153650
  'id': id,
153490
153651
  };
153491
- const response = await this.privateGetAuthOrderGetOrderId(this.extend(request, params));
153652
+ const isTrigger = this.safeValue2(params, 'trigger', 'stop');
153653
+ params = this.omit(params, ['stop', 'trigger']);
153654
+ let response = undefined;
153655
+ if (isTrigger) {
153656
+ response = await this.privateGetAuthStopOrderGetOrderId(this.extend(request, params));
153657
+ }
153658
+ else {
153659
+ response = await this.privateGetAuthOrderGetOrderId(this.extend(request, params));
153660
+ }
153492
153661
  //
153493
153662
  // {
153494
153663
  // "id":"a76bd262-3560-4bfb-98ac-1cedd394f4fc",
@@ -153516,12 +153685,19 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153516
153685
  * @method
153517
153686
  * @name latoken#createOrder
153518
153687
  * @description create a trade order
153688
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/placeOrder
153689
+ * @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/placeStopOrder // stop
153519
153690
  * @param {string} symbol unified symbol of the market to create an order in
153520
153691
  * @param {string} type 'market' or 'limit'
153521
153692
  * @param {string} side 'buy' or 'sell'
153522
153693
  * @param {float} amount how much of currency you want to trade in units of base currency
153523
153694
  * @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
153524
153695
  * @param {object} [params] extra parameters specific to the latoken api endpoint
153696
+ * @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
153697
+ *
153698
+ * EXCHANGE SPECIFIC PARAMETERS
153699
+ * @param {string} [params.condition] "GTC", "IOC", or "FOK"
153700
+ * @param {string} [params.clientOrderId] [ 0 .. 50 ] characters, client's custom order id (free field for your convenience)
153525
153701
  * @returns {object} an [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
153526
153702
  */
153527
153703
  await this.loadMarkets();
@@ -153533,27 +153709,36 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153533
153709
  'side': side.toUpperCase(),
153534
153710
  'condition': 'GTC',
153535
153711
  'type': uppercaseType,
153536
- 'clientOrderId': this.uuid(), // 50 characters max
153712
+ 'clientOrderId': this.uuid(),
153537
153713
  // 'price': this.priceToPrecision (symbol, price),
153538
153714
  // 'quantity': this.amountToPrecision (symbol, amount),
153715
+ 'quantity': this.amountToPrecision(symbol, amount),
153716
+ 'timestamp': this.seconds(),
153539
153717
  };
153540
153718
  if (uppercaseType === 'LIMIT') {
153541
153719
  request['price'] = this.priceToPrecision(symbol, price);
153542
153720
  }
153543
- request['quantity'] = this.amountToPrecision(symbol, amount);
153544
- request['timestamp'] = this.seconds();
153545
- const response = await this.privatePostAuthOrderPlace(this.extend(request, params));
153721
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
153722
+ params = this.omit(params, ['triggerPrice', 'stopPrice']);
153723
+ let response = undefined;
153724
+ if (triggerPrice !== undefined) {
153725
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
153726
+ response = await this.privatePostAuthStopOrderPlace(this.extend(request, params));
153727
+ }
153728
+ else {
153729
+ response = await this.privatePostAuthOrderPlace(this.extend(request, params));
153730
+ }
153546
153731
  //
153547
- // {
153548
- // "orderId":"1563460093.134037.704945@0370:2",
153549
- // "cliOrdId":"",
153550
- // "pairId":370,
153551
- // "symbol":"ETHBTC",
153552
- // "side":"sell",
153553
- // "orderType":"limit",
153554
- // "price":1.0,
153555
- // "amount":1.0
153556
- // }
153732
+ // {
153733
+ // "baseCurrency": "f7dac554-8139-4ff6-841f-0e586a5984a0",
153734
+ // "quoteCurrency": "a5a7a7a9-e2a3-43f9-8754-29a02f6b709b",
153735
+ // "side": "BID",
153736
+ // "clientOrderId": "my-wonderful-order-number-71566",
153737
+ // "price": "10103.19",
153738
+ // "stopPrice": "10103.19",
153739
+ // "quantity": "3.21",
153740
+ // "timestamp": 1568185507
153741
+ // }
153557
153742
  //
153558
153743
  return this.parseOrder(response, market);
153559
153744
  }
@@ -153562,16 +153747,27 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153562
153747
  * @method
153563
153748
  * @name latoken#cancelOrder
153564
153749
  * @description cancels an open order
153750
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/cancelOrder
153751
+ * @see https://api.latoken.com/doc/v2/#tag/StopOrder/operation/cancelStopOrder // stop
153565
153752
  * @param {string} id order id
153566
153753
  * @param {string} symbol not used by latoken cancelOrder ()
153567
153754
  * @param {object} [params] extra parameters specific to the latoken api endpoint
153755
+ * @param {boolean} [params.trigger] true if cancelling a trigger order
153568
153756
  * @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
153569
153757
  */
153570
153758
  await this.loadMarkets();
153571
153759
  const request = {
153572
153760
  'id': id,
153573
153761
  };
153574
- const response = await this.privatePostAuthOrderCancel(this.extend(request, params));
153762
+ const isTrigger = this.safeValue2(params, 'trigger', 'stop');
153763
+ params = this.omit(params, ['stop', 'trigger']);
153764
+ let response = undefined;
153765
+ if (isTrigger) {
153766
+ response = await this.privatePostAuthStopOrderCancel(this.extend(request, params));
153767
+ }
153768
+ else {
153769
+ response = await this.privatePostAuthOrderCancel(this.extend(request, params));
153770
+ }
153575
153771
  //
153576
153772
  // {
153577
153773
  // "id": "12345678-1234-1244-1244-123456789012",
@@ -153588,8 +153784,11 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153588
153784
  * @method
153589
153785
  * @name latoken#cancelAllOrders
153590
153786
  * @description cancel all open orders in a market
153787
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/cancelAllOrders
153788
+ * @see https://api.latoken.com/doc/v2/#tag/Order/operation/cancelAllOrdersByPair
153591
153789
  * @param {string} symbol unified market symbol of the market to cancel orders in
153592
153790
  * @param {object} [params] extra parameters specific to the latoken api endpoint
153791
+ * @param {boolean} [params.trigger] true if cancelling trigger orders
153593
153792
  * @returns {object[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
153594
153793
  */
153595
153794
  await this.loadMarkets();
@@ -153597,15 +153796,29 @@ class latoken extends _abstract_latoken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
153597
153796
  // 'currency': market['baseId'],
153598
153797
  // 'quote': market['quoteId'],
153599
153798
  };
153600
- let method = 'privatePostAuthOrderCancelAll';
153601
153799
  let market = undefined;
153800
+ const isTrigger = this.safeValue2(params, 'trigger', 'stop');
153801
+ params = this.omit(params, ['stop', 'trigger']);
153802
+ let response = undefined;
153602
153803
  if (symbol !== undefined) {
153603
153804
  market = this.market(symbol);
153604
153805
  request['currency'] = market['baseId'];
153605
153806
  request['quote'] = market['quoteId'];
153606
- method = 'privatePostAuthOrderCancelAllCurrencyQuote';
153807
+ if (isTrigger) {
153808
+ response = await this.privatePostAuthStopOrderCancelAllCurrencyQuote(this.extend(request, params));
153809
+ }
153810
+ else {
153811
+ response = await this.privatePostAuthOrderCancelAllCurrencyQuote(this.extend(request, params));
153812
+ }
153813
+ }
153814
+ else {
153815
+ if (isTrigger) {
153816
+ response = await this.privatePostAuthStopOrderCancelAll(this.extend(request, params));
153817
+ }
153818
+ else {
153819
+ response = await this.privatePostAuthOrderCancelAll(this.extend(request, params));
153820
+ }
153607
153821
  }
153608
- const response = await this[method](this.extend(request, params));
153609
153822
  //
153610
153823
  // {
153611
153824
  // "message":"cancellation request successfully submitted",
@@ -273364,7 +273577,7 @@ SOFTWARE.
273364
273577
 
273365
273578
  //-----------------------------------------------------------------------------
273366
273579
  // this is updated by vss.js when building
273367
- const version = '4.0.110';
273580
+ const version = '4.0.112';
273368
273581
  _src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange.ccxtVersion */ .e.ccxtVersion = version;
273369
273582
  //-----------------------------------------------------------------------------
273370
273583