ccxt 4.4.44 → 4.4.45

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.
Files changed (70) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +15 -15
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/binance.js +161 -39
  5. package/dist/cjs/src/bingx.js +15 -9
  6. package/dist/cjs/src/bitfinex.js +1 -1
  7. package/dist/cjs/src/bitget.js +3 -3
  8. package/dist/cjs/src/bitmart.js +3 -3
  9. package/dist/cjs/src/bitmex.js +1 -1
  10. package/dist/cjs/src/blofin.js +22 -0
  11. package/dist/cjs/src/bybit.js +4 -4
  12. package/dist/cjs/src/coinbase.js +1 -1
  13. package/dist/cjs/src/coinex.js +1 -1
  14. package/dist/cjs/src/cryptocom.js +1 -1
  15. package/dist/cjs/src/exmo.js +18 -8
  16. package/dist/cjs/src/gate.js +1 -1
  17. package/dist/cjs/src/hashkey.js +7 -1
  18. package/dist/cjs/src/htx.js +2 -2
  19. package/dist/cjs/src/hyperliquid.js +1 -1
  20. package/dist/cjs/src/kraken.js +1 -1
  21. package/dist/cjs/src/krakenfutures.js +1 -1
  22. package/dist/cjs/src/kucoin.js +1 -1
  23. package/dist/cjs/src/kucoinfutures.js +2 -3
  24. package/dist/cjs/src/lykke.js +1 -1
  25. package/dist/cjs/src/mexc.js +2 -2
  26. package/dist/cjs/src/myokx.js +8 -0
  27. package/dist/cjs/src/okx.js +4 -4
  28. package/dist/cjs/src/onetrading.js +2 -1
  29. package/dist/cjs/src/pro/binance.js +2 -1
  30. package/dist/cjs/src/pro/myokx.js +5 -0
  31. package/dist/cjs/src/whitebit.js +34 -8
  32. package/dist/cjs/src/woo.js +1 -1
  33. package/dist/cjs/src/woofipro.js +2 -2
  34. package/js/ccxt.d.ts +1 -1
  35. package/js/ccxt.js +1 -1
  36. package/js/src/abstract/blofin.d.ts +22 -0
  37. package/js/src/binance.d.ts +4 -0
  38. package/js/src/binance.js +161 -39
  39. package/js/src/bingx.js +15 -9
  40. package/js/src/bitfinex.js +1 -1
  41. package/js/src/bitget.js +3 -3
  42. package/js/src/bitmart.js +3 -3
  43. package/js/src/bitmex.js +1 -1
  44. package/js/src/blofin.js +22 -0
  45. package/js/src/bybit.js +4 -4
  46. package/js/src/coinbase.js +1 -1
  47. package/js/src/coinex.js +1 -1
  48. package/js/src/cryptocom.js +1 -1
  49. package/js/src/exmo.d.ts +1 -0
  50. package/js/src/exmo.js +18 -8
  51. package/js/src/gate.js +1 -1
  52. package/js/src/hashkey.js +7 -1
  53. package/js/src/htx.js +2 -2
  54. package/js/src/hyperliquid.js +1 -1
  55. package/js/src/kraken.js +1 -1
  56. package/js/src/krakenfutures.js +1 -1
  57. package/js/src/kucoin.js +1 -1
  58. package/js/src/kucoinfutures.js +2 -3
  59. package/js/src/lykke.js +1 -1
  60. package/js/src/mexc.js +2 -2
  61. package/js/src/myokx.js +8 -0
  62. package/js/src/okx.js +4 -4
  63. package/js/src/onetrading.js +2 -1
  64. package/js/src/pro/binance.js +2 -1
  65. package/js/src/pro/myokx.js +5 -0
  66. package/js/src/whitebit.d.ts +2 -1
  67. package/js/src/whitebit.js +34 -8
  68. package/js/src/woo.js +1 -1
  69. package/js/src/woofipro.js +2 -2
  70. package/package.json +1 -1
