ccxt 4.5.36 → 4.5.38
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 +18 -20
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +3 -0
- package/dist/cjs/src/bitmex.js +19 -3
- package/dist/cjs/src/bitstamp.js +9 -0
- package/dist/cjs/src/bybit.js +2 -1
- package/dist/cjs/src/gate.js +4 -2
- package/dist/cjs/src/htx.js +67 -12
- package/dist/cjs/src/hyperliquid.js +250 -2
- package/dist/cjs/src/krakenfutures.js +74 -6
- package/dist/cjs/src/kucoin.js +43 -4
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/pro/aster.js +11 -2
- package/dist/cjs/src/pro/binance.js +4 -2
- package/dist/cjs/src/pro/bitmex.js +2 -1
- package/dist/cjs/src/pro/bybit.js +4 -2
- package/dist/cjs/src/pro/gate.js +2 -1
- package/dist/cjs/src/pro/okx.js +4 -2
- package/dist/cjs/src/whitebit.js +14 -4
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitstamp.d.ts +8 -0
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/kucoin.d.ts +33 -1
- package/js/src/abstract/kucoinfutures.d.ts +33 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +3 -0
- package/js/src/bitmex.js +19 -3
- package/js/src/bitstamp.js +9 -0
- package/js/src/bybit.js +2 -1
- package/js/src/gate.js +4 -2
- package/js/src/htx.d.ts +5 -2
- package/js/src/htx.js +67 -12
- package/js/src/hyperliquid.d.ts +64 -0
- package/js/src/hyperliquid.js +251 -3
- package/js/src/krakenfutures.js +74 -6
- package/js/src/kucoin.js +43 -4
- package/js/src/mexc.js +2 -2
- package/js/src/pro/aster.js +11 -2
- package/js/src/pro/binance.js +4 -2
- package/js/src/pro/bitmex.js +2 -1
- package/js/src/pro/bybit.js +4 -2
- package/js/src/pro/gate.js +2 -1
- package/js/src/pro/okx.js +4 -2
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +14 -4
- package/package.json +1 -1
|
@@ -1680,7 +1680,9 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
1680
1680
|
'filled': 'closed',
|
|
1681
1681
|
'notFound': 'rejected',
|
|
1682
1682
|
'untouched': 'open',
|
|
1683
|
-
'partiallyFilled': 'open',
|
|
1683
|
+
'partiallyFilled': 'open',
|
|
1684
|
+
'ENTERED_BOOK': 'open',
|
|
1685
|
+
'FULLY_EXECUTED': 'closed',
|
|
1684
1686
|
};
|
|
1685
1687
|
return this.safeString(statuses, status, status);
|
|
1686
1688
|
}
|
|
@@ -1919,6 +1921,72 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
1919
1921
|
// status: 'closed'
|
|
1920
1922
|
// }
|
|
1921
1923
|
//
|
|
1924
|
+
// order: {
|
|
1925
|
+
// type: 'ORDER',
|
|
1926
|
+
// orderId: 'a111f276-95fd-47fc-b77b-709c5ab2e9e1',
|
|
1927
|
+
// cliOrdId: null,
|
|
1928
|
+
// symbol: 'PF_LTCUSD',
|
|
1929
|
+
// side: 'buy',
|
|
1930
|
+
// quantity: '0.1',
|
|
1931
|
+
// filled: '0',
|
|
1932
|
+
// limitPrice: '40',
|
|
1933
|
+
// reduceOnly: false,
|
|
1934
|
+
// timestamp: '2026-02-13T12:09:03.738Z',
|
|
1935
|
+
// lastUpdateTimestamp: '2026-02-13T12:09:03.738Z'
|
|
1936
|
+
// },
|
|
1937
|
+
// status: 'ENTERED_BOOK',
|
|
1938
|
+
// updateReason: null,
|
|
1939
|
+
// error: null
|
|
1940
|
+
// }
|
|
1941
|
+
//
|
|
1942
|
+
const orderDictFromFetchOrder = this.safeDict(order, 'order');
|
|
1943
|
+
if (orderDictFromFetchOrder !== undefined) {
|
|
1944
|
+
// order: {
|
|
1945
|
+
// type: 'ORDER',
|
|
1946
|
+
// orderId: 'a111f276-95fd-47fc-b77b-709c5ab2e9e1',
|
|
1947
|
+
// cliOrdId: null,
|
|
1948
|
+
// symbol: 'PF_LTCUSD',
|
|
1949
|
+
// side: 'buy',
|
|
1950
|
+
// quantity: '0.1',
|
|
1951
|
+
// filled: '0',
|
|
1952
|
+
// limitPrice: '40',
|
|
1953
|
+
// reduceOnly: false,
|
|
1954
|
+
// timestamp: '2026-02-13T12:09:03.738Z',
|
|
1955
|
+
// lastUpdateTimestamp: '2026-02-13T12:09:03.738Z'
|
|
1956
|
+
// },
|
|
1957
|
+
// status: 'ENTERED_BOOK',
|
|
1958
|
+
// updateReason: null,
|
|
1959
|
+
// error: null
|
|
1960
|
+
//
|
|
1961
|
+
const datetime = this.safeString(orderDictFromFetchOrder, 'timestamp');
|
|
1962
|
+
const innerStatus = this.safeString(order, 'status');
|
|
1963
|
+
return this.safeOrder({
|
|
1964
|
+
'info': order,
|
|
1965
|
+
'id': this.safeString(orderDictFromFetchOrder, 'orderId'),
|
|
1966
|
+
'clientOrderId': this.safeStringN(orderDictFromFetchOrder, ['cliOrdId']),
|
|
1967
|
+
'timestamp': this.parse8601(datetime),
|
|
1968
|
+
'datetime': datetime,
|
|
1969
|
+
'lastTradeTimestamp': undefined,
|
|
1970
|
+
'lastUpdateTimestamp': this.parse8601(this.safeString(orderDictFromFetchOrder, 'lastUpdateTimestamp')),
|
|
1971
|
+
'symbol': this.safeSymbol(this.safeString(orderDictFromFetchOrder, 'symbol'), market),
|
|
1972
|
+
'type': undefined,
|
|
1973
|
+
'timeInForce': undefined,
|
|
1974
|
+
'postOnly': undefined,
|
|
1975
|
+
'reduceOnly': this.safeBool(orderDictFromFetchOrder, 'reduceOnly'),
|
|
1976
|
+
'side': this.safeString(orderDictFromFetchOrder, 'side'),
|
|
1977
|
+
'price': this.safeString(orderDictFromFetchOrder, 'limitPrice'),
|
|
1978
|
+
'triggerPrice': undefined,
|
|
1979
|
+
'amount': this.safeString(orderDictFromFetchOrder, 'quantity'),
|
|
1980
|
+
'cost': undefined,
|
|
1981
|
+
'average': undefined,
|
|
1982
|
+
'filled': this.safeString(orderDictFromFetchOrder, 'filled'),
|
|
1983
|
+
'remaining': undefined,
|
|
1984
|
+
'status': this.parseOrderStatus(innerStatus),
|
|
1985
|
+
'fee': undefined,
|
|
1986
|
+
'fees': undefined,
|
|
1987
|
+
'trades': undefined,
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1922
1990
|
const orderEvents = this.safeValue(order, 'orderEvents', []);
|
|
1923
1991
|
const errorStatus = this.safeString(order, 'status');
|
|
1924
1992
|
const orderEventsLength = orderEvents.length;
|
|
@@ -2389,7 +2457,7 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
2389
2457
|
// "fundingRate": -0.000000756414717067,
|
|
2390
2458
|
// "fundingRatePrediction": 0.000000195218676,
|
|
2391
2459
|
// "suspended": false,
|
|
2392
|
-
// "indexPrice": 0.
|
|
2460
|
+
// "indexPrice": 0.043391,
|
|
2393
2461
|
// "postOnly": false,
|
|
2394
2462
|
// "change24h": -0.46
|
|
2395
2463
|
// }
|
|
@@ -2402,16 +2470,16 @@ class krakenfutures extends krakenfutures$1["default"] {
|
|
|
2402
2470
|
let fundingRateResult = Precise["default"].stringDiv(fundingRateString, markPriceString);
|
|
2403
2471
|
const nextFundingRateString = this.safeString(ticker, 'fundingRatePrediction');
|
|
2404
2472
|
let nextFundingRateResult = Precise["default"].stringDiv(nextFundingRateString, markPriceString);
|
|
2405
|
-
if (fundingRateResult
|
|
2473
|
+
if (Precise["default"].stringGt(fundingRateResult, '0.25')) {
|
|
2406
2474
|
fundingRateResult = '0.25';
|
|
2407
2475
|
}
|
|
2408
|
-
else if (fundingRateResult
|
|
2476
|
+
else if (Precise["default"].stringLt(fundingRateResult, '-0.25')) {
|
|
2409
2477
|
fundingRateResult = '-0.25';
|
|
2410
2478
|
}
|
|
2411
|
-
if (nextFundingRateResult
|
|
2479
|
+
if (Precise["default"].stringGt(nextFundingRateResult, '0.25')) {
|
|
2412
2480
|
nextFundingRateResult = '0.25';
|
|
2413
2481
|
}
|
|
2414
|
-
else if (nextFundingRateResult
|
|
2482
|
+
else if (Precise["default"].stringLt(nextFundingRateResult, '-0.25')) {
|
|
2415
2483
|
nextFundingRateResult = '-0.25';
|
|
2416
2484
|
}
|
|
2417
2485
|
return {
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -128,6 +128,7 @@ class kucoin extends kucoin$1["default"] {
|
|
|
128
128
|
'broker': 'https://api-broker.kucoin.com',
|
|
129
129
|
'earn': 'https://api.kucoin.com',
|
|
130
130
|
'uta': 'https://api.kucoin.com',
|
|
131
|
+
'utaPrivate': 'https://api.kucoin.com',
|
|
131
132
|
},
|
|
132
133
|
'www': 'https://www.kucoin.com',
|
|
133
134
|
'doc': [
|
|
@@ -484,17 +485,55 @@ class kucoin extends kucoin$1["default"] {
|
|
|
484
485
|
'get': {
|
|
485
486
|
'market/announcement': 20,
|
|
486
487
|
'market/currency': 3,
|
|
488
|
+
'market/currencies': 3,
|
|
487
489
|
'market/instrument': 4,
|
|
488
490
|
'market/ticker': 15,
|
|
489
|
-
'market/orderbook': 3,
|
|
490
491
|
'market/trade': 3,
|
|
491
492
|
'market/kline': 3,
|
|
492
493
|
'market/funding-rate': 2,
|
|
493
494
|
'market/funding-rate-history': 5,
|
|
494
495
|
'market/cross-config': 25,
|
|
496
|
+
'market/collateral-discount-ratio': 10,
|
|
497
|
+
'market/index-price': 20,
|
|
498
|
+
'market/position-tiers': 20,
|
|
499
|
+
'market/open-interest': 10,
|
|
495
500
|
'server/status': 3,
|
|
496
501
|
},
|
|
497
502
|
},
|
|
503
|
+
'utaPrivate': {
|
|
504
|
+
'get': {
|
|
505
|
+
'market/orderbook': 3,
|
|
506
|
+
'account/balance': 5,
|
|
507
|
+
'account/transfer-quota': 20,
|
|
508
|
+
'account/mode': 30,
|
|
509
|
+
'account/ledger': 2,
|
|
510
|
+
'account/interest-history': 15,
|
|
511
|
+
'account/deposit/address': 5,
|
|
512
|
+
'{accountMode}/account/balance': 5,
|
|
513
|
+
'{accountMode}/account/overview': 5,
|
|
514
|
+
'{accountMode}/order/detail': 4,
|
|
515
|
+
'{accountMode}/order/open-list': 4,
|
|
516
|
+
'{accountMode}/order/history': 4,
|
|
517
|
+
'{accountMode}/order/execution': 4,
|
|
518
|
+
'{accountMode}/position/open-list': 3,
|
|
519
|
+
'{accountMode}/position/history': 2,
|
|
520
|
+
'{accountMode}/position/tiers': 20,
|
|
521
|
+
'sub-account/balance': 5,
|
|
522
|
+
'user/fee-rate': 3,
|
|
523
|
+
'dcp/query': 2,
|
|
524
|
+
},
|
|
525
|
+
'post': {
|
|
526
|
+
'account/transfer': 4,
|
|
527
|
+
'account/mode': 30,
|
|
528
|
+
'{accountMode}/account/modify-leverage': 20,
|
|
529
|
+
'{accountMode}/order/place': 1,
|
|
530
|
+
'{accountMode}/order/place-batch': 4,
|
|
531
|
+
'{accountMode}/order/cancel': 1,
|
|
532
|
+
'{accountMode}/order/cancel-batch': 4,
|
|
533
|
+
'sub-account/canTransferOut': 5,
|
|
534
|
+
'dcp/set': 2,
|
|
535
|
+
},
|
|
536
|
+
},
|
|
498
537
|
},
|
|
499
538
|
'timeframes': {
|
|
500
539
|
'1m': '1min',
|
|
@@ -2579,7 +2618,7 @@ class kucoin extends kucoin$1["default"] {
|
|
|
2579
2618
|
else {
|
|
2580
2619
|
request['tradeType'] = 'FUTURES';
|
|
2581
2620
|
}
|
|
2582
|
-
response = await this.
|
|
2621
|
+
response = await this.utaPrivateGetMarketOrderbook(this.extend(request, params));
|
|
2583
2622
|
//
|
|
2584
2623
|
// {
|
|
2585
2624
|
// "code": "200000",
|
|
@@ -5757,9 +5796,9 @@ class kucoin extends kucoin$1["default"] {
|
|
|
5757
5796
|
endpoint = '/api/v1/' + this.implodeParams(path, params);
|
|
5758
5797
|
}
|
|
5759
5798
|
let isUtaPrivate = false;
|
|
5760
|
-
if (api === 'uta') {
|
|
5799
|
+
if ((api === 'uta') || (api === 'utaPrivate')) {
|
|
5761
5800
|
endpoint = '/api/ua/v1/' + this.implodeParams(path, params);
|
|
5762
|
-
if (
|
|
5801
|
+
if (api === 'utaPrivate') {
|
|
5763
5802
|
isUtaPrivate = true;
|
|
5764
5803
|
}
|
|
5765
5804
|
}
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -152,8 +152,8 @@ class mexc extends mexc$1["default"] {
|
|
|
152
152
|
'private': 'https://www.mexc.com/open/api/v2',
|
|
153
153
|
},
|
|
154
154
|
'contract': {
|
|
155
|
-
'public': 'https://
|
|
156
|
-
'private': 'https://
|
|
155
|
+
'public': 'https://api.mexc.com/api/v1/contract',
|
|
156
|
+
'private': 'https://api.mexc.com/api/v1/private',
|
|
157
157
|
},
|
|
158
158
|
'broker': {
|
|
159
159
|
'private': 'https://api.mexc.com/api/v3/broker',
|
|
@@ -778,10 +778,19 @@ class aster extends aster$1["default"] {
|
|
|
778
778
|
// "ss": 0
|
|
779
779
|
// }
|
|
780
780
|
//
|
|
781
|
+
const e = this.safeString(trade, 'e');
|
|
782
|
+
const isPublicTrade = (e === 'trade') || (e === 'aggTrade');
|
|
781
783
|
const id = this.safeString2(trade, 't', 'a');
|
|
782
784
|
const timestamp = this.safeInteger(trade, 'T');
|
|
783
785
|
const price = this.safeString2(trade, 'L', 'p');
|
|
784
|
-
|
|
786
|
+
let amount = undefined;
|
|
787
|
+
if (isPublicTrade) {
|
|
788
|
+
amount = this.safeString(trade, 'q');
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
// private trades, amount is in 'l' field, quantity of the last filled trade
|
|
792
|
+
amount = this.safeString(trade, 'l');
|
|
793
|
+
}
|
|
785
794
|
let cost = this.safeString(trade, 'Y');
|
|
786
795
|
if (cost === undefined) {
|
|
787
796
|
if ((price !== undefined) && (amount !== undefined)) {
|
|
@@ -1711,7 +1720,7 @@ class aster extends aster$1["default"] {
|
|
|
1711
1720
|
const myTrades = this.myTrades;
|
|
1712
1721
|
myTrades.append(trade);
|
|
1713
1722
|
client.resolve(this.myTrades, messageHash);
|
|
1714
|
-
const messageHashSymbol = messageHash + '
|
|
1723
|
+
const messageHashSymbol = messageHash + '::' + symbol;
|
|
1715
1724
|
client.resolve(this.myTrades, messageHashSymbol);
|
|
1716
1725
|
}
|
|
1717
1726
|
}
|
|
@@ -352,7 +352,8 @@ class binance extends binance$1["default"] {
|
|
|
352
352
|
const symbol = market['symbol'];
|
|
353
353
|
const liquidation = this.parseWsLiquidation(rawLiquidation, market);
|
|
354
354
|
if (this.liquidations === undefined) {
|
|
355
|
-
|
|
355
|
+
const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
|
|
356
|
+
this.liquidations = new Cache.ArrayCache(limit);
|
|
356
357
|
}
|
|
357
358
|
const cache = this.liquidations;
|
|
358
359
|
cache.append(liquidation);
|
|
@@ -562,7 +563,8 @@ class binance extends binance$1["default"] {
|
|
|
562
563
|
const liquidation = this.parseWsLiquidation(message, market);
|
|
563
564
|
let cache = this.myLiquidations;
|
|
564
565
|
if (cache === undefined) {
|
|
565
|
-
|
|
566
|
+
const limit = this.safeInteger(this.options, 'myLiquidationsLimit', 1000);
|
|
567
|
+
cache = new Cache.ArrayCache(limit);
|
|
566
568
|
}
|
|
567
569
|
cache.append(liquidation);
|
|
568
570
|
this.myLiquidations = cache;
|
|
@@ -440,7 +440,8 @@ class bitmex extends bitmex$1["default"] {
|
|
|
440
440
|
const rawLiquidations = this.safeValue(message, 'data', []);
|
|
441
441
|
const newLiquidations = [];
|
|
442
442
|
if (this.liquidations === undefined) {
|
|
443
|
-
|
|
443
|
+
const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
|
|
444
|
+
this.liquidations = new Cache.ArrayCache(limit);
|
|
444
445
|
}
|
|
445
446
|
const cache = this.liquidations;
|
|
446
447
|
for (let i = 0; i < rawLiquidations.length; i++) {
|
|
@@ -1696,7 +1696,8 @@ class bybit extends bybit$1["default"] {
|
|
|
1696
1696
|
const symbol = market['symbol'];
|
|
1697
1697
|
const liquidation = this.parseWsLiquidation(rawLiquidation, market);
|
|
1698
1698
|
if (this.liquidations === undefined) {
|
|
1699
|
-
|
|
1699
|
+
const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
|
|
1700
|
+
this.liquidations = new Cache.ArrayCache(limit);
|
|
1700
1701
|
}
|
|
1701
1702
|
const cache = this.liquidations;
|
|
1702
1703
|
cache.append(liquidation);
|
|
@@ -1711,7 +1712,8 @@ class bybit extends bybit$1["default"] {
|
|
|
1711
1712
|
const symbol = market['symbol'];
|
|
1712
1713
|
const liquidation = this.parseWsLiquidation(rawLiquidation, market);
|
|
1713
1714
|
if (this.liquidations === undefined) {
|
|
1714
|
-
|
|
1715
|
+
const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
|
|
1716
|
+
this.liquidations = new Cache.ArrayCache(limit);
|
|
1715
1717
|
}
|
|
1716
1718
|
const cache = this.liquidations;
|
|
1717
1719
|
cache.append(liquidation);
|
package/dist/cjs/src/pro/gate.js
CHANGED
|
@@ -1524,7 +1524,8 @@ class gate extends gate$1["default"] {
|
|
|
1524
1524
|
const rawLiquidations = this.safeList(message, 'result', []);
|
|
1525
1525
|
const newLiquidations = [];
|
|
1526
1526
|
if (this.liquidations === undefined) {
|
|
1527
|
-
|
|
1527
|
+
const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
|
|
1528
|
+
this.liquidations = new Cache.ArrayCache(limit);
|
|
1528
1529
|
}
|
|
1529
1530
|
const cache = this.liquidations;
|
|
1530
1531
|
for (let i = 0; i < rawLiquidations.length; i++) {
|
package/dist/cjs/src/pro/okx.js
CHANGED
|
@@ -758,7 +758,8 @@ class okx extends okx$1["default"] {
|
|
|
758
758
|
const liquidation = this.parseWsLiquidation(rawLiquidation);
|
|
759
759
|
const symbol = this.safeString(liquidation, 'symbol');
|
|
760
760
|
if (this.liquidations === undefined) {
|
|
761
|
-
|
|
761
|
+
const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
|
|
762
|
+
this.liquidations = new Cache.ArrayCache(limit);
|
|
762
763
|
}
|
|
763
764
|
const cache = this.liquidations;
|
|
764
765
|
cache.append(liquidation);
|
|
@@ -855,7 +856,8 @@ class okx extends okx$1["default"] {
|
|
|
855
856
|
const liquidation = this.parseWsMyLiquidation(rawLiquidation);
|
|
856
857
|
const symbol = this.safeString(liquidation, 'symbol');
|
|
857
858
|
if (this.liquidations === undefined) {
|
|
858
|
-
|
|
859
|
+
const limit = this.safeInteger(this.options, 'liquidationsLimit', 1000);
|
|
860
|
+
this.liquidations = new Cache.ArrayCache(limit);
|
|
859
861
|
}
|
|
860
862
|
const cache = this.liquidations;
|
|
861
863
|
cache.append(liquidation);
|
package/dist/cjs/src/whitebit.js
CHANGED
|
@@ -514,6 +514,7 @@ class whitebit extends whitebit$1["default"] {
|
|
|
514
514
|
const taker = Precise["default"].stringDiv(takerFeeRate, '100');
|
|
515
515
|
const makerFeeRate = this.safeString(market, 'makerFee');
|
|
516
516
|
const maker = Precise["default"].stringDiv(makerFeeRate, '100');
|
|
517
|
+
const isSpot = !swap;
|
|
517
518
|
return {
|
|
518
519
|
'id': id,
|
|
519
520
|
'symbol': symbol,
|
|
@@ -524,7 +525,7 @@ class whitebit extends whitebit$1["default"] {
|
|
|
524
525
|
'quoteId': quoteId,
|
|
525
526
|
'settleId': settleId,
|
|
526
527
|
'type': type,
|
|
527
|
-
'spot':
|
|
528
|
+
'spot': isSpot,
|
|
528
529
|
'margin': margin,
|
|
529
530
|
'swap': swap,
|
|
530
531
|
'future': false,
|
|
@@ -535,7 +536,7 @@ class whitebit extends whitebit$1["default"] {
|
|
|
535
536
|
'inverse': inverse,
|
|
536
537
|
'taker': this.parseNumber(taker),
|
|
537
538
|
'maker': this.parseNumber(maker),
|
|
538
|
-
'contractSize': contractSize,
|
|
539
|
+
'contractSize': isSpot ? undefined : contractSize,
|
|
539
540
|
'expiry': undefined,
|
|
540
541
|
'expiryDatetime': undefined,
|
|
541
542
|
'strike': undefined,
|
|
@@ -1798,7 +1799,7 @@ class whitebit extends whitebit$1["default"] {
|
|
|
1798
1799
|
// "time":1737380046
|
|
1799
1800
|
// }
|
|
1800
1801
|
//
|
|
1801
|
-
return this.
|
|
1802
|
+
return this.safeIntegerProduct(response, 'time', 1000);
|
|
1802
1803
|
}
|
|
1803
1804
|
/**
|
|
1804
1805
|
* @method
|
|
@@ -2435,7 +2436,7 @@ class whitebit extends whitebit$1["default"] {
|
|
|
2435
2436
|
'lastTradeTimestamp': lastTradeTimestamp,
|
|
2436
2437
|
'timeInForce': undefined,
|
|
2437
2438
|
'postOnly': undefined,
|
|
2438
|
-
'status':
|
|
2439
|
+
'status': this.parseOrderStatus(this.safeString(order, 'status')),
|
|
2439
2440
|
'side': side,
|
|
2440
2441
|
'price': price,
|
|
2441
2442
|
'type': orderType,
|
|
@@ -2449,6 +2450,15 @@ class whitebit extends whitebit$1["default"] {
|
|
|
2449
2450
|
'trades': undefined,
|
|
2450
2451
|
}, market);
|
|
2451
2452
|
}
|
|
2453
|
+
parseOrderStatus(status) {
|
|
2454
|
+
const statuses = {
|
|
2455
|
+
'CANCELED': 'canceled',
|
|
2456
|
+
'OPEN': 'open',
|
|
2457
|
+
'PARTIALLY_FILLED': 'open',
|
|
2458
|
+
'FILLED': 'closed',
|
|
2459
|
+
};
|
|
2460
|
+
return this.safeStringLower(statuses, status, status);
|
|
2461
|
+
}
|
|
2452
2462
|
/**
|
|
2453
2463
|
* @method
|
|
2454
2464
|
* @name whitebit#fetchOrderTrades
|
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 } 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.37";
|
|
8
8
|
import alp from './src/alp.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import apex from './src/apex.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, 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';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.5.
|
|
41
|
+
const version = '4.5.37';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import alp from './src/alp.js';
|
|
@@ -8,13 +8,18 @@ interface Exchange {
|
|
|
8
8
|
publicGetTickerPair(params?: {}): Promise<implicitReturnType>;
|
|
9
9
|
publicGetTransactionsPair(params?: {}): Promise<implicitReturnType>;
|
|
10
10
|
publicGetTradingPairsInfo(params?: {}): Promise<implicitReturnType>;
|
|
11
|
+
publicGetMarkets(params?: {}): Promise<implicitReturnType>;
|
|
11
12
|
publicGetCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
12
13
|
publicGetEurUsd(params?: {}): Promise<implicitReturnType>;
|
|
13
14
|
publicGetTravelRuleVasps(params?: {}): Promise<implicitReturnType>;
|
|
15
|
+
publicGetFundingRatePair(params?: {}): Promise<implicitReturnType>;
|
|
16
|
+
publicGetFundingRateHistoryPair(params?: {}): Promise<implicitReturnType>;
|
|
14
17
|
privateGetTravelRuleContacts(params?: {}): Promise<implicitReturnType>;
|
|
15
18
|
privateGetContactsContactUuid(params?: {}): Promise<implicitReturnType>;
|
|
16
19
|
privateGetEarnSubscriptions(params?: {}): Promise<implicitReturnType>;
|
|
17
20
|
privateGetEarnTransactions(params?: {}): Promise<implicitReturnType>;
|
|
21
|
+
privateGetTradeHistory(params?: {}): Promise<implicitReturnType>;
|
|
22
|
+
privateGetTradeHistoryPair(params?: {}): Promise<implicitReturnType>;
|
|
18
23
|
privatePostAccountBalances(params?: {}): Promise<implicitReturnType>;
|
|
19
24
|
privatePostAccountBalancesCurrency(params?: {}): Promise<implicitReturnType>;
|
|
20
25
|
privatePostBalance(params?: {}): Promise<implicitReturnType>;
|
|
@@ -27,6 +32,7 @@ interface Exchange {
|
|
|
27
32
|
privatePostOpenOrder(params?: {}): Promise<implicitReturnType>;
|
|
28
33
|
privatePostOpenOrdersAll(params?: {}): Promise<implicitReturnType>;
|
|
29
34
|
privatePostOpenOrdersPair(params?: {}): Promise<implicitReturnType>;
|
|
35
|
+
privatePostReplaceOrder(params?: {}): Promise<implicitReturnType>;
|
|
30
36
|
privatePostOrderStatus(params?: {}): Promise<implicitReturnType>;
|
|
31
37
|
privatePostCancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
32
38
|
privatePostCancelAllOrders(params?: {}): Promise<implicitReturnType>;
|
|
@@ -52,6 +58,8 @@ interface Exchange {
|
|
|
52
58
|
privatePostLiquidationAddressInfo(params?: {}): Promise<implicitReturnType>;
|
|
53
59
|
privatePostBtcUnconfirmed(params?: {}): Promise<implicitReturnType>;
|
|
54
60
|
privatePostWebsocketsToken(params?: {}): Promise<implicitReturnType>;
|
|
61
|
+
privatePostRevokeAllApiKeys(params?: {}): Promise<implicitReturnType>;
|
|
62
|
+
privatePostGetMaxOrderAmount(params?: {}): Promise<implicitReturnType>;
|
|
55
63
|
privatePostBtcWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
56
64
|
privatePostBtcAddress(params?: {}): Promise<implicitReturnType>;
|
|
57
65
|
privatePostRippleWithdrawal(params?: {}): Promise<implicitReturnType>;
|
|
@@ -310,6 +310,7 @@ interface Exchange {
|
|
|
310
310
|
privatePostV5AccountBorrow(params?: {}): Promise<implicitReturnType>;
|
|
311
311
|
privatePostV5AccountRepay(params?: {}): Promise<implicitReturnType>;
|
|
312
312
|
privatePostV5AccountNoConvertRepay(params?: {}): Promise<implicitReturnType>;
|
|
313
|
+
privatePostV5AccountSetLimitPxAction(params?: {}): Promise<implicitReturnType>;
|
|
313
314
|
privatePostV5AssetExchangeQuoteApply(params?: {}): Promise<implicitReturnType>;
|
|
314
315
|
privatePostV5AssetExchangeConvertExecute(params?: {}): Promise<implicitReturnType>;
|
|
315
316
|
privatePostV5AssetTransferInterTransfer(params?: {}): Promise<implicitReturnType>;
|
|
@@ -259,15 +259,47 @@ interface Exchange {
|
|
|
259
259
|
earnDeleteEarnOrders(params?: {}): Promise<implicitReturnType>;
|
|
260
260
|
utaGetMarketAnnouncement(params?: {}): Promise<implicitReturnType>;
|
|
261
261
|
utaGetMarketCurrency(params?: {}): Promise<implicitReturnType>;
|
|
262
|
+
utaGetMarketCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
262
263
|
utaGetMarketInstrument(params?: {}): Promise<implicitReturnType>;
|
|
263
264
|
utaGetMarketTicker(params?: {}): Promise<implicitReturnType>;
|
|
264
|
-
utaGetMarketOrderbook(params?: {}): Promise<implicitReturnType>;
|
|
265
265
|
utaGetMarketTrade(params?: {}): Promise<implicitReturnType>;
|
|
266
266
|
utaGetMarketKline(params?: {}): Promise<implicitReturnType>;
|
|
267
267
|
utaGetMarketFundingRate(params?: {}): Promise<implicitReturnType>;
|
|
268
268
|
utaGetMarketFundingRateHistory(params?: {}): Promise<implicitReturnType>;
|
|
269
269
|
utaGetMarketCrossConfig(params?: {}): Promise<implicitReturnType>;
|
|
270
|
+
utaGetMarketCollateralDiscountRatio(params?: {}): Promise<implicitReturnType>;
|
|
271
|
+
utaGetMarketIndexPrice(params?: {}): Promise<implicitReturnType>;
|
|
272
|
+
utaGetMarketPositionTiers(params?: {}): Promise<implicitReturnType>;
|
|
273
|
+
utaGetMarketOpenInterest(params?: {}): Promise<implicitReturnType>;
|
|
270
274
|
utaGetServerStatus(params?: {}): Promise<implicitReturnType>;
|
|
275
|
+
utaPrivateGetMarketOrderbook(params?: {}): Promise<implicitReturnType>;
|
|
276
|
+
utaPrivateGetAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
277
|
+
utaPrivateGetAccountTransferQuota(params?: {}): Promise<implicitReturnType>;
|
|
278
|
+
utaPrivateGetAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
279
|
+
utaPrivateGetAccountLedger(params?: {}): Promise<implicitReturnType>;
|
|
280
|
+
utaPrivateGetAccountInterestHistory(params?: {}): Promise<implicitReturnType>;
|
|
281
|
+
utaPrivateGetAccountDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
282
|
+
utaPrivateGetAccountModeAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
283
|
+
utaPrivateGetAccountModeAccountOverview(params?: {}): Promise<implicitReturnType>;
|
|
284
|
+
utaPrivateGetAccountModeOrderDetail(params?: {}): Promise<implicitReturnType>;
|
|
285
|
+
utaPrivateGetAccountModeOrderOpenList(params?: {}): Promise<implicitReturnType>;
|
|
286
|
+
utaPrivateGetAccountModeOrderHistory(params?: {}): Promise<implicitReturnType>;
|
|
287
|
+
utaPrivateGetAccountModeOrderExecution(params?: {}): Promise<implicitReturnType>;
|
|
288
|
+
utaPrivateGetAccountModePositionOpenList(params?: {}): Promise<implicitReturnType>;
|
|
289
|
+
utaPrivateGetAccountModePositionHistory(params?: {}): Promise<implicitReturnType>;
|
|
290
|
+
utaPrivateGetAccountModePositionTiers(params?: {}): Promise<implicitReturnType>;
|
|
291
|
+
utaPrivateGetSubAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
292
|
+
utaPrivateGetUserFeeRate(params?: {}): Promise<implicitReturnType>;
|
|
293
|
+
utaPrivateGetDcpQuery(params?: {}): Promise<implicitReturnType>;
|
|
294
|
+
utaPrivatePostAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
295
|
+
utaPrivatePostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
296
|
+
utaPrivatePostAccountModeAccountModifyLeverage(params?: {}): Promise<implicitReturnType>;
|
|
297
|
+
utaPrivatePostAccountModeOrderPlace(params?: {}): Promise<implicitReturnType>;
|
|
298
|
+
utaPrivatePostAccountModeOrderPlaceBatch(params?: {}): Promise<implicitReturnType>;
|
|
299
|
+
utaPrivatePostAccountModeOrderCancel(params?: {}): Promise<implicitReturnType>;
|
|
300
|
+
utaPrivatePostAccountModeOrderCancelBatch(params?: {}): Promise<implicitReturnType>;
|
|
301
|
+
utaPrivatePostSubAccountCanTransferOut(params?: {}): Promise<implicitReturnType>;
|
|
302
|
+
utaPrivatePostDcpSet(params?: {}): Promise<implicitReturnType>;
|
|
271
303
|
}
|
|
272
304
|
declare abstract class Exchange extends _Exchange {
|
|
273
305
|
}
|
|
@@ -287,15 +287,47 @@ interface kucoin {
|
|
|
287
287
|
earnDeleteEarnOrders(params?: {}): Promise<implicitReturnType>;
|
|
288
288
|
utaGetMarketAnnouncement(params?: {}): Promise<implicitReturnType>;
|
|
289
289
|
utaGetMarketCurrency(params?: {}): Promise<implicitReturnType>;
|
|
290
|
+
utaGetMarketCurrencies(params?: {}): Promise<implicitReturnType>;
|
|
290
291
|
utaGetMarketInstrument(params?: {}): Promise<implicitReturnType>;
|
|
291
292
|
utaGetMarketTicker(params?: {}): Promise<implicitReturnType>;
|
|
292
|
-
utaGetMarketOrderbook(params?: {}): Promise<implicitReturnType>;
|
|
293
293
|
utaGetMarketTrade(params?: {}): Promise<implicitReturnType>;
|
|
294
294
|
utaGetMarketKline(params?: {}): Promise<implicitReturnType>;
|
|
295
295
|
utaGetMarketFundingRate(params?: {}): Promise<implicitReturnType>;
|
|
296
296
|
utaGetMarketFundingRateHistory(params?: {}): Promise<implicitReturnType>;
|
|
297
297
|
utaGetMarketCrossConfig(params?: {}): Promise<implicitReturnType>;
|
|
298
|
+
utaGetMarketCollateralDiscountRatio(params?: {}): Promise<implicitReturnType>;
|
|
299
|
+
utaGetMarketIndexPrice(params?: {}): Promise<implicitReturnType>;
|
|
300
|
+
utaGetMarketPositionTiers(params?: {}): Promise<implicitReturnType>;
|
|
301
|
+
utaGetMarketOpenInterest(params?: {}): Promise<implicitReturnType>;
|
|
298
302
|
utaGetServerStatus(params?: {}): Promise<implicitReturnType>;
|
|
303
|
+
utaPrivateGetMarketOrderbook(params?: {}): Promise<implicitReturnType>;
|
|
304
|
+
utaPrivateGetAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
305
|
+
utaPrivateGetAccountTransferQuota(params?: {}): Promise<implicitReturnType>;
|
|
306
|
+
utaPrivateGetAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
307
|
+
utaPrivateGetAccountLedger(params?: {}): Promise<implicitReturnType>;
|
|
308
|
+
utaPrivateGetAccountInterestHistory(params?: {}): Promise<implicitReturnType>;
|
|
309
|
+
utaPrivateGetAccountDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
310
|
+
utaPrivateGetAccountModeAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
311
|
+
utaPrivateGetAccountModeAccountOverview(params?: {}): Promise<implicitReturnType>;
|
|
312
|
+
utaPrivateGetAccountModeOrderDetail(params?: {}): Promise<implicitReturnType>;
|
|
313
|
+
utaPrivateGetAccountModeOrderOpenList(params?: {}): Promise<implicitReturnType>;
|
|
314
|
+
utaPrivateGetAccountModeOrderHistory(params?: {}): Promise<implicitReturnType>;
|
|
315
|
+
utaPrivateGetAccountModeOrderExecution(params?: {}): Promise<implicitReturnType>;
|
|
316
|
+
utaPrivateGetAccountModePositionOpenList(params?: {}): Promise<implicitReturnType>;
|
|
317
|
+
utaPrivateGetAccountModePositionHistory(params?: {}): Promise<implicitReturnType>;
|
|
318
|
+
utaPrivateGetAccountModePositionTiers(params?: {}): Promise<implicitReturnType>;
|
|
319
|
+
utaPrivateGetSubAccountBalance(params?: {}): Promise<implicitReturnType>;
|
|
320
|
+
utaPrivateGetUserFeeRate(params?: {}): Promise<implicitReturnType>;
|
|
321
|
+
utaPrivateGetDcpQuery(params?: {}): Promise<implicitReturnType>;
|
|
322
|
+
utaPrivatePostAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
323
|
+
utaPrivatePostAccountMode(params?: {}): Promise<implicitReturnType>;
|
|
324
|
+
utaPrivatePostAccountModeAccountModifyLeverage(params?: {}): Promise<implicitReturnType>;
|
|
325
|
+
utaPrivatePostAccountModeOrderPlace(params?: {}): Promise<implicitReturnType>;
|
|
326
|
+
utaPrivatePostAccountModeOrderPlaceBatch(params?: {}): Promise<implicitReturnType>;
|
|
327
|
+
utaPrivatePostAccountModeOrderCancel(params?: {}): Promise<implicitReturnType>;
|
|
328
|
+
utaPrivatePostAccountModeOrderCancelBatch(params?: {}): Promise<implicitReturnType>;
|
|
329
|
+
utaPrivatePostSubAccountCanTransferOut(params?: {}): Promise<implicitReturnType>;
|
|
330
|
+
utaPrivatePostDcpSet(params?: {}): Promise<implicitReturnType>;
|
|
299
331
|
}
|
|
300
332
|
declare abstract class kucoin extends _kucoin {
|
|
301
333
|
}
|
|
@@ -766,6 +766,7 @@ export default class Exchange {
|
|
|
766
766
|
fetchOrderStatus(id: string, symbol?: Str, params?: {}): Promise<string>;
|
|
767
767
|
fetchUnifiedOrder(order: any, params?: {}): Promise<Order>;
|
|
768
768
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
769
|
+
createTwapOrder(symbol: string, side: OrderSide, amount: number, duration: number, params?: {}): Promise<Order>;
|
|
769
770
|
createConvertTrade(id: string, fromCode: string, toCode: string, amount?: Num, params?: {}): Promise<Conversion>;
|
|
770
771
|
fetchConvertTrade(id: string, code?: Str, params?: {}): Promise<Conversion>;
|
|
771
772
|
fetchConvertTradeHistory(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Conversion[]>;
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -5491,6 +5491,9 @@ export default class Exchange {
|
|
|
5491
5491
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
5492
5492
|
throw new NotSupported(this.id + ' createOrder() is not supported yet');
|
|
5493
5493
|
}
|
|
5494
|
+
async createTwapOrder(symbol, side, amount, duration, params = {}) {
|
|
5495
|
+
throw new NotSupported(this.id + ' createTwapOrder() is not supported yet');
|
|
5496
|
+
}
|
|
5494
5497
|
async createConvertTrade(id, fromCode, toCode, amount = undefined, params = {}) {
|
|
5495
5498
|
throw new NotSupported(this.id + ' createConvertTrade() is not supported yet');
|
|
5496
5499
|
}
|
package/js/src/bitmex.js
CHANGED
|
@@ -1881,10 +1881,12 @@ export default class bitmex extends Exchange {
|
|
|
1881
1881
|
else {
|
|
1882
1882
|
filled = cumQty;
|
|
1883
1883
|
}
|
|
1884
|
-
const execInst = this.safeString(order, 'execInst');
|
|
1884
|
+
const execInst = this.safeString(order, 'execInst', '');
|
|
1885
1885
|
let postOnly = undefined;
|
|
1886
|
-
|
|
1887
|
-
|
|
1886
|
+
let reduceOnly = undefined;
|
|
1887
|
+
if (execInst.length > 0) {
|
|
1888
|
+
postOnly = (execInst.indexOf('ParticipateDoNotInitiate') >= 0);
|
|
1889
|
+
reduceOnly = ((execInst.indexOf('ReduceOnly') >= 0) || (execInst.indexOf('Close') >= 0));
|
|
1888
1890
|
}
|
|
1889
1891
|
const timestamp = this.parse8601(this.safeString(order, 'timestamp'));
|
|
1890
1892
|
const triggerPrice = this.safeNumber(order, 'stopPx');
|
|
@@ -1900,6 +1902,7 @@ export default class bitmex extends Exchange {
|
|
|
1900
1902
|
'type': this.safeStringLower(order, 'ordType'),
|
|
1901
1903
|
'timeInForce': this.parseTimeInForce(this.safeString(order, 'timeInForce')),
|
|
1902
1904
|
'postOnly': postOnly,
|
|
1905
|
+
'reduceOnly': reduceOnly,
|
|
1903
1906
|
'side': this.safeStringLower(order, 'side'),
|
|
1904
1907
|
'price': this.safeString(order, 'price'),
|
|
1905
1908
|
'triggerPrice': triggerPrice,
|
|
@@ -2008,6 +2011,8 @@ export default class bitmex extends Exchange {
|
|
|
2008
2011
|
throw new InvalidOrder(this.id + ' createOrder() does not support reduceOnly for ' + market['type'] + ' orders, reduceOnly orders are supported for swap and future markets only');
|
|
2009
2012
|
}
|
|
2010
2013
|
}
|
|
2014
|
+
const postOnly = this.safeBool(params, 'postOnly');
|
|
2015
|
+
params = this.omit(params, ['reduceOnly', 'postOnly']);
|
|
2011
2016
|
const brokerId = this.safeString(this.options, 'brokerId', 'CCXT');
|
|
2012
2017
|
const qty = this.parseToInt(this.amountToPrecision(symbol, amount));
|
|
2013
2018
|
const request = {
|
|
@@ -2017,6 +2022,17 @@ export default class bitmex extends Exchange {
|
|
|
2017
2022
|
'ordType': orderType,
|
|
2018
2023
|
'text': brokerId,
|
|
2019
2024
|
};
|
|
2025
|
+
const execInstructions = [];
|
|
2026
|
+
if (reduceOnly === true) {
|
|
2027
|
+
execInstructions.push('ReduceOnly');
|
|
2028
|
+
}
|
|
2029
|
+
if (postOnly === true) {
|
|
2030
|
+
execInstructions.push('ParticipateDoNotInitiate');
|
|
2031
|
+
}
|
|
2032
|
+
const execInstLength = execInstructions.length;
|
|
2033
|
+
if (execInstLength > 0) {
|
|
2034
|
+
request['execInst'] = execInstructions.join(',');
|
|
2035
|
+
}
|
|
2020
2036
|
// support for unified trigger format
|
|
2021
2037
|
const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPx', 'stopPrice']);
|
|
2022
2038
|
let trailingAmount = this.safeString2(params, 'trailingAmount', 'pegOffsetValue');
|