ccxt 4.4.43 → 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 (95) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +6 -6
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/binance.js +216 -82
  5. package/dist/cjs/src/bingx.js +20 -9
  6. package/dist/cjs/src/bitfinex.js +7 -3
  7. package/dist/cjs/src/bitget.js +6 -4
  8. package/dist/cjs/src/bitmart.js +7 -10
  9. package/dist/cjs/src/bitmex.js +4 -6
  10. package/dist/cjs/src/bitstamp.js +5 -0
  11. package/dist/cjs/src/blofin.js +22 -0
  12. package/dist/cjs/src/bybit.js +11 -26
  13. package/dist/cjs/src/coinbase.js +14 -10
  14. package/dist/cjs/src/coinbaseinternational.js +13 -9
  15. package/dist/cjs/src/coincatch.js +2 -2
  16. package/dist/cjs/src/coinex.js +6 -6
  17. package/dist/cjs/src/cryptocom.js +4 -2
  18. package/dist/cjs/src/defx.js +2 -2
  19. package/dist/cjs/src/delta.js +1 -1
  20. package/dist/cjs/src/exmo.js +18 -8
  21. package/dist/cjs/src/gate.js +8 -3
  22. package/dist/cjs/src/gemini.js +5 -0
  23. package/dist/cjs/src/hashkey.js +16 -10
  24. package/dist/cjs/src/htx.js +107 -4
  25. package/dist/cjs/src/hyperliquid.js +6 -1
  26. package/dist/cjs/src/kraken.js +10 -3
  27. package/dist/cjs/src/krakenfutures.js +6 -1
  28. package/dist/cjs/src/kucoin.js +10 -8
  29. package/dist/cjs/src/kucoinfutures.js +7 -8
  30. package/dist/cjs/src/lykke.js +1 -1
  31. package/dist/cjs/src/mexc.js +18 -12
  32. package/dist/cjs/src/myokx.js +8 -0
  33. package/dist/cjs/src/ndax.js +1 -1
  34. package/dist/cjs/src/oceanex.js +1 -1
  35. package/dist/cjs/src/okx.js +8 -9
  36. package/dist/cjs/src/onetrading.js +2 -1
  37. package/dist/cjs/src/pro/binance.js +2 -1
  38. package/dist/cjs/src/pro/bitcoincom.js +4 -1
  39. package/dist/cjs/src/pro/bitopro.js +1 -1
  40. package/dist/cjs/src/pro/myokx.js +5 -0
  41. package/dist/cjs/src/whitebit.js +38 -10
  42. package/dist/cjs/src/woo.js +6 -4
  43. package/dist/cjs/src/woofipro.js +7 -4
  44. package/js/ccxt.d.ts +1 -1
  45. package/js/ccxt.js +1 -1
  46. package/js/src/abstract/binance.d.ts +1 -0
  47. package/js/src/abstract/binancecoinm.d.ts +1 -0
  48. package/js/src/abstract/binanceus.d.ts +1 -0
  49. package/js/src/abstract/binanceusdm.d.ts +1 -0
  50. package/js/src/abstract/blofin.d.ts +22 -0
  51. package/js/src/binance.d.ts +37 -32
  52. package/js/src/binance.js +216 -82
  53. package/js/src/bingx.js +20 -9
  54. package/js/src/bitfinex.js +7 -3
  55. package/js/src/bitget.js +6 -4
  56. package/js/src/bitmart.js +7 -10
  57. package/js/src/bitmex.js +4 -6
  58. package/js/src/bitstamp.js +5 -0
  59. package/js/src/blofin.js +22 -0
  60. package/js/src/bybit.js +11 -26
  61. package/js/src/coinbase.js +14 -10
  62. package/js/src/coinbaseinternational.js +13 -9
  63. package/js/src/coincatch.js +2 -2
  64. package/js/src/coinex.js +6 -6
  65. package/js/src/cryptocom.js +4 -2
  66. package/js/src/defx.js +2 -2
  67. package/js/src/delta.js +1 -1
  68. package/js/src/exmo.d.ts +1 -0
  69. package/js/src/exmo.js +18 -8
  70. package/js/src/gate.js +8 -3
  71. package/js/src/gemini.js +5 -0
  72. package/js/src/hashkey.js +16 -10
  73. package/js/src/htx.d.ts +13 -1
  74. package/js/src/htx.js +107 -4
  75. package/js/src/hyperliquid.js +6 -1
  76. package/js/src/kraken.js +10 -3
  77. package/js/src/krakenfutures.js +6 -1
  78. package/js/src/kucoin.js +10 -8
  79. package/js/src/kucoinfutures.js +7 -8
  80. package/js/src/lykke.js +1 -1
  81. package/js/src/mexc.js +18 -12
  82. package/js/src/myokx.js +8 -0
  83. package/js/src/ndax.js +1 -1
  84. package/js/src/oceanex.js +1 -1
  85. package/js/src/okx.js +8 -9
  86. package/js/src/onetrading.js +2 -1
  87. package/js/src/pro/binance.js +2 -1
  88. package/js/src/pro/bitcoincom.js +4 -1
  89. package/js/src/pro/bitopro.js +1 -1
  90. package/js/src/pro/myokx.js +5 -0
  91. package/js/src/whitebit.d.ts +2 -1
  92. package/js/src/whitebit.js +38 -10
  93. package/js/src/woo.js +6 -4
  94. package/js/src/woofipro.js +7 -4
  95. package/package.json +1 -1