package/js/src/hashkey.js CHANGED
@@ -1458,10 +1458,16 @@ export default class hashkey extends Exchange {
1458
1458
  side = isBuyer ? 'buy' : 'sell';
1459
1459
  }
1460
1460
  let takerOrMaker = undefined;
1461
- const isMaker = this.safeBoolN(trade, ['isMaker', 'isMarker', 'ibm']);
1461
+ const isMaker = this.safeBoolN(trade, ['isMaker', 'isMarker']);
1462
1462
  if (isMaker !== undefined) {
1463
1463
  takerOrMaker = isMaker ? 'maker' : 'taker';
1464
1464
  }
1465
+ const isBuyerMaker = this.safeBool(trade, 'ibm');
1466
+ // if public trade
1467
+ if (isBuyerMaker !== undefined) {
1468
+ takerOrMaker = 'taker';
1469
+ side = isBuyerMaker ? 'sell' : 'buy';
1470
+ }
1465
1471
  let feeCost = this.safeString(trade, 'commission');
1466
1472
  let feeCurrncyId = this.safeString(trade, 'commissionAsset');
1467
1473
  const feeInfo = this.safeDict(trade, 'fee');
package/js/src/htx.js CHANGED
@@ -1295,7 +1295,7 @@ export default class htx extends Exchange {
1295
1295
  'trailing': false,
1296
1296
  'untilDays': 2,
1297
1297
  'limit': 500,
1298
- 'daysBackClosed': 180,
1298
+ 'daysBack': 180,
1299
1299
  'daysBackCanceled': 1 / 12,
1300
1300
  },
