ccxt 4.4.90 → 4.4.92

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 (71) hide show
  1. package/README.md +5 -6
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -4
  4. package/dist/cjs/src/base/Exchange.js +23 -33
  5. package/dist/cjs/src/base/ws/Client.js +4 -34
  6. package/dist/cjs/src/binance.js +1 -1
  7. package/dist/cjs/src/bitmart.js +7 -0
  8. package/dist/cjs/src/bitmex.js +2 -1
  9. package/dist/cjs/src/bitvavo.js +10 -1
  10. package/dist/cjs/src/cex.js +61 -0
  11. package/dist/cjs/src/cryptocom.js +21 -2
  12. package/dist/cjs/src/cryptomus.js +1 -1
  13. package/dist/cjs/src/exmo.js +25 -10
  14. package/dist/cjs/src/fmfwio.js +1 -1
  15. package/dist/cjs/src/gate.js +2 -2
  16. package/dist/cjs/src/htx.js +1 -1
  17. package/dist/cjs/src/hyperliquid.js +115 -59
  18. package/dist/cjs/src/kraken.js +29 -1
  19. package/dist/cjs/src/krakenfutures.js +1 -1
  20. package/dist/cjs/src/lbank.js +116 -32
  21. package/dist/cjs/src/mexc.js +1 -0
  22. package/dist/cjs/src/modetrade.js +2 -2
  23. package/dist/cjs/src/okx.js +2 -2
  24. package/dist/cjs/src/paradex.js +1 -1
  25. package/dist/cjs/src/pro/bitstamp.js +1 -1
  26. package/dist/cjs/src/pro/bybit.js +10 -149
  27. package/dist/cjs/src/pro/kraken.js +251 -264
  28. package/dist/cjs/src/pro/mexc.js +0 -1
  29. package/js/ccxt.d.ts +2 -5
  30. package/js/ccxt.js +2 -4
  31. package/js/src/abstract/lbank.d.ts +1 -0
  32. package/js/src/base/Exchange.d.ts +4 -1
  33. package/js/src/base/Exchange.js +24 -34
  34. package/js/src/base/ws/Client.d.ts +0 -2
  35. package/js/src/base/ws/Client.js +4 -34
  36. package/js/src/binance.js +1 -1
  37. package/js/src/bitmart.d.ts +7 -0
  38. package/js/src/bitmart.js +7 -0
  39. package/js/src/bitmex.js +2 -1
  40. package/js/src/bitvavo.js +10 -1
  41. package/js/src/cex.js +61 -0
  42. package/js/src/cryptocom.js +21 -2
  43. package/js/src/cryptomus.js +1 -1
  44. package/js/src/exmo.js +25 -10
  45. package/js/src/fmfwio.js +2 -2
  46. package/js/src/gate.js +2 -2
  47. package/js/src/htx.js +1 -1
  48. package/js/src/hyperliquid.d.ts +1 -0
  49. package/js/src/hyperliquid.js +115 -59
  50. package/js/src/kraken.js +29 -1
  51. package/js/src/krakenfutures.js +1 -1
  52. package/js/src/lbank.d.ts +9 -1
  53. package/js/src/lbank.js +116 -32
  54. package/js/src/mexc.js +1 -0
  55. package/js/src/modetrade.js +2 -2
  56. package/js/src/okx.d.ts +1 -1
  57. package/js/src/okx.js +2 -2
  58. package/js/src/p2b.d.ts +1 -2
  59. package/js/src/paradex.js +1 -1
  60. package/js/src/pro/bitstamp.js +1 -1
  61. package/js/src/pro/bybit.d.ts +0 -1
  62. package/js/src/pro/bybit.js +11 -150
  63. package/js/src/pro/kraken.d.ts +17 -17
  64. package/js/src/pro/kraken.js +251 -264
  65. package/js/src/pro/mexc.js +0 -1
  66. package/js/src/tradeogre.d.ts +1 -2
  67. package/package.json +1 -1
  68. package/js/src/abstract/coinlist.d.ts +0 -60
  69. package/js/src/abstract/coinlist.js +0 -11
  70. package/js/src/coinlist.d.ts +0 -384
  71. package/js/src/coinlist.js +0 -2610
