ccxt 4.1.84 → 4.1.85

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
@@ -172,7 +172,7 @@ var woo$1 = require('./src/pro/woo.js');
172
172
 
173
173
  //-----------------------------------------------------------------------------
174
174
  // this is updated by vss.js when building
175
- const version = '4.1.84';
175
+ const version = '4.1.85';
176
176
  Exchange["default"].ccxtVersion = version;
177
177
  const exchanges = {
178
178
  'ace': ace,
@@ -3706,6 +3706,9 @@ class Exchange {
3706
3706
  async closeAllPositions(params = {}) {
3707
3707
  throw new errors.NotSupported(this.id + ' closeAllPositions() is not supported yet');
3708
3708
  }
3709
+ async fetchL3OrderBook(symbol, limit = undefined, params = {}) {
3710
+ throw new errors.BadRequest(this.id + ' fetchL3OrderBook() is not supported yet');
3711
+ }
3709
3712
  parseLastPrice(price, market = undefined) {
3710
3713
  throw new errors.NotSupported(this.id + ' parseLastPrice() is not supported yet');
3711
3714
  }
@@ -2012,6 +2012,9 @@ class bingx extends bingx$1 {
2012
2012
  const positionSide = this.safeString2(order, 'positionSide', 'ps');
2013
2013
  const marketType = (positionSide === undefined) ? 'spot' : 'swap';
2014
2014
  const marketId = this.safeString2(order, 'symbol', 's');
2015
+ if (market === undefined) {
2016
+ market = this.safeMarket(marketId, undefined, undefined, marketType);
2017
+ }
2015
2018
  const symbol = this.safeSymbol(marketId, market, '-', marketType);
2016
2019
  const orderId = this.safeString2(order, 'orderId', 'i');
2017
2020
  const side = this.safeStringLower2(order, 'side', 'S');
@@ -2377,16 +2380,15 @@ class bingx extends bingx$1 {
2377
2380
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2378
2381
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
2379
2382
  */
2380
- if (symbol === undefined) {
2381
- throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
2382
- }
2383
2383
  await this.loadMarkets();
2384
- const market = this.market(symbol);
2385
- const request = {
2386
- 'symbol': market['id'],
2387
- };
2384
+ let market = undefined;
2385
+ const request = {};
2386
+ if (symbol !== undefined) {
2387
+ market = this.market(symbol);
2388
+ request['symbol'] = market['id'];
2389
+ }
2388
2390
  let response = undefined;
2389
- const [marketType, query] = this.handleMarketTypeAndParams('fetchOrder', market, params);
2391
+ const [marketType, query] = this.handleMarketTypeAndParams('fetchOpenOrders', market, params);
2390
2392
  if (marketType === 'spot') {
2391
2393
  response = await this.spotV1PrivateGetTradeOpenOrders(this.extend(request, query));
2392
2394
  }
@@ -945,11 +945,11 @@ class bithumb extends bithumb$1 {
945
945
  };
946
946
  return await this.privatePostTradeCancel(this.extend(request, params));
947
947
  }
948
- cancelUnifiedOrder(order, params = {}) {
948
+ async cancelUnifiedOrder(order, params = {}) {
949
949
  const request = {
950
950
  'side': order['side'],
951
951
  };
952
- return this.cancelOrder(order['id'], order['symbol'], this.extend(request, params));
952
+ return await this.cancelOrder(order['id'], order['symbol'], this.extend(request, params));
953
953
  }
954
954
  async withdraw(code, amount, address, tag = undefined, params = {}) {
955
955
  /**
@@ -1334,48 +1334,58 @@ class bitmart extends bitmart$1 {
1334
1334
  //
1335
1335
  // public fetchTrades spot ( amount = count * price )
1336
1336
  //
1337
- // {
1338
- // "amount": "818.94",
1339
- // "order_time": "1637601839035", // ETH/USDT
1340
- // "price": "4221.99",
1341
- // "count": "0.19397",
1342
- // "type": "buy"
1343
- // }
1337
+ // {
1338
+ // "amount": "818.94",
1339
+ // "order_time": "1637601839035", // ETH/USDT
1340
+ // "price": "4221.99",
1341
+ // "count": "0.19397",
1342
+ // "type": "buy"
1343
+ // }
1344
1344
  //
1345
1345
  // spot: fetchMyTrades
1346
1346
  //
1347
- // {
1348
- // "tradeId":"182342999769370687",
1349
- // "orderId":"183270218784142990",
1350
- // "clientOrderId":"183270218784142990",
1351
- // "symbol":"ADA_USDT",
1352
- // "side":"buy",
1353
- // "orderMode":"spot",
1354
- // "type":"market",
1355
- // "price":"0.245948",
1356
- // "size":"20.71",
1357
- // "notional":"5.09358308",
1358
- // "fee":"0.00509358",
1359
- // "feeCoinName":"USDT",
1360
- // "tradeRole":"taker",
1361
- // "createTime":1695658457836,
1362
- // }
1347
+ // {
1348
+ // "tradeId":"182342999769370687",
1349
+ // "orderId":"183270218784142990",
1350
+ // "clientOrderId":"183270218784142990",
1351
+ // "symbol":"ADA_USDT",
1352
+ // "side":"buy",
1353
+ // "orderMode":"spot",
1354
+ // "type":"market",
1355
+ // "price":"0.245948",
1356
+ // "size":"20.71",
1357
+ // "notional":"5.09358308",
1358
+ // "fee":"0.00509358",
1359
+ // "feeCoinName":"USDT",
1360
+ // "tradeRole":"taker",
1361
+ // "createTime":1695658457836,
1362
+ // }
1363
1363
  //
1364
1364
  // swap: fetchMyTrades
1365
1365
  //
1366
- // {
1367
- // "order_id": "230930336848609",
1368
- // "trade_id": "6212604014",
1369
- // "symbol": "BTCUSDT",
1370
- // "side": 3,
1371
- // "price": "26910.4",
1372
- // "vol": "1",
1373
- // "exec_type": "Taker",
1374
- // "profit": false,
1375
- // "create_time": 1695961596692,
1376
- // "realised_profit": "-0.0003",
1377
- // "paid_fees": "0.01614624"
1378
- // }
1366
+ // {
1367
+ // "order_id": "230930336848609",
1368
+ // "trade_id": "6212604014",
1369
+ // "symbol": "BTCUSDT",
1370
+ // "side": 3,
1371
+ // "price": "26910.4",
1372
+ // "vol": "1",
1373
+ // "exec_type": "Taker",
1374
+ // "profit": false,
1375
+ // "create_time": 1695961596692,
1376
+ // "realised_profit": "-0.0003",
1377
+ // "paid_fees": "0.01614624"
1378
+ // }
1379
+ //
1380
+ // ws swap
1381
+ //
1382
+ // {
1383
+ // 'fee': '-0.000044502',
1384
+ // 'feeCcy': 'USDT',
1385
+ // 'fillPrice': '74.17',
1386
+ // 'fillQty': '1',
1387
+ // 'lastTradeID': 6802340762
1388
+ // }
1379
1389
  //
1380
1390
  const timestamp = this.safeIntegerN(trade, ['order_time', 'createTime', 'create_time']);
1381
1391
  const isPublicTrade = ('order_time' in trade);
@@ -1389,7 +1399,7 @@ class bitmart extends bitmart$1 {
1389
1399
  side = this.safeString(trade, 'type');
1390
1400
  }
1391
1401
  else {
1392
- amount = this.safeString2(trade, 'size', 'vol');
1402
+ amount = this.safeStringN(trade, ['size', 'vol', 'fillQty']);
1393
1403
  cost = this.safeString(trade, 'notional');
1394
1404
  type = this.safeString(trade, 'type');
1395
1405
  side = this.parseOrderSide(this.safeString(trade, 'side'));
@@ -1411,14 +1421,14 @@ class bitmart extends bitmart$1 {
1411
1421
  }
1412
1422
  return this.safeTrade({
1413
1423
  'info': trade,
1414
- 'id': this.safeString2(trade, 'tradeId', 'trade_id'),
1424
+ 'id': this.safeStringN(trade, ['tradeId', 'trade_id', 'lastTradeID']),
1415
1425
  'order': this.safeString2(trade, 'orderId', 'order_id'),
1416
1426
  'timestamp': timestamp,
1417
1427
  'datetime': this.iso8601(timestamp),
1418
1428
  'symbol': market['symbol'],
1419
1429
  'type': type,
1420
1430
  'side': side,
1421
- 'price': this.safeString(trade, 'price'),
1431
+ 'price': this.safeString2(trade, 'price', 'fillPrice'),
1422
1432
  'amount': amount,
1423
1433
  'cost': cost,
1424
1434
  'takerOrMaker': this.safeStringLower2(trade, 'tradeRole', 'exec_type'),
@@ -1472,38 +1482,45 @@ class bitmart extends bitmart$1 {
1472
1482
  parseOHLCV(ohlcv, market = undefined) {
1473
1483
  //
1474
1484
  // spot
1475
- //
1476
- // [
1477
- // "1699512060", // timestamp
1478
- // "36746.49", // open
1479
- // "36758.71", // high
1480
- // "36736.13", // low
1481
- // "36755.99", // close
1482
- // "2.83965", // base volume
1483
- // "104353.57" // quote volume
1484
- // ]
1485
+ // [
1486
+ // "1699512060", // timestamp
1487
+ // "36746.49", // open
1488
+ // "36758.71", // high
1489
+ // "36736.13", // low
1490
+ // "36755.99", // close
1491
+ // "2.83965", // base volume
1492
+ // "104353.57" // quote volume
1493
+ // ]
1485
1494
  //
1486
1495
  // swap
1487
- //
1488
- // {
1489
- // "low_price": "20090.3",
1490
- // "high_price": "20095.5",
1491
- // "open_price": "20092.6",
1492
- // "close_price": "20091.4",
1493
- // "volume": "8748",
1494
- // "timestamp": 1665002281
1495
- // }
1496
+ // {
1497
+ // "low_price": "20090.3",
1498
+ // "high_price": "20095.5",
1499
+ // "open_price": "20092.6",
1500
+ // "close_price": "20091.4",
1501
+ // "volume": "8748",
1502
+ // "timestamp": 1665002281
1503
+ // }
1496
1504
  //
1497
1505
  // ws
1498
- //
1499
- // [
1500
- // 1631056350, // timestamp
1501
- // "46532.83", // open
1502
- // "46555.71", // high
1503
- // "46511.41", // low
1504
- // "46555.71", // close
1505
- // "0.25", // volume
1506
- // ]
1506
+ // [
1507
+ // 1631056350, // timestamp
1508
+ // "46532.83", // open
1509
+ // "46555.71", // high
1510
+ // "46511.41", // low
1511
+ // "46555.71", // close
1512
+ // "0.25", // volume
1513
+ // ]
1514
+ //
1515
+ // ws swap
1516
+ // {
1517
+ // "symbol":"BTCUSDT",
1518
+ // "o":"146.24",
1519
+ // "h":"146.24",
1520
+ // "l":"146.24",
1521
+ // "c":"146.24",
1522
+ // "v":"146"
1523
+ // }
1507
1524
  //
1508
1525
  if (Array.isArray(ohlcv)) {
1509
1526
  return [
@@ -1517,12 +1534,12 @@ class bitmart extends bitmart$1 {
1517
1534
  }
1518
1535
  else {
1519
1536
  return [
1520
- this.safeTimestamp(ohlcv, 'timestamp'),
1521
- this.safeNumber(ohlcv, 'open_price'),
1522
- this.safeNumber(ohlcv, 'high_price'),
1523
- this.safeNumber(ohlcv, 'low_price'),
1524
- this.safeNumber(ohlcv, 'close_price'),
1525
- this.safeNumber(ohlcv, 'volume'),
1537
+ this.safeTimestamp2(ohlcv, 'timestamp', 'ts'),
1538
+ this.safeNumber2(ohlcv, 'open_price', 'o'),
1539
+ this.safeNumber2(ohlcv, 'high_price', 'h'),
1540
+ this.safeNumber2(ohlcv, 'low_price', 'l'),
1541
+ this.safeNumber2(ohlcv, 'close_price', 'c'),
1542
+ this.safeNumber2(ohlcv, 'volume', 'v'),
1526
1543
  ];
1527
1544
  }
1528
1545
  }
@@ -1253,11 +1253,11 @@ class bitopro extends bitopro$1 {
1253
1253
  //
1254
1254
  return this.parseOrders(orders, market, since, limit);
1255
1255
  }
1256
- fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1256
+ async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1257
1257
  const request = {
1258
1258
  'statusKind': 'OPEN',
1259
1259
  };
1260
- return this.fetchOrders(symbol, since, limit, this.extend(request, params));
1260
+ return await this.fetchOrders(symbol, since, limit, this.extend(request, params));
1261
1261
  }
1262
1262
  async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
1263
1263
  /**
@@ -30,6 +30,7 @@ class coinex extends coinex$1 {
30
30
  // 20 per 2 seconds => 10 per second => weight = 40
31
31
  'rateLimit': 2.5,
32
32
  'pro': true,
33
+ 'certified': true,
33
34
  'has': {
34
35
  'CORS': undefined,
35
36
  'spot': true,
@@ -704,9 +704,6 @@ class kucoinfutures extends kucoinfutures$1 {
704
704
  orderbook['nonce'] = this.safeInteger(data, 'sequence');
705
705
  return orderbook;
706
706
  }
707
- async fetchL3OrderBook(symbol, limit = undefined, params = {}) {
708
- throw new errors.BadRequest(this.id + ' fetchL3OrderBook() is not supported yet');
709
- }
710
707
  async fetchTicker(symbol, params = {}) {
711
708
  /**
712
709
  * @method