ccxt 4.5.36 → 4.5.38

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 (48) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +18 -20
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +3 -0
  5. package/dist/cjs/src/bitmex.js +19 -3
  6. package/dist/cjs/src/bitstamp.js +9 -0
  7. package/dist/cjs/src/bybit.js +2 -1
  8. package/dist/cjs/src/gate.js +4 -2
  9. package/dist/cjs/src/htx.js +67 -12
  10. package/dist/cjs/src/hyperliquid.js +250 -2
  11. package/dist/cjs/src/krakenfutures.js +74 -6
  12. package/dist/cjs/src/kucoin.js +43 -4
  13. package/dist/cjs/src/mexc.js +2 -2
  14. package/dist/cjs/src/pro/aster.js +11 -2
  15. package/dist/cjs/src/pro/binance.js +4 -2
  16. package/dist/cjs/src/pro/bitmex.js +2 -1
  17. package/dist/cjs/src/pro/bybit.js +4 -2
  18. package/dist/cjs/src/pro/gate.js +2 -1
  19. package/dist/cjs/src/pro/okx.js +4 -2
  20. package/dist/cjs/src/whitebit.js +14 -4
  21. package/js/ccxt.d.ts +1 -1
  22. package/js/ccxt.js +1 -1
  23. package/js/src/abstract/bitstamp.d.ts +8 -0
  24. package/js/src/abstract/bybit.d.ts +1 -0
  25. package/js/src/abstract/kucoin.d.ts +33 -1
  26. package/js/src/abstract/kucoinfutures.d.ts +33 -1
  27. package/js/src/base/Exchange.d.ts +1 -0
  28. package/js/src/base/Exchange.js +3 -0
  29. package/js/src/bitmex.js +19 -3
  30. package/js/src/bitstamp.js +9 -0
  31. package/js/src/bybit.js +2 -1
  32. package/js/src/gate.js +4 -2
  33. package/js/src/htx.d.ts +5 -2
  34. package/js/src/htx.js +67 -12
  35. package/js/src/hyperliquid.d.ts +64 -0
  36. package/js/src/hyperliquid.js +251 -3
  37. package/js/src/krakenfutures.js +74 -6
  38. package/js/src/kucoin.js +43 -4
  39. package/js/src/mexc.js +2 -2
  40. package/js/src/pro/aster.js +11 -2
  41. package/js/src/pro/binance.js +4 -2
  42. package/js/src/pro/bitmex.js +2 -1
  43. package/js/src/pro/bybit.js +4 -2
  44. package/js/src/pro/gate.js +2 -1
  45. package/js/src/pro/okx.js +4 -2
  46. package/js/src/whitebit.d.ts +1 -0
  47. package/js/src/whitebit.js +14 -4
  48. package/package.json +1 -1
package/js/src/pro/okx.js CHANGED
@@ -759,7 +759,8 @@ export default class okx extends okxRest {
759
759
  const liquidation = this.parseWsLiquidation(rawLiquidation);
760
760
  const symbol = this.safeString(liquidation, 'symbol');
761
761
  if (this.liquidations === undefined) {
762
- this.liquidations = new ArrayCacheBySymbolBySide();
762
+ const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
763
+ this.liquidations = new ArrayCache(limit);
763
764
  }
764
765
  const cache = this.liquidations;
765
766
  cache.append(liquidation);
@@ -856,7 +857,8 @@ export default class okx extends okxRest {
856
857
  const liquidation = this.parseWsMyLiquidation(rawLiquidation);
857
858
  const symbol = this.safeString(liquidation, 'symbol');
858
859
  if (this.liquidations === undefined) {
859
- this.liquidations = new ArrayCacheBySymbolBySide();
860
+ const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
861
+ this.liquidations = new ArrayCache(limit);
860
862
  }
861
863
  const cache = this.liquidations;
862
864
  cache.append(liquidation);
@@ -335,6 +335,7 @@ export default class whitebit extends Exchange {
335
335
  fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
336
336
  parseOrderType(type: Str): string;
337
337
  parseOrder(order: Dict, market?: Market): Order;
338
+ parseOrderStatus(status: Str): string;
338
339
  /**
339
340
  * @method
340
341
  * @name whitebit#fetchOrderTrades
@@ -515,6 +515,7 @@ export default class whitebit extends Exchange {
515
515
  const taker = Precise.stringDiv(takerFeeRate, '100');
516
516
  const makerFeeRate = this.safeString(market, 'makerFee');
517
517
  const maker = Precise.stringDiv(makerFeeRate, '100');
518
+ const isSpot = !swap;
518
519
  return {
519
520
  'id': id,
520
521
  'symbol': symbol,
@@ -525,7 +526,7 @@ export default class whitebit extends Exchange {
525
526
  'quoteId': quoteId,
526
527
  'settleId': settleId,
527
528
  'type': type,
528
- 'spot': !swap,
529
+ 'spot': isSpot,
529
530
  'margin': margin,
530
531
  'swap': swap,
531
532
  'future': false,
@@ -536,7 +537,7 @@ export default class whitebit extends Exchange {
536
537
  'inverse': inverse,
537
538
  'taker': this.parseNumber(taker),
538
539
  'maker': this.parseNumber(maker),
539
- 'contractSize': contractSize,
540
+ 'contractSize': isSpot ? undefined : contractSize,
540
541
  'expiry': undefined,
541
542
  'expiryDatetime': undefined,
542
543
  'strike': undefined,
@@ -1800,7 +1801,7 @@ export default class whitebit extends Exchange {
1800
1801
  // "time":1737380046
1801
1802
  // }
1802
1803
  //
1803
- return this.safeInteger(response, 'time');
1804
+ return this.safeIntegerProduct(response, 'time', 1000);
1804
1805
  }
1805
1806
  /**
1806
1807
  * @method
@@ -2437,7 +2438,7 @@ export default class whitebit extends Exchange {
2437
2438
  'lastTradeTimestamp': lastTradeTimestamp,
2438
2439
  'timeInForce': undefined,
2439
2440
  'postOnly': undefined,
2440
- 'status': undefined,
2441
+ 'status': this.parseOrderStatus(this.safeString(order, 'status')),
2441
2442
  'side': side,
2442
2443
  'price': price,
2443
2444
  'type': orderType,
@@ -2451,6 +2452,15 @@ export default class whitebit extends Exchange {
2451
2452
  'trades': undefined,
2452
2453
  }, market);
2453
2454
  }
2455
+ parseOrderStatus(status) {
2456
+ const statuses = {
2457
+ 'CANCELED': 'canceled',
2458
+ 'OPEN': 'open',
2459
+ 'PARTIALLY_FILLED': 'open',
2460
+ 'FILLED': 'closed',
2461
+ };
2462
+ return this.safeStringLower(statuses, status, status);
2463
+ }
2454
2464
  /**
2455
2465
  * @method
2456
2466
  * @name whitebit#fetchOrderTrades
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.5.36",
3
+ "version": "4.5.38",
4
4
  "description": "A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go",
5
5
  "unpkg": "dist/ccxt.browser.min.js",
6
6
  "type": "module",