@@ -534,7 +534,26 @@ export default class cryptocom extends Exchange {
534
534
  if (!this.checkRequiredCredentials(false)) {
535
535
  return undefined;
536
536
  }
537
- const response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
537
+ let skipFetchCurrencies = false;
538
+ [skipFetchCurrencies, params] = this.handleOptionAndParams(params, 'fetchCurrencies', 'skipFetchCurrencies', false);
539
+ if (skipFetchCurrencies) {
540
+ // sub-accounts can't access this endpoint
541
+ return undefined;
542
+ }
543
+ let response = {};
544
+ try {
545
+ response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
546
+ }
547
+ catch (e) {
548
+ if (e instanceof ExchangeError) {
549
+ // sub-accounts can't access this endpoint
550
+ // {"code":"10001","msg":"SYS_ERROR"}
551
+ return undefined;
552
+ }
553
+ throw e;
554
+ // do nothing
555
+ // sub-accounts can't access this endpoint
556
+ }
538
557
  //
539
558
  // {
540
559
  // "id": "1747502328559",
@@ -559,7 +578,7 @@ export default class cryptocom extends Exchange {
559
578
  // "network_id": "CRONOS",
560
579
  // "withdrawal_fee": "0.18000000",
561
580
  // "withdraw_enabled": true,
562
- // "min_withdrawal_amount": "0.36",
581
+ // "min_withdrawal_amount": "0.35",
563
582
  // "deposit_enabled": true,
564
583
  // "confirmation_required": "15"
565
584
  // },
@@ -463,7 +463,7 @@ export default class cryptomus extends Exchange {
463
463
  //
464
464
  // {
465
465
  // "currency_pair": "XMR_USDT",
466
- // "last_price": "158.04829771",
466
+ // "last_price": "158.04829772",
467
467
  // "base_volume": "0.35185785",
468
468
  // "quote_volume": "55.523761128544"
469
469
  // }
package/js/src/exmo.js CHANGED
@@ -673,8 +673,9 @@ export default class exmo extends Exchange {
673
673
  * @returns {object} an associative dictionary of currencies
674
674
  */
675
675
  async fetchCurrencies(params = {}) {
676
+ const promises = [];
676
677
  //
677
- const currencyList = await this.publicGetCurrencyListExtended(params);
678
+ promises.push(this.publicGetCurrencyListExtended(params));
678
679
  //
679
680
  // [
680
681
  // {"name":"VLX","description":"Velas"},
@@ -683,7 +684,7 @@ export default class exmo extends Exchange {
683
684
  // {"name":"USD","description":"US Dollar"}
684
685
  // ]
685
686
  //
686
- const cryptoList = await this.publicGetPaymentsProvidersCryptoList(params);
687
+ promises.push(this.publicGetPaymentsProvidersCryptoList(params));
687
688
  //
688
689
  // {
689
690
  // "BTC":[
@@ -708,6 +709,9 @@ export default class exmo extends Exchange {
708
709
  // ],
709
710
  // }
710
711
  //
712
+ const responses = await Promise.all(promises);
713
+ const currencyList = responses[0];
714
+ const cryptoList = responses[1];
711
715
  const result = {};
712
716
  for (let i = 0; i < currencyList.length; i++) {
713
717
  const currency = currencyList[i];
@@ -774,6 +778,10 @@ export default class exmo extends Exchange {
774
778
  }
775
779
  }
776
780
  const code = this.safeCurrencyCode(currencyId);
781
+ const info = {
782
+ 'currency': currency,
783
+ 'providers': providers,
784
+ };
777
785
  result[code] = {
778
786
  'id': currencyId,
779
787
  'code': code,
@@ -785,7 +793,7 @@ export default class exmo extends Exchange {
785
793
  'fee': fee,
786
794
  'precision': this.parseNumber('1e-8'),
787
795
  'limits': limits,
788
- 'info': providers,
796
+ 'info': info,
789
797
  'networks': {},
790
798
  };
791
799
  }
@@ -800,7 +808,8 @@ export default class exmo extends Exchange {
800
808
  * @returns {object[]} an array of objects representing market data
801
809
  */
802
810
  async fetchMarkets(params = {}) {
803
- const response = await this.publicGetPairSettings(params);
811
+ const promises = [];
812
+ promises.push(this.publicGetPairSettings(params));
804
813
  //
805
814
  // {
806
815
  // "BTC_USD":{
@@ -817,8 +826,9 @@ export default class exmo extends Exchange {
817
826
  // }
818
827
  //
819
828
  let marginPairsDict = {};
820
- if (this.checkRequiredCredentials(false)) {
821
- const marginPairs = await this.privatePostMarginPairList(params);
829
+ const fetchMargin = this.checkRequiredCredentials(false);
830
+ if (fetchMargin) {
831
+ promises.push(this.privatePostMarginPairList(params));
822
832
  //
823
833
  // {
824
834
  // "pairs": [
@@ -848,15 +858,20 @@ export default class exmo extends Exchange {
848
858
  // ]
849
859
  // }
850
860
  //
851
- const pairs = this.safeValue(marginPairs, 'pairs');
861
+ }
862
+ const responses = await Promise.all(promises);
863
+ const spotResponse = responses[0];
864
+ if (fetchMargin) {
865
+ const marginPairs = responses[1];
866
+ const pairs = this.safeList(marginPairs, 'pairs');
852
867
  marginPairsDict = this.indexBy(pairs, 'name');
853
868
  }
854
- const keys = Object.keys(response);
869
+ const keys = Object.keys(spotResponse);
855
870
  const result = [];
856
871
  for (let i = 0; i < keys.length; i++) {
857
872
  const id = keys[i];
858
- const market = response[id];
859
- const marginMarket = this.safeValue(marginPairsDict, id);
873
+ const market = spotResponse[id];
874
+ const marginMarket = this.safeDict(marginPairsDict, id);
860
875
  const symbol = id.replace('_', '/');
861
876
  const [baseId, quoteId] = symbol.split('/');
862
877
  const base = this.safeCurrencyCode(baseId);
package/js/src/fmfwio.js CHANGED
@@ -4,9 +4,9 @@
4
4
  // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
5
  // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
6
 
7
- // ---------------------------------------------------------------------------
7
+ // ----------------------------------------------------------------------------
8
8
  import hitbtc from './hitbtc.js';
9
- // ---------------------------------------------------------------------------
9
+ // ----------------------------------------------------------------------------
10
10
  export default class fmfwio extends hitbtc {
11
11
  describe() {
12
12
  return this.deepExtend(super.describe(), {
package/js/src/gate.js CHANGED
@@ -1235,7 +1235,7 @@ export default class gate extends Exchange {
1235
1235
  this.fetchOptionMarkets(params),
1236
1236
  ];
1237
1237
  if (!sandboxMode) {
1238
- // gate does not have a sandbox for spot markets
1238
+ // gate doesn't have a sandbox for spot markets
1239
1239
  const mainnetOnly = [this.fetchSpotMarkets(params)];
1240
1240
  rawPromises = this.arrayConcat(rawPromises, mainnetOnly);
1241
1241
  }
@@ -1655,7 +1655,7 @@ export default class gate extends Exchange {
1655
1655
  'contractSize': this.parseNumber('1'),
1656
1656
  'expiry': expiry,
1657
1657
  'expiryDatetime': this.iso8601(expiry),
1658
- 'strike': strike,
1658
+ 'strike': this.parseNumber(strike),
1659
1659
  'optionType': optionType,
1660
1660
  'precision': {
1661
1661
  'amount': this.parseNumber('1'),
package/js/src/htx.js CHANGED
@@ -6859,7 +6859,7 @@ export default class htx extends Exchange {
6859
6859
  let fee = this.safeNumber(params, 'fee');
6860
6860
  if (fee === undefined) {
6861
6861
  const currencies = await this.fetchCurrencies();
6862
- this.currencies = this.deepExtend(this.currencies, currencies);
6862
+ this.currencies = this.mapToSafeMap(this.deepExtend(this.currencies, currencies));
6863
6863
  const targetNetwork = this.safeValue(currency['networks'], networkCode, {});
6864
6864
  fee = this.safeNumber(targetNetwork, 'fee');
6865
6865
  if (fee === undefined) {
@@ -204,6 +204,7 @@ export default class hyperliquid extends Exchange {
204
204
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
205
205
  */
206
206
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
207
+ createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: string, price?: Str, params?: {}): Dict;
207
208
  createOrdersRequest(orders: any, params?: {}): Dict;
208
209
  /**
209
210
  * @method
@@ -50,6 +50,7 @@ export default class hyperliquid extends Exchange {
50
50
  'createMarketSellOrderWithCost': false,
51
51
  'createOrder': true,
52
52
  'createOrders': true,
53
+ 'createOrderWithTakeProfitAndStopLoss': true,
53
54
  'createReduceOnlyOrder': true,
54
55
  'createStopOrder': true,
55
56
  'createTriggerOrder': true,
@@ -231,7 +232,16 @@ export default class hyperliquid extends Exchange {
231
232
  'triggerDirection': false,
232
233
  'stopLossPrice': false,
233
234
  'takeProfitPrice': false,
234
- 'attachedStopLossTakeProfit': undefined,
235
+ 'attachedStopLossTakeProfit': {
236
+ 'triggerPriceType': {
237
+ 'last': false,
238
+ 'mark': false,
239
+ 'index': false,
240
+ },
241
+ 'triggerPrice': true,
242
+ 'type': true,
243
+ 'price': true,
244
+ },
235
245
  'timeInForce': {
236
246
  'IOC': true,
237
247
  'FOK': false,
@@ -1421,6 +1431,74 @@ export default class hyperliquid extends Exchange {
1421
1431
  const statuses = this.safeList(data, 'statuses', []);
1422
1432
  return this.parseOrders(statuses, undefined);
1423
1433
  }
1434
+ createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
1435
+ const market = this.market(symbol);
1436
+ type = type.toUpperCase();
1437
+ side = side.toUpperCase();
1438
+ const isMarket = (type === 'MARKET');
1439
+ const isBuy = (side === 'BUY');
1440
+ const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_id');
1441
+ const slippage = this.safeString(params, 'slippage');
1442
+ let defaultTimeInForce = (isMarket) ? 'ioc' : 'gtc';
1443
+ const postOnly = this.safeBool(params, 'postOnly', false);
1444
+ if (postOnly) {
1445
+ defaultTimeInForce = 'alo';
1446
+ }
1447
+ let timeInForce = this.safeStringLower(params, 'timeInForce', defaultTimeInForce);
1448
+ timeInForce = this.capitalize(timeInForce);
1449
+ let triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
1450
+ const stopLossPrice = this.safeString(params, 'stopLossPrice', triggerPrice);
1451
+ const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
1452
+ const isTrigger = (stopLossPrice || takeProfitPrice);
1453
+ let px = undefined;
1454
+ if (isMarket) {
1455
+ if (price === undefined) {
1456
+ throw new ArgumentsRequired(this.id + ' market orders require price to calculate the max slippage price. Default slippage can be set in options (default is 5%).');
1457
+ }
1458
+ px = (isBuy) ? Precise.stringMul(price, Precise.stringAdd('1', slippage)) : Precise.stringMul(price, Precise.stringSub('1', slippage));
1459
+ px = this.priceToPrecision(symbol, px); // round after adding slippage
1460
+ }
1461
+ else {
1462
+ px = this.priceToPrecision(symbol, price);
1463
+ }
1464
+ const sz = this.amountToPrecision(symbol, amount);
1465
+ const reduceOnly = this.safeBool(params, 'reduceOnly', false);
1466
+ const orderType = {};
1467
+ if (isTrigger) {
1468
+ let isTp = false;
1469
+ if (takeProfitPrice !== undefined) {
1470
+ triggerPrice = this.priceToPrecision(symbol, takeProfitPrice);
1471
+ isTp = true;
1472
+ }
1473
+ else {
1474
+ triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
1475
+ }
1476
+ orderType['trigger'] = {
1477
+ 'isMarket': isMarket,
1478
+ 'triggerPx': triggerPrice,
1479
+ 'tpsl': (isTp) ? 'tp' : 'sl',
1480
+ };
1481
+ }
1482
+ else {
1483
+ orderType['limit'] = {
1484
+ 'tif': timeInForce,
1485
+ };
1486
+ }
1487
+ params = this.omit(params, ['clientOrderId', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce', 'client_id', 'reduceOnly', 'postOnly']);
1488
+ const orderObj = {
1489
+ 'a': this.parseToInt(market['baseId']),
1490
+ 'b': isBuy,
1491
+ 'p': px,
1492
+ 's': sz,
1493
+ 'r': reduceOnly,
1494
+ 't': orderType,
1495
+ // 'c': clientOrderId,
1496
+ };
1497
+ if (clientOrderId !== undefined) {
1498
+ orderObj['c'] = clientOrderId;
1499
+ }
1500
+ return orderObj;
1501
+ }
1424
1502
  createOrdersRequest(orders, params = {}) {
1425
1503
  /**
1426
1504
  * @method
@@ -1455,79 +1533,57 @@ export default class hyperliquid extends Exchange {
1455
1533
  params = this.omit(params, ['slippage', 'clientOrderId', 'client_id', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce']);
1456
1534
  const nonce = this.milliseconds();
1457
1535
  const orderReq = [];
1536
+ let grouping = 'na';
1458
1537
  for (let i = 0; i < orders.length; i++) {
1459
1538
  const rawOrder = orders[i];
1460
1539
  const marketId = this.safeString(rawOrder, 'symbol');
1461
1540
  const market = this.market(marketId);
1462
1541
  const symbol = market['symbol'];
1463
1542
  const type = this.safeStringUpper(rawOrder, 'type');
1464
- const isMarket = (type === 'MARKET');
1465
1543
  const side = this.safeStringUpper(rawOrder, 'side');
1466
- const isBuy = (side === 'BUY');
1467
1544
  const amount = this.safeString(rawOrder, 'amount');
1468
1545
  const price = this.safeString(rawOrder, 'price');
1469
1546
  let orderParams = this.safeDict(rawOrder, 'params', {});
1470
- const clientOrderId = this.safeString2(orderParams, 'clientOrderId', 'client_id');
1471
1547
  const slippage = this.safeString(orderParams, 'slippage', defaultSlippage);
1472
- let defaultTimeInForce = (isMarket) ? 'ioc' : 'gtc';
1473
- const postOnly = this.safeBool(orderParams, 'postOnly', false);
1474
- if (postOnly) {
1475
- defaultTimeInForce = 'alo';
1476
- }
1477
- let timeInForce = this.safeStringLower(orderParams, 'timeInForce', defaultTimeInForce);
1478
- timeInForce = this.capitalize(timeInForce);
1479
- let triggerPrice = this.safeString2(orderParams, 'triggerPrice', 'stopPrice');
1480
- const stopLossPrice = this.safeString(orderParams, 'stopLossPrice', triggerPrice);
1481
- const takeProfitPrice = this.safeString(orderParams, 'takeProfitPrice');
1482
- const isTrigger = (stopLossPrice || takeProfitPrice);
1483
- let px = undefined;
1484
- if (isMarket) {
1485
- if (price === undefined) {
1486
- throw new ArgumentsRequired(this.id + ' market orders require price to calculate the max slippage price. Default slippage can be set in options (default is 5%).');
1487
- }
1488
- px = (isBuy) ? Precise.stringMul(price, Precise.stringAdd('1', slippage)) : Precise.stringMul(price, Precise.stringSub('1', slippage));
1489
- px = this.priceToPrecision(symbol, px); // round after adding slippage
1490
- }
1491
- else {
1492
- px = this.priceToPrecision(symbol, price);
1493
- }
1494
- const sz = this.amountToPrecision(symbol, amount);
1495
- const reduceOnly = this.safeBool(orderParams, 'reduceOnly', false);
1496
- const orderType = {};
1548
+ orderParams['slippage'] = slippage;
1549
+ const stopLoss = this.safeValue(orderParams, 'stopLoss');
1550
+ const takeProfit = this.safeValue(orderParams, 'takeProfit');
1551
+ const isTrigger = (stopLoss || takeProfit);
1552
+ orderParams = this.omit(orderParams, ['stopLoss', 'takeProfit']);
1553
+ const mainOrderObj = this.createOrderRequest(symbol, type, side, amount, price, orderParams);
1554
+ orderReq.push(mainOrderObj);
1497
1555
  if (isTrigger) {
1498
- let isTp = false;
1499
- if (takeProfitPrice !== undefined) {
1500
- triggerPrice = this.priceToPrecision(symbol, takeProfitPrice);
1501
- isTp = true;
1556
+ // grouping opposed orders for sl/tp
1557
+ const stopLossOrderTriggerPrice = this.safeStringN(stopLoss, ['triggerPrice', 'stopPrice']);
1558
+ const stopLossOrderType = this.safeString(stopLoss, 'type');
1559
+ const stopLossOrderLimitPrice = this.safeStringN(stopLoss, ['price', 'stopLossPrice'], stopLossOrderTriggerPrice);
1560
+ const takeProfitOrderTriggerPrice = this.safeStringN(takeProfit, ['triggerPrice', 'stopPrice']);
1561
+ const takeProfitOrderType = this.safeString(takeProfit, 'type');
1562
+ const takeProfitOrderLimitPrice = this.safeStringN(takeProfit, ['price', 'takeProfitPrice'], takeProfitOrderTriggerPrice);
1563
+ grouping = 'normalTpsl';
1564
+ orderParams = this.omit(orderParams, ['stopLoss', 'takeProfit']);
1565
+ let triggerOrderSide = '';
1566
+ if (side === 'BUY') {
1567
+ triggerOrderSide = 'sell';
1502
1568
  }
1503
1569
  else {
1504
- triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
1570
+ triggerOrderSide = 'buy';
1571
+ }
1572
+ if (takeProfit !== undefined) {
1573
+ const orderObj = this.createOrderRequest(symbol, takeProfitOrderType, triggerOrderSide, amount, takeProfitOrderLimitPrice, this.extend(orderParams, {
1574
+ 'takeProfitPrice': takeProfitOrderTriggerPrice,
1575
+ 'reduceOnly': true,
1576
+ }));
1577
+ orderReq.push(orderObj);
1578
+ }
1579
+ if (stopLoss !== undefined) {
1580
+ const orderObj = this.createOrderRequest(symbol, stopLossOrderType, triggerOrderSide, amount, stopLossOrderLimitPrice, this.extend(orderParams, {
1581
+ 'stopLossPrice': stopLossOrderTriggerPrice,
1582
+ 'reduceOnly': true,
1583
+ }));
1584
+ orderReq.push(orderObj);
1505
1585
  }
1506
- orderType['trigger'] = {
1507
- 'isMarket': isMarket,
1508
- 'triggerPx': triggerPrice,
1509
- 'tpsl': (isTp) ? 'tp' : 'sl',
1510
- };
1511
- }
1512
- else {
1513
- orderType['limit'] = {
1514
- 'tif': timeInForce,
1515
- };
1516
- }
1517
- orderParams = this.omit(orderParams, ['clientOrderId', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce', 'client_id', 'reduceOnly', 'postOnly']);
1518
- const orderObj = {
1519
- 'a': this.parseToInt(market['baseId']),
1520
- 'b': isBuy,
1521
- 'p': px,
1522
- 's': sz,
1523
- 'r': reduceOnly,
1524
- 't': orderType,
1525
- // 'c': clientOrderId,
1526
- };
1527
- if (clientOrderId !== undefined) {
1528
- orderObj['c'] = clientOrderId;
1529
1586
  }
1530
- orderReq.push(orderObj);
1531
1587
  }
1532
1588
  let vaultAddress = undefined;
1533
1589
  [vaultAddress, params] = this.handleOptionAndParams(params, 'createOrder', 'vaultAddress');
@@ -1535,7 +1591,7 @@ export default class hyperliquid extends Exchange {
1535
1591
  const orderAction = {
1536
1592
  'type': 'order',
1537
1593
  'orders': orderReq,
1538
- 'grouping': 'na',
1594
+ 'grouping': grouping,
1539
1595
  // 'brokerCode': 1, // cant
1540
1596
  };
1541
1597
  if (vaultAddress === undefined) {
package/js/src/kraken.js CHANGED
@@ -1383,7 +1383,20 @@ export default class kraken extends Exchange {
1383
1383
  // "maker": false
1384
1384
  // }
1385
1385
  //
1386
+ // watchTrades
1387
+ //
1388
+ // {
1389
+ // "symbol": "BTC/USD",
1390
+ // "side": "buy",
1391
+ // "price": 109601.2,
1392
+ // "qty": 0.04561994,
1393
+ // "ord_type": "market",
1394
+ // "trade_id": 83449369,
1395
+ // "timestamp": "2025-05-27T11:24:03.847761Z"
1396
+ // }
1397
+ //
1386
1398
  let timestamp = undefined;
1399
+ let datetime = undefined;
1387
1400
  let side = undefined;
1388
1401
  let type = undefined;
1389
1402
  let price = undefined;
@@ -1434,6 +1447,15 @@ export default class kraken extends Exchange {
1434
1447
  };
1435
1448
  }
1436
1449
  }
1450
+ else {
1451
+ symbol = this.safeString(trade, 'symbol');
1452
+ datetime = this.safeString(trade, 'timestamp');
1453
+ id = this.safeString(trade, 'trade_id');
1454
+ side = this.safeString(trade, 'side');
1455
+ type = this.safeString(trade, 'ord_type');
1456
+ price = this.safeString(trade, 'price');
1457
+ amount = this.safeString(trade, 'qty');
1458
+ }
1437
1459
  if (market !== undefined) {
1438
1460
  symbol = market['symbol'];
1439
1461
  }
@@ -1443,12 +1465,18 @@ export default class kraken extends Exchange {
1443
1465
  if (maker !== undefined) {
1444
1466
  takerOrMaker = maker ? 'maker' : 'taker';
1445
1467
  }
1468
+ if (datetime === undefined) {
1469
+ datetime = this.iso8601(timestamp);
1470
+ }
1471
+ else {
1472
+ timestamp = this.parse8601(datetime);
1473
+ }
1446
1474
  return this.safeTrade({
1447
1475
  'id': id,
1448
1476
  'order': orderId,
1449
1477
  'info': trade,
1450
1478
  'timestamp': timestamp,
1451
- 'datetime': this.iso8601(timestamp),
1479
+ 'datetime': datetime,
1452
1480
  'symbol': symbol,
1453
1481
  'type': type,
1454
1482
  'side': side,
@@ -534,7 +534,7 @@ export default class krakenfutures extends Exchange {
534
534
  'precision': undefined,
535
535
  });
536
536
  }
537
- this.currencies = this.deepExtend(currencies, this.currencies);
537
+ this.currencies = this.mapToSafeMap(this.deepExtend(currencies, this.currencies));
538
538
  return result;
539
539
  }
540
540
  /**
package/js/src/lbank.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/lbank.js';
2
- import type { Balances, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, int, DepositAddress, FundingRates, FundingRate } from './base/types.js';
2
+ import type { Balances, Currency, Currencies, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, int, DepositAddress, FundingRates, FundingRate } from './base/types.js';
3
3
  /**
4
4
  * @class lbank
5
5
  * @augments Exchange
@@ -16,6 +16,14 @@ export default class lbank extends Exchange {
16
16
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
17
17
  */
18
18
  fetchTime(params?: {}): Promise<Int>;
19
+ /**
20
+ * @method
21
+ * @name lbank#fetchCurrencies
22
+ * @description fetches all available currencies on an exchange
23
+ * @param {dict} [params] extra parameters specific to the exchange API endpoint
24
+ * @returns {dict} an associative dictionary of currencies
25
+ */
26
+ fetchCurrencies(params?: {}): Promise<Currencies>;
19
27
  /**
20
28
  * @method
21
29
  * @name lbank#fetchMarkets