ccxt 4.4.32 → 4.4.34
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 +8 -7
- package/dist/ccxt.browser.min.js +6 -6
- package/dist/cjs/ccxt.js +4 -1
- package/dist/cjs/src/abstract/ellipx.js +9 -0
- package/dist/cjs/src/alpaca.js +2 -0
- package/dist/cjs/src/base/Exchange.js +116 -1
- package/dist/cjs/src/binance.js +164 -6
- package/dist/cjs/src/bingx.js +156 -9
- package/dist/cjs/src/bitbank.js +5 -0
- package/dist/cjs/src/bitbns.js +2 -0
- package/dist/cjs/src/bitfinex2.js +2 -1
- package/dist/cjs/src/bitget.js +177 -44
- package/dist/cjs/src/bitmex.js +2 -0
- package/dist/cjs/src/bitopro.js +3 -0
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/btcmarkets.js +2 -0
- package/dist/cjs/src/bybit.js +148 -13
- package/dist/cjs/src/cex.js +16 -6
- package/dist/cjs/src/coinbase.js +5 -24
- package/dist/cjs/src/coinbaseexchange.js +2 -1
- package/dist/cjs/src/coinex.js +2 -0
- package/dist/cjs/src/coinone.js +7 -7
- package/dist/cjs/src/coinsph.js +7 -7
- package/dist/cjs/src/coinspot.js +39 -39
- package/dist/cjs/src/cryptocom.js +36 -34
- package/dist/cjs/src/ellipx.js +1871 -0
- package/dist/cjs/src/gate.js +2 -1
- package/dist/cjs/src/hyperliquid.js +16 -2
- package/dist/cjs/src/kraken.js +1 -0
- package/dist/cjs/src/krakenfutures.js +3 -1
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/lbank.js +1 -0
- package/dist/cjs/src/okcoin.js +2 -0
- package/dist/cjs/src/okx.js +104 -9
- package/dist/cjs/src/onetrading.js +14 -1
- package/dist/cjs/src/paradex.js +2 -0
- package/dist/cjs/src/phemex.js +35 -7
- package/dist/cjs/src/poloniex.js +3 -1
- package/dist/cjs/src/poloniexfutures.js +3 -1
- package/dist/cjs/src/pro/idex.js +5 -0
- package/dist/cjs/src/pro/okx.js +11 -1
- package/dist/cjs/src/pro/probit.js +4 -2
- package/dist/cjs/src/pro/woo.js +15 -15
- package/dist/cjs/src/vertex.js +2 -0
- package/dist/cjs/src/woo.js +69 -69
- package/examples/js/cli.js +1 -1
- package/js/ccxt.d.ts +5 -2
- package/js/ccxt.js +4 -2
- package/js/src/abstract/bingx.d.ts +16 -0
- package/js/src/abstract/bitbank.d.ts +5 -0
- package/js/src/abstract/bitfinex2.d.ts +1 -0
- package/js/src/abstract/coinbaseexchange.d.ts +1 -0
- package/js/src/abstract/ellipx.d.ts +28 -0
- package/js/src/abstract/ellipx.js +11 -0
- package/js/src/abstract/kraken.d.ts +1 -0
- package/js/src/alpaca.js +2 -0
- package/js/src/base/Exchange.d.ts +11 -0
- package/js/src/base/Exchange.js +116 -1
- package/js/src/binance.js +164 -6
- package/js/src/bingx.d.ts +3 -1
- package/js/src/bingx.js +156 -9
- package/js/src/bitbank.js +5 -0
- package/js/src/bitbns.js +2 -0
- package/js/src/bitfinex2.js +2 -1
- package/js/src/bitget.d.ts +4 -4
- package/js/src/bitget.js +177 -44
- package/js/src/bitmex.js +2 -0
- package/js/src/bitopro.d.ts +1 -0
- package/js/src/bitopro.js +3 -0
- package/js/src/bitrue.js +1 -0
- package/js/src/btcmarkets.d.ts +1 -0
- package/js/src/btcmarkets.js +2 -0
- package/js/src/bybit.d.ts +3 -2
- package/js/src/bybit.js +149 -14
- package/js/src/cex.d.ts +1 -0
- package/js/src/cex.js +17 -7
- package/js/src/coinbase.d.ts +2 -1
- package/js/src/coinbase.js +5 -24
- package/js/src/coinbaseexchange.js +2 -1
- package/js/src/coinex.js +2 -0
- package/js/src/coinone.js +7 -7
- package/js/src/coinsph.js +7 -7
- package/js/src/coinspot.js +39 -39
- package/js/src/cryptocom.d.ts +1 -1
- package/js/src/cryptocom.js +36 -34
- package/js/src/ellipx.d.ts +236 -0
- package/js/src/ellipx.js +1874 -0
- package/js/src/gate.d.ts +2 -2
- package/js/src/gate.js +2 -1
- package/js/src/hyperliquid.d.ts +2 -1
- package/js/src/hyperliquid.js +16 -2
- package/js/src/kraken.js +1 -0
- package/js/src/krakenfutures.js +3 -1
- package/js/src/kucoinfutures.d.ts +1 -1
- package/js/src/kucoinfutures.js +1 -1
- package/js/src/lbank.js +1 -0
- package/js/src/okcoin.js +2 -0
- package/js/src/okx.d.ts +1 -1
- package/js/src/okx.js +104 -9
- package/js/src/onetrading.d.ts +5 -0
- package/js/src/onetrading.js +15 -2
- package/js/src/paradex.js +2 -0
- package/js/src/phemex.d.ts +4 -0
- package/js/src/phemex.js +35 -7
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/poloniex.js +3 -1
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/poloniexfutures.js +3 -1
- package/js/src/pro/idex.d.ts +5 -0
- package/js/src/pro/idex.js +5 -0
- package/js/src/pro/okx.js +11 -1
- package/js/src/pro/probit.js +4 -2
- package/js/src/pro/woo.d.ts +11 -11
- package/js/src/pro/woo.js +15 -15
- package/js/src/vertex.js +2 -0
- package/js/src/woo.d.ts +60 -60
- package/js/src/woo.js +69 -69
- package/package.json +3 -3
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -1439,6 +1439,141 @@ class bitget extends bitget$1 {
|
|
|
1439
1439
|
},
|
|
1440
1440
|
'defaultTimeInForce': 'GTC', // 'GTC' = Good To Cancel (default), 'IOC' = Immediate Or Cancel
|
|
1441
1441
|
},
|
|
1442
|
+
'features': {
|
|
1443
|
+
'spot': {
|
|
1444
|
+
'sandbox': true,
|
|
1445
|
+
'createOrder': {
|
|
1446
|
+
'marginMode': true,
|
|
1447
|
+
'triggerPrice': true,
|
|
1448
|
+
'triggerPriceType': {
|
|
1449
|
+
'last': true,
|
|
1450
|
+
'mark': true,
|
|
1451
|
+
'index': false, // not on spot
|
|
1452
|
+
},
|
|
1453
|
+
'triggerDirection': false,
|
|
1454
|
+
'stopLossPrice': true,
|
|
1455
|
+
'takeProfitPrice': true,
|
|
1456
|
+
'attachedStopLossTakeProfit': {
|
|
1457
|
+
'triggerPriceType': {
|
|
1458
|
+
'last': false,
|
|
1459
|
+
'mark': false,
|
|
1460
|
+
'index': false,
|
|
1461
|
+
},
|
|
1462
|
+
'limitPrice': true,
|
|
1463
|
+
},
|
|
1464
|
+
'timeInForce': {
|
|
1465
|
+
'GTC': true,
|
|
1466
|
+
'IOC': true,
|
|
1467
|
+
'FOK': true,
|
|
1468
|
+
'PO': true,
|
|
1469
|
+
'GTD': false,
|
|
1470
|
+
},
|
|
1471
|
+
'hedged': false,
|
|
1472
|
+
'trailing': false,
|
|
1473
|
+
'marketBuyRequiresPrice': true,
|
|
1474
|
+
'marketBuyByCost': true,
|
|
1475
|
+
// exchange-supported features
|
|
1476
|
+
// 'selfTradePrevention': true,
|
|
1477
|
+
// 'twap': false,
|
|
1478
|
+
// 'iceberg': false,
|
|
1479
|
+
// 'oco': false,
|
|
1480
|
+
},
|
|
1481
|
+
'createOrders': {
|
|
1482
|
+
'max': 50,
|
|
1483
|
+
},
|
|
1484
|
+
'fetchMyTrades': {
|
|
1485
|
+
'marginMode': true,
|
|
1486
|
+
'limit': 100,
|
|
1487
|
+
'daysBack': undefined,
|
|
1488
|
+
'untilDays': 90,
|
|
1489
|
+
},
|
|
1490
|
+
'fetchOrder': {
|
|
1491
|
+
'marginMode': false,
|
|
1492
|
+
'trigger': false,
|
|
1493
|
+
'trailing': false,
|
|
1494
|
+
},
|
|
1495
|
+
'fetchOpenOrders': {
|
|
1496
|
+
'marginMode': true,
|
|
1497
|
+
'limit': 100,
|
|
1498
|
+
'trigger': true,
|
|
1499
|
+
'trailing': false,
|
|
1500
|
+
},
|
|
1501
|
+
'fetchOrders': undefined,
|
|
1502
|
+
'fetchClosedOrders': {
|
|
1503
|
+
'marginMode': true,
|
|
1504
|
+
'limit': 100,
|
|
1505
|
+
'daysBackClosed': undefined,
|
|
1506
|
+
'daysBackCanceled': undefined,
|
|
1507
|
+
'untilDays': 90,
|
|
1508
|
+
'trigger': true,
|
|
1509
|
+
'trailing': false,
|
|
1510
|
+
},
|
|
1511
|
+
'fetchOHLCV': {
|
|
1512
|
+
'limit': 1000, // variable timespans for recent endpoint, 200 for historical
|
|
1513
|
+
},
|
|
1514
|
+
},
|
|
1515
|
+
'forPerps': {
|
|
1516
|
+
'extends': 'spot',
|
|
1517
|
+
'createOrder': {
|
|
1518
|
+
'triggerPrice': true,
|
|
1519
|
+
'triggerPriceType': {
|
|
1520
|
+
'last': true,
|
|
1521
|
+
'mark': true,
|
|
1522
|
+
'index': false, // not on spot
|
|
1523
|
+
},
|
|
1524
|
+
'triggerDirection': false,
|
|
1525
|
+
'stopLossPrice': true,
|
|
1526
|
+
'takeProfitPrice': true,
|
|
1527
|
+
'attachedStopLossTakeProfit': {
|
|
1528
|
+
'triggerPriceType': {
|
|
1529
|
+
'last': true,
|
|
1530
|
+
'mark': true,
|
|
1531
|
+
'index': true,
|
|
1532
|
+
},
|
|
1533
|
+
'limitPrice': false,
|
|
1534
|
+
},
|
|
1535
|
+
'timeInForce': {
|
|
1536
|
+
'GTC': true,
|
|
1537
|
+
'IOC': true,
|
|
1538
|
+
'FOK': true,
|
|
1539
|
+
'PO': true,
|
|
1540
|
+
'GTD': false,
|
|
1541
|
+
},
|
|
1542
|
+
'hedged': true,
|
|
1543
|
+
'trailing': true,
|
|
1544
|
+
'marketBuyRequiresPrice': false,
|
|
1545
|
+
'marketBuyByCost': false,
|
|
1546
|
+
// exchange-supported features
|
|
1547
|
+
// 'selfTradePrevention': true,
|
|
1548
|
+
// 'trailing': true,
|
|
1549
|
+
// 'twap': false,
|
|
1550
|
+
// 'iceberg': false,
|
|
1551
|
+
// 'oco': false,
|
|
1552
|
+
},
|
|
1553
|
+
'fetchMyTrades': {
|
|
1554
|
+
'untilDays': 7,
|
|
1555
|
+
},
|
|
1556
|
+
'fetchClosedOrders': {
|
|
1557
|
+
'trailing': true,
|
|
1558
|
+
},
|
|
1559
|
+
},
|
|
1560
|
+
'swap': {
|
|
1561
|
+
'linear': {
|
|
1562
|
+
'extends': 'forPerps',
|
|
1563
|
+
},
|
|
1564
|
+
'inverse': {
|
|
1565
|
+
'extends': 'forPerps',
|
|
1566
|
+
},
|
|
1567
|
+
},
|
|
1568
|
+
'future': {
|
|
1569
|
+
'linear': {
|
|
1570
|
+
'extends': 'forPerps',
|
|
1571
|
+
},
|
|
1572
|
+
'inverse': {
|
|
1573
|
+
'extends': 'forPerps',
|
|
1574
|
+
},
|
|
1575
|
+
},
|
|
1576
|
+
},
|
|
1442
1577
|
});
|
|
1443
1578
|
}
|
|
1444
1579
|
setSandboxMode(enabled) {
|
|
@@ -4275,7 +4410,7 @@ class bitget extends bitget$1 {
|
|
|
4275
4410
|
if (type === 'limit') {
|
|
4276
4411
|
request['price'] = this.priceToPrecision(symbol, price);
|
|
4277
4412
|
}
|
|
4278
|
-
const
|
|
4413
|
+
const triggerPriceType = this.safeString2(params, 'triggerPriceType', 'triggerType', 'mark_price');
|
|
4279
4414
|
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
4280
4415
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
4281
4416
|
const exchangeSpecificTifParam = this.safeString2(params, 'force', 'timeInForce');
|
|
@@ -4306,7 +4441,7 @@ class bitget extends bitget$1 {
|
|
|
4306
4441
|
request['clientOid'] = clientOrderId;
|
|
4307
4442
|
}
|
|
4308
4443
|
if (isTriggerOrder || isStopLossOrTakeProfitTrigger || isTrailingPercentOrder) {
|
|
4309
|
-
request['triggerType'] =
|
|
4444
|
+
request['triggerType'] = triggerPriceType;
|
|
4310
4445
|
}
|
|
4311
4446
|
if (isTrailingPercentOrder) {
|
|
4312
4447
|
if (!isMarketOrder) {
|
|
@@ -4452,7 +4587,7 @@ class bitget extends bitget$1 {
|
|
|
4452
4587
|
}
|
|
4453
4588
|
if (triggerPrice !== undefined) {
|
|
4454
4589
|
request['planType'] = planType;
|
|
4455
|
-
request['triggerType'] =
|
|
4590
|
+
request['triggerType'] = triggerPriceType;
|
|
4456
4591
|
request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
|
|
4457
4592
|
if (price !== undefined) {
|
|
4458
4593
|
request['executePrice'] = this.priceToPrecision(symbol, price);
|
|
@@ -4769,7 +4904,7 @@ class bitget extends bitget$1 {
|
|
|
4769
4904
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
4770
4905
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4771
4906
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
|
|
4772
|
-
* @param {boolean} [params.
|
|
4907
|
+
* @param {boolean} [params.trigger] set to true for canceling trigger orders
|
|
4773
4908
|
* @param {string} [params.planType] *swap only* either profit_plan, loss_plan, normal_plan, pos_profit, pos_loss, moving_plan or track_plan
|
|
4774
4909
|
* @param {boolean} [params.trailing] set to true if you want to cancel a trailing order
|
|
4775
4910
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -4793,19 +4928,19 @@ class bitget extends bitget$1 {
|
|
|
4793
4928
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
4794
4929
|
const request = {};
|
|
4795
4930
|
const trailing = this.safeValue(params, 'trailing');
|
|
4796
|
-
const
|
|
4931
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
4797
4932
|
params = this.omit(params, ['stop', 'trigger', 'trailing']);
|
|
4798
|
-
if (!(market['spot'] &&
|
|
4933
|
+
if (!(market['spot'] && trigger)) {
|
|
4799
4934
|
request['symbol'] = market['id'];
|
|
4800
4935
|
}
|
|
4801
|
-
if (!((market['swap'] || market['future']) &&
|
|
4936
|
+
if (!((market['swap'] || market['future']) && trigger)) {
|
|
4802
4937
|
request['orderId'] = id;
|
|
4803
4938
|
}
|
|
4804
4939
|
if ((market['swap']) || (market['future'])) {
|
|
4805
4940
|
let productType = undefined;
|
|
4806
4941
|
[productType, params] = this.handleProductTypeAndParams(market, params);
|
|
4807
4942
|
request['productType'] = productType;
|
|
4808
|
-
if (
|
|
4943
|
+
if (trigger || trailing) {
|
|
4809
4944
|
const orderIdList = [];
|
|
4810
4945
|
const orderId = {
|
|
4811
4946
|
'orderId': id,
|
|
@@ -4818,7 +4953,7 @@ class bitget extends bitget$1 {
|
|
|
4818
4953
|
request['planType'] = planType;
|
|
4819
4954
|
response = await this.privateMixPostV2MixOrderCancelPlanOrder(this.extend(request, params));
|
|
4820
4955
|
}
|
|
4821
|
-
else if (
|
|
4956
|
+
else if (trigger) {
|
|
4822
4957
|
response = await this.privateMixPostV2MixOrderCancelPlanOrder(this.extend(request, params));
|
|
4823
4958
|
}
|
|
4824
4959
|
else {
|
|
@@ -4835,7 +4970,7 @@ class bitget extends bitget$1 {
|
|
|
4835
4970
|
}
|
|
4836
4971
|
}
|
|
4837
4972
|
else {
|
|
4838
|
-
if (
|
|
4973
|
+
if (trigger) {
|
|
4839
4974
|
response = await this.privateSpotPostV2SpotTradeCancelPlanOrder(this.extend(request, params));
|
|
4840
4975
|
}
|
|
4841
4976
|
else {
|
|
@@ -4889,7 +5024,7 @@ class bitget extends bitget$1 {
|
|
|
4889
5024
|
//
|
|
4890
5025
|
const data = this.safeValue(response, 'data', {});
|
|
4891
5026
|
let order = undefined;
|
|
4892
|
-
if ((market['swap'] || market['future']) &&
|
|
5027
|
+
if ((market['swap'] || market['future']) && trigger) {
|
|
4893
5028
|
const orderInfo = this.safeValue(data, 'successList', []);
|
|
4894
5029
|
order = orderInfo[0];
|
|
4895
5030
|
}
|
|
@@ -4911,7 +5046,7 @@ class bitget extends bitget$1 {
|
|
|
4911
5046
|
* @param {string} symbol unified market symbol, default is undefined
|
|
4912
5047
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4913
5048
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
|
|
4914
|
-
* @param {boolean} [params.
|
|
5049
|
+
* @param {boolean} [params.trigger] *contract only* set to true for canceling trigger orders
|
|
4915
5050
|
* @returns {object} an array of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4916
5051
|
*/
|
|
4917
5052
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
@@ -4930,7 +5065,7 @@ class bitget extends bitget$1 {
|
|
|
4930
5065
|
}
|
|
4931
5066
|
let marginMode = undefined;
|
|
4932
5067
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrders', params);
|
|
4933
|
-
const
|
|
5068
|
+
const trigger = this.safeValue2(params, 'stop', 'trigger');
|
|
4934
5069
|
params = this.omit(params, ['stop', 'trigger']);
|
|
4935
5070
|
const orderIdList = [];
|
|
4936
5071
|
for (let i = 0; i < ids.length; i++) {
|
|
@@ -4967,7 +5102,7 @@ class bitget extends bitget$1 {
|
|
|
4967
5102
|
let productType = undefined;
|
|
4968
5103
|
[productType, params] = this.handleProductTypeAndParams(market, params);
|
|
4969
5104
|
request['productType'] = productType;
|
|
4970
|
-
if (
|
|
5105
|
+
if (trigger) {
|
|
4971
5106
|
response = await this.privateMixPostV2MixOrderCancelPlanOrder(this.extend(request, params));
|
|
4972
5107
|
}
|
|
4973
5108
|
else {
|
|
@@ -5006,7 +5141,7 @@ class bitget extends bitget$1 {
|
|
|
5006
5141
|
* @param {string} symbol unified market symbol
|
|
5007
5142
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5008
5143
|
* @param {string} [params.marginMode] 'isolated' or 'cross' for spot margin trading
|
|
5009
|
-
* @param {boolean} [params.
|
|
5144
|
+
* @param {boolean} [params.trigger] *contract only* set to true for canceling trigger orders
|
|
5010
5145
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5011
5146
|
*/
|
|
5012
5147
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
@@ -5028,7 +5163,7 @@ class bitget extends bitget$1 {
|
|
|
5028
5163
|
const request = {
|
|
5029
5164
|
'symbol': market['id'],
|
|
5030
5165
|
};
|
|
5031
|
-
const
|
|
5166
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
5032
5167
|
params = this.omit(params, ['stop', 'trigger']);
|
|
5033
5168
|
let response = undefined;
|
|
5034
5169
|
if (market['spot']) {
|
|
@@ -5057,7 +5192,7 @@ class bitget extends bitget$1 {
|
|
|
5057
5192
|
//
|
|
5058
5193
|
}
|
|
5059
5194
|
else {
|
|
5060
|
-
if (
|
|
5195
|
+
if (trigger) {
|
|
5061
5196
|
const stopRequest = {
|
|
5062
5197
|
'symbolList': [market['id']],
|
|
5063
5198
|
};
|
|
@@ -5093,7 +5228,7 @@ class bitget extends bitget$1 {
|
|
|
5093
5228
|
let productType = undefined;
|
|
5094
5229
|
[productType, params] = this.handleProductTypeAndParams(market, params);
|
|
5095
5230
|
request['productType'] = productType;
|
|
5096
|
-
if (
|
|
5231
|
+
if (trigger) {
|
|
5097
5232
|
response = await this.privateMixPostV2MixOrderCancelPlanOrder(this.extend(request, params));
|
|
5098
5233
|
}
|
|
5099
5234
|
else {
|
|
@@ -5260,7 +5395,7 @@ class bitget extends bitget$1 {
|
|
|
5260
5395
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5261
5396
|
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
5262
5397
|
* @param {string} [params.planType] *contract stop only* 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan'
|
|
5263
|
-
* @param {boolean} [params.
|
|
5398
|
+
* @param {boolean} [params.trigger] set to true for fetching trigger orders
|
|
5264
5399
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
5265
5400
|
* @param {string} [params.isPlan] *swap only* 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan'
|
|
5266
5401
|
* @param {boolean} [params.trailing] set to true if you want to fetch trailing orders
|
|
@@ -5307,9 +5442,9 @@ class bitget extends bitget$1 {
|
|
|
5307
5442
|
}
|
|
5308
5443
|
let response = undefined;
|
|
5309
5444
|
const trailing = this.safeBool(params, 'trailing');
|
|
5310
|
-
const
|
|
5445
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
5311
5446
|
const planTypeDefined = this.safeString(params, 'planType') !== undefined;
|
|
5312
|
-
const
|
|
5447
|
+
const isTrigger = (trigger || planTypeDefined);
|
|
5313
5448
|
params = this.omit(params, ['stop', 'trigger', 'trailing']);
|
|
5314
5449
|
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
5315
5450
|
if (since !== undefined) {
|
|
@@ -5341,7 +5476,7 @@ class bitget extends bitget$1 {
|
|
|
5341
5476
|
}
|
|
5342
5477
|
}
|
|
5343
5478
|
else {
|
|
5344
|
-
if (
|
|
5479
|
+
if (trigger) {
|
|
5345
5480
|
response = await this.privateSpotGetV2SpotTradeCurrentPlanOrder(this.extend(request, query));
|
|
5346
5481
|
}
|
|
5347
5482
|
else {
|
|
@@ -5358,7 +5493,7 @@ class bitget extends bitget$1 {
|
|
|
5358
5493
|
request['planType'] = planType;
|
|
5359
5494
|
response = await this.privateMixGetV2MixOrderOrdersPlanPending(this.extend(request, query));
|
|
5360
5495
|
}
|
|
5361
|
-
else if (
|
|
5496
|
+
else if (isTrigger) {
|
|
5362
5497
|
const planType = this.safeString(query, 'planType', 'normal_plan');
|
|
5363
5498
|
request['planType'] = planType;
|
|
5364
5499
|
response = await this.privateMixGetV2MixOrderOrdersPlanPending(this.extend(request, query));
|
|
@@ -5544,7 +5679,7 @@ class bitget extends bitget$1 {
|
|
|
5544
5679
|
//
|
|
5545
5680
|
const data = this.safeValue(response, 'data');
|
|
5546
5681
|
if (type === 'spot') {
|
|
5547
|
-
if ((marginMode !== undefined) ||
|
|
5682
|
+
if ((marginMode !== undefined) || trigger) {
|
|
5548
5683
|
const resultList = this.safeList(data, 'orderList', []);
|
|
5549
5684
|
return this.parseOrders(resultList, market, since, limit);
|
|
5550
5685
|
}
|
|
@@ -5658,7 +5793,7 @@ class bitget extends bitget$1 {
|
|
|
5658
5793
|
}
|
|
5659
5794
|
let response = undefined;
|
|
5660
5795
|
const trailing = this.safeValue(params, 'trailing');
|
|
5661
|
-
const
|
|
5796
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
5662
5797
|
params = this.omit(params, ['stop', 'trigger', 'trailing']);
|
|
5663
5798
|
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
5664
5799
|
if (since !== undefined) {
|
|
@@ -5688,25 +5823,23 @@ class bitget extends bitget$1 {
|
|
|
5688
5823
|
response = await this.privateMarginGetV2MarginCrossedHistoryOrders(this.extend(request, params));
|
|
5689
5824
|
}
|
|
5690
5825
|
}
|
|
5691
|
-
else {
|
|
5692
|
-
if (
|
|
5693
|
-
|
|
5694
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchCanceledAndClosedOrders() requires a symbol argument');
|
|
5695
|
-
}
|
|
5696
|
-
const endTime = this.safeIntegerN(params, ['endTime', 'until']);
|
|
5697
|
-
params = this.omit(params, ['until']);
|
|
5698
|
-
if (since === undefined) {
|
|
5699
|
-
since = now - 7776000000;
|
|
5700
|
-
request['startTime'] = since;
|
|
5701
|
-
}
|
|
5702
|
-
if (endTime === undefined) {
|
|
5703
|
-
request['endTime'] = now;
|
|
5704
|
-
}
|
|
5705
|
-
response = await this.privateSpotGetV2SpotTradeHistoryPlanOrder(this.extend(request, params));
|
|
5826
|
+
else if (trigger) {
|
|
5827
|
+
if (symbol === undefined) {
|
|
5828
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchCanceledAndClosedOrders() requires a symbol argument');
|
|
5706
5829
|
}
|
|
5707
|
-
|
|
5708
|
-
|
|
5830
|
+
const endTime = this.safeIntegerN(params, ['endTime', 'until']);
|
|
5831
|
+
params = this.omit(params, ['until']);
|
|
5832
|
+
if (since === undefined) {
|
|
5833
|
+
since = now - 7776000000;
|
|
5834
|
+
request['startTime'] = since;
|
|
5835
|
+
}
|
|
5836
|
+
if (endTime === undefined) {
|
|
5837
|
+
request['endTime'] = now;
|
|
5709
5838
|
}
|
|
5839
|
+
response = await this.privateSpotGetV2SpotTradeHistoryPlanOrder(this.extend(request, params));
|
|
5840
|
+
}
|
|
5841
|
+
else {
|
|
5842
|
+
response = await this.privateSpotGetV2SpotTradeHistoryOrders(this.extend(request, params));
|
|
5710
5843
|
}
|
|
5711
5844
|
}
|
|
5712
5845
|
else {
|
|
@@ -5718,7 +5851,7 @@ class bitget extends bitget$1 {
|
|
|
5718
5851
|
request['planType'] = planType;
|
|
5719
5852
|
response = await this.privateMixGetV2MixOrderOrdersPlanHistory(this.extend(request, params));
|
|
5720
5853
|
}
|
|
5721
|
-
else if (
|
|
5854
|
+
else if (trigger) {
|
|
5722
5855
|
const planType = this.safeString(params, 'planType', 'normal_plan');
|
|
5723
5856
|
request['planType'] = planType;
|
|
5724
5857
|
response = await this.privateMixGetV2MixOrderOrdersPlanHistory(this.extend(request, params));
|
|
@@ -5907,7 +6040,7 @@ class bitget extends bitget$1 {
|
|
|
5907
6040
|
//
|
|
5908
6041
|
const data = this.safeValue(response, 'data', {});
|
|
5909
6042
|
if (marketType === 'spot') {
|
|
5910
|
-
if ((marginMode !== undefined) ||
|
|
6043
|
+
if ((marginMode !== undefined) || trigger) {
|
|
5911
6044
|
return this.parseOrders(this.safeValue(data, 'orderList', []), market, since, limit);
|
|
5912
6045
|
}
|
|
5913
6046
|
}
|
package/dist/cjs/src/bitmex.js
CHANGED
|
@@ -44,7 +44,9 @@ class bitmex extends bitmex$1 {
|
|
|
44
44
|
'closePosition': true,
|
|
45
45
|
'createOrder': true,
|
|
46
46
|
'createReduceOnlyOrder': true,
|
|
47
|
+
'createStopOrder': true,
|
|
47
48
|
'createTrailingAmountOrder': true,
|
|
49
|
+
'createTriggerOrder': true,
|
|
48
50
|
'editOrder': true,
|
|
49
51
|
'fetchBalance': true,
|
|
50
52
|
'fetchClosedOrders': true,
|
package/dist/cjs/src/bitopro.js
CHANGED
|
@@ -34,6 +34,8 @@ class bitopro extends bitopro$1 {
|
|
|
34
34
|
'closeAllPositions': false,
|
|
35
35
|
'closePosition': false,
|
|
36
36
|
'createOrder': true,
|
|
37
|
+
'createStopOrder': true,
|
|
38
|
+
'createTriggerOrder': true,
|
|
37
39
|
'editOrder': false,
|
|
38
40
|
'fetchBalance': true,
|
|
39
41
|
'fetchBorrowRateHistories': false,
|
|
@@ -1002,6 +1004,7 @@ class bitopro extends bitopro$1 {
|
|
|
1002
1004
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1003
1005
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1004
1006
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1007
|
+
* @param {object} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
1005
1008
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1006
1009
|
*/
|
|
1007
1010
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
package/dist/cjs/src/bitrue.js
CHANGED
|
@@ -511,6 +511,7 @@ class bitrue extends bitrue$1 {
|
|
|
511
511
|
'-4051': errors.InsufficientFunds, // {"code":-4051,"msg":"Isolated balance insufficient."}
|
|
512
512
|
},
|
|
513
513
|
'broad': {
|
|
514
|
+
'Insufficient account balance': errors.InsufficientFunds,
|
|
514
515
|
'has no operation privilege': errors.PermissionDenied,
|
|
515
516
|
'MAX_POSITION': errors.InvalidOrder, // {"code":-2010,"msg":"Filter failure: MAX_POSITION"}
|
|
516
517
|
},
|
|
@@ -35,6 +35,7 @@ class btcmarkets extends btcmarkets$1 {
|
|
|
35
35
|
'createDepositAddress': false,
|
|
36
36
|
'createOrder': true,
|
|
37
37
|
'createReduceOnlyOrder': false,
|
|
38
|
+
'createTriggerOrder': true,
|
|
38
39
|
'fetchBalance': true,
|
|
39
40
|
'fetchBorrowRateHistories': false,
|
|
40
41
|
'fetchBorrowRateHistory': false,
|
|
@@ -792,6 +793,7 @@ class btcmarkets extends btcmarkets$1 {
|
|
|
792
793
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
793
794
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
794
795
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
796
|
+
* @param {float} [params.triggerPrice] the price at which a trigger order is triggered at
|
|
795
797
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
796
798
|
*/
|
|
797
799
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|