@@ -20,7 +20,10 @@ export default class bitcoincom extends hitbtc {
20
20
  'urls': {
21
21
  'logo': 'https://user-images.githubusercontent.com/1294454/97296144-514fa300-1861-11eb-952b-3d55d492200b.jpg',
22
22
  'api': {
23
- 'ws': 'wss://api.fmfw.io/api/2/ws',
23
+ 'ws': {
24
+ 'public': 'wss://api.fmfw.io/api/3/ws/public',
25
+ 'private': 'wss://api.fmfw.io/api/3/ws/trading',
26
+ },
24
27
  },
25
28
  },
26
29
  'fees': {
@@ -77,7 +77,7 @@ export default class bitopro extends bitoproRest {
77
77
  endPart = market['id'];
78
78
  }
79
79
  else {
80
- endPart = market['id'] + ':' + limit;
80
+ endPart = market['id'] + ':' + this.numberToString(limit);
81
81
  }
82
82
  const orderbook = await this.watchPublic('order-books', messageHash, endPart);
83
83
  return orderbook.limit();
@@ -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++) {
@@ -1231,9 +1257,11 @@ export default class whitebit extends Exchange {
1231
1257
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1232
1258
  */
1233
1259
  async createMarketOrderWithCost(symbol, side, cost, params = {}) {
1234
- params['cost'] = cost;
1260
+ const req = {
1261
+ 'cost': cost,
1262
+ };
1235
1263
  // only buy side is supported
1236
- return await this.createOrder(symbol, 'market', side, 0, undefined, params);
1264
+ return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
1237
1265
  }
1238
1266
  /**
1239
1267
  * @method
package/js/src/woo.js CHANGED
@@ -336,9 +336,11 @@ export default class woo extends Exchange {
336
336
  },
337
337
  'hedged': false,
338
338
  'trailing': true,
339
- // exchange specific params:
340
- // 'iceberg': true,
341
- // 'oco': true,
339
+ 'leverage': false,
340
+ 'marketBuyByCost': true,
341
+ 'marketBuyRequiresPrice': false,
342
+ 'selfTradePrevention': false,
343
+ 'iceberg': true, // todo implement
342
344
  },
343
345
  'createOrders': undefined,
344
346
  'fetchMyTrades': {
@@ -369,7 +371,7 @@ export default class woo extends Exchange {
369
371
  'fetchClosedOrders': {
370
372
  'marginMode': false,
371
373
  'limit': 500,
372
- 'daysBackClosed': undefined,
374
+ 'daysBack': undefined,
373
375
  'daysBackCanceled': undefined,
374
376
  'untilDays': 100000,
375
377
  'trigger': true,
@@ -323,8 +323,11 @@ export default class woofipro extends Exchange {
323
323
  },
324
324
  'hedged': false,
325
325
  'trailing': true,
326
- // exchange specific
327
- // 'iceberg': true,
326
+ 'leverage': true,
327
+ 'marketBuyByCost': false,
328
+ 'marketBuyRequiresPrice': false,
329
+ 'selfTradePrevention': false,
330
+ 'iceberg': true, // todo implement
328
331
  },
329
332
  'createOrders': {
330
333
  'max': 10,
@@ -350,7 +353,7 @@ export default class woofipro extends Exchange {
350
353
  'fetchClosedOrders': {
351
354
  'marginMode': false,
352
355
  'limit': 500,
353
- 'daysBackClosed': undefined,
356
+ 'daysBack': undefined,
354
357
  'daysBackCanceled': undefined,
355
358
  'untilDays': 100000,
356
359
  'trigger': true,
@@ -371,7 +374,7 @@ export default class woofipro extends Exchange {
371
374
  'attachedStopLossTakeProfit': {
372
375
  // todo: implementation needs unification
373
376
  'triggerPriceType': undefined,
374
- 'limitPrice': false,
377
+ 'price': false,
375
378
  },
376
379
  },
377
380
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.4.43",
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",