ccxt 4.5.55 → 4.5.56
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 +209 -5
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +25 -16
- package/dist/cjs/src/arkham.js +7 -4
- package/dist/cjs/src/ascendex.js +6 -3
- package/dist/cjs/src/base/Exchange.js +3 -3
- package/dist/cjs/src/bigone.js +7 -4
- package/dist/cjs/src/binance.js +4 -4
- package/dist/cjs/src/bingx.js +4 -4
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +14 -3
- package/dist/cjs/src/bitmart.js +5 -4
- package/dist/cjs/src/bitmex.js +7 -4
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitrue.js +2 -1
- package/dist/cjs/src/bitso.js +6 -3
- package/dist/cjs/src/bitstamp.js +5 -3
- package/dist/cjs/src/bittrade.js +2 -1
- package/dist/cjs/src/blofin.js +2 -1
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- package/dist/cjs/src/coinbaseexchange.js +2 -1
- package/dist/cjs/src/coinbaseinternational.js +15 -9
- package/dist/cjs/src/coinex.js +5 -3
- package/dist/cjs/src/coinsph.js +4 -4
- package/dist/cjs/src/cryptocom.js +6 -6
- package/dist/cjs/src/deepcoin.js +6 -3
- package/dist/cjs/src/delta.js +2 -1
- package/dist/cjs/src/deribit.js +4 -2
- package/dist/cjs/src/derive.js +5 -3
- package/dist/cjs/src/digifinex.js +2 -1
- package/dist/cjs/src/exmo.js +12 -39
- package/dist/cjs/src/foxbit.js +1 -1
- package/dist/cjs/src/gemini.js +4 -2
- package/dist/cjs/src/grvt.js +13 -7
- package/dist/cjs/src/hashkey.js +4 -4
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +2 -1
- package/dist/cjs/src/htx.js +9 -5
- package/dist/cjs/src/hyperliquid.js +19 -13
- package/dist/cjs/src/indodax.js +2 -1
- package/dist/cjs/src/kraken.js +14 -13
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/lbank.js +8 -4
- package/dist/cjs/src/lighter.js +1 -1
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +24 -14
- package/dist/cjs/src/modetrade.js +1 -1
- package/dist/cjs/src/okx.js +6 -3
- package/dist/cjs/src/oxfun.js +5 -3
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +4 -2
- package/dist/cjs/src/poloniex.js +2 -1
- package/dist/cjs/src/pro/apex.js +10 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/binance.js +3 -3
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- package/dist/cjs/src/pro/oxfun.js +4 -4
- package/dist/cjs/src/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.js +1 -1
- package/dist/cjs/src/toobit.js +1 -1
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/woofipro.js +1 -1
- package/dist/cjs/src/xt.js +2 -1
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +3 -3
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +25 -16
- package/js/src/arkham.js +7 -4
- package/js/src/ascendex.js +6 -3
- package/js/src/base/Exchange.js +3 -3
- package/js/src/bigone.js +7 -4
- package/js/src/binance.js +4 -4
- package/js/src/bingx.js +4 -4
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +14 -3
- package/js/src/bitmart.js +5 -4
- package/js/src/bitmex.js +7 -4
- package/js/src/bitopro.js +1 -1
- package/js/src/bitrue.js +2 -1
- package/js/src/bitso.js +6 -3
- package/js/src/bitstamp.js +5 -3
- package/js/src/bittrade.js +2 -1
- package/js/src/blofin.js +2 -1
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- package/js/src/coinbaseexchange.js +2 -1
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +15 -9
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +5 -3
- package/js/src/coinsph.js +4 -4
- package/js/src/cryptocom.js +6 -6
- package/js/src/deepcoin.js +6 -3
- package/js/src/delta.js +2 -1
- package/js/src/deribit.js +4 -2
- package/js/src/derive.js +5 -3
- package/js/src/digifinex.js +2 -1
- package/js/src/exmo.js +12 -39
- package/js/src/foxbit.js +1 -1
- package/js/src/gemini.js +4 -2
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +13 -7
- package/js/src/hashkey.js +4 -4
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.js +2 -1
- package/js/src/htx.js +9 -5
- package/js/src/hyperliquid.d.ts +4 -4
- package/js/src/hyperliquid.js +19 -13
- package/js/src/indodax.js +2 -1
- package/js/src/kraken.js +14 -13
- package/js/src/krakenfutures.js +2 -1
- package/js/src/lbank.js +8 -4
- package/js/src/lighter.d.ts +1 -1
- package/js/src/lighter.js +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +2 -2
- package/js/src/mexc.js +24 -14
- package/js/src/modetrade.js +1 -1
- package/js/src/okx.js +6 -3
- package/js/src/oxfun.js +5 -3
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.js +4 -2
- package/js/src/poloniex.js +2 -1
- package/js/src/pro/apex.js +10 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- package/js/src/pro/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- package/js/src/pro/oxfun.d.ts +4 -4
- package/js/src/pro/oxfun.js +4 -4
- package/js/src/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +1 -1
- package/js/src/woo.js +1 -1
- package/js/src/woofipro.js +1 -1
- package/js/src/xt.js +2 -1
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.js +3 -3
- package/package.json +21 -7
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -731,6 +731,7 @@ class phemex extends phemex$1["default"] {
|
|
|
731
731
|
// "1.0"
|
|
732
732
|
contractSize = this.parseNumber(contractSizeString);
|
|
733
733
|
}
|
|
734
|
+
const isLinear = !inverse;
|
|
734
735
|
return this.safeMarketStructure({
|
|
735
736
|
'id': id,
|
|
736
737
|
'symbol': base + '/' + quote + ':' + settle,
|
|
@@ -748,7 +749,7 @@ class phemex extends phemex$1["default"] {
|
|
|
748
749
|
'option': false,
|
|
749
750
|
'active': status === 'Listed',
|
|
750
751
|
'contract': true,
|
|
751
|
-
'linear':
|
|
752
|
+
'linear': isLinear,
|
|
752
753
|
'inverse': inverse,
|
|
753
754
|
'taker': this.parseNumber(this.fromEn(takerFeeRateEr, ratioScale)),
|
|
754
755
|
'maker': this.parseNumber(this.fromEn(makerFeeRateEr, ratioScale)),
|
|
@@ -4667,11 +4668,12 @@ class phemex extends phemex$1["default"] {
|
|
|
4667
4668
|
for (let i = 0; i < riskLimits.length; i++) {
|
|
4668
4669
|
const tier = riskLimits[i];
|
|
4669
4670
|
const maxNotional = this.safeInteger(tier, 'limit');
|
|
4671
|
+
const minNotionalResponse = minNotional; // java req
|
|
4670
4672
|
tiers.push({
|
|
4671
4673
|
'tier': this.sum(i, 1),
|
|
4672
4674
|
'symbol': this.safeSymbol(marketId, market),
|
|
4673
4675
|
'currency': market['settle'],
|
|
4674
|
-
'minNotional':
|
|
4676
|
+
'minNotional': minNotionalResponse,
|
|
4675
4677
|
'maxNotional': maxNotional,
|
|
4676
4678
|
'maintenanceMarginRate': this.safeString(tier, 'maintenanceMargin'),
|
|
4677
4679
|
'maxLeverage': undefined,
|
package/dist/cjs/src/poloniex.js
CHANGED
|
@@ -922,6 +922,7 @@ class poloniex extends poloniex$1["default"] {
|
|
|
922
922
|
if (alias !== undefined) {
|
|
923
923
|
type = 'future';
|
|
924
924
|
}
|
|
925
|
+
const marketType = (type === 'future') ? 'future' : 'swap';
|
|
925
926
|
return {
|
|
926
927
|
'id': id,
|
|
927
928
|
'symbol': symbol,
|
|
@@ -931,7 +932,7 @@ class poloniex extends poloniex$1["default"] {
|
|
|
931
932
|
'baseId': baseId,
|
|
932
933
|
'quoteId': quoteId,
|
|
933
934
|
'settleId': settleId,
|
|
934
|
-
'type':
|
|
935
|
+
'type': marketType,
|
|
935
936
|
'spot': false,
|
|
936
937
|
'margin': false,
|
|
937
938
|
'swap': type === 'swap',
|
package/dist/cjs/src/pro/apex.js
CHANGED
|
@@ -767,7 +767,7 @@ class apex extends apex$1["default"] {
|
|
|
767
767
|
async loadPositionsSnapshot(client, messageHash) {
|
|
768
768
|
// as only one ws channel gives positions for all types, for snapshot must load all positions
|
|
769
769
|
const fetchFunctions = [
|
|
770
|
-
this.fetchPositions(
|
|
770
|
+
this.fetchPositions(),
|
|
771
771
|
];
|
|
772
772
|
const promises = await Promise.all(fetchFunctions);
|
|
773
773
|
this.positions = new Cache.ArrayCacheBySymbolBySide();
|
|
@@ -937,6 +937,15 @@ class apex extends apex$1["default"] {
|
|
|
937
937
|
const ret_msg = this.safeString(message, 'ret_msg');
|
|
938
938
|
const request = this.safeValue(message, 'request', {});
|
|
939
939
|
const op = this.safeString(request, 'op');
|
|
940
|
+
// Benign re-subscribe notice (same shape as bitmart 90008 /
|
|
941
|
+
// krakenfutures "Already subscribed"): the original subscription
|
|
942
|
+
// is still active and delivering data on this socket. Without
|
|
943
|
+
// this short-circuit the catch-clause's `client.reject(error,
|
|
944
|
+
// messageHash)` rejects every in-flight future on the connection
|
|
945
|
+
// because apex doesn't echo a `reqId` on these warnings.
|
|
946
|
+
if (ret_msg !== undefined && ret_msg.indexOf('already subscribed') >= 0) {
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
940
949
|
if (op === 'auth') {
|
|
941
950
|
throw new errors.AuthenticationError('Authentication failed: ' + ret_msg);
|
|
942
951
|
}
|
|
@@ -377,13 +377,11 @@ class aster extends aster$1["default"] {
|
|
|
377
377
|
}
|
|
378
378
|
parseWsTicker(message, marketType) {
|
|
379
379
|
const event = this.safeString(message, 'e');
|
|
380
|
-
const part = event.split('@');
|
|
381
|
-
const channel = this.safeString(part, 1);
|
|
382
380
|
const marketId = this.safeString(message, 's');
|
|
383
381
|
const timestamp = this.safeInteger(message, 'E');
|
|
384
382
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
385
383
|
const last = this.safeString(message, 'c');
|
|
386
|
-
if (
|
|
384
|
+
if (event === 'markPriceUpdate') {
|
|
387
385
|
return this.safeTicker({
|
|
388
386
|
'symbol': market['symbol'],
|
|
389
387
|
'timestamp': timestamp,
|
|
@@ -1203,7 +1201,12 @@ class aster extends aster$1["default"] {
|
|
|
1203
1201
|
return;
|
|
1204
1202
|
}
|
|
1205
1203
|
try {
|
|
1206
|
-
|
|
1204
|
+
if (type === 'spot') {
|
|
1205
|
+
await this.sapiPrivatePutV3ListenKey(); // extend the expiry
|
|
1206
|
+
}
|
|
1207
|
+
else {
|
|
1208
|
+
await this.fapiPrivatePutV3ListenKey(); // extend the expiry
|
|
1209
|
+
}
|
|
1207
1210
|
}
|
|
1208
1211
|
catch (error) {
|
|
1209
1212
|
const url = this.urls['api']['ws']['private'][type] + '/' + listenKey;
|
|
@@ -1880,13 +1883,11 @@ class aster extends aster$1["default"] {
|
|
|
1880
1883
|
const messageInner = this.safeDict(message, 'data', message); // can be either wrapped in 'data' or full object itself
|
|
1881
1884
|
const event = this.safeString(messageInner, 'e');
|
|
1882
1885
|
const methods = {
|
|
1883
|
-
'
|
|
1886
|
+
'24hrTicker': this.handleTicker,
|
|
1884
1887
|
'aggTrade': this.handleTrade,
|
|
1885
|
-
'
|
|
1886
|
-
'depth10': this.handleOrderBook,
|
|
1887
|
-
'depth20': this.handleOrderBook,
|
|
1888
|
+
'depthUpdate': this.handleOrderBook,
|
|
1888
1889
|
'kline': this.handleOHLCV,
|
|
1889
|
-
'
|
|
1890
|
+
'markPriceUpdate': this.handleTicker,
|
|
1890
1891
|
'bookTicker': this.handleBidAsk,
|
|
1891
1892
|
'outboundAccountPosition': this.handleBalance,
|
|
1892
1893
|
'ACCOUNT_UPDATE': this.handleBalanceAndPosition,
|
|
@@ -1504,7 +1504,7 @@ class binance extends binance$1["default"] {
|
|
|
1504
1504
|
}
|
|
1505
1505
|
const isSpot = (type === 'spot');
|
|
1506
1506
|
let timezone = undefined;
|
|
1507
|
-
[timezone, params] = this.handleParamString(params, 'timezone'
|
|
1507
|
+
[timezone, params] = this.handleParamString(params, 'timezone');
|
|
1508
1508
|
const isUtc8 = (timezone !== undefined) && ((timezone === '+08:00') || Precise["default"].stringEq(timezone, '8'));
|
|
1509
1509
|
const rawHashes = [];
|
|
1510
1510
|
const messageHashes = [];
|
|
@@ -1569,7 +1569,7 @@ class binance extends binance$1["default"] {
|
|
|
1569
1569
|
}
|
|
1570
1570
|
const isSpot = (type === 'spot');
|
|
1571
1571
|
let timezone = undefined;
|
|
1572
|
-
[timezone, params] = this.handleParamString(params, 'timezone'
|
|
1572
|
+
[timezone, params] = this.handleParamString(params, 'timezone');
|
|
1573
1573
|
const isUtc8 = (timezone !== undefined) && ((timezone === '+08:00') || Precise["default"].stringEq(timezone, '8'));
|
|
1574
1574
|
const rawHashes = [];
|
|
1575
1575
|
const subMessageHashes = [];
|
|
@@ -2407,7 +2407,7 @@ class binance extends binance$1["default"] {
|
|
|
2407
2407
|
/**
|
|
2408
2408
|
* @name binance#ensureUserDataStreamWsSubscribeSignature
|
|
2409
2409
|
* @description watches best bid & ask for symbols
|
|
2410
|
-
* @param
|
|
2410
|
+
* @param {string} [marketType] only supports 'spot'
|
|
2411
2411
|
* @see {@link https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/user-data-stream-requests#subscribe-to-user-data-stream-through-signature-subscription-user_data Binance User Data Stream Documentation}
|
|
2412
2412
|
* @returns Promise<number> The subscription ID for the user data stream
|
|
2413
2413
|
*/
|
|
@@ -696,7 +696,9 @@ class bingx extends bingx$1["default"] {
|
|
|
696
696
|
// const limit = [ 5, 10, 20, 50, 100 ]
|
|
697
697
|
const subscriptionHash = dataType;
|
|
698
698
|
const subscription = client.subscriptions[subscriptionHash];
|
|
699
|
-
|
|
699
|
+
// see handleOHLCV — subscription.limit may be missing for non-orderbook callers;
|
|
700
|
+
// default to a reasonable depth instead of throwing NPE in the Java port.
|
|
701
|
+
const limit = this.safeInteger(subscription, 'limit', 100);
|
|
700
702
|
this.orderbooks[symbol] = this.orderBook({}, limit);
|
|
701
703
|
}
|
|
702
704
|
orderbook = this.orderbooks[symbol];
|
|
@@ -842,7 +844,10 @@ class bingx extends bingx$1["default"] {
|
|
|
842
844
|
if (this.safeValue(this.ohlcvs[symbol], rawTimeframe) === undefined) {
|
|
843
845
|
const subscriptionHash = dataType;
|
|
844
846
|
const subscription = client.subscriptions[subscriptionHash];
|
|
845
|
-
|
|
847
|
+
// subscription.limit is only set when watchOHLCV registers the subscription;
|
|
848
|
+
// when handleMessage routes a non-OHLCV-originated subscription here (or the
|
|
849
|
+
// subscription dict was reset on reconnect), fall back to the OHLCVLimit option.
|
|
850
|
+
const limit = this.safeInteger(subscription, 'limit', this.safeInteger(this.options, 'OHLCVLimit', 1000));
|
|
846
851
|
this.ohlcvs[symbol][unifiedTimeframe] = new Cache.ArrayCacheByTimestamp(limit);
|
|
847
852
|
}
|
|
848
853
|
const stored = this.ohlcvs[symbol][unifiedTimeframe];
|
|
@@ -1874,6 +1874,16 @@ class bitmart extends bitmart$1["default"] {
|
|
|
1874
1874
|
//
|
|
1875
1875
|
const errorCode = this.safeString(message, 'errorCode');
|
|
1876
1876
|
const error = this.safeString(message, 'error');
|
|
1877
|
+
// Duplicate-subscription notice errorCode 90008: bitmart's WS rejects
|
|
1878
|
+
// a re-subscribe attempt on a topic that's already active on this
|
|
1879
|
+
// connection, but the original subscription keeps delivering data —
|
|
1880
|
+
// so treat it as benign. Without this short-circuit, the generic
|
|
1881
|
+
// client.reject below kills every unrelated in-flight future —
|
|
1882
|
+
// e.g. a watchOHLCV waiting on its kline subscription gets rejected
|
|
1883
|
+
// by an orderbook 90008 raised on the same socket.
|
|
1884
|
+
if (errorCode === '90008') {
|
|
1885
|
+
return false;
|
|
1886
|
+
}
|
|
1877
1887
|
try {
|
|
1878
1888
|
if (errorCode !== undefined || error !== undefined) {
|
|
1879
1889
|
const feedback = this.id + ' ' + this.json(message);
|
|
@@ -1595,7 +1595,7 @@ class bitmex extends bitmex$1["default"] {
|
|
|
1595
1595
|
if (!(marketId in numUpdatesByMarketId)) {
|
|
1596
1596
|
numUpdatesByMarketId[marketId] = 0;
|
|
1597
1597
|
}
|
|
1598
|
-
numUpdatesByMarketId[marketId] = this.sum(numUpdatesByMarketId, 1);
|
|
1598
|
+
numUpdatesByMarketId[marketId] = this.sum(numUpdatesByMarketId[marketId], 1);
|
|
1599
1599
|
const market = this.safeMarket(marketId);
|
|
1600
1600
|
const symbol = market['symbol'];
|
|
1601
1601
|
const orderbook = this.orderbooks[symbol];
|
package/dist/cjs/src/pro/grvt.js
CHANGED
|
@@ -578,6 +578,14 @@ class grvt extends grvt$1["default"] {
|
|
|
578
578
|
orderbook['timestamp'] = timestamp;
|
|
579
579
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
580
580
|
}
|
|
581
|
+
// grvt defaults to the delta channel (v1.book.d); if the very first
|
|
582
|
+
// message is a delta, the freshly-created orderbook has symbol=null
|
|
583
|
+
// because no snapshot has reset it yet. Set it unconditionally — we
|
|
584
|
+
// know the symbol from the selector regardless of channel. Java's
|
|
585
|
+
// typed WsOrderBook surfaces this as `"symbol":null` in the output;
|
|
586
|
+
// Python/JS dict-backed orderbooks happen to mask it but the
|
|
587
|
+
// unconditional assignment is correct for every language.
|
|
588
|
+
orderbook['symbol'] = symbol;
|
|
581
589
|
orderbook['nonce'] = sequenceNumber;
|
|
582
590
|
const messageHash = 'orderbook::' + symbol;
|
|
583
591
|
this.orderbooks[symbol] = orderbook;
|
package/dist/cjs/src/pro/htx.js
CHANGED
|
@@ -1361,10 +1361,10 @@ class htx extends htx$1["default"] {
|
|
|
1361
1361
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
|
|
1362
1362
|
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=5d5156b5-77b6-11ed-9966-0242ac110003
|
|
1363
1363
|
* @description watch all open positions. Note: huobi has one channel for each marginMode and type
|
|
1364
|
-
* @param {string[]
|
|
1365
|
-
* @param since
|
|
1366
|
-
* @param limit
|
|
1367
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1364
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1365
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1366
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1367
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1368
1368
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1369
1369
|
*/
|
|
1370
1370
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -266,10 +266,10 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
266
266
|
* @name krakenfutures#watchPositions
|
|
267
267
|
* @see https://docs.futures.kraken.com/#websocket-api-private-feeds-open-positions
|
|
268
268
|
* @description watch all open positions
|
|
269
|
-
* @param {string[]
|
|
270
|
-
* @param since
|
|
271
|
-
* @param limit
|
|
272
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
269
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
270
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
271
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
272
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
273
273
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
274
274
|
*/
|
|
275
275
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1542,8 +1542,20 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
1542
1542
|
// event: 'alert',
|
|
1543
1543
|
// message: 'Failed to subscribe to authenticated feed'
|
|
1544
1544
|
// }
|
|
1545
|
+
// {
|
|
1546
|
+
// event: 'alert',
|
|
1547
|
+
// message: 'Already subscribed to feed, re-requesting'
|
|
1548
|
+
// }
|
|
1545
1549
|
//
|
|
1546
1550
|
const errMsg = this.safeString(message, 'message');
|
|
1551
|
+
// Benign "already subscribed" notice: the original subscription is still
|
|
1552
|
+
// active and delivering data on this socket. The generic client.reject
|
|
1553
|
+
// below rejects every pending future on the connection, so a stray
|
|
1554
|
+
// re-subscribe warning would kill unrelated in-flight watch* calls —
|
|
1555
|
+
// mirrors the bitmart 90008 fix.
|
|
1556
|
+
if (errMsg !== undefined && errMsg.indexOf('Already subscribed') >= 0) {
|
|
1557
|
+
return false;
|
|
1558
|
+
}
|
|
1547
1559
|
try {
|
|
1548
1560
|
throw new errors.ExchangeError(this.id + ' ' + errMsg);
|
|
1549
1561
|
}
|
|
@@ -961,9 +961,9 @@ class modetrade extends modetrade$1["default"] {
|
|
|
961
961
|
* @see https://orderly.network/docs/build-on-evm/evm-api/websocket-api/private/position-push
|
|
962
962
|
* @description watch all open positions
|
|
963
963
|
* @param {string[]} [symbols] list of unified market symbols
|
|
964
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
965
|
-
* @param limit the maximum number of positions to fetch
|
|
966
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
964
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
965
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
966
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
967
967
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
968
968
|
*/
|
|
969
969
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/dist/cjs/src/pro/okx.js
CHANGED
|
@@ -1702,10 +1702,10 @@ class okx extends okx$1["default"] {
|
|
|
1702
1702
|
* @name okx#watchPositions
|
|
1703
1703
|
* @see https://www.okx.com/docs-v5/en/#trading-account-websocket-positions-channel
|
|
1704
1704
|
* @description watch all open positions
|
|
1705
|
-
* @param {string[]
|
|
1706
|
-
* @param since
|
|
1707
|
-
* @param limit
|
|
1708
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1705
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1706
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1707
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1708
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1709
1709
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1710
1710
|
*/
|
|
1711
1711
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -637,10 +637,10 @@ class oxfun extends oxfun$1["default"] {
|
|
|
637
637
|
* @name oxfun#watchPositions
|
|
638
638
|
* @see https://docs.ox.fun/?json#position-channel
|
|
639
639
|
* @description watch all open positions
|
|
640
|
-
* @param {string[]
|
|
641
|
-
* @param since
|
|
642
|
-
* @param limit
|
|
643
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
640
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
641
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
642
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
643
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
644
644
|
* @param {int|string} [params.tag] If given it will be echoed in the reply and the max size of tag is 32
|
|
645
645
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
646
646
|
*/
|
package/dist/cjs/src/pro/woo.js
CHANGED
|
@@ -1202,10 +1202,10 @@ class woo extends woo$1["default"] {
|
|
|
1202
1202
|
* @name woo#watchPositions
|
|
1203
1203
|
* @see https://docs.woox.io/#position-push
|
|
1204
1204
|
* @description watch all open positions
|
|
1205
|
-
* @param {string[]
|
|
1206
|
-
* @param since
|
|
1207
|
-
* @param limit
|
|
1208
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
1205
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1206
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
1207
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
1208
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1209
1209
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
1210
1210
|
*/
|
|
1211
1211
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -961,9 +961,9 @@ class woofipro extends woofipro$1["default"] {
|
|
|
961
961
|
* @see https://orderly.network/docs/build-on-omnichain/evm-api/websocket-api/private/position-push
|
|
962
962
|
* @description watch all open positions
|
|
963
963
|
* @param {string[]} [symbols] list of unified market symbols
|
|
964
|
-
* @param since timestamp in ms of the earliest position to fetch
|
|
965
|
-
* @param limit the maximum number of positions to fetch
|
|
966
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
964
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch
|
|
965
|
+
* @param {int} [limit] the maximum number of positions to fetch
|
|
966
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
967
967
|
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
|
|
968
968
|
*/
|
|
969
969
|
async watchPositions(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
package/dist/cjs/src/pro/xt.js
CHANGED
|
@@ -603,7 +603,7 @@ class xt extends xt$1["default"] {
|
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
async loadPositionsSnapshot(client, messageHash) {
|
|
606
|
-
const positions = await this.fetchPositions(
|
|
606
|
+
const positions = await this.fetchPositions();
|
|
607
607
|
this.positions = new Cache.ArrayCacheBySymbolBySide();
|
|
608
608
|
const cache = this.positions;
|
|
609
609
|
for (let i = 0; i < positions.length; i++) {
|
package/dist/cjs/src/toobit.js
CHANGED
|
@@ -2518,7 +2518,7 @@ class toobit extends toobit$1["default"] {
|
|
|
2518
2518
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2519
2519
|
return await this.fetchDepositsOrWithdrawalsHelper('withdrawals', code, since, limit, params);
|
|
2520
2520
|
}
|
|
2521
|
-
async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params) {
|
|
2521
|
+
async fetchDepositsOrWithdrawalsHelper(type, code, since, limit, params = {}) {
|
|
2522
2522
|
await this.loadMarkets();
|
|
2523
2523
|
let currency = undefined;
|
|
2524
2524
|
let request = {};
|
package/dist/cjs/src/woo.js
CHANGED
|
@@ -1911,7 +1911,7 @@ class woo extends woo$1["default"] {
|
|
|
1911
1911
|
'fok': 'FOK',
|
|
1912
1912
|
'post_only': 'PO',
|
|
1913
1913
|
};
|
|
1914
|
-
return this.safeString(timeInForces, timeInForce
|
|
1914
|
+
return this.safeString(timeInForces, timeInForce);
|
|
1915
1915
|
}
|
|
1916
1916
|
parseOrder(order, market = undefined) {
|
|
1917
1917
|
//
|
package/dist/cjs/src/woofipro.js
CHANGED
|
@@ -1434,7 +1434,7 @@ class woofipro extends woofipro$1["default"] {
|
|
|
1434
1434
|
'fok': 'FOK',
|
|
1435
1435
|
'post_only': 'PO',
|
|
1436
1436
|
};
|
|
1437
|
-
return this.safeString(timeInForces, timeInForce
|
|
1437
|
+
return this.safeString(timeInForces, timeInForce);
|
|
1438
1438
|
}
|
|
1439
1439
|
parseOrderStatus(status) {
|
|
1440
1440
|
if (status !== undefined) {
|
package/dist/cjs/src/xt.js
CHANGED
|
@@ -4389,11 +4389,12 @@ class xt extends xt$1["default"] {
|
|
|
4389
4389
|
const tier = brackets[i];
|
|
4390
4390
|
const marketId = this.safeString(info, 'symbol');
|
|
4391
4391
|
market = this.safeMarket(marketId, market, '_', 'contract');
|
|
4392
|
+
const minNotional = this.safeNumber(brackets[i - 1], 'maxNominalValue', 0);
|
|
4392
4393
|
tiers.push({
|
|
4393
4394
|
'tier': this.safeInteger(tier, 'bracket'),
|
|
4394
4395
|
'symbol': this.safeSymbol(marketId, market, '_', 'contract'),
|
|
4395
4396
|
'currency': market['settle'],
|
|
4396
|
-
'minNotional':
|
|
4397
|
+
'minNotional': minNotional,
|
|
4397
4398
|
'maxNotional': this.safeNumber(tier, 'maxNominalValue'),
|
|
4398
4399
|
'maintenanceMarginRate': this.safeNumber(tier, 'maintMarginRate'),
|
|
4399
4400
|
'maxLeverage': this.safeNumber(tier, 'maxLeverage'),
|
package/dist/cjs/src/yobit.js
CHANGED
|
@@ -579,7 +579,8 @@ class yobit extends yobit$1["default"] {
|
|
|
579
579
|
await this.loadMarkets();
|
|
580
580
|
let ids = undefined;
|
|
581
581
|
if (symbols === undefined) {
|
|
582
|
-
|
|
582
|
+
const allIds = this.ids;
|
|
583
|
+
ids = allIds.join('-');
|
|
583
584
|
// max URL length is 2083 symbols, including http schema, hostname, tld, etc...
|
|
584
585
|
if (ids.length > 2048) {
|
|
585
586
|
const numIds = this.ids.length;
|
|
@@ -1116,8 +1117,9 @@ class yobit extends yobit$1["default"] {
|
|
|
1116
1117
|
*/
|
|
1117
1118
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
1118
1119
|
await this.loadMarkets();
|
|
1120
|
+
const intId = parseInt(id);
|
|
1119
1121
|
const request = {
|
|
1120
|
-
'order_id':
|
|
1122
|
+
'order_id': intId,
|
|
1121
1123
|
};
|
|
1122
1124
|
const response = await this.privatePostOrderInfo(this.extend(request, params));
|
|
1123
1125
|
id = id.toString();
|
package/dist/cjs/src/zebpay.js
CHANGED
|
@@ -1791,11 +1791,11 @@ class zebpay extends zebpay$1["default"] {
|
|
|
1791
1791
|
// }
|
|
1792
1792
|
// ]
|
|
1793
1793
|
//
|
|
1794
|
-
const timestamp = this.safeInteger2(ticker, 'timestamp', 'ts'
|
|
1794
|
+
const timestamp = this.safeInteger2(ticker, 'timestamp', 'ts');
|
|
1795
1795
|
const marketId = this.safeString(ticker, 'symbol');
|
|
1796
1796
|
market = this.safeMarket(marketId);
|
|
1797
|
-
const close = this.safeString(ticker, 'close'
|
|
1798
|
-
const last = this.safeString(ticker, 'last'
|
|
1797
|
+
const close = this.safeString(ticker, 'close');
|
|
1798
|
+
const last = this.safeString(ticker, 'last');
|
|
1799
1799
|
const percentage = this.safeString(ticker, 'percentage');
|
|
1800
1800
|
const bidVolume = this.safeString(ticker, 'bidVolume');
|
|
1801
1801
|
const askVolume = this.safeString(ticker, 'askVolume');
|
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, 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, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs, ADL } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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.5.
|
|
7
|
+
declare const version = "4.5.55";
|
|
8
8
|
import aftermath from './src/aftermath.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import apex from './src/apex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -32,7 +32,7 @@ import * as errors from './src/base/errors.js';
|
|
|
32
32
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, 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';
|
|
33
33
|
//-----------------------------------------------------------------------------
|
|
34
34
|
// this is updated by vss.js when building
|
|
35
|
-
const version = '4.5.
|
|
35
|
+
const version = '4.5.55';
|
|
36
36
|
Exchange.ccxtVersion = version;
|
|
37
37
|
//-----------------------------------------------------------------------------
|
|
38
38
|
import aftermath from './src/aftermath.js';
|
|
@@ -131,6 +131,7 @@ interface Exchange {
|
|
|
131
131
|
contractPrivateGetPositionFundingRecords(params?: {}): Promise<implicitReturnType>;
|
|
132
132
|
contractPrivateGetPositionPositionMode(params?: {}): Promise<implicitReturnType>;
|
|
133
133
|
contractPrivateGetOrderListOpenOrdersSymbol(params?: {}): Promise<implicitReturnType>;
|
|
134
|
+
contractPrivateGetOrderListOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
134
135
|
contractPrivateGetOrderListHistoryOrders(params?: {}): Promise<implicitReturnType>;
|
|
135
136
|
contractPrivateGetOrderListOrderDealsV3(params?: {}): Promise<implicitReturnType>;
|
|
136
137
|
contractPrivateGetOrderExternalSymbolExternalOid(params?: {}): Promise<implicitReturnType>;
|
package/js/src/aftermath.js
CHANGED
|
@@ -816,7 +816,8 @@ export default class aftermath extends Exchange {
|
|
|
816
816
|
let account = undefined;
|
|
817
817
|
[account, params] = this.handleOptionAndParams(params, 'createOrder', 'account');
|
|
818
818
|
const order = this.parseCreateEditOrderArgs(undefined, symbol, type, side, amount, price, params);
|
|
819
|
-
const
|
|
819
|
+
const accountObj = { 'account': account };
|
|
820
|
+
const orders = await this.createOrders([order], accountObj);
|
|
820
821
|
return orders[0];
|
|
821
822
|
}
|
|
822
823
|
/**
|
|
@@ -1175,10 +1176,14 @@ export default class aftermath extends Exchange {
|
|
|
1175
1176
|
// "collateral": 39.0
|
|
1176
1177
|
// }
|
|
1177
1178
|
//
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1179
|
+
const parsedTx = this.parseTransaction(response, currency);
|
|
1180
|
+
parsedTx['addressFrom '] = account;
|
|
1181
|
+
parsedTx['amount'] = amount;
|
|
1182
|
+
return parsedTx;
|
|
1183
|
+
// return this.extend (, {
|
|
1184
|
+
// 'addressFrom': account,
|
|
1185
|
+
// 'amount': amount,
|
|
1186
|
+
// });
|
|
1182
1187
|
}
|
|
1183
1188
|
parseTransaction(transaction, currency = undefined) {
|
|
1184
1189
|
return {
|
package/js/src/alpaca.js
CHANGED
|
@@ -1142,7 +1142,7 @@ export default class alpaca extends Exchange {
|
|
|
1142
1142
|
await this.loadMarkets();
|
|
1143
1143
|
const response = await this.traderPrivateDeleteV2Orders(params);
|
|
1144
1144
|
if (Array.isArray(response)) {
|
|
1145
|
-
return this.parseOrders(response
|
|
1145
|
+
return this.parseOrders(response);
|
|
1146
1146
|
}
|
|
1147
1147
|
else {
|
|
1148
1148
|
return [
|
|
@@ -1891,7 +1891,7 @@ export default class alpaca extends Exchange {
|
|
|
1891
1891
|
if (code !== undefined) {
|
|
1892
1892
|
this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
|
|
1893
1893
|
}
|
|
1894
|
-
const message = this.safeValue(response, 'message'
|
|
1894
|
+
const message = this.safeValue(response, 'message');
|
|
1895
1895
|
if (message !== undefined) {
|
|
1896
1896
|
this.throwExactlyMatchedException(this.exceptions['exact'], message, feedback);
|
|
1897
1897
|
this.throwBroadlyMatchedException(this.exceptions['broad'], message, feedback);
|
package/js/src/apex.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ export default class apex extends Exchange {
|
|
|
202
202
|
* @description cancels an open order
|
|
203
203
|
* @see https://api-docs.pro.apex.exchange/#privateapi-v3-for-omni-post-cancel-order
|
|
204
204
|
* @param {string} id order id
|
|
205
|
-
* @param symbol
|
|
205
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
206
206
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
207
207
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
208
208
|
*/
|