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/README.md +3 -3
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +3 -3
- package/dist/cjs/src/binanceus.js +1 -0
- package/dist/cjs/src/bitget.js +47 -94
- package/dist/cjs/src/bybit.js +79 -6
- package/dist/cjs/src/lykke.js +2 -2
- package/dist/cjs/src/mexc.js +7 -1
- package/dist/cjs/src/paradex.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -2
- package/dist/cjs/src/pro/binanceus.js +2 -1
- package/dist/cjs/src/pro/hyperliquid.js +16 -1
- package/dist/cjs/src/pro/paradex.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/binance.js +3 -3
- package/js/src/binanceus.js +1 -0
- package/js/src/bitget.d.ts +0 -1
- package/js/src/bitget.js +47 -94
- package/js/src/bybit.js +79 -6
- package/js/src/lykke.js +2 -2
- package/js/src/mexc.js +7 -1
- package/js/src/paradex.js +1 -1
- package/js/src/pro/binance.d.ts +140 -0
- package/js/src/pro/binance.js +6 -2
- package/js/src/pro/binanceus.js +2 -1
- package/js/src/pro/hyperliquid.d.ts +1 -0
- package/js/src/pro/hyperliquid.js +16 -1
- package/js/src/pro/paradex.js +1 -0
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/js/src/static_dependencies/starknet/utils/calldata/parser/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -194,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
194
194
|
|
|
195
195
|
//-----------------------------------------------------------------------------
|
|
196
196
|
// this is updated by vss.js when building
|
|
197
|
-
const version = '4.4.
|
|
197
|
+
const version = '4.4.5';
|
|
198
198
|
Exchange["default"].ccxtVersion = version;
|
|
199
199
|
const exchanges = {
|
|
200
200
|
'ace': ace,
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -1199,6 +1199,7 @@ class binance extends binance$1 {
|
|
|
1199
1199
|
// exchange-specific options
|
|
1200
1200
|
'options': {
|
|
1201
1201
|
'sandboxMode': false,
|
|
1202
|
+
'fetchMargins': true,
|
|
1202
1203
|
'fetchMarkets': [
|
|
1203
1204
|
'spot',
|
|
1204
1205
|
'linear',
|
|
@@ -2872,13 +2873,12 @@ class binance extends binance$1 {
|
|
|
2872
2873
|
}
|
|
2873
2874
|
fetchMarkets.push(type);
|
|
2874
2875
|
}
|
|
2875
|
-
|
|
2876
|
+
const fetchMargins = this.safeBool(this.options, 'fetchMargins', false);
|
|
2876
2877
|
for (let i = 0; i < fetchMarkets.length; i++) {
|
|
2877
2878
|
const marketType = fetchMarkets[i];
|
|
2878
2879
|
if (marketType === 'spot') {
|
|
2879
2880
|
promisesRaw.push(this.publicGetExchangeInfo(params));
|
|
2880
|
-
if (this.checkRequiredCredentials(false) && !sandboxMode) {
|
|
2881
|
-
fetchMargins = true;
|
|
2881
|
+
if (fetchMargins && this.checkRequiredCredentials(false) && !sandboxMode) {
|
|
2882
2882
|
promisesRaw.push(this.sapiGetMarginAllPairs(params));
|
|
2883
2883
|
promisesRaw.push(this.sapiGetMarginIsolatedAllPairs(params));
|
|
2884
2884
|
}
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -1533,6 +1533,7 @@ class bitget extends bitget$1 {
|
|
|
1533
1533
|
* @description retrieves data on all markets for bitget
|
|
1534
1534
|
* @see https://www.bitget.com/api-doc/spot/market/Get-Symbols
|
|
1535
1535
|
* @see https://www.bitget.com/api-doc/contract/market/Get-All-Symbols-Contracts
|
|
1536
|
+
* @see https://www.bitget.com/api-doc/margin/common/support-currencies
|
|
1536
1537
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1537
1538
|
* @returns {object[]} an array of objects representing market data
|
|
1538
1539
|
*/
|
|
@@ -1541,10 +1542,11 @@ class bitget extends bitget$1 {
|
|
|
1541
1542
|
if (sandboxMode) {
|
|
1542
1543
|
types = ['swap'];
|
|
1543
1544
|
}
|
|
1544
|
-
|
|
1545
|
+
const promises = [];
|
|
1546
|
+
let fetchMargins = false;
|
|
1545
1547
|
for (let i = 0; i < types.length; i++) {
|
|
1546
1548
|
const type = types[i];
|
|
1547
|
-
if (type === 'swap') {
|
|
1549
|
+
if ((type === 'swap') || (type === 'future')) {
|
|
1548
1550
|
let subTypes = undefined;
|
|
1549
1551
|
if (sandboxMode) {
|
|
1550
1552
|
// the following are simulated trading markets [ 'SUSDT-FUTURES', 'SCOIN-FUTURES', 'SUSDC-FUTURES' ];
|
|
@@ -1554,19 +1556,41 @@ class bitget extends bitget$1 {
|
|
|
1554
1556
|
subTypes = ['USDT-FUTURES', 'COIN-FUTURES', 'USDC-FUTURES'];
|
|
1555
1557
|
}
|
|
1556
1558
|
for (let j = 0; j < subTypes.length; j++) {
|
|
1557
|
-
promises.push(this.
|
|
1559
|
+
promises.push(this.publicMixGetV2MixMarketContracts(this.extend(params, {
|
|
1558
1560
|
'productType': subTypes[j],
|
|
1559
1561
|
})));
|
|
1560
1562
|
}
|
|
1561
1563
|
}
|
|
1564
|
+
else if (type === 'spot') {
|
|
1565
|
+
promises.push(this.publicSpotGetV2SpotPublicSymbols(params));
|
|
1566
|
+
fetchMargins = true;
|
|
1567
|
+
promises.push(this.publicMarginGetV2MarginCurrencies(params));
|
|
1568
|
+
}
|
|
1569
|
+
else {
|
|
1570
|
+
throw new errors.NotSupported(this.id + ' does not support ' + type + ' market');
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
const results = await Promise.all(promises);
|
|
1574
|
+
let markets = [];
|
|
1575
|
+
this.options['crossMarginPairsData'] = [];
|
|
1576
|
+
this.options['isolatedMarginPairsData'] = [];
|
|
1577
|
+
for (let i = 0; i < results.length; i++) {
|
|
1578
|
+
const res = this.safeDict(results, i);
|
|
1579
|
+
const data = this.safeList(res, 'data', []);
|
|
1580
|
+
const firstData = this.safeDict(data, 0, {});
|
|
1581
|
+
const isBorrowable = this.safeString(firstData, 'isBorrowable');
|
|
1582
|
+
if (fetchMargins && isBorrowable !== undefined) {
|
|
1583
|
+
const keysList = Object.keys(this.indexBy(data, 'symbol'));
|
|
1584
|
+
this.options['crossMarginPairsData'] = keysList;
|
|
1585
|
+
this.options['isolatedMarginPairsData'] = keysList;
|
|
1586
|
+
}
|
|
1562
1587
|
else {
|
|
1563
|
-
|
|
1588
|
+
markets = this.arrayConcat(markets, data);
|
|
1564
1589
|
}
|
|
1565
1590
|
}
|
|
1566
|
-
|
|
1567
|
-
let
|
|
1568
|
-
|
|
1569
|
-
result = this.arrayConcat(result, promises[i]);
|
|
1591
|
+
const result = [];
|
|
1592
|
+
for (let i = 0; i < markets.length; i++) {
|
|
1593
|
+
result.push(this.parseMarket(markets[i]));
|
|
1570
1594
|
}
|
|
1571
1595
|
return result;
|
|
1572
1596
|
}
|
|
@@ -1658,11 +1682,20 @@ class bitget extends bitget$1 {
|
|
|
1658
1682
|
let expiry = undefined;
|
|
1659
1683
|
let expiryDatetime = undefined;
|
|
1660
1684
|
const symbolType = this.safeString(market, 'symbolType');
|
|
1685
|
+
let marginModes = undefined;
|
|
1686
|
+
let isMarginTradingAllowed = false;
|
|
1661
1687
|
if (symbolType === undefined) {
|
|
1662
1688
|
type = 'spot';
|
|
1663
1689
|
spot = true;
|
|
1664
1690
|
pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision')));
|
|
1665
1691
|
amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
|
|
1692
|
+
const hasCrossMargin = this.inArray(marketId, this.options['crossMarginPairsData']);
|
|
1693
|
+
const hasIsolatedMargin = this.inArray(marketId, this.options['isolatedMarginPairsData']);
|
|
1694
|
+
marginModes = {
|
|
1695
|
+
'cross': hasCrossMargin,
|
|
1696
|
+
'isolated': hasIsolatedMargin,
|
|
1697
|
+
};
|
|
1698
|
+
isMarginTradingAllowed = hasCrossMargin || hasCrossMargin;
|
|
1666
1699
|
}
|
|
1667
1700
|
else {
|
|
1668
1701
|
if (symbolType === 'perpetual') {
|
|
@@ -1701,6 +1734,10 @@ class bitget extends bitget$1 {
|
|
|
1701
1734
|
preciseAmount.reduce();
|
|
1702
1735
|
const amountString = preciseAmount.toString();
|
|
1703
1736
|
amountPrecision = this.parseNumber(amountString);
|
|
1737
|
+
marginModes = {
|
|
1738
|
+
'cross': true,
|
|
1739
|
+
'isolated': true,
|
|
1740
|
+
};
|
|
1704
1741
|
}
|
|
1705
1742
|
const status = this.safeString2(market, 'status', 'symbolStatus');
|
|
1706
1743
|
let active = undefined;
|
|
@@ -1723,7 +1760,8 @@ class bitget extends bitget$1 {
|
|
|
1723
1760
|
'settleId': settleId,
|
|
1724
1761
|
'type': type,
|
|
1725
1762
|
'spot': spot,
|
|
1726
|
-
'margin':
|
|
1763
|
+
'margin': spot && isMarginTradingAllowed,
|
|
1764
|
+
'marginModes': marginModes,
|
|
1727
1765
|
'swap': swap,
|
|
1728
1766
|
'future': future,
|
|
1729
1767
|
'option': false,
|
|
@@ -1764,91 +1802,6 @@ class bitget extends bitget$1 {
|
|
|
1764
1802
|
'info': market,
|
|
1765
1803
|
};
|
|
1766
1804
|
}
|
|
1767
|
-
async fetchMarketsByType(type, params = {}) {
|
|
1768
|
-
let response = undefined;
|
|
1769
|
-
if (type === 'spot') {
|
|
1770
|
-
response = await this.publicSpotGetV2SpotPublicSymbols(params);
|
|
1771
|
-
}
|
|
1772
|
-
else if ((type === 'swap') || (type === 'future')) {
|
|
1773
|
-
response = await this.publicMixGetV2MixMarketContracts(params);
|
|
1774
|
-
}
|
|
1775
|
-
else {
|
|
1776
|
-
throw new errors.NotSupported(this.id + ' does not support ' + type + ' market');
|
|
1777
|
-
}
|
|
1778
|
-
//
|
|
1779
|
-
// spot
|
|
1780
|
-
//
|
|
1781
|
-
// {
|
|
1782
|
-
// "code": "00000",
|
|
1783
|
-
// "msg": "success",
|
|
1784
|
-
// "requestTime": 1700102364653,
|
|
1785
|
-
// "data": [
|
|
1786
|
-
// {
|
|
1787
|
-
// "symbol": "TRXUSDT",
|
|
1788
|
-
// "baseCoin": "TRX",
|
|
1789
|
-
// "quoteCoin": "USDT",
|
|
1790
|
-
// "minTradeAmount": "0",
|
|
1791
|
-
// "maxTradeAmount": "10000000000",
|
|
1792
|
-
// "takerFeeRate": "0.002",
|
|
1793
|
-
// "makerFeeRate": "0.002",
|
|
1794
|
-
// "pricePrecision": "6",
|
|
1795
|
-
// "quantityPrecision": "4",
|
|
1796
|
-
// "quotePrecision": "6",
|
|
1797
|
-
// "status": "online",
|
|
1798
|
-
// "minTradeUSDT": "5",
|
|
1799
|
-
// "buyLimitPriceRatio": "0.05",
|
|
1800
|
-
// "sellLimitPriceRatio": "0.05"
|
|
1801
|
-
// },
|
|
1802
|
-
// ]
|
|
1803
|
-
// }
|
|
1804
|
-
//
|
|
1805
|
-
// swap and future
|
|
1806
|
-
//
|
|
1807
|
-
// {
|
|
1808
|
-
// "code": "00000",
|
|
1809
|
-
// "msg": "success",
|
|
1810
|
-
// "requestTime": 1700102364709,
|
|
1811
|
-
// "data": [
|
|
1812
|
-
// {
|
|
1813
|
-
// "symbol": "BTCUSDT",
|
|
1814
|
-
// "baseCoin": "BTC",
|
|
1815
|
-
// "quoteCoin": "USDT",
|
|
1816
|
-
// "buyLimitPriceRatio": "0.01",
|
|
1817
|
-
// "sellLimitPriceRatio": "0.01",
|
|
1818
|
-
// "feeRateUpRatio": "0.005",
|
|
1819
|
-
// "makerFeeRate": "0.0002",
|
|
1820
|
-
// "takerFeeRate": "0.0006",
|
|
1821
|
-
// "openCostUpRatio": "0.01",
|
|
1822
|
-
// "supportMarginCoins": ["USDT"],
|
|
1823
|
-
// "minTradeNum": "0.001",
|
|
1824
|
-
// "priceEndStep": "1",
|
|
1825
|
-
// "volumePlace": "3",
|
|
1826
|
-
// "pricePlace": "1",
|
|
1827
|
-
// "sizeMultiplier": "0.001",
|
|
1828
|
-
// "symbolType": "perpetual",
|
|
1829
|
-
// "minTradeUSDT": "5",
|
|
1830
|
-
// "maxSymbolOrderNum": "200",
|
|
1831
|
-
// "maxProductOrderNum": "400",
|
|
1832
|
-
// "maxPositionNum": "150",
|
|
1833
|
-
// "symbolStatus": "normal",
|
|
1834
|
-
// "offTime": "-1",
|
|
1835
|
-
// "limitOpenTime": "-1",
|
|
1836
|
-
// "deliveryTime": "",
|
|
1837
|
-
// "deliveryStartTime": "",
|
|
1838
|
-
// "deliveryPeriod": "",
|
|
1839
|
-
// "launchTime": "",
|
|
1840
|
-
// "fundInterval": "8",
|
|
1841
|
-
// "minLever": "1",
|
|
1842
|
-
// "maxLever": "125",
|
|
1843
|
-
// "posLimit": "0.05",
|
|
1844
|
-
// "maintainTime": ""
|
|
1845
|
-
// },
|
|
1846
|
-
// ]
|
|
1847
|
-
// }
|
|
1848
|
-
//
|
|
1849
|
-
const data = this.safeValue(response, 'data', []);
|
|
1850
|
-
return this.parseMarkets(data);
|
|
1851
|
-
}
|
|
1852
1805
|
async fetchCurrencies(params = {}) {
|
|
1853
1806
|
/**
|
|
1854
1807
|
* @method
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -98,7 +98,7 @@ class bybit extends bybit$1 {
|
|
|
98
98
|
'fetchOpenOrders': true,
|
|
99
99
|
'fetchOption': true,
|
|
100
100
|
'fetchOptionChain': true,
|
|
101
|
-
'fetchOrder':
|
|
101
|
+
'fetchOrder': true,
|
|
102
102
|
'fetchOrderBook': true,
|
|
103
103
|
'fetchOrders': false,
|
|
104
104
|
'fetchOrderTrades': true,
|
|
@@ -4873,14 +4873,87 @@ class bybit extends bybit$1 {
|
|
|
4873
4873
|
* @param {string} id the order id
|
|
4874
4874
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
4875
4875
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4876
|
+
* @param {object} [params.acknowledged] to suppress the warning, set to true
|
|
4876
4877
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4877
4878
|
*/
|
|
4878
|
-
|
|
4879
|
-
const enableUnifiedAccount = this.
|
|
4880
|
-
|
|
4881
|
-
|
|
4879
|
+
await this.loadMarkets();
|
|
4880
|
+
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4881
|
+
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
4882
|
+
if (!isUnifiedAccount) {
|
|
4883
|
+
return await this.fetchOrderClassic(id, symbol, params);
|
|
4884
|
+
}
|
|
4885
|
+
let acknowledge = false;
|
|
4886
|
+
[acknowledge, params] = this.handleOptionAndParams(params, 'fetchOrder', 'acknowledged');
|
|
4887
|
+
if (!acknowledge) {
|
|
4888
|
+
throw new errors.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');
|
|
4882
4889
|
}
|
|
4883
|
-
|
|
4890
|
+
const market = this.market(symbol);
|
|
4891
|
+
let marketType = undefined;
|
|
4892
|
+
[marketType, params] = this.getBybitType('fetchOrder', market, params);
|
|
4893
|
+
const request = {
|
|
4894
|
+
'symbol': market['id'],
|
|
4895
|
+
'orderId': id,
|
|
4896
|
+
'category': marketType,
|
|
4897
|
+
};
|
|
4898
|
+
let isTrigger = undefined;
|
|
4899
|
+
[isTrigger, params] = this.handleParamBool2(params, 'trigger', 'stop', false);
|
|
4900
|
+
if (isTrigger) {
|
|
4901
|
+
request['orderFilter'] = 'StopOrder';
|
|
4902
|
+
}
|
|
4903
|
+
const response = await this.privateGetV5OrderRealtime(this.extend(request, params));
|
|
4904
|
+
//
|
|
4905
|
+
// {
|
|
4906
|
+
// "retCode": 0,
|
|
4907
|
+
// "retMsg": "OK",
|
|
4908
|
+
// "result": {
|
|
4909
|
+
// "nextPageCursor": "1321052653536515584%3A1672217748287%2C1321052653536515584%3A1672217748287",
|
|
4910
|
+
// "category": "spot",
|
|
4911
|
+
// "list": [
|
|
4912
|
+
// {
|
|
4913
|
+
// "symbol": "ETHUSDT",
|
|
4914
|
+
// "orderType": "Limit",
|
|
4915
|
+
// "orderLinkId": "1672217748277652",
|
|
4916
|
+
// "orderId": "1321052653536515584",
|
|
4917
|
+
// "cancelType": "UNKNOWN",
|
|
4918
|
+
// "avgPrice": "",
|
|
4919
|
+
// "stopOrderType": "tpslOrder",
|
|
4920
|
+
// "lastPriceOnCreated": "",
|
|
4921
|
+
// "orderStatus": "Cancelled",
|
|
4922
|
+
// "takeProfit": "",
|
|
4923
|
+
// "cumExecValue": "0",
|
|
4924
|
+
// "triggerDirection": 0,
|
|
4925
|
+
// "isLeverage": "0",
|
|
4926
|
+
// "rejectReason": "",
|
|
4927
|
+
// "price": "1000",
|
|
4928
|
+
// "orderIv": "",
|
|
4929
|
+
// "createdTime": "1672217748287",
|
|
4930
|
+
// "tpTriggerBy": "",
|
|
4931
|
+
// "positionIdx": 0,
|
|
4932
|
+
// "timeInForce": "GTC",
|
|
4933
|
+
// "leavesValue": "500",
|
|
4934
|
+
// "updatedTime": "1672217748287",
|
|
4935
|
+
// "side": "Buy",
|
|
4936
|
+
// "triggerPrice": "1500",
|
|
4937
|
+
// "cumExecFee": "0",
|
|
4938
|
+
// "leavesQty": "0",
|
|
4939
|
+
// "slTriggerBy": "",
|
|
4940
|
+
// "closeOnTrigger": false,
|
|
4941
|
+
// "cumExecQty": "0",
|
|
4942
|
+
// "reduceOnly": false,
|
|
4943
|
+
// "qty": "0.5",
|
|
4944
|
+
// "stopLoss": "",
|
|
4945
|
+
// "triggerBy": "1192.5"
|
|
4946
|
+
// }
|
|
4947
|
+
// ]
|
|
4948
|
+
// },
|
|
4949
|
+
// "retExtInfo": {},
|
|
4950
|
+
// "time": 1672219526294
|
|
4951
|
+
// }
|
|
4952
|
+
//
|
|
4953
|
+
const result = this.safeDict(response, 'result', {});
|
|
4954
|
+
const innerList = this.safeList(result, 'list', []);
|
|
4955
|
+
const order = this.safeDict(innerList, 0, {});
|
|
4956
|
+
return this.parseOrder(order, market);
|
|
4884
4957
|
}
|
|
4885
4958
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4886
4959
|
const res = await this.isUnifiedEnabled();
|
package/dist/cjs/src/lykke.js
CHANGED
|
@@ -678,9 +678,9 @@ class lykke extends lykke$1 {
|
|
|
678
678
|
const currencyId = this.safeString(balance, 'assetId');
|
|
679
679
|
const code = this.safeCurrencyCode(currencyId);
|
|
680
680
|
const account = this.account();
|
|
681
|
-
const
|
|
681
|
+
const total = this.safeString(balance, 'available');
|
|
682
682
|
const used = this.safeString(balance, 'reserved');
|
|
683
|
-
account['
|
|
683
|
+
account['total'] = total;
|
|
684
684
|
account['used'] = used;
|
|
685
685
|
result[code] = account;
|
|
686
686
|
}
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -89,7 +89,7 @@ class mexc extends mexc$1 {
|
|
|
89
89
|
'fetchOrderBooks': undefined,
|
|
90
90
|
'fetchOrders': true,
|
|
91
91
|
'fetchOrderTrades': true,
|
|
92
|
-
'fetchPosition':
|
|
92
|
+
'fetchPosition': 'emulated',
|
|
93
93
|
'fetchPositionHistory': 'emulated',
|
|
94
94
|
'fetchPositionMode': true,
|
|
95
95
|
'fetchPositions': true,
|
|
@@ -2914,6 +2914,9 @@ class mexc extends mexc$1 {
|
|
|
2914
2914
|
* @method
|
|
2915
2915
|
* @name mexc#cancelOrder
|
|
2916
2916
|
* @description cancels an open order
|
|
2917
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
|
|
2918
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
2919
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
|
|
2917
2920
|
* @param {string} id order id
|
|
2918
2921
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2919
2922
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -3030,6 +3033,7 @@ class mexc extends mexc$1 {
|
|
|
3030
3033
|
* @method
|
|
3031
3034
|
* @name mexc#cancelOrders
|
|
3032
3035
|
* @description cancel multiple orders
|
|
3036
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
3033
3037
|
* @param {string[]} ids order ids
|
|
3034
3038
|
* @param {string} symbol unified market symbol, default is undefined
|
|
3035
3039
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -4763,6 +4767,7 @@ class mexc extends mexc$1 {
|
|
|
4763
4767
|
* @method
|
|
4764
4768
|
* @name mexc#fetchPosition
|
|
4765
4769
|
* @description fetch data on a single open contract trade position
|
|
4770
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4766
4771
|
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
4767
4772
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4768
4773
|
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
@@ -4780,6 +4785,7 @@ class mexc extends mexc$1 {
|
|
|
4780
4785
|
* @method
|
|
4781
4786
|
* @name mexc#fetchPositions
|
|
4782
4787
|
* @description fetch all open positions
|
|
4788
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4783
4789
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4784
4790
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4785
4791
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
package/dist/cjs/src/paradex.js
CHANGED
|
@@ -657,7 +657,7 @@ class paradex extends paradex$1 {
|
|
|
657
657
|
'low': undefined,
|
|
658
658
|
'bid': this.safeString(ticker, 'bid'),
|
|
659
659
|
'bidVolume': undefined,
|
|
660
|
-
'ask': this.safeString(ticker, '
|
|
660
|
+
'ask': this.safeString(ticker, 'ask'),
|
|
661
661
|
'askVolume': undefined,
|
|
662
662
|
'vwap': undefined,
|
|
663
663
|
'open': undefined,
|
|
@@ -13,7 +13,11 @@ var ed25519 = require('../static_dependencies/noble-curves/ed25519.js');
|
|
|
13
13
|
// -----------------------------------------------------------------------------
|
|
14
14
|
class binance extends binance$1 {
|
|
15
15
|
describe() {
|
|
16
|
-
|
|
16
|
+
const superDescribe = super.describe();
|
|
17
|
+
return this.deepExtend(superDescribe, this.describeData());
|
|
18
|
+
}
|
|
19
|
+
describeData() {
|
|
20
|
+
return {
|
|
17
21
|
'has': {
|
|
18
22
|
'ws': true,
|
|
19
23
|
'watchBalance': true,
|
|
@@ -155,7 +159,7 @@ class binance extends binance$1 {
|
|
|
155
159
|
'bookTicker': 'bookTicker',
|
|
156
160
|
},
|
|
157
161
|
},
|
|
158
|
-
}
|
|
162
|
+
};
|
|
159
163
|
}
|
|
160
164
|
requestId(url) {
|
|
161
165
|
const options = this.safeDict(this.options, 'requestId', this.createSafeDictionary());
|
|
@@ -10,7 +10,8 @@ class binanceus extends binance {
|
|
|
10
10
|
// eslint-disable-next-line new-cap
|
|
11
11
|
const restInstance = new binanceus$1();
|
|
12
12
|
const restDescribe = restInstance.describe();
|
|
13
|
-
const
|
|
13
|
+
const parentWsDescribe = super.describeData();
|
|
14
|
+
const extended = this.deepExtend(restDescribe, parentWsDescribe);
|
|
14
15
|
return this.deepExtend(extended, {
|
|
15
16
|
'id': 'binanceus',
|
|
16
17
|
'name': 'Binance US',
|
|
@@ -19,7 +19,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
19
19
|
'watchOHLCV': true,
|
|
20
20
|
'watchOrderBook': true,
|
|
21
21
|
'watchOrders': true,
|
|
22
|
-
'watchTicker':
|
|
22
|
+
'watchTicker': true,
|
|
23
23
|
'watchTickers': true,
|
|
24
24
|
'watchTrades': true,
|
|
25
25
|
'watchTradesForSymbols': false,
|
|
@@ -235,6 +235,21 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
235
235
|
const messageHash = 'orderbook:' + symbol;
|
|
236
236
|
client.resolve(orderbook, messageHash);
|
|
237
237
|
}
|
|
238
|
+
async watchTicker(symbol, params = {}) {
|
|
239
|
+
/**
|
|
240
|
+
* @method
|
|
241
|
+
* @name hyperliquid#watchTicker
|
|
242
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
|
|
243
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
244
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
245
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
246
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
247
|
+
*/
|
|
248
|
+
const market = this.market(symbol);
|
|
249
|
+
symbol = market['symbol'];
|
|
250
|
+
const tickers = await this.watchTickers([symbol], params);
|
|
251
|
+
return tickers[symbol];
|
|
252
|
+
}
|
|
238
253
|
async watchTickers(symbols = undefined, params = {}) {
|
|
239
254
|
/**
|
|
240
255
|
* @method
|
|
@@ -221,6 +221,7 @@ class paradex extends paradex$1 {
|
|
|
221
221
|
* @method
|
|
222
222
|
* @name paradex#watchTickers
|
|
223
223
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
224
|
+
* @see https://docs.api.testnet.paradex.trade/#sub-markets_summary-operation
|
|
224
225
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
225
226
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
226
227
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.4.
|
|
7
|
+
declare const version = "4.4.4";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.4.
|
|
41
|
+
const version = '4.4.5';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
package/js/src/binance.js
CHANGED
|
@@ -1202,6 +1202,7 @@ export default class binance extends Exchange {
|
|
|
1202
1202
|
// exchange-specific options
|
|
1203
1203
|
'options': {
|
|
1204
1204
|
'sandboxMode': false,
|
|
1205
|
+
'fetchMargins': true,
|
|
1205
1206
|
'fetchMarkets': [
|
|
1206
1207
|
'spot',
|
|
1207
1208
|
'linear',
|
|
@@ -2875,13 +2876,12 @@ export default class binance extends Exchange {
|
|
|
2875
2876
|
}
|
|
2876
2877
|
fetchMarkets.push(type);
|
|
2877
2878
|
}
|
|
2878
|
-
|
|
2879
|
+
const fetchMargins = this.safeBool(this.options, 'fetchMargins', false);
|
|
2879
2880
|
for (let i = 0; i < fetchMarkets.length; i++) {
|
|
2880
2881
|
const marketType = fetchMarkets[i];
|
|
2881
2882
|
if (marketType === 'spot') {
|
|
2882
2883
|
promisesRaw.push(this.publicGetExchangeInfo(params));
|
|
2883
|
-
if (this.checkRequiredCredentials(false) && !sandboxMode) {
|
|
2884
|
-
fetchMargins = true;
|
|
2884
|
+
if (fetchMargins && this.checkRequiredCredentials(false) && !sandboxMode) {
|
|
2885
2885
|
promisesRaw.push(this.sapiGetMarginAllPairs(params));
|
|
2886
2886
|
promisesRaw.push(this.sapiGetMarginIsolatedAllPairs(params));
|
|
2887
2887
|
}
|
package/js/src/binanceus.js
CHANGED
package/js/src/bitget.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export default class bitget extends Exchange {
|
|
|
12
12
|
fetchTime(params?: {}): Promise<number>;
|
|
13
13
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
14
14
|
parseMarket(market: Dict): Market;
|
|
15
|
-
fetchMarketsByType(type: any, params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
|
|
16
15
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
17
16
|
fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<LeverageTier[]>;
|
|
18
17
|
parseMarketLeverageTiers(info: any, market?: Market): LeverageTier[];
|