ccxt 4.4.4 → 4.4.5

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/js/src/bitget.js CHANGED
@@ -1536,6 +1536,7 @@ export default class bitget extends Exchange {
1536
1536
  * @description retrieves data on all markets for bitget
1537
1537
  * @see https://www.bitget.com/api-doc/spot/market/Get-Symbols
1538
1538
  * @see https://www.bitget.com/api-doc/contract/market/Get-All-Symbols-Contracts
1539
+ * @see https://www.bitget.com/api-doc/margin/common/support-currencies
1539
1540
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1540
1541
  * @returns {object[]} an array of objects representing market data
1541
1542
  */
@@ -1544,10 +1545,11 @@ export default class bitget extends Exchange {
1544
1545
  if (sandboxMode) {
1545
1546
  types = ['swap'];
1546
1547
  }
1547
- let promises = [];
1548
+ const promises = [];
1549
+ let fetchMargins = false;
1548
1550
  for (let i = 0; i < types.length; i++) {
1549
1551
  const type = types[i];
1550
- if (type === 'swap') {
1552
+ if ((type === 'swap') || (type === 'future')) {
1551
1553
  let subTypes = undefined;
1552
1554
  if (sandboxMode) {
1553
1555
  // the following are simulated trading markets [ 'SUSDT-FUTURES', 'SCOIN-FUTURES', 'SUSDC-FUTURES' ];
@@ -1557,19 +1559,41 @@ export default class bitget extends Exchange {
1557
1559
  subTypes = ['USDT-FUTURES', 'COIN-FUTURES', 'USDC-FUTURES'];
1558
1560
  }
1559
1561
  for (let j = 0; j < subTypes.length; j++) {
1560
- promises.push(this.fetchMarketsByType(type, this.extend(params, {
1562
+ promises.push(this.publicMixGetV2MixMarketContracts(this.extend(params, {
1561
1563
  'productType': subTypes[j],
1562
1564
  })));
1563
1565
  }
1564
1566
  }
1567
+ else if (type === 'spot') {
1568
+ promises.push(this.publicSpotGetV2SpotPublicSymbols(params));
1569
+ fetchMargins = true;
1570
+ promises.push(this.publicMarginGetV2MarginCurrencies(params));
1571
+ }
1572
+ else {
1573
+ throw new NotSupported(this.id + ' does not support ' + type + ' market');
1574
+ }
1575
+ }
1576
+ const results = await Promise.all(promises);
1577
+ let markets = [];
1578
+ this.options['crossMarginPairsData'] = [];
1579
+ this.options['isolatedMarginPairsData'] = [];
1580
+ for (let i = 0; i < results.length; i++) {
1581
+ const res = this.safeDict(results, i);
1582
+ const data = this.safeList(res, 'data', []);
1583
+ const firstData = this.safeDict(data, 0, {});
1584
+ const isBorrowable = this.safeString(firstData, 'isBorrowable');
1585
+ if (fetchMargins && isBorrowable !== undefined) {
1586
+ const keysList = Object.keys(this.indexBy(data, 'symbol'));
1587
+ this.options['crossMarginPairsData'] = keysList;
1588
+ this.options['isolatedMarginPairsData'] = keysList;
1589
+ }
1565
1590
  else {
1566
- promises.push(this.fetchMarketsByType(types[i], params));
1591
+ markets = this.arrayConcat(markets, data);
1567
1592
  }
1568
1593
  }
1569
- promises = await Promise.all(promises);
1570
- let result = promises[0];
1571
- for (let i = 1; i < promises.length; i++) {
1572
- result = this.arrayConcat(result, promises[i]);
1594
+ const result = [];
1595
+ for (let i = 0; i < markets.length; i++) {
1596
+ result.push(this.parseMarket(markets[i]));
1573
1597
  }
1574
1598
  return result;
1575
1599
  }
@@ -1661,11 +1685,20 @@ export default class bitget extends Exchange {
1661
1685
  let expiry = undefined;
1662
1686
  let expiryDatetime = undefined;
1663
1687
  const symbolType = this.safeString(market, 'symbolType');
1688
+ let marginModes = undefined;
1689
+ let isMarginTradingAllowed = false;
1664
1690
  if (symbolType === undefined) {
1665
1691
  type = 'spot';
1666
1692
  spot = true;
1667
1693
  pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision')));
1668
1694
  amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
1695
+ const hasCrossMargin = this.inArray(marketId, this.options['crossMarginPairsData']);
1696
+ const hasIsolatedMargin = this.inArray(marketId, this.options['isolatedMarginPairsData']);
1697
+ marginModes = {
1698
+ 'cross': hasCrossMargin,
1699
+ 'isolated': hasIsolatedMargin,
1700
+ };
1701
+ isMarginTradingAllowed = hasCrossMargin || hasCrossMargin;
1669
1702
  }
1670
1703
  else {
1671
1704
  if (symbolType === 'perpetual') {
@@ -1704,6 +1737,10 @@ export default class bitget extends Exchange {
1704
1737
  preciseAmount.reduce();
1705
1738
  const amountString = preciseAmount.toString();
1706
1739
  amountPrecision = this.parseNumber(amountString);
1740
+ marginModes = {
1741
+ 'cross': true,
1742
+ 'isolated': true,
1743
+ };
1707
1744
  }
1708
1745
  const status = this.safeString2(market, 'status', 'symbolStatus');
1709
1746
  let active = undefined;
@@ -1726,7 +1763,8 @@ export default class bitget extends Exchange {
1726
1763
  'settleId': settleId,
1727
1764
  'type': type,
1728
1765
  'spot': spot,
1729
- 'margin': undefined,
1766
+ 'margin': spot && isMarginTradingAllowed,
1767
+ 'marginModes': marginModes,
1730
1768
  'swap': swap,
1731
1769
  'future': future,
1732
1770
  'option': false,
@@ -1767,91 +1805,6 @@ export default class bitget extends Exchange {
1767
1805
  'info': market,
1768
1806
  };
1769
1807
  }
1770
- async fetchMarketsByType(type, params = {}) {
1771
- let response = undefined;
1772
- if (type === 'spot') {
1773
- response = await this.publicSpotGetV2SpotPublicSymbols(params);
1774
- }
1775
- else if ((type === 'swap') || (type === 'future')) {
1776
- response = await this.publicMixGetV2MixMarketContracts(params);
1777
- }
1778
- else {
1779
- throw new NotSupported(this.id + ' does not support ' + type + ' market');
1780
- }
1781
- //
1782
- // spot
1783
- //
1784
- // {
1785
- // "code": "00000",
1786
- // "msg": "success",
1787
- // "requestTime": 1700102364653,
1788
- // "data": [
1789
- // {
1790
- // "symbol": "TRXUSDT",
1791
- // "baseCoin": "TRX",
1792
- // "quoteCoin": "USDT",
1793
- // "minTradeAmount": "0",
1794
- // "maxTradeAmount": "10000000000",
1795
- // "takerFeeRate": "0.002",
1796
- // "makerFeeRate": "0.002",
1797
- // "pricePrecision": "6",
1798
- // "quantityPrecision": "4",
1799
- // "quotePrecision": "6",
1800
- // "status": "online",
1801
- // "minTradeUSDT": "5",
1802
- // "buyLimitPriceRatio": "0.05",
1803
- // "sellLimitPriceRatio": "0.05"
1804
- // },
1805
- // ]
1806
- // }
1807
- //
1808
- // swap and future
1809
- //
1810
- // {
1811
- // "code": "00000",
1812
- // "msg": "success",
1813
- // "requestTime": 1700102364709,
1814
- // "data": [
1815
- // {
1816
- // "symbol": "BTCUSDT",
1817
- // "baseCoin": "BTC",
1818
- // "quoteCoin": "USDT",
1819
- // "buyLimitPriceRatio": "0.01",
1820
- // "sellLimitPriceRatio": "0.01",
1821
- // "feeRateUpRatio": "0.005",
1822
- // "makerFeeRate": "0.0002",
1823
- // "takerFeeRate": "0.0006",
1824
- // "openCostUpRatio": "0.01",
1825
- // "supportMarginCoins": ["USDT"],
1826
- // "minTradeNum": "0.001",
1827
- // "priceEndStep": "1",
1828
- // "volumePlace": "3",
1829
- // "pricePlace": "1",
1830
- // "sizeMultiplier": "0.001",
1831
- // "symbolType": "perpetual",
1832
- // "minTradeUSDT": "5",
1833
- // "maxSymbolOrderNum": "200",
1834
- // "maxProductOrderNum": "400",
1835
- // "maxPositionNum": "150",
1836
- // "symbolStatus": "normal",
1837
- // "offTime": "-1",
1838
- // "limitOpenTime": "-1",
1839
- // "deliveryTime": "",
1840
- // "deliveryStartTime": "",
1841
- // "deliveryPeriod": "",
1842
- // "launchTime": "",
1843
- // "fundInterval": "8",
1844
- // "minLever": "1",
1845
- // "maxLever": "125",
1846
- // "posLimit": "0.05",
1847
- // "maintainTime": ""
1848
- // },
1849
- // ]
1850
- // }
1851
- //
1852
- const data = this.safeValue(response, 'data', []);
1853
- return this.parseMarkets(data);
1854
- }
1855
1808
  async fetchCurrencies(params = {}) {
1856
1809
  /**
1857
1810
  * @method
package/js/src/bybit.js CHANGED
@@ -101,7 +101,7 @@ export default class bybit extends Exchange {
101
101
  'fetchOpenOrders': true,
102
102
  'fetchOption': true,
103
103
  'fetchOptionChain': true,
104
- 'fetchOrder': false,
104
+ 'fetchOrder': true,
105
105
  'fetchOrderBook': true,
106
106
  'fetchOrders': false,
107
107
  'fetchOrderTrades': true,
@@ -4876,14 +4876,87 @@ export default class bybit extends Exchange {
4876
4876
  * @param {string} id the order id
4877
4877
  * @param {string} symbol unified symbol of the market the order was made in
4878
4878
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4879
+ * @param {object} [params.acknowledged] to suppress the warning, set to true
4879
4880
  * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
4880
4881
  */
4881
- const res = await this.isUnifiedEnabled();
4882
- const enableUnifiedAccount = this.safeBool(res, 1);
4883
- if (enableUnifiedAccount) {
4884
- throw new NotSupported(this.id + ' fetchOrder() is not supported after the 5/02 update for UTA accounts, please use fetchOpenOrder or fetchClosedOrder');
4882
+ await this.loadMarkets();
4883
+ const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
4884
+ const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
4885
+ if (!isUnifiedAccount) {
4886
+ return await this.fetchOrderClassic(id, symbol, params);
4887
+ }
4888
+ let acknowledge = false;
4889
+ [acknowledge, params] = this.handleOptionAndParams(params, 'fetchOrder', 'acknowledged');
4890
+ if (!acknowledge) {
4891
+ throw new ArgumentsRequired(this.id + ' fetchOrder() can only access an order if it is in last 500 orders (of any status) for your account. Set params["acknowledged"] = true to hide this warning. Alternatively, we suggest to use fetchOpenOrder or fetchClosedOrder');
4885
4892
  }
4886
- return await this.fetchOrderClassic(id, symbol, params);
4893
+ const market = this.market(symbol);
4894
+ let marketType = undefined;
4895
+ [marketType, params] = this.getBybitType('fetchOrder', market, params);
4896
+ const request = {
4897
+ 'symbol': market['id'],
4898
+ 'orderId': id,
4899
+ 'category': marketType,
4900
+ };
4901
+ let isTrigger = undefined;
4902
+ [isTrigger, params] = this.handleParamBool2(params, 'trigger', 'stop', false);
4903
+ if (isTrigger) {
4904
+ request['orderFilter'] = 'StopOrder';
4905
+ }
4906
+ const response = await this.privateGetV5OrderRealtime(this.extend(request, params));
4907
+ //
4908
+ // {
4909
+ // "retCode": 0,
4910
+ // "retMsg": "OK",
4911
+ // "result": {
4912
+ // "nextPageCursor": "1321052653536515584%3A1672217748287%2C1321052653536515584%3A1672217748287",
4913
+ // "category": "spot",
4914
+ // "list": [
4915
+ // {
4916
+ // "symbol": "ETHUSDT",
4917
+ // "orderType": "Limit",
4918
+ // "orderLinkId": "1672217748277652",
4919
+ // "orderId": "1321052653536515584",
4920
+ // "cancelType": "UNKNOWN",
4921
+ // "avgPrice": "",
4922
+ // "stopOrderType": "tpslOrder",
4923
+ // "lastPriceOnCreated": "",
4924
+ // "orderStatus": "Cancelled",
4925
+ // "takeProfit": "",
4926
+ // "cumExecValue": "0",
4927
+ // "triggerDirection": 0,
4928
+ // "isLeverage": "0",
4929
+ // "rejectReason": "",
4930
+ // "price": "1000",
4931
+ // "orderIv": "",
4932
+ // "createdTime": "1672217748287",
4933
+ // "tpTriggerBy": "",
4934
+ // "positionIdx": 0,
4935
+ // "timeInForce": "GTC",
4936
+ // "leavesValue": "500",
4937
+ // "updatedTime": "1672217748287",
4938
+ // "side": "Buy",
4939
+ // "triggerPrice": "1500",
4940
+ // "cumExecFee": "0",
4941
+ // "leavesQty": "0",
4942
+ // "slTriggerBy": "",
4943
+ // "closeOnTrigger": false,
4944
+ // "cumExecQty": "0",
4945
+ // "reduceOnly": false,
4946
+ // "qty": "0.5",
4947
+ // "stopLoss": "",
4948
+ // "triggerBy": "1192.5"
4949
+ // }
4950
+ // ]
4951
+ // },
4952
+ // "retExtInfo": {},
4953
+ // "time": 1672219526294
4954
+ // }
4955
+ //
4956
+ const result = this.safeDict(response, 'result', {});
4957
+ const innerList = this.safeList(result, 'list', []);
4958
+ const order = this.safeDict(innerList, 0, {});
4959
+ return this.parseOrder(order, market);
4887
4960
  }
4888
4961
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
4889
4962
  const res = await this.isUnifiedEnabled();
package/js/src/lykke.js CHANGED
@@ -681,9 +681,9 @@ export default class lykke extends Exchange {
681
681
  const currencyId = this.safeString(balance, 'assetId');
682
682
  const code = this.safeCurrencyCode(currencyId);
683
683
  const account = this.account();
684
- const free = this.safeString(balance, 'available');
684
+ const total = this.safeString(balance, 'available');
685
685
  const used = this.safeString(balance, 'reserved');
686
- account['free'] = free;
686
+ account['total'] = total;
687
687
  account['used'] = used;
688
688
  result[code] = account;
689
689
  }
package/js/src/mexc.js CHANGED
@@ -92,7 +92,7 @@ export default class mexc extends Exchange {
92
92
  'fetchOrderBooks': undefined,
93
93
  'fetchOrders': true,
94
94
  'fetchOrderTrades': true,
95
- 'fetchPosition': true,
95
+ 'fetchPosition': 'emulated',
96
96
  'fetchPositionHistory': 'emulated',
97
97
  'fetchPositionMode': true,
98
98
  'fetchPositions': true,
@@ -2917,6 +2917,9 @@ export default class mexc extends Exchange {
2917
2917
  * @method
2918
2918
  * @name mexc#cancelOrder
2919
2919
  * @description cancels an open order
2920
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
2921
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
2922
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
2920
2923
  * @param {string} id order id
2921
2924
  * @param {string} symbol unified symbol of the market the order was made in
2922
2925
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -3034,6 +3037,7 @@ export default class mexc extends Exchange {
3034
3037
  * @method
3035
3038
  * @name mexc#cancelOrders
3036
3039
  * @description cancel multiple orders
3040
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
3037
3041
  * @param {string[]} ids order ids
3038
3042
  * @param {string} symbol unified market symbol, default is undefined
3039
3043
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -4767,6 +4771,7 @@ export default class mexc extends Exchange {
4767
4771
  * @method
4768
4772
  * @name mexc#fetchPosition
4769
4773
  * @description fetch data on a single open contract trade position
4774
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
4770
4775
  * @param {string} symbol unified market symbol of the market the position is held in, default is undefined
4771
4776
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4772
4777
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
@@ -4784,6 +4789,7 @@ export default class mexc extends Exchange {
4784
4789
  * @method
4785
4790
  * @name mexc#fetchPositions
4786
4791
  * @description fetch all open positions
4792
+ * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
4787
4793
  * @param {string[]|undefined} symbols list of unified market symbols
4788
4794
  * @param {object} [params] extra parameters specific to the exchange API endpoint
4789
4795
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
package/js/src/paradex.js CHANGED
@@ -659,7 +659,7 @@ export default class paradex extends Exchange {
659
659
  'low': undefined,
660
660
  'bid': this.safeString(ticker, 'bid'),
661
661
  'bidVolume': undefined,
662
- 'ask': this.safeString(ticker, 'sdk'),
662
+ 'ask': this.safeString(ticker, 'ask'),
663
663
  'askVolume': undefined,
664
664
  'vwap': undefined,
665
665
  'open': undefined,
@@ -3,6 +3,146 @@ import type { Int, OrderSide, OrderType, Str, Strings, Trade, OrderBook, Order,
3
3
  import Client from '../base/ws/Client.js';
4
4
  export default class binance extends binanceRest {
5
5
  describe(): any;
6
+ describeData(): {
7
+ has: {
8
+ ws: boolean;
9
+ watchBalance: boolean;
10
+ watchLiquidations: boolean;
11
+ watchLiquidationsForSymbols: boolean;
12
+ watchMyLiquidations: boolean;
13
+ watchMyLiquidationsForSymbols: boolean;
14
+ watchBidsAsks: boolean;
15
+ watchMyTrades: boolean;
16
+ watchOHLCV: boolean;
17
+ watchOHLCVForSymbols: boolean;
18
+ watchOrderBook: boolean;
19
+ watchOrderBookForSymbols: boolean;
20
+ watchOrders: boolean;
21
+ watchOrdersForSymbols: boolean;
22
+ watchPositions: boolean;
23
+ watchTicker: boolean;
24
+ watchTickers: boolean;
25
+ watchTrades: boolean;
26
+ watchTradesForSymbols: boolean;
27
+ createOrderWs: boolean;
28
+ editOrderWs: boolean;
29
+ cancelOrderWs: boolean;
30
+ cancelOrdersWs: boolean;
31
+ cancelAllOrdersWs: boolean;
32
+ fetchBalanceWs: boolean;
33
+ fetchDepositsWs: boolean;
34
+ fetchMarketsWs: boolean;
35
+ fetchMyTradesWs: boolean;
36
+ fetchOHLCVWs: boolean;
37
+ fetchOrderBookWs: boolean;
38
+ fetchOpenOrdersWs: boolean;
39
+ fetchOrderWs: boolean;
40
+ fetchOrdersWs: boolean;
41
+ fetchPositionWs: boolean;
42
+ fetchPositionForSymbolWs: boolean;
43
+ fetchPositionsWs: boolean;
44
+ fetchTickerWs: boolean;
45
+ fetchTradesWs: boolean;
46
+ fetchTradingFeesWs: boolean;
47
+ fetchWithdrawalsWs: boolean;
48
+ };
49
+ urls: {
50
+ test: {
51
+ ws: {
52
+ spot: string;
53
+ margin: string;
54
+ future: string;
55
+ delivery: string;
56
+ 'ws-api': {
57
+ spot: string;
58
+ future: string;
59
+ };
60
+ };
61
+ };
62
+ api: {
63
+ ws: {
64
+ spot: string;
65
+ margin: string;
66
+ future: string;
67
+ delivery: string;
68
+ 'ws-api': {
69
+ spot: string;
70
+ future: string;
71
+ };
72
+ papi: string;
73
+ };
74
+ };
75
+ doc: string;
76
+ };
77
+ streaming: {
78
+ keepAlive: number;
79
+ };
80
+ options: {
81
+ returnRateLimits: boolean;
82
+ streamLimits: {
83
+ spot: number;
84
+ margin: number;
85
+ future: number;
86
+ delivery: number;
87
+ };
88
+ subscriptionLimitByStream: {
89
+ spot: number;
90
+ margin: number;
91
+ future: number;
92
+ delivery: number;
93
+ };
94
+ streamBySubscriptionsHash: {};
95
+ streamIndex: number;
96
+ watchOrderBookRate: number;
97
+ liquidationsLimit: number;
98
+ myLiquidationsLimit: number;
99
+ tradesLimit: number;
100
+ ordersLimit: number;
101
+ OHLCVLimit: number;
102
+ requestId: {};
103
+ watchOrderBookLimit: number;
104
+ watchTrades: {
105
+ name: string;
106
+ };
107
+ watchTicker: {
108
+ name: string;
109
+ };
110
+ watchTickers: {
111
+ name: string;
112
+ };
113
+ watchOHLCV: {
114
+ name: string;
115
+ };
116
+ watchOrderBook: {
117
+ maxRetries: number;
118
+ checksum: boolean;
119
+ };
120
+ watchBalance: {
121
+ fetchBalanceSnapshot: boolean;
122
+ awaitBalanceSnapshot: boolean;
123
+ };
124
+ watchLiquidationsForSymbols: {
125
+ defaultType: string;
126
+ };
127
+ watchPositions: {
128
+ fetchPositionsSnapshot: boolean;
129
+ awaitPositionsSnapshot: boolean;
130
+ };
131
+ wallet: string;
132
+ listenKeyRefreshRate: number;
133
+ ws: {
134
+ cost: number;
135
+ };
136
+ tickerChannelsMap: {
137
+ '24hrTicker': string;
138
+ '24hrMiniTicker': string;
139
+ '1hTicker': string;
140
+ '4hTicker': string;
141
+ '1dTicker': string;
142
+ bookTicker: string;
143
+ };
144
+ };
145
+ };
6
146
  requestId(url: any): any;
7
147
  stream(type: Str, subscriptionHash: Str, numSubscriptions?: number): string;
8
148
  watchLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
@@ -16,7 +16,11 @@ import { ed25519 } from '../static_dependencies/noble-curves/ed25519.js';
16
16
  // -----------------------------------------------------------------------------
17
17
  export default class binance extends binanceRest {
18
18
  describe() {
19
- return this.deepExtend(super.describe(), {
19
+ const superDescribe = super.describe();
20
+ return this.deepExtend(superDescribe, this.describeData());
21
+ }
22
+ describeData() {
23
+ return {
20
24
  'has': {
21
25
  'ws': true,
22
26
  'watchBalance': true,
@@ -158,7 +162,7 @@ export default class binance extends binanceRest {
158
162
  'bookTicker': 'bookTicker',
159
163
  },
160
164
  },
161
- });
165
+ };
162
166
  }
163
167
  requestId(url) {
164
168
  const options = this.safeDict(this.options, 'requestId', this.createSafeDictionary());
@@ -13,7 +13,8 @@ export default class binanceus extends binance {
13
13
  // eslint-disable-next-line new-cap
14
14
  const restInstance = new binanceusRest();
15
15
  const restDescribe = restInstance.describe();
16
- const extended = this.deepExtend(restDescribe, super.describe());
16
+ const parentWsDescribe = super.describeData();
17
+ const extended = this.deepExtend(restDescribe, parentWsDescribe);
17
18
  return this.deepExtend(extended, {
18
19
  'id': 'binanceus',
19
20
  'name': 'Binance US',
@@ -9,6 +9,7 @@ export default class hyperliquid extends hyperliquidRest {
9
9
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
10
10
  unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
11
11
  handleOrderBook(client: any, message: any): void;
12
+ watchTicker(symbol: string, params?: {}): Promise<Ticker>;
12
13
  watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
13
14
  unWatchTickers(symbols?: Strings, params?: {}): Promise<any>;
14
15
  watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -22,7 +22,7 @@ export default class hyperliquid extends hyperliquidRest {
22
22
  'watchOHLCV': true,
23
23
  'watchOrderBook': true,
24
24
  'watchOrders': true,
25
- 'watchTicker': false,
25
+ 'watchTicker': true,
26
26
  'watchTickers': true,
27
27
  'watchTrades': true,
28
28
  'watchTradesForSymbols': false,
@@ -238,6 +238,21 @@ export default class hyperliquid extends hyperliquidRest {
238
238
  const messageHash = 'orderbook:' + symbol;
239
239
  client.resolve(orderbook, messageHash);
240
240
  }
241
+ async watchTicker(symbol, params = {}) {
242
+ /**
243
+ * @method
244
+ * @name hyperliquid#watchTicker
245
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
246
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
247
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
248
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
249
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
250
+ */
251
+ const market = this.market(symbol);
252
+ symbol = market['symbol'];
253
+ const tickers = await this.watchTickers([symbol], params);
254
+ return tickers[symbol];
255
+ }
241
256
  async watchTickers(symbols = undefined, params = {}) {
242
257
  /**
243
258
  * @method
@@ -224,6 +224,7 @@ export default class paradex extends paradexRest {
224
224
  * @method
225
225
  * @name paradex#watchTickers
226
226
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
227
+ * @see https://docs.api.testnet.paradex.trade/#sub-markets_summary-operation
227
228
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
228
229
  * @param {object} [params] extra parameters specific to the exchange API endpoint
229
230
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -15,7 +15,7 @@ export declare class BigInteger {
15
15
  protected intValue(): number;
16
16
  protected byteValue(): number;
17
17
  protected shortValue(): number;
18
- protected signum(): 0 | 1 | -1;
18
+ protected signum(): 1 | 0 | -1;
19
19
  toByteArray(): number[];
20
20
  protected equals(a: BigInteger): boolean;
21
21
  protected min(a: BigInteger): BigInteger;
@@ -1,5 +1,5 @@
1
1
  import { Abi, FunctionAbi, RawArgs } from '../../../types/index.js';
2
2
  import { AbiParserInterface } from './interface.js';
3
3
  export declare function createAbiParser(abi: Abi): AbiParserInterface;
4
- export declare function getAbiVersion(abi: Abi): 0 | 1 | 2;
4
+ export declare function getAbiVersion(abi: Abi): 1 | 0 | 2;
5
5
  export declare function isNoConstructorValid(method: string, argsCalldata: RawArgs, abiMethod?: FunctionAbi): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
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",