1301
1301
  'fetchOHLCV': {
@@ -1336,7 +1336,7 @@ export default class htx extends Exchange {
1336
1336
  'trailing': false,
1337
1337
  'untilDays': 2,
1338
1338
  'limit': 50,
1339
- 'daysBackClosed': 90,
1339
+ 'daysBack': 90,
1340
1340
  'daysBackCanceled': 1 / 12,
1341
1341
  },
1342
1342
  'fetchOHLCV': {
@@ -275,7 +275,7 @@ export default class hyperliquid extends Exchange {
275
275
  'fetchClosedOrders': {
276
276
  'marginMode': false,
277
277
  'limit': 2000,
278
- 'daysBackClosed': undefined,
278
+ 'daysBack': undefined,
279
279
  'daysBackCanceled': undefined,
280
280
  'untilDays': undefined,
281
281
  'trigger': false,
package/js/src/kraken.js CHANGED
@@ -477,7 +477,7 @@ export default class kraken extends Exchange {
477
477
  'fetchClosedOrders': {
478
478
  'marginMode': false,
479
479
  'limit': undefined,
480
- 'daysBackClosed': undefined,
480
+ 'daysBack': undefined,
481
481
  'daysBackCanceled': undefined,
482
482
  'untilDays': 100000,
483
483
  'trigger': false,
@@ -313,7 +313,7 @@ export default class krakenfutures extends Exchange {
313
313
  'fetchClosedOrders': {
314
314
  'marginMode': false,
315
315
  'limit': undefined,
316
- 'daysBackClosed': undefined,
316
+ 'daysBack': undefined,
317
317
  'daysBackCanceled': undefined,
318
318
  'untilDays': undefined,
319
319
  'trigger': false,
package/js/src/kucoin.js CHANGED
@@ -1039,7 +1039,7 @@ export default class kucoin extends Exchange {
1039
1039
  'fetchClosedOrders': {
1040
1040
  'marginMode': true,
1041
1041
  'limit': 500,
1042
- 'daysBackClosed': undefined,
1042
+ 'daysBack': undefined,
1043
1043
  'daysBackCanceled': undefined,
1044
1044
  'untilDays': 7,
1045
1045
  'trigger': true,
@@ -376,9 +376,8 @@ export default class kucoinfutures extends kucoin {
376
376
  'stopLossPrice': true,
377
377
  'takeProfitPrice': true,
378
378
  'attachedStopLossTakeProfit': {
379
- 'triggerPrice': undefined,
380
379
  'triggerPriceType': undefined,
381
- 'limitPrice': true,
380
+ 'price': true,
382
381
  },
383
382
  'timeInForce': {
384
383
  'IOC': true,
@@ -418,7 +417,7 @@ export default class kucoinfutures extends kucoin {
418
417
  'fetchClosedOrders': {
419
418
  'marginMode': false,
420
419
  'limit': 1000,
421
- 'daysBackClosed': undefined,
420
+ 'daysBack': undefined,
422
421
  'daysBackCanceled': undefined,
423
422
  'untilDays': undefined,
424
423
  'trigger': true,
package/js/src/lykke.js CHANGED
@@ -204,7 +204,7 @@ export default class lykke extends Exchange {
204
204
  // {
205
205
  // "payload":[
206
206
  // {
207
- // "assetId":"115a60c2-0da1-40f9-a7f2-41da723b9074",
207
+ // "assetId":"115a60c2-0da1-40f9-a7f2-41da723b9075",
208
208
  // "name":"Monaco Token",
209
209
  // "symbol":"MCO",
210
210
  // "accuracy":6,
package/js/src/mexc.js CHANGED
@@ -737,7 +737,7 @@ export default class mexc extends Exchange {
737
737
  'fetchClosedOrders': {
738
738
  'marginMode': true,
739
739
  'limit': 1000,
740
- 'daysBackClosed': 7,
740
+ 'daysBack': 7,
741
741
  'daysBackCanceled': 7,
742
742
  'untilDays': 7,
743
743
  'trigger': false,
@@ -793,7 +793,7 @@ export default class mexc extends Exchange {
793
793
  'fetchClosedOrders': {
794
794
  'marginMode': false,
795
795
  'limit': 100,
796
- 'daysBackClosed': 90,
796
+ 'daysBack': 90,
797
797
  'daysBackCanceled': undefined,
798
798
  'untilDays': 90,
799
799
  'trigger': true,
package/js/src/myokx.js CHANGED
@@ -31,6 +31,14 @@ export default class myokx extends okx {
31
31
  'rest': 'https://{hostname}',
32
32
  },
33
33
  },
34
+ 'has': {
35
+ 'CORS': undefined,
36
+ 'spot': true,
37
+ 'margin': undefined,
38
+ 'swap': false,
39
+ 'future': false,
40
+ 'option': false,
41
+ },
34
42
  });
35
43
  }
36
44
  }
package/js/src/okx.js CHANGED
@@ -1202,7 +1202,7 @@ export default class okx extends Exchange {
1202
1202
  'mark': true,
1203
1203
  'index': true,
1204
1204
  },
1205
- 'limitPrice': true,
1205
+ 'price': true,
1206
1206
  },
1207
1207
  'timeInForce': {
1208
1208
  'IOC': true,
@@ -1242,7 +1242,7 @@ export default class okx extends Exchange {
1242
1242
  'fetchClosedOrders': {
1243
1243
  'marginMode': false,
1244
1244
  'limit': 100,
1245
- 'daysBackClosed': 90,
1245
+ 'daysBack': 90,
1246
1246
  'daysBackCanceled': 1 / 12,
1247
1247
  'untilDays': undefined,
1248
1248
  'trigger': true,
@@ -1629,7 +1629,7 @@ export default class okx extends Exchange {
1629
1629
  'contractSize': contract ? this.safeNumber(market, 'ctVal') : undefined,
1630
1630
  'expiry': expiry,
1631
1631
  'expiryDatetime': this.iso8601(expiry),
1632
- 'strike': strikePrice,
1632
+ 'strike': this.parseNumber(strikePrice),
1633
1633
  'optionType': optionType,
1634
1634
  'created': this.safeInteger(market, 'listTime'),
1635
1635
  'precision': {
@@ -1836,7 +1836,7 @@ export default class okx extends Exchange {
1836
1836
  }
1837
1837
  const firstChain = this.safeDict(chains, 0, {});
1838
1838
  result[code] = {
1839
- 'info': undefined,
1839
+ 'info': chains,
1840
1840
  'code': code,
1841
1841
  'id': currencyId,
1842
1842
  'name': this.safeString(firstChain, 'name'),
@@ -867,7 +867,8 @@ export default class onetrading extends Exchange {
867
867
  // {"instrument_code":"BTC_EUR","granularity":{"unit":"HOURS","period":1},"high":"9135.7","low":"9002.59","open":"9055.45","close":"9133.98","total_amount":"26.21919","volume":"238278.8724959","time":"2020-05-09T00:59:59.999Z","last_sequence":461521},
868
868
  // ]
869
869
  //
870
- return this.parseOHLCVs(response, market, timeframe, since, limit);
870
+ const ohlcv = this.safeList(response, 'candlesticks');
871
+ return this.parseOHLCVs(ohlcv, market, timeframe, since, limit);
871
872
  }
872
873
  parseTrade(trade, market = undefined) {
873
874
  //
@@ -4277,7 +4277,8 @@ export default class binance extends binanceRest {
4277
4277
  client.reject(message, id);
4278
4278
  }
4279
4279
  // reset connection if 5xx error
4280
- if (this.safeString(code, 0) === '5') {
4280
+ const codeString = this.safeString(error, 'code');
4281
+ if ((codeString !== undefined) && (codeString[0] === '5')) {
4281
4282
  client.reset(message);
4282
4283
  }
4283
4284
  }
@@ -20,6 +20,11 @@ export default class myokx extends okx {
20
20
  'ws': 'wss://wseeapap.okx.com:8443/ws/v5',
21
21
  },
22
22
  },
23
+ 'has': {
24
+ 'swap': false,
25
+ 'future': false,
26
+ 'option': false,
27
+ },
23
28
  });
24
29
  }
25
30
  }
@@ -76,8 +76,9 @@ export default class whitebit extends Exchange {
76
76
  * @name whitebit#fetchTickers
77
77
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
78
78
  * @see https://docs.whitebit.com/public/http-v4/#market-activity
79
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
79
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
80
80
  * @param {object} [params] extra parameters specific to the exchange API endpoint
81
+ * @param {string} [params.method] either v2PublicGetTicker or v4PublicGetTicker default is v4PublicGetTicker
81
82
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
82
83
  */
83
84
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
@@ -821,9 +821,22 @@ export default class whitebit extends Exchange {
821
821
  // "last": "55913.88",
822
822
  // "period": 86400
823
823
  // }
824
- market = this.safeMarket(undefined, market);
824
+ // v2
825
+ // {
826
+ // lastUpdateTimestamp: '2025-01-02T09:16:36.000Z',
827
+ // tradingPairs: 'ARB_USDC',
828
+ // lastPrice: '0.7727',
829
+ // lowestAsk: '0.7735',
830
+ // highestBid: '0.7732',
831
+ // baseVolume24h: '1555793.74',
832
+ // quoteVolume24h: '1157602.622406',
833
+ // tradesEnabled: true
834
+ // }
835
+ //
836
+ const marketId = this.safeString(ticker, 'tradingPairs');
837
+ market = this.safeMarket(marketId, market);
825
838
  // last price is provided as "last" or "last_price"
826
- const last = this.safeString2(ticker, 'last', 'last_price');
839
+ const last = this.safeStringN(ticker, ['last', 'last_price', 'lastPrice']);
827
840
  // if "close" is provided, use it, otherwise use <last>
828
841
  const close = this.safeString(ticker, 'close', last);
829
842
  return this.safeTicker({
@@ -832,9 +845,9 @@ export default class whitebit extends Exchange {
832
845
  'datetime': undefined,
833
846
  'high': this.safeString(ticker, 'high'),
834
847
  'low': this.safeString(ticker, 'low'),
835
- 'bid': this.safeString(ticker, 'bid'),
848
+ 'bid': this.safeString2(ticker, 'bid', 'highestBid'),
836
849
  'bidVolume': undefined,
837
- 'ask': this.safeString(ticker, 'ask'),
850
+ 'ask': this.safeString2(ticker, 'ask', 'lowestAsk'),
838
851
  'askVolume': undefined,
839
852
  'vwap': undefined,
840
853
  'open': this.safeString(ticker, 'open'),
@@ -844,8 +857,8 @@ export default class whitebit extends Exchange {
844
857
  'change': undefined,
845
858
  'percentage': this.safeString(ticker, 'change'),
846
859
  'average': undefined,
847
- 'baseVolume': this.safeString2(ticker, 'base_volume', 'volume'),
848
- 'quoteVolume': this.safeString2(ticker, 'quote_volume', 'deal'),
860
+ 'baseVolume': this.safeStringN(ticker, ['base_volume', 'volume', 'baseVolume24h']),
861
+ 'quoteVolume': this.safeStringN(ticker, ['quote_volume', 'deal', 'quoteVolume24h']),
849
862
  'info': ticker,
850
863
  }, market);
851
864
  }
@@ -854,14 +867,23 @@ export default class whitebit extends Exchange {
854
867
  * @name whitebit#fetchTickers
855
868
  * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
856
869
  * @see https://docs.whitebit.com/public/http-v4/#market-activity
857
- * @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
870
+ * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
858
871
  * @param {object} [params] extra parameters specific to the exchange API endpoint
872
+ * @param {string} [params.method] either v2PublicGetTicker or v4PublicGetTicker default is v4PublicGetTicker
859
873
  * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
860
874
  */
861
875
  async fetchTickers(symbols = undefined, params = {}) {
862
876
  await this.loadMarkets();
863
877
  symbols = this.marketSymbols(symbols);
864
- const response = await this.v4PublicGetTicker(params);
878
+ let method = 'v4PublicGetTicker';
879
+ [method, params] = this.handleOptionAndParams(params, 'fetchTickers', 'method', method);
880
+ let response = undefined;
881
+ if (method === 'v4PublicGetTicker') {
882
+ response = await this.v4PublicGetTicker(params);
883
+ }
884
+ else {
885
+ response = await this.v2PublicGetTicker(params);
886
+ }
865
887
  //
866
888
  // "BCH_RUB": {
867
889
  // "base_id":1831,
@@ -873,6 +895,10 @@ export default class whitebit extends Exchange {
873
895
  // "change":"2.12"
874
896
  // },
875
897
  //
898
+ const resultList = this.safeList(response, 'result');
899
+ if (resultList !== undefined) {
900
+ return this.parseTickers(resultList, symbols);
901
+ }
876
902
  const marketIds = Object.keys(response);
877
903
  const result = {};
878
904
  for (let i = 0; i < marketIds.length; i++) {
package/js/src/woo.js CHANGED
@@ -371,7 +371,7 @@ export default class woo extends Exchange {
371
371
  'fetchClosedOrders': {
372
372
  'marginMode': false,
373
373
  'limit': 500,
374
- 'daysBackClosed': undefined,
374
+ 'daysBack': undefined,
375
375
  'daysBackCanceled': undefined,
376
376
  'untilDays': 100000,
377
377
  'trigger': true,
@@ -353,7 +353,7 @@ export default class woofipro extends Exchange {
353
353
  'fetchClosedOrders': {
354
354
  'marginMode': false,
355
355
  'limit': 500,
356
- 'daysBackClosed': undefined,
356
+ 'daysBack': undefined,
357
357
  'daysBackCanceled': undefined,
358
358
  'untilDays': 100000,
359
359
  'trigger': true,
@@ -374,7 +374,7 @@ export default class woofipro extends Exchange {
374
374
  'attachedStopLossTakeProfit': {
375
375
  // todo: implementation needs unification
376
376
  'triggerPriceType': undefined,
377
- 'limitPrice': false,
377
+ 'price': false,
378
378
  },
379
379
  },
380
380
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.4.44",
3
+ "version": "4.4.45",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",