ccxt 4.2.78 → 4.2.80
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 +5 -5
- package/dist/ccxt.browser.js +517 -79
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +35 -3
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bingx.js +39 -5
- package/dist/cjs/src/bitstamp.js +21 -26
- package/dist/cjs/src/bybit.js +101 -0
- package/dist/cjs/src/coinbaseinternational.js +2 -2
- package/dist/cjs/src/deribit.js +155 -0
- package/dist/cjs/src/gate.js +15 -4
- package/dist/cjs/src/hyperliquid.js +54 -10
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/binance.js +5 -5
- package/dist/cjs/src/pro/bitfinex2.js +1 -1
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitopro.js +2 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +16 -1
- package/dist/cjs/src/pro/cex.js +9 -5
- package/dist/cjs/src/pro/cryptocom.js +1 -1
- package/dist/cjs/src/pro/gemini.js +3 -2
- package/dist/cjs/src/pro/hitbtc.js +1 -1
- package/dist/cjs/src/pro/htx.js +1 -1
- package/dist/cjs/src/pro/okcoin.js +1 -1
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/phemex.js +7 -2
- package/dist/cjs/src/pro/woo.js +38 -0
- package/dist/cjs/src/upbit.js +2 -0
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/gate.d.ts +1 -0
- package/js/src/abstract/gateio.d.ts +1 -0
- package/js/src/abstract/upbit.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +14 -5
- package/js/src/base/Exchange.js +35 -3
- package/js/src/base/types.d.ts +21 -0
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +1 -1
- package/js/src/bingx.js +39 -5
- package/js/src/bitstamp.js +21 -26
- package/js/src/bybit.d.ts +12 -1
- package/js/src/bybit.js +101 -0
- package/js/src/coinbaseinternational.js +2 -2
- package/js/src/deribit.d.ts +22 -1
- package/js/src/deribit.js +155 -0
- package/js/src/gate.js +15 -4
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +54 -10
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/binance.js +5 -5
- package/js/src/pro/bitfinex2.js +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitmart.js +1 -1
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitopro.js +2 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +16 -1
- package/js/src/pro/cex.js +9 -5
- package/js/src/pro/cryptocom.js +1 -1
- package/js/src/pro/gemini.d.ts +2 -2
- package/js/src/pro/gemini.js +3 -2
- package/js/src/pro/hitbtc.js +1 -1
- package/js/src/pro/htx.js +1 -1
- package/js/src/pro/okcoin.js +1 -1
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/phemex.js +7 -2
- package/js/src/pro/woo.js +38 -0
- package/js/src/upbit.js +2 -0
- package/package.json +1 -1
- package/skip-tests.json +7 -2
|
@@ -768,6 +768,8 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
768
768
|
*/
|
|
769
769
|
await this.loadMarkets();
|
|
770
770
|
const market = this.market(symbol);
|
|
771
|
+
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
772
|
+
params = this.omit(params, 'vaultAddress');
|
|
771
773
|
symbol = market['symbol'];
|
|
772
774
|
const order = {
|
|
773
775
|
'symbol': symbol,
|
|
@@ -777,7 +779,11 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
777
779
|
'price': price,
|
|
778
780
|
'params': params,
|
|
779
781
|
};
|
|
780
|
-
const
|
|
782
|
+
const globalParams = {};
|
|
783
|
+
if (vaultAddress !== undefined) {
|
|
784
|
+
globalParams['vaultAddress'] = vaultAddress;
|
|
785
|
+
}
|
|
786
|
+
const response = await this.createOrders([order], globalParams);
|
|
781
787
|
const first = this.safeDict(response, 0);
|
|
782
788
|
return first;
|
|
783
789
|
}
|
|
@@ -828,7 +834,6 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
828
834
|
const amount = this.safeString(rawOrder, 'amount');
|
|
829
835
|
const price = this.safeString(rawOrder, 'price');
|
|
830
836
|
let orderParams = this.safeDict(rawOrder, 'params', {});
|
|
831
|
-
orderParams = this.extend(params, orderParams);
|
|
832
837
|
const clientOrderId = this.safeString2(orderParams, 'clientOrderId', 'client_id');
|
|
833
838
|
const slippage = this.safeString(orderParams, 'slippage', defaultSlippage);
|
|
834
839
|
let defaultTimeInForce = (isMarket) ? 'ioc' : 'gtc';
|
|
@@ -876,6 +881,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
876
881
|
'tif': timeInForce,
|
|
877
882
|
};
|
|
878
883
|
}
|
|
884
|
+
orderParams = this.omit(orderParams, ['clientOrderId', 'slippage', 'triggerPrice', 'stopPrice', 'stopLossPrice', 'takeProfitPrice', 'timeInForce', 'client_id']);
|
|
879
885
|
const orderObj = {
|
|
880
886
|
'a': this.parseToInt(market['baseId']),
|
|
881
887
|
'b': isBuy,
|
|
@@ -888,9 +894,9 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
888
894
|
if (clientOrderId !== undefined) {
|
|
889
895
|
orderObj['c'] = clientOrderId;
|
|
890
896
|
}
|
|
891
|
-
orderReq.push(orderObj);
|
|
897
|
+
orderReq.push(this.extend(orderObj, orderParams));
|
|
892
898
|
}
|
|
893
|
-
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
899
|
+
const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
|
|
894
900
|
const orderAction = {
|
|
895
901
|
'type': 'order',
|
|
896
902
|
'orders': orderReq,
|
|
@@ -907,6 +913,10 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
907
913
|
'signature': signature,
|
|
908
914
|
// 'vaultAddress': vaultAddress,
|
|
909
915
|
};
|
|
916
|
+
if (vaultAddress !== undefined) {
|
|
917
|
+
params = this.omit(params, 'vaultAddress');
|
|
918
|
+
request['vaultAddress'] = vaultAddress;
|
|
919
|
+
}
|
|
910
920
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
911
921
|
//
|
|
912
922
|
// {
|
|
@@ -999,10 +1009,14 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
999
1009
|
}
|
|
1000
1010
|
}
|
|
1001
1011
|
cancelAction['cancels'] = cancelReq;
|
|
1002
|
-
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
1012
|
+
const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
|
|
1003
1013
|
const signature = this.signL1Action(cancelAction, nonce, vaultAddress);
|
|
1004
1014
|
request['action'] = cancelAction;
|
|
1005
1015
|
request['signature'] = signature;
|
|
1016
|
+
if (vaultAddress !== undefined) {
|
|
1017
|
+
params = this.omit(params, 'vaultAddress');
|
|
1018
|
+
request['vaultAddress'] = vaultAddress;
|
|
1019
|
+
}
|
|
1006
1020
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
1007
1021
|
//
|
|
1008
1022
|
// {
|
|
@@ -1120,7 +1134,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1120
1134
|
'type': 'batchModify',
|
|
1121
1135
|
'modifies': [modifyReq],
|
|
1122
1136
|
};
|
|
1123
|
-
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
1137
|
+
const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
|
|
1124
1138
|
const signature = this.signL1Action(modifyAction, nonce, vaultAddress);
|
|
1125
1139
|
const request = {
|
|
1126
1140
|
'action': modifyAction,
|
|
@@ -1128,6 +1142,10 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1128
1142
|
'signature': signature,
|
|
1129
1143
|
// 'vaultAddress': vaultAddress,
|
|
1130
1144
|
};
|
|
1145
|
+
if (vaultAddress !== undefined) {
|
|
1146
|
+
params = this.omit(params, 'vaultAddress');
|
|
1147
|
+
request['vaultAddress'] = vaultAddress;
|
|
1148
|
+
}
|
|
1131
1149
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
1132
1150
|
//
|
|
1133
1151
|
// {
|
|
@@ -1726,7 +1744,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1726
1744
|
'isolated': isIsolated,
|
|
1727
1745
|
'hedged': undefined,
|
|
1728
1746
|
'side': side,
|
|
1729
|
-
'contracts': this.
|
|
1747
|
+
'contracts': this.safeNumber(entry, 'szi'),
|
|
1730
1748
|
'contractSize': undefined,
|
|
1731
1749
|
'entryPrice': this.safeNumber(entry, 'entryPx'),
|
|
1732
1750
|
'markPrice': undefined,
|
|
@@ -1773,7 +1791,13 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1773
1791
|
'isCross': isCross,
|
|
1774
1792
|
'leverage': leverage,
|
|
1775
1793
|
};
|
|
1776
|
-
|
|
1794
|
+
let vaultAddress = this.safeString(params, 'vaultAddress');
|
|
1795
|
+
if (vaultAddress !== undefined) {
|
|
1796
|
+
params = this.omit(params, 'vaultAddress');
|
|
1797
|
+
if (vaultAddress.startsWith('0x')) {
|
|
1798
|
+
vaultAddress = vaultAddress.replace('0x', '');
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1777
1801
|
const signature = this.signL1Action(updateAction, nonce, vaultAddress);
|
|
1778
1802
|
const request = {
|
|
1779
1803
|
'action': updateAction,
|
|
@@ -1781,6 +1805,9 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1781
1805
|
'signature': signature,
|
|
1782
1806
|
// 'vaultAddress': vaultAddress,
|
|
1783
1807
|
};
|
|
1808
|
+
if (vaultAddress !== undefined) {
|
|
1809
|
+
request['vaultAddress'] = vaultAddress;
|
|
1810
|
+
}
|
|
1784
1811
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
1785
1812
|
//
|
|
1786
1813
|
// {
|
|
@@ -1819,7 +1846,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1819
1846
|
'isCross': isCross,
|
|
1820
1847
|
'leverage': leverage,
|
|
1821
1848
|
};
|
|
1822
|
-
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
1849
|
+
const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
|
|
1823
1850
|
const signature = this.signL1Action(updateAction, nonce, vaultAddress);
|
|
1824
1851
|
const request = {
|
|
1825
1852
|
'action': updateAction,
|
|
@@ -1827,6 +1854,10 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1827
1854
|
'signature': signature,
|
|
1828
1855
|
// 'vaultAddress': vaultAddress,
|
|
1829
1856
|
};
|
|
1857
|
+
if (vaultAddress !== undefined) {
|
|
1858
|
+
params = this.omit(params, 'vaultAddress');
|
|
1859
|
+
request['vaultAddress'] = vaultAddress;
|
|
1860
|
+
}
|
|
1830
1861
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
1831
1862
|
//
|
|
1832
1863
|
// {
|
|
@@ -1879,7 +1910,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1879
1910
|
'isBuy': true,
|
|
1880
1911
|
'ntli': sz,
|
|
1881
1912
|
};
|
|
1882
|
-
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
1913
|
+
const vaultAddress = this.formatVaultAddress(this.safeString(params, 'vaultAddress'));
|
|
1883
1914
|
const signature = this.signL1Action(updateAction, nonce, vaultAddress);
|
|
1884
1915
|
const request = {
|
|
1885
1916
|
'action': updateAction,
|
|
@@ -1887,6 +1918,10 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1887
1918
|
'signature': signature,
|
|
1888
1919
|
// 'vaultAddress': vaultAddress,
|
|
1889
1920
|
};
|
|
1921
|
+
if (vaultAddress !== undefined) {
|
|
1922
|
+
params = this.omit(params, 'vaultAddress');
|
|
1923
|
+
request['vaultAddress'] = vaultAddress;
|
|
1924
|
+
}
|
|
1890
1925
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
1891
1926
|
//
|
|
1892
1927
|
// {
|
|
@@ -1985,6 +2020,15 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1985
2020
|
const response = await this.privatePostExchange(this.extend(request, params));
|
|
1986
2021
|
return response;
|
|
1987
2022
|
}
|
|
2023
|
+
formatVaultAddress(address = undefined) {
|
|
2024
|
+
if (address === undefined) {
|
|
2025
|
+
return undefined;
|
|
2026
|
+
}
|
|
2027
|
+
if (address.startsWith('0x')) {
|
|
2028
|
+
return address.replace('0x', '');
|
|
2029
|
+
}
|
|
2030
|
+
return address;
|
|
2031
|
+
}
|
|
1988
2032
|
handlePublicAddress(methodName, params) {
|
|
1989
2033
|
let userAux = undefined;
|
|
1990
2034
|
[userAux, params] = this.handleOptionAndParams(params, methodName, 'user');
|
|
@@ -84,7 +84,7 @@ class binance extends binance$1 {
|
|
|
84
84
|
'future': 200,
|
|
85
85
|
'delivery': 200,
|
|
86
86
|
},
|
|
87
|
-
'streamBySubscriptionsHash':
|
|
87
|
+
'streamBySubscriptionsHash': this.createSafeDictionary(),
|
|
88
88
|
'streamIndex': -1,
|
|
89
89
|
// get updates every 1000ms or 100ms
|
|
90
90
|
// or every 0ms in real-time for futures
|
|
@@ -92,7 +92,7 @@ class binance extends binance$1 {
|
|
|
92
92
|
'tradesLimit': 1000,
|
|
93
93
|
'ordersLimit': 1000,
|
|
94
94
|
'OHLCVLimit': 1000,
|
|
95
|
-
'requestId':
|
|
95
|
+
'requestId': this.createSafeDictionary(),
|
|
96
96
|
'watchOrderBookLimit': 1000,
|
|
97
97
|
'watchTrades': {
|
|
98
98
|
'name': 'trade', // 'trade' or 'aggTrade'
|
|
@@ -126,14 +126,14 @@ class binance extends binance$1 {
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
requestId(url) {
|
|
129
|
-
const options = this.
|
|
129
|
+
const options = this.safeDict(this.options, 'requestId', this.createSafeDictionary());
|
|
130
130
|
const previousValue = this.safeInteger(options, url, 0);
|
|
131
131
|
const newValue = this.sum(previousValue, 1);
|
|
132
132
|
this.options['requestId'][url] = newValue;
|
|
133
133
|
return newValue;
|
|
134
134
|
}
|
|
135
135
|
stream(type, subscriptionHash, numSubscriptions = 1) {
|
|
136
|
-
const streamBySubscriptionsHash = this.
|
|
136
|
+
const streamBySubscriptionsHash = this.safeDict(this.options, 'streamBySubscriptionsHash', this.createSafeDictionary());
|
|
137
137
|
let stream = this.safeString(streamBySubscriptionsHash, subscriptionHash);
|
|
138
138
|
if (stream === undefined) {
|
|
139
139
|
let streamIndex = this.safeInteger(this.options, 'streamIndex', -1);
|
|
@@ -146,7 +146,7 @@ class binance extends binance$1 {
|
|
|
146
146
|
this.options['streamBySubscriptionsHash'][subscriptionHash] = stream;
|
|
147
147
|
const subscriptionsByStreams = this.safeValue(this.options, 'numSubscriptionsByStream');
|
|
148
148
|
if (subscriptionsByStreams === undefined) {
|
|
149
|
-
this.options['numSubscriptionsByStream'] =
|
|
149
|
+
this.options['numSubscriptionsByStream'] = this.createSafeDictionary();
|
|
150
150
|
}
|
|
151
151
|
const subscriptionsByStream = this.safeInteger(this.options['numSubscriptionsByStream'], stream, 0);
|
|
152
152
|
const newNumSubscriptions = subscriptionsByStream + numSubscriptions;
|
|
@@ -861,7 +861,7 @@ class bitfinex2 extends bitfinex2$1 {
|
|
|
861
861
|
const message = this.extend(request, params);
|
|
862
862
|
this.watch(url, messageHash, message, messageHash);
|
|
863
863
|
}
|
|
864
|
-
return future;
|
|
864
|
+
return await future;
|
|
865
865
|
}
|
|
866
866
|
handleAuthenticationMessage(client, message) {
|
|
867
867
|
const messageHash = 'authenticated';
|
|
@@ -1607,7 +1607,7 @@ class bitget extends bitget$1 {
|
|
|
1607
1607
|
const message = this.extend(request, params);
|
|
1608
1608
|
this.watch(url, messageHash, message, messageHash);
|
|
1609
1609
|
}
|
|
1610
|
-
return future;
|
|
1610
|
+
return await future;
|
|
1611
1611
|
}
|
|
1612
1612
|
async watchPrivate(messageHash, subscriptionHash, args, params = {}) {
|
|
1613
1613
|
await this.authenticate();
|
|
@@ -1406,7 +1406,7 @@ class bitmart extends bitmart$1 {
|
|
|
1406
1406
|
const message = this.extend(request, params);
|
|
1407
1407
|
this.watch(url, messageHash, message, messageHash);
|
|
1408
1408
|
}
|
|
1409
|
-
return future;
|
|
1409
|
+
return await future;
|
|
1410
1410
|
}
|
|
1411
1411
|
handleSubscriptionStatus(client, message) {
|
|
1412
1412
|
//
|
|
@@ -607,7 +607,7 @@ class bitmex extends bitmex$1 {
|
|
|
607
607
|
const message = this.extend(request, params);
|
|
608
608
|
this.watch(url, messageHash, message, messageHash);
|
|
609
609
|
}
|
|
610
|
-
return future;
|
|
610
|
+
return await future;
|
|
611
611
|
}
|
|
612
612
|
handleAuthenticationMessage(client, message) {
|
|
613
613
|
const authenticated = this.safeBool(message, 'success', false);
|
|
@@ -385,7 +385,8 @@ class bitopro extends bitopro$1 {
|
|
|
385
385
|
},
|
|
386
386
|
},
|
|
387
387
|
};
|
|
388
|
-
this.options = this.extend(defaultOptions, this.options);
|
|
388
|
+
// this.options = this.extend (defaultOptions, this.options);
|
|
389
|
+
this.extendExchangeOptions(defaultOptions);
|
|
389
390
|
const originalHeaders = this.options['ws']['options']['headers'];
|
|
390
391
|
const headers = {
|
|
391
392
|
'X-BITOPRO-API': 'ccxt',
|
|
@@ -1037,8 +1037,23 @@ class bybit extends bybit$1 {
|
|
|
1037
1037
|
for (let i = 0; i < rawPositions.length; i++) {
|
|
1038
1038
|
const rawPosition = rawPositions[i];
|
|
1039
1039
|
const position = this.parsePosition(rawPosition);
|
|
1040
|
+
const side = this.safeString(position, 'side');
|
|
1041
|
+
// hacky solution to handle closing positions
|
|
1042
|
+
// without crashing, we should handle this properly later
|
|
1040
1043
|
newPositions.push(position);
|
|
1041
|
-
|
|
1044
|
+
if (side === undefined || side === '') {
|
|
1045
|
+
// closing update, adding both sides to "reset" both sides
|
|
1046
|
+
// since we don't know which side is being closed
|
|
1047
|
+
position['side'] = 'long';
|
|
1048
|
+
cache.append(position);
|
|
1049
|
+
position['side'] = 'short';
|
|
1050
|
+
cache.append(position);
|
|
1051
|
+
position['side'] = undefined;
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
// regular update
|
|
1055
|
+
cache.append(position);
|
|
1056
|
+
}
|
|
1042
1057
|
}
|
|
1043
1058
|
const messageHashes = this.findMessageHashes(client, 'positions::');
|
|
1044
1059
|
for (let i = 0; i < messageHashes.length; i++) {
|
package/dist/cjs/src/pro/cex.js
CHANGED
|
@@ -157,16 +157,20 @@ class cex extends cex$1 {
|
|
|
157
157
|
// {
|
|
158
158
|
// "e": "history",
|
|
159
159
|
// "data": [
|
|
160
|
-
//
|
|
161
|
-
//
|
|
160
|
+
// 'buy:1710255706095:444444:71222.2:14892622'
|
|
161
|
+
// 'sell:1710255658251:42530:71300:14892621'
|
|
162
|
+
// 'buy:1710252424241:87913:72800:14892620'
|
|
163
|
+
// ... timestamp descending
|
|
162
164
|
// ]
|
|
163
165
|
// }
|
|
164
166
|
//
|
|
165
|
-
const data = this.
|
|
167
|
+
const data = this.safeList(message, 'data', []);
|
|
166
168
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
167
169
|
const stored = new Cache.ArrayCache(limit);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
const dataLength = data.length;
|
|
171
|
+
for (let i = 0; i < dataLength; i++) {
|
|
172
|
+
const index = dataLength - 1 - i;
|
|
173
|
+
const rawTrade = data[index];
|
|
170
174
|
const parsed = this.parseWsOldTrade(rawTrade);
|
|
171
175
|
stored.append(parsed);
|
|
172
176
|
}
|
|
@@ -1003,7 +1003,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
1003
1003
|
const message = this.extend(request, params);
|
|
1004
1004
|
this.watch(url, messageHash, message, messageHash);
|
|
1005
1005
|
}
|
|
1006
|
-
return future;
|
|
1006
|
+
return await future;
|
|
1007
1007
|
}
|
|
1008
1008
|
handlePing(client, message) {
|
|
1009
1009
|
this.spawn(this.pong, client, message);
|
|
@@ -415,7 +415,7 @@ class gemini extends gemini$1 {
|
|
|
415
415
|
const orderbook = await this.helperForWatchMultipleConstruct('orderbook', symbols, params);
|
|
416
416
|
return orderbook.limit();
|
|
417
417
|
}
|
|
418
|
-
async watchBidsAsks(symbols
|
|
418
|
+
async watchBidsAsks(symbols = undefined, params = {}) {
|
|
419
419
|
/**
|
|
420
420
|
* @method
|
|
421
421
|
* @name gemini#watchBidsAsks
|
|
@@ -911,7 +911,8 @@ class gemini extends gemini$1 {
|
|
|
911
911
|
},
|
|
912
912
|
},
|
|
913
913
|
};
|
|
914
|
-
this.options = this.extend(defaultOptions, this.options);
|
|
914
|
+
// this.options = this.extend (defaultOptions, this.options);
|
|
915
|
+
this.extendExchangeOptions(defaultOptions);
|
|
915
916
|
const originalHeaders = this.options['ws']['options']['headers'];
|
|
916
917
|
const headers = {
|
|
917
918
|
'X-GEMINI-APIKEY': this.apiKey,
|
package/dist/cjs/src/pro/htx.js
CHANGED
|
@@ -20,7 +20,11 @@ class phemex extends phemex$1 {
|
|
|
20
20
|
'watchOrders': true,
|
|
21
21
|
'watchOrderBook': true,
|
|
22
22
|
'watchOHLCV': true,
|
|
23
|
-
'watchPositions': undefined,
|
|
23
|
+
'watchPositions': undefined,
|
|
24
|
+
// mutli-endpoints are not supported: https://github.com/ccxt/ccxt/pull/21490
|
|
25
|
+
'watchOrderBookForSymbols': false,
|
|
26
|
+
'watchTradesForSymbols': false,
|
|
27
|
+
'watchOHLCVForSymbols': false,
|
|
24
28
|
},
|
|
25
29
|
'urls': {
|
|
26
30
|
'test': {
|
|
@@ -560,9 +564,10 @@ class phemex extends phemex$1 {
|
|
|
560
564
|
/**
|
|
561
565
|
* @method
|
|
562
566
|
* @name phemex#watchOrderBook
|
|
567
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Spot-API-en.md#subscribe-orderbook
|
|
563
568
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#subscribe-orderbook-for-new-model
|
|
564
569
|
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#subscribe-30-levels-orderbook
|
|
565
|
-
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-
|
|
570
|
+
* @see https://github.com/phemex/phemex-api-docs/blob/master/Public-Contract-API-en.md#subscribe-full-orderbook
|
|
566
571
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
567
572
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
568
573
|
* @param {int} [limit] the maximum amount of order book entries to return
|
package/dist/cjs/src/pro/woo.js
CHANGED
|
@@ -82,6 +82,15 @@ class woo extends woo$1 {
|
|
|
82
82
|
return await this.watch(url, messageHash, request, messageHash, subscribe);
|
|
83
83
|
}
|
|
84
84
|
async watchOrderBook(symbol, limit = undefined, params = {}) {
|
|
85
|
+
/**
|
|
86
|
+
* @method
|
|
87
|
+
* @name woo#watchOrderBook
|
|
88
|
+
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
89
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
90
|
+
* @param {int} [limit] the maximum amount of order book entries to return.
|
|
91
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
92
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
93
|
+
*/
|
|
85
94
|
await this.loadMarkets();
|
|
86
95
|
const name = 'orderbook';
|
|
87
96
|
const market = this.market(symbol);
|
|
@@ -131,9 +140,18 @@ class woo extends woo$1 {
|
|
|
131
140
|
client.resolve(orderbook, topic);
|
|
132
141
|
}
|
|
133
142
|
async watchTicker(symbol, params = {}) {
|
|
143
|
+
/**
|
|
144
|
+
* @method
|
|
145
|
+
* @name woo#watchTicker
|
|
146
|
+
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
147
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
148
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
149
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
150
|
+
*/
|
|
134
151
|
await this.loadMarkets();
|
|
135
152
|
const name = 'ticker';
|
|
136
153
|
const market = this.market(symbol);
|
|
154
|
+
symbol = market['symbol'];
|
|
137
155
|
const topic = market['id'] + '@' + name;
|
|
138
156
|
const request = {
|
|
139
157
|
'event': 'subscribe',
|
|
@@ -208,7 +226,16 @@ class woo extends woo$1 {
|
|
|
208
226
|
return message;
|
|
209
227
|
}
|
|
210
228
|
async watchTickers(symbols = undefined, params = {}) {
|
|
229
|
+
/**
|
|
230
|
+
* @method
|
|
231
|
+
* @name woo#watchTickers
|
|
232
|
+
* @description n watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
233
|
+
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
234
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
235
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
236
|
+
*/
|
|
211
237
|
await this.loadMarkets();
|
|
238
|
+
symbols = this.marketSymbols(symbols);
|
|
212
239
|
const name = 'tickers';
|
|
213
240
|
const topic = name;
|
|
214
241
|
const request = {
|
|
@@ -327,8 +354,19 @@ class woo extends woo$1 {
|
|
|
327
354
|
client.resolve(stored, topic);
|
|
328
355
|
}
|
|
329
356
|
async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
357
|
+
/**
|
|
358
|
+
* @method
|
|
359
|
+
* @name woo#watchTrades
|
|
360
|
+
* @description watches information on multiple trades made in a market
|
|
361
|
+
* @param {string} symbol unified market symbol of the market trades were made in
|
|
362
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
363
|
+
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
364
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
365
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
366
|
+
*/
|
|
330
367
|
await this.loadMarkets();
|
|
331
368
|
const market = this.market(symbol);
|
|
369
|
+
symbol = market['symbol'];
|
|
332
370
|
const topic = market['id'] + '@trade';
|
|
333
371
|
const request = {
|
|
334
372
|
'event': 'subscribe',
|
package/dist/cjs/src/upbit.js
CHANGED
|
@@ -78,6 +78,7 @@ class upbit extends upbit$1 {
|
|
|
78
78
|
'1m': 'minutes',
|
|
79
79
|
'3m': 'minutes',
|
|
80
80
|
'5m': 'minutes',
|
|
81
|
+
'10m': 'minutes',
|
|
81
82
|
'15m': 'minutes',
|
|
82
83
|
'30m': 'minutes',
|
|
83
84
|
'1h': 'minutes',
|
|
@@ -107,6 +108,7 @@ class upbit extends upbit$1 {
|
|
|
107
108
|
'candles/minutes/1',
|
|
108
109
|
'candles/minutes/3',
|
|
109
110
|
'candles/minutes/5',
|
|
111
|
+
'candles/minutes/10',
|
|
110
112
|
'candles/minutes/15',
|
|
111
113
|
'candles/minutes/30',
|
|
112
114
|
'candles/minutes/60',
|
package/js/ccxt.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import { Exchange } from './src/base/Exchange.js';
|
|
|
2
2
|
import { Precise } from './src/base/Precise.js';
|
|
3
3
|
import * as functions from './src/base/functions.js';
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
|
-
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages } from './src/base/types.js';
|
|
5
|
+
import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.2.
|
|
7
|
+
declare const version = "4.2.79";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
|
@@ -516,5 +516,5 @@ declare const ccxt: {
|
|
|
516
516
|
zaif: typeof zaif;
|
|
517
517
|
zonda: typeof zonda;
|
|
518
518
|
} & typeof functions & typeof errors;
|
|
519
|
-
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
519
|
+
export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks, Leverage, Leverages, Option, OptionChain, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitteam, bitvavo, bl3p, blockchaincom, blofin, btcalpha, btcbox, btcmarkets, btcturk, bybit, cex, coinbase, coinbaseinternational, coinbasepro, coincheck, coinex, coinlist, coinmate, coinmetro, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, htx, huobi, huobijp, hyperliquid, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, luno, lykke, mercado, mexc, ndax, novadax, oceanex, okcoin, okx, onetrading, p2b, paymium, phemex, poloniex, poloniexfutures, probit, timex, tokocrypto, tradeogre, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
|
|
520
520
|
export default ccxt;
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.2.
|
|
41
|
+
const version = '4.2.80';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -31,6 +31,7 @@ interface Exchange {
|
|
|
31
31
|
swapV1PrivateGetTradeBatchCancelReplace(params?: {}): Promise<implicitReturnType>;
|
|
32
32
|
swapV1PrivatePostTradeCancelReplace(params?: {}): Promise<implicitReturnType>;
|
|
33
33
|
swapV1PrivatePostPositionSideDual(params?: {}): Promise<implicitReturnType>;
|
|
34
|
+
swapV1PrivatePostTradeClosePosition(params?: {}): Promise<implicitReturnType>;
|
|
34
35
|
swapV2PublicGetServerTime(params?: {}): Promise<implicitReturnType>;
|
|
35
36
|
swapV2PublicGetQuoteContracts(params?: {}): Promise<implicitReturnType>;
|
|
36
37
|
swapV2PublicGetQuotePrice(params?: {}): Promise<implicitReturnType>;
|
|
@@ -90,6 +90,7 @@ interface Exchange {
|
|
|
90
90
|
privateUnifiedGetLoanRecords(params?: {}): Promise<implicitReturnType>;
|
|
91
91
|
privateUnifiedGetInterestRecords(params?: {}): Promise<implicitReturnType>;
|
|
92
92
|
privateUnifiedGetEstimateRate(params?: {}): Promise<implicitReturnType>;
|
|
93
|
+
privateUnifiedGetCurrencyDiscountTiers(params?: {}): Promise<implicitReturnType>;
|
|
93
94
|
privateUnifiedPostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
94
95
|
privateUnifiedPostLoans(params?: {}): Promise<implicitReturnType>;
|
|
95
96
|
privateSpotGetFee(params?: {}): Promise<implicitReturnType>;
|
|
@@ -90,6 +90,7 @@ interface gate {
|
|
|
90
90
|
privateUnifiedGetLoanRecords(params?: {}): Promise<implicitReturnType>;
|
|
91
91
|
privateUnifiedGetInterestRecords(params?: {}): Promise<implicitReturnType>;
|
|
92
92
|
privateUnifiedGetEstimateRate(params?: {}): Promise<implicitReturnType>;
|
|
93
|
+
privateUnifiedGetCurrencyDiscountTiers(params?: {}): Promise<implicitReturnType>;
|
|
93
94
|
privateUnifiedPostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
94
95
|
privateUnifiedPostLoans(params?: {}): Promise<implicitReturnType>;
|
|
95
96
|
privateSpotGetFee(params?: {}): Promise<implicitReturnType>;
|
|
@@ -8,6 +8,7 @@ interface Exchange {
|
|
|
8
8
|
publicGetCandlesMinutes1(params?: {}): Promise<implicitReturnType>;
|
|
9
9
|
publicGetCandlesMinutes3(params?: {}): Promise<implicitReturnType>;
|
|
10
10
|
publicGetCandlesMinutes5(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetCandlesMinutes10(params?: {}): Promise<implicitReturnType>;
|
|
11
12
|
publicGetCandlesMinutes15(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
publicGetCandlesMinutes30(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
publicGetCandlesMinutes60(params?: {}): Promise<implicitReturnType>;
|