ccxt 4.1.100 → 4.2.2

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
@@ -169,7 +169,7 @@ var woo$1 = require('./src/pro/woo.js');
169
169
 
170
170
  //-----------------------------------------------------------------------------
171
171
  // this is updated by vss.js when building
172
- const version = '4.1.100';
172
+ const version = '4.2.2';
173
173
  Exchange["default"].ccxtVersion = version;
174
174
  const exchanges = {
175
175
  'ace': ace,
@@ -1592,6 +1592,7 @@ class binance extends binance$1 {
1592
1592
  '-4046': errors.AuthenticationError,
1593
1593
  '-4047': errors.BadRequest,
1594
1594
  '-4054': errors.BadRequest,
1595
+ '-4164': errors.InvalidOrder,
1595
1596
  '-5001': errors.BadRequest,
1596
1597
  '-5002': errors.InsufficientFunds,
1597
1598
  '-5003': errors.InsufficientFunds,
@@ -117,6 +117,7 @@ class bingx extends bingx$1 {
117
117
  'trade/query': 3,
118
118
  'trade/openOrders': 3,
119
119
  'trade/historyOrders': 3,
120
+ 'user/commissionRate': 3,
120
121
  'account/balance': 3,
121
122
  },
122
123
  'post': {
@@ -124,6 +125,7 @@ class bingx extends bingx$1 {
124
125
  'trade/cancel': 3,
125
126
  'trade/batchOrders': 3,
126
127
  'trade/cancelOrders': 3,
128
+ 'trade/cancelOpenOrders': 3,
127
129
  },
128
130
  },
129
131
  },
@@ -1314,22 +1316,30 @@ class bingx extends bingx$1 {
1314
1316
  // }
1315
1317
  //
1316
1318
  const marketId = this.safeString(ticker, 'symbol');
1317
- // const change = this.safeString (ticker, 'priceChange'); // this is not ccxt's change because it does high-low instead of last-open
1318
1319
  const lastQty = this.safeString(ticker, 'lastQty');
1319
1320
  // in spot markets, lastQty is not present
1320
1321
  // it's (bad, but) the only way we can check the tickers origin
1321
1322
  const type = (lastQty === undefined) ? 'spot' : 'swap';
1322
- const symbol = this.safeSymbol(marketId, market, undefined, type);
1323
+ market = this.safeMarket(marketId, market, undefined, type);
1324
+ const symbol = market['symbol'];
1323
1325
  const open = this.safeString(ticker, 'openPrice');
1324
1326
  const high = this.safeString(ticker, 'highPrice');
1325
1327
  const low = this.safeString(ticker, 'lowPrice');
1326
1328
  const close = this.safeString(ticker, 'lastPrice');
1327
1329
  const quoteVolume = this.safeString(ticker, 'quoteVolume');
1328
1330
  const baseVolume = this.safeString(ticker, 'volume');
1331
+ let percentage = undefined;
1332
+ let change = undefined;
1333
+ if (market['swap']) {
1334
+ // right now only swap uses the 24h change, spot will be added soon
1335
+ percentage = this.safeString(ticker, 'priceChangePercent');
1336
+ change = this.safeString(ticker, 'priceChange');
1337
+ }
1329
1338
  // let percentage = this.safeString (ticker, 'priceChangePercent');
1330
1339
  // if (percentage !== undefined) {
1331
1340
  // percentage = percentage.replace ('%', '');
1332
1341
  // } similarly to change, it's not ccxt's percentage because it does priceChange/open, and priceChange is high-low
1342
+ // const change = this.safeString (ticker, 'priceChange'); // this is not ccxt's change because it does high-low instead of last-open
1333
1343
  const ts = this.safeInteger(ticker, 'closeTime');
1334
1344
  const datetime = this.iso8601(ts);
1335
1345
  const bid = this.safeString(ticker, 'bidPrice');
@@ -1351,8 +1361,8 @@ class bingx extends bingx$1 {
1351
1361
  'close': close,
1352
1362
  'last': undefined,
1353
1363
  'previousClose': undefined,
1354
- 'change': undefined,
1355
- 'percentage': undefined,
1364
+ 'change': change,
1365
+ 'percentage': percentage,
1356
1366
  'average': undefined,
1357
1367
  'baseVolume': baseVolume,
1358
1368
  'quoteVolume': quoteVolume,
@@ -2203,6 +2213,7 @@ class bingx extends bingx$1 {
2203
2213
  * @method
2204
2214
  * @name bingx#cancelAllOrders
2205
2215
  * @description cancel all open orders
2216
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20orders%20by%20symbol
2206
2217
  * @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20All%20Orders
2207
2218
  * @param {string} [symbol] unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
2208
2219
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2213,42 +2224,70 @@ class bingx extends bingx$1 {
2213
2224
  }
2214
2225
  await this.loadMarkets();
2215
2226
  const market = this.market(symbol);
2216
- if (market['type'] !== 'swap') {
2217
- throw new errors.BadRequest(this.id + ' cancelAllOrders is only supported for swap markets.');
2218
- }
2219
2227
  const request = {
2220
2228
  'symbol': market['id'],
2221
2229
  };
2222
- const response = await this.swapV2PrivateDeleteTradeAllOpenOrders(this.extend(request, params));
2223
- //
2224
- // {
2225
- // "code": 0,
2226
- // "msg": "",
2227
- // "data": {
2228
- // "success": [
2229
- // {
2230
- // "symbol": "LINK-USDT",
2231
- // "orderId": 1597783835095859200,
2232
- // "side": "BUY",
2233
- // "positionSide": "LONG",
2234
- // "type": "TRIGGER_LIMIT",
2235
- // "origQty": "5.0",
2236
- // "price": "9.0000",
2237
- // "executedQty": "0.0",
2238
- // "avgPrice": "0.0000",
2239
- // "cumQuote": "0",
2240
- // "stopPrice": "9.5000",
2241
- // "profit": "",
2242
- // "commission": "",
2243
- // "status": "NEW",
2244
- // "time": 1669776326000,
2245
- // "updateTime": 1669776326000
2246
- // }
2247
- // ],
2248
- // "failed": null
2249
- // }
2250
- // }
2251
- //
2230
+ let response = undefined;
2231
+ if (market['spot']) {
2232
+ response = await this.spotV1PrivatePostTradeCancelOpenOrders(this.extend(request, params));
2233
+ //
2234
+ // {
2235
+ // "code": 0,
2236
+ // "msg": "",
2237
+ // "debugMsg": "",
2238
+ // "data": {
2239
+ // "orders": [{
2240
+ // "symbol": "ADA-USDT",
2241
+ // "orderId": 1740659971369992192,
2242
+ // "transactTime": 1703840651730,
2243
+ // "price": 5,
2244
+ // "stopPrice": 0,
2245
+ // "origQty": 10,
2246
+ // "executedQty": 0,
2247
+ // "cummulativeQuoteQty": 0,
2248
+ // "status": "CANCELED",
2249
+ // "type": "LIMIT",
2250
+ // "side": "SELL"
2251
+ // }]
2252
+ // }
2253
+ // }
2254
+ //
2255
+ }
2256
+ else if (market['swap']) {
2257
+ response = await this.swapV2PrivateDeleteTradeAllOpenOrders(this.extend(request, params));
2258
+ //
2259
+ // {
2260
+ // "code": 0,
2261
+ // "msg": "",
2262
+ // "data": {
2263
+ // "success": [
2264
+ // {
2265
+ // "symbol": "LINK-USDT",
2266
+ // "orderId": 1597783835095859200,
2267
+ // "side": "BUY",
2268
+ // "positionSide": "LONG",
2269
+ // "type": "TRIGGER_LIMIT",
2270
+ // "origQty": "5.0",
2271
+ // "price": "9.0000",
2272
+ // "executedQty": "0.0",
2273
+ // "avgPrice": "0.0000",
2274
+ // "cumQuote": "0",
2275
+ // "stopPrice": "9.5000",
2276
+ // "profit": "",
2277
+ // "commission": "",
2278
+ // "status": "NEW",
2279
+ // "time": 1669776326000,
2280
+ // "updateTime": 1669776326000
2281
+ // }
2282
+ // ],
2283
+ // "failed": null
2284
+ // }
2285
+ // }
2286
+ //
2287
+ }
2288
+ else {
2289
+ throw new errors.BadRequest(this.id + ' cancelAllOrders is only supported for spot and swap markets.');
2290
+ }
2252
2291
  return response;
2253
2292
  }
2254
2293
  async cancelOrders(ids, symbol = undefined, params = {}) {
@@ -3221,14 +3221,13 @@ class bitget extends bitget$1 {
3221
3221
  // "1399132.341"
3222
3222
  // ]
3223
3223
  //
3224
- const volumeIndex = (market['inverse']) ? 6 : 5;
3225
3224
  return [
3226
3225
  this.safeInteger(ohlcv, 0),
3227
3226
  this.safeNumber(ohlcv, 1),
3228
3227
  this.safeNumber(ohlcv, 2),
3229
3228
  this.safeNumber(ohlcv, 3),
3230
3229
  this.safeNumber(ohlcv, 4),
3231
- this.safeNumber(ohlcv, volumeIndex),
3230
+ this.safeNumber(ohlcv, 5),
3232
3231
  ];
3233
3232
  }
3234
3233
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -3536,10 +3535,16 @@ class bitget extends bitget$1 {
3536
3535
  // Use transferable instead of available for swap and margin https://github.com/ccxt/ccxt/pull/19127
3537
3536
  const spotAccountFree = this.safeString(entry, 'available');
3538
3537
  const contractAccountFree = this.safeString(entry, 'maxTransferOut');
3539
- account['free'] = (contractAccountFree !== undefined) ? contractAccountFree : spotAccountFree;
3540
- const frozen = this.safeString(entry, 'frozen');
3541
- const locked = this.safeString(entry, 'locked');
3542
- account['used'] = Precise["default"].stringAdd(frozen, locked);
3538
+ if (contractAccountFree !== undefined) {
3539
+ account['free'] = contractAccountFree;
3540
+ account['total'] = this.safeString(entry, 'accountEquity');
3541
+ }
3542
+ else {
3543
+ account['free'] = spotAccountFree;
3544
+ const frozen = this.safeString(entry, 'frozen');
3545
+ const locked = this.safeString(entry, 'locked');
3546
+ account['used'] = Precise["default"].stringAdd(frozen, locked);
3547
+ }
3543
3548
  }
3544
3549
  result[code] = account;
3545
3550
  }
@@ -1332,6 +1332,12 @@ class bitstamp extends bitstamp$1 {
1332
1332
  * @method
1333
1333
  * @name bitstamp#createOrder
1334
1334
  * @description create a trade order
1335
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/OpenInstantBuyOrder
1336
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/OpenMarketBuyOrder
1337
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/OpenLimitBuyOrder
1338
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/OpenInstantSellOrder
1339
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/OpenMarketSellOrder
1340
+ * @see https://www.bitstamp.net/api/#tag/Orders/operation/OpenLimitSellOrder
1335
1341
  * @param {string} symbol unified symbol of the market to create an order in
1336
1342
  * @param {string} type 'market' or 'limit'
1337
1343
  * @param {string} side 'buy' or 'sell'
@@ -1342,27 +1348,42 @@ class bitstamp extends bitstamp$1 {
1342
1348
  */
1343
1349
  await this.loadMarkets();
1344
1350
  const market = this.market(symbol);
1345
- let method = 'privatePost' + this.capitalize(side);
1346
1351
  const request = {
1347
1352
  'pair': market['id'],
1348
1353
  'amount': this.amountToPrecision(symbol, amount),
1349
1354
  };
1355
+ const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
1356
+ if (clientOrderId !== undefined) {
1357
+ request['client_order_id'] = clientOrderId;
1358
+ params = this.omit(params, ['clientOrderId']);
1359
+ }
1360
+ let response = undefined;
1361
+ const capitalizedSide = this.capitalize(side);
1350
1362
  if (type === 'market') {
1351
- method += 'Market';
1363
+ if (capitalizedSide === 'Buy') {
1364
+ response = await this.privatePostBuyMarketPair(this.extend(request, params));
1365
+ }
1366
+ else {
1367
+ response = await this.privatePostSellMarketPair(this.extend(request, params));
1368
+ }
1352
1369
  }
1353
1370
  else if (type === 'instant') {
1354
- method += 'Instant';
1371
+ if (capitalizedSide === 'Buy') {
1372
+ response = await this.privatePostBuyInstantPair(this.extend(request, params));
1373
+ }
1374
+ else {
1375
+ response = await this.privatePostSellInstantPair(this.extend(request, params));
1376
+ }
1355
1377
  }
1356
1378
  else {
1357
1379
  request['price'] = this.priceToPrecision(symbol, price);
1380
+ if (capitalizedSide === 'Buy') {
1381
+ response = await this.privatePostBuyPair(this.extend(request, params));
1382
+ }
1383
+ else {
1384
+ response = await this.privatePostSellPair(this.extend(request, params));
1385
+ }
1358
1386
  }
1359
- method += 'Pair';
1360
- const clientOrderId = this.safeString2(params, 'client_order_id', 'clientOrderId');
1361
- if (clientOrderId !== undefined) {
1362
- request['client_order_id'] = clientOrderId;
1363
- params = this.omit(params, ['client_order_id', 'clientOrderId']);
1364
- }
1365
- const response = await this[method](this.extend(request, params));
1366
1387
  const order = this.parseOrder(response, market);
1367
1388
  order['type'] = type;
1368
1389
  return order;
@@ -1395,13 +1416,16 @@ class bitstamp extends bitstamp$1 {
1395
1416
  await this.loadMarkets();
1396
1417
  let market = undefined;
1397
1418
  const request = {};
1398
- let method = 'privatePostCancelAllOrders';
1419
+ let response = undefined;
1399
1420
  if (symbol !== undefined) {
1400
1421
  market = this.market(symbol);
1401
1422
  request['pair'] = market['id'];
1402
- method = 'privatePostCancelAllOrdersPair';
1423
+ response = await this.privatePostCancelAllOrdersPair(this.extend(request, params));
1424
+ }
1425
+ else {
1426
+ response = await this.privatePostCancelAllOrders(this.extend(request, params));
1403
1427
  }
1404
- return await this[method](this.extend(request, params));
1428
+ return response;
1405
1429
  }
1406
1430
  parseOrderStatus(status) {
1407
1431
  const statuses = {
@@ -1168,14 +1168,16 @@ class cex extends cex$1 {
1168
1168
  */
1169
1169
  await this.loadMarkets();
1170
1170
  const request = {};
1171
- let method = 'privatePostOpenOrders';
1172
1171
  let market = undefined;
1172
+ let orders = undefined;
1173
1173
  if (symbol !== undefined) {
1174
1174
  market = this.market(symbol);
1175
1175
  request['pair'] = market['id'];
1176
- method += 'Pair';
1176
+ orders = await this.privatePostOpenOrdersPair(this.extend(request, params));
1177
+ }
1178
+ else {
1179
+ orders = await this.privatePostOpenOrders(this.extend(request, params));
1177
1180
  }
1178
- const orders = await this[method](this.extend(request, params));
1179
1181
  for (let i = 0; i < orders.length; i++) {
1180
1182
  orders[i] = this.extend(orders[i], { 'status': 'open' });
1181
1183
  }
@@ -1197,10 +1199,9 @@ class cex extends cex$1 {
1197
1199
  throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
1198
1200
  }
1199
1201
  await this.loadMarkets();
1200
- const method = 'privatePostArchivedOrdersPair';
1201
1202
  const market = this.market(symbol);
1202
1203
  const request = { 'pair': market['id'] };
1203
- const response = await this[method](this.extend(request, params));
1204
+ const response = await this.privatePostArchivedOrdersPair(this.extend(request, params));
1204
1205
  return this.parseOrders(response, market, since, limit);
1205
1206
  }
1206
1207
  async fetchOrder(id, symbol = undefined, params = {}) {
@@ -1317,14 +1317,19 @@ class deribit extends deribit$1 {
1317
1317
  'instrument_name': market['id'],
1318
1318
  'include_old': true,
1319
1319
  };
1320
- const method = (since === undefined) ? 'publicGetGetLastTradesByInstrument' : 'publicGetGetLastTradesByInstrumentAndTime';
1321
1320
  if (since !== undefined) {
1322
1321
  request['start_timestamp'] = since;
1323
1322
  }
1324
1323
  if (limit !== undefined) {
1325
1324
  request['count'] = Math.min(limit, 1000); // default 10
1326
1325
  }
1327
- const response = await this[method](this.extend(request, params));
1326
+ let response = undefined;
1327
+ if (since === undefined) {
1328
+ response = await this.publicGetGetLastTradesByInstrument(this.extend(request, params));
1329
+ }
1330
+ else {
1331
+ response = await this.publicGetGetLastTradesByInstrumentAndTime(this.extend(request, params));
1332
+ }
1328
1333
  //
1329
1334
  // {
1330
1335
  // "jsonrpc":"2.0",
@@ -1821,9 +1826,14 @@ class deribit extends deribit$1 {
1821
1826
  request['time_in_force'] = 'fill_or_kill';
1822
1827
  }
1823
1828
  }
1824
- const method = 'privateGet' + this.capitalize(side);
1825
1829
  params = this.omit(params, ['timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'reduceOnly']);
1826
- const response = await this[method](this.extend(request, params));
1830
+ let response = undefined;
1831
+ if (this.capitalize(side) === 'Buy') {
1832
+ response = await this.privateGetBuy(this.extend(request, params));
1833
+ }
1834
+ else {
1835
+ response = await this.privateGetSell(this.extend(request, params));
1836
+ }
1827
1837
  //
1828
1838
  // {
1829
1839
  // "jsonrpc": "2.0",
@@ -1938,16 +1948,15 @@ class deribit extends deribit$1 {
1938
1948
  */
1939
1949
  await this.loadMarkets();
1940
1950
  const request = {};
1941
- let method = undefined;
1951
+ let response = undefined;
1942
1952
  if (symbol === undefined) {
1943
- method = 'privateGetCancelAll';
1953
+ response = await this.privateGetCancelAll(this.extend(request, params));
1944
1954
  }
1945
1955
  else {
1946
- method = 'privateGetCancelAllByInstrument';
1947
1956
  const market = this.market(symbol);
1948
1957
  request['instrument_name'] = market['id'];
1958
+ response = await this.privateGetCancelAllByInstrument(this.extend(request, params));
1949
1959
  }
1950
- const response = await this[method](this.extend(request, params));
1951
1960
  return response;
1952
1961
  }
1953
1962
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -1964,19 +1973,18 @@ class deribit extends deribit$1 {
1964
1973
  await this.loadMarkets();
1965
1974
  const request = {};
1966
1975
  let market = undefined;
1967
- let method = undefined;
1976
+ let response = undefined;
1968
1977
  if (symbol === undefined) {
1969
1978
  const code = this.codeFromOptions('fetchOpenOrders', params);
1970
1979
  const currency = this.currency(code);
1971
1980
  request['currency'] = currency['id'];
1972
- method = 'privateGetGetOpenOrdersByCurrency';
1981
+ response = await this.privateGetGetOpenOrdersByCurrency(this.extend(request, params));
1973
1982
  }
1974
1983
  else {
1975
1984
  market = this.market(symbol);
1976
1985
  request['instrument_name'] = market['id'];
1977
- method = 'privateGetGetOpenOrdersByInstrument';
1986
+ response = await this.privateGetGetOpenOrdersByInstrument(this.extend(request, params));
1978
1987
  }
1979
- const response = await this[method](this.extend(request, params));
1980
1988
  const result = this.safeValue(response, 'result', []);
1981
1989
  return this.parseOrders(result, market, since, limit);
1982
1990
  }
@@ -1994,19 +2002,18 @@ class deribit extends deribit$1 {
1994
2002
  await this.loadMarkets();
1995
2003
  const request = {};
1996
2004
  let market = undefined;
1997
- let method = undefined;
2005
+ let response = undefined;
1998
2006
  if (symbol === undefined) {
1999
2007
  const code = this.codeFromOptions('fetchClosedOrders', params);
2000
2008
  const currency = this.currency(code);
2001
2009
  request['currency'] = currency['id'];
2002
- method = 'privateGetGetOrderHistoryByCurrency';
2010
+ response = await this.privateGetGetOrderHistoryByCurrency(this.extend(request, params));
2003
2011
  }
2004
2012
  else {
2005
2013
  market = this.market(symbol);
2006
2014
  request['instrument_name'] = market['id'];
2007
- method = 'privateGetGetOrderHistoryByInstrument';
2015
+ response = await this.privateGetGetOrderHistoryByInstrument(this.extend(request, params));
2008
2016
  }
2009
- const response = await this[method](this.extend(request, params));
2010
2017
  const result = this.safeValue(response, 'result', []);
2011
2018
  return this.parseOrders(result, market, since, limit);
2012
2019
  }
@@ -2079,34 +2086,33 @@ class deribit extends deribit$1 {
2079
2086
  'include_old': true,
2080
2087
  };
2081
2088
  let market = undefined;
2082
- let method = undefined;
2089
+ if (limit !== undefined) {
2090
+ request['count'] = limit; // default 10
2091
+ }
2092
+ let response = undefined;
2083
2093
  if (symbol === undefined) {
2084
2094
  const code = this.codeFromOptions('fetchMyTrades', params);
2085
2095
  const currency = this.currency(code);
2086
2096
  request['currency'] = currency['id'];
2087
2097
  if (since === undefined) {
2088
- method = 'privateGetGetUserTradesByCurrency';
2098
+ response = await this.privateGetGetUserTradesByCurrency(this.extend(request, params));
2089
2099
  }
2090
2100
  else {
2091
- method = 'privateGetGetUserTradesByCurrencyAndTime';
2092
2101
  request['start_timestamp'] = since;
2102
+ response = await this.privateGetGetUserTradesByCurrencyAndTime(this.extend(request, params));
2093
2103
  }
2094
2104
  }
2095
2105
  else {
2096
2106
  market = this.market(symbol);
2097
2107
  request['instrument_name'] = market['id'];
2098
2108
  if (since === undefined) {
2099
- method = 'privateGetGetUserTradesByInstrument';
2109
+ response = await this.privateGetGetUserTradesByInstrument(this.extend(request, params));
2100
2110
  }
2101
2111
  else {
2102
- method = 'privateGetGetUserTradesByInstrumentAndTime';
2103
2112
  request['start_timestamp'] = since;
2113
+ response = await this.privateGetGetUserTradesByInstrumentAndTime(this.extend(request, params));
2104
2114
  }
2105
2115
  }
2106
- if (limit !== undefined) {
2107
- request['count'] = limit; // default 10
2108
- }
2109
- const response = await this[method](this.extend(request, params));
2110
2116
  //
2111
2117
  // {
2112
2118
  // "jsonrpc": "2.0",
@@ -2640,7 +2646,13 @@ class deribit extends deribit$1 {
2640
2646
  const transferOptions = this.safeValue(this.options, 'transfer', {});
2641
2647
  method = this.safeString(transferOptions, 'method', 'privateGetSubmitTransferToSubaccount');
2642
2648
  }
2643
- const response = await this[method](this.extend(request, params));
2649
+ let response = undefined;
2650
+ if (method === 'privateGetSubmitTransferToUser') {
2651
+ response = await this.privateGetSubmitTransferToUser(this.extend(request, params));
2652
+ }
2653
+ else {
2654
+ response = await this.privateGetSubmitTransferToSubaccount(this.extend(request, params));
2655
+ }
2644
2656
  //
2645
2657
  // {
2646
2658
  // "jsonrpc": "2.0",
@@ -1732,14 +1732,18 @@ class kucoinfutures extends kucoinfutures$1 {
1732
1732
  const cancelExist = this.safeValue(order, 'cancelExist', false);
1733
1733
  let status = isActive ? 'open' : 'closed';
1734
1734
  status = cancelExist ? 'canceled' : status;
1735
- const fee = {
1736
- 'currency': feeCurrency,
1737
- 'cost': feeCost,
1738
- };
1735
+ let fee = undefined;
1736
+ if (feeCost !== undefined) {
1737
+ fee = {
1738
+ 'currency': feeCurrency,
1739
+ 'cost': feeCost,
1740
+ };
1741
+ }
1739
1742
  const clientOrderId = this.safeString(order, 'clientOid');
1740
1743
  const timeInForce = this.safeString(order, 'timeInForce');
1741
1744
  const stopPrice = this.safeNumber(order, 'stopPrice');
1742
1745
  const postOnly = this.safeValue(order, 'postOnly');
1746
+ const reduceOnly = this.safeValue(order, 'reduceOnly');
1743
1747
  const lastUpdateTimestamp = this.safeInteger(order, 'updatedAt');
1744
1748
  return this.safeOrder({
1745
1749
  'id': orderId,
@@ -1748,6 +1752,7 @@ class kucoinfutures extends kucoinfutures$1 {
1748
1752
  'type': type,
1749
1753
  'timeInForce': timeInForce,
1750
1754
  'postOnly': postOnly,
1755
+ 'reduceOnly': reduceOnly,
1751
1756
  'side': side,
1752
1757
  'amount': amount,
1753
1758
  'price': price,
@@ -432,7 +432,13 @@ class lykke extends lykke$1 {
432
432
  };
433
433
  // publicGetTickers or publicGetPrices
434
434
  const method = this.safeString(this.options, 'fetchTickerMethod', 'publicGetTickers');
435
- const response = await this[method](this.extend(request, params));
435
+ let response = undefined;
436
+ if (method === 'publicGetPrices') {
437
+ response = await this.publicGetPrices(this.extend(request, params));
438
+ }
439
+ else {
440
+ response = await this.publicGetTickers(this.extend(request, params));
441
+ }
436
442
  const ticker = this.safeValue(response, 'payload', []);
437
443
  //
438
444
  // publicGetTickers
@@ -786,8 +792,13 @@ class lykke extends lykke$1 {
786
792
  if (type === 'limit') {
787
793
  query['price'] = parseFloat(this.priceToPrecision(market['symbol'], price));
788
794
  }
789
- const method = 'privatePostOrders' + this.capitalize(type);
790
- const result = await this[method](this.extend(query, params));
795
+ let result = undefined;
796
+ if (this.capitalize(type) === 'Market') {
797
+ result = await this.privatePostOrdersMarket(this.extend(query, params));
798
+ }
799
+ else {
800
+ result = await this.privatePostOrdersLimit(this.extend(query, params));
801
+ }
791
802
  //
792
803
  // market
793
804
  //