ccxt 4.4.38 → 4.4.39
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 +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +73 -2
- package/dist/cjs/src/base/Exchange.js +26 -9
- package/dist/cjs/src/digifinex.js +58 -18
- package/dist/cjs/src/htx.js +154 -32
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/mexc.js +36 -25
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/woo.js +4 -4
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/digifinex.d.ts +1 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/alpaca.d.ts +11 -1
- package/js/src/alpaca.js +73 -2
- package/js/src/base/Exchange.js +26 -9
- package/js/src/digifinex.d.ts +4 -2
- package/js/src/digifinex.js +58 -18
- package/js/src/htx.d.ts +5 -5
- package/js/src/htx.js +154 -32
- package/js/src/kucoin.js +1 -0
- package/js/src/mexc.d.ts +7 -7
- package/js/src/mexc.js +36 -25
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +1 -0
- package/js/src/pro/woo.js +1 -1
- package/js/src/woo.js +4 -4
- package/package.json +1 -1
package/js/src/htx.js
CHANGED
|
@@ -1235,6 +1235,128 @@ export default class htx extends Exchange {
|
|
|
1235
1235
|
'BIFI': 'BITCOINFILE',
|
|
1236
1236
|
'FUD': 'FTX Users Debt',
|
|
1237
1237
|
},
|
|
1238
|
+
'features': {
|
|
1239
|
+
'spot': {
|
|
1240
|
+
'sandbox': true,
|
|
1241
|
+
'createOrder': {
|
|
1242
|
+
'marginMode': true,
|
|
1243
|
+
'triggerPrice': true,
|
|
1244
|
+
'triggerDirection': true,
|
|
1245
|
+
'triggerPriceType': undefined,
|
|
1246
|
+
'stopLossPrice': false,
|
|
1247
|
+
'takeProfitPrice': false,
|
|
1248
|
+
'attachedStopLossTakeProfit': undefined,
|
|
1249
|
+
'timeInForce': {
|
|
1250
|
+
'IOC': true,
|
|
1251
|
+
'FOK': true,
|
|
1252
|
+
'PO': true,
|
|
1253
|
+
'GTD': false,
|
|
1254
|
+
},
|
|
1255
|
+
'hedged': false,
|
|
1256
|
+
'trailing': false,
|
|
1257
|
+
// exchange-specific features
|
|
1258
|
+
'iceberg': false,
|
|
1259
|
+
'selfTradePrevention': true,
|
|
1260
|
+
},
|
|
1261
|
+
'createOrders': {
|
|
1262
|
+
'max': 10,
|
|
1263
|
+
},
|
|
1264
|
+
'fetchMyTrades': {
|
|
1265
|
+
'marginMode': false,
|
|
1266
|
+
'limit': 500,
|
|
1267
|
+
'daysBack': 120,
|
|
1268
|
+
'untilDays': 2,
|
|
1269
|
+
},
|
|
1270
|
+
'fetchOrder': {
|
|
1271
|
+
'marginMode': false,
|
|
1272
|
+
'trigger': false,
|
|
1273
|
+
'trailing': false,
|
|
1274
|
+
},
|
|
1275
|
+
'fetchOpenOrders': {
|
|
1276
|
+
'marginMode': false,
|
|
1277
|
+
'trigger': true,
|
|
1278
|
+
'trailing': false,
|
|
1279
|
+
'limit': 500,
|
|
1280
|
+
},
|
|
1281
|
+
'fetchOrders': {
|
|
1282
|
+
'marginMode': false,
|
|
1283
|
+
'trigger': true,
|
|
1284
|
+
'trailing': false,
|
|
1285
|
+
'limit': 500,
|
|
1286
|
+
'untilDays': 2,
|
|
1287
|
+
'daysBack': 180,
|
|
1288
|
+
},
|
|
1289
|
+
'fetchClosedOrders': {
|
|
1290
|
+
'marginMode': false,
|
|
1291
|
+
'trigger': true,
|
|
1292
|
+
'trailing': false,
|
|
1293
|
+
'untilDays': 2,
|
|
1294
|
+
'limit': 500,
|
|
1295
|
+
'daysBackClosed': 180,
|
|
1296
|
+
'daysBackCanceled': 1 / 12,
|
|
1297
|
+
},
|
|
1298
|
+
'fetchOHLCV': {
|
|
1299
|
+
'limit': 1000, // 2000 for non-historical
|
|
1300
|
+
},
|
|
1301
|
+
},
|
|
1302
|
+
'forDerivatives': {
|
|
1303
|
+
'extends': 'spot',
|
|
1304
|
+
'createOrder': {
|
|
1305
|
+
'stopLossPrice': true,
|
|
1306
|
+
'takeProfitPrice': true,
|
|
1307
|
+
'trailing': true,
|
|
1308
|
+
'hedged': true,
|
|
1309
|
+
// 'leverage': true, // todo
|
|
1310
|
+
},
|
|
1311
|
+
'createOrders': {
|
|
1312
|
+
'max': 25,
|
|
1313
|
+
},
|
|
1314
|
+
'fetchOrder': {
|
|
1315
|
+
'marginMode': true,
|
|
1316
|
+
},
|
|
1317
|
+
'fetchOpenOrders': {
|
|
1318
|
+
'marginMode': true,
|
|
1319
|
+
'trigger': false,
|
|
1320
|
+
'trailing': false,
|
|
1321
|
+
'limit': 50,
|
|
1322
|
+
},
|
|
1323
|
+
'fetchOrders': {
|
|
1324
|
+
'marginMode': true,
|
|
1325
|
+
'trigger': false,
|
|
1326
|
+
'trailing': false,
|
|
1327
|
+
'limit': 50,
|
|
1328
|
+
'daysBack': 90,
|
|
1329
|
+
},
|
|
1330
|
+
'fetchClosedOrders': {
|
|
1331
|
+
'marginMode': true,
|
|
1332
|
+
'trigger': false,
|
|
1333
|
+
'trailing': false,
|
|
1334
|
+
'untilDays': 2,
|
|
1335
|
+
'limit': 50,
|
|
1336
|
+
'daysBackClosed': 90,
|
|
1337
|
+
'daysBackCanceled': 1 / 12,
|
|
1338
|
+
},
|
|
1339
|
+
'fetchOHLCV': {
|
|
1340
|
+
'limit': 2000,
|
|
1341
|
+
},
|
|
1342
|
+
},
|
|
1343
|
+
'swap': {
|
|
1344
|
+
'linear': {
|
|
1345
|
+
'extends': 'forDerivatives',
|
|
1346
|
+
},
|
|
1347
|
+
'inverse': {
|
|
1348
|
+
'extends': 'forDerivatives',
|
|
1349
|
+
},
|
|
1350
|
+
},
|
|
1351
|
+
'future': {
|
|
1352
|
+
'linear': {
|
|
1353
|
+
'extends': 'forDerivatives',
|
|
1354
|
+
},
|
|
1355
|
+
'inverse': {
|
|
1356
|
+
'extends': 'forDerivatives',
|
|
1357
|
+
},
|
|
1358
|
+
},
|
|
1359
|
+
},
|
|
1238
1360
|
});
|
|
1239
1361
|
}
|
|
1240
1362
|
/**
|
|
@@ -4084,11 +4206,11 @@ export default class htx extends Exchange {
|
|
|
4084
4206
|
'status': '0', // support multiple query seperated by ',',such as '3,4,5', 0: all. 3. Have sumbmitted the orders; 4. Orders partially matched; 5. Orders cancelled with partially matched; 6. Orders fully matched; 7. Orders cancelled;
|
|
4085
4207
|
};
|
|
4086
4208
|
let response = undefined;
|
|
4087
|
-
const
|
|
4209
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4088
4210
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4089
4211
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4090
4212
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
4091
|
-
if (
|
|
4213
|
+
if (trigger || stopLossTakeProfit || trailing) {
|
|
4092
4214
|
if (limit !== undefined) {
|
|
4093
4215
|
request['page_size'] = limit;
|
|
4094
4216
|
}
|
|
@@ -4109,7 +4231,7 @@ export default class htx extends Exchange {
|
|
|
4109
4231
|
[marginMode, params] = this.handleMarginModeAndParams('fetchContractOrders', params);
|
|
4110
4232
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
4111
4233
|
if (marginMode === 'isolated') {
|
|
4112
|
-
if (
|
|
4234
|
+
if (trigger) {
|
|
4113
4235
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerHisorders(this.extend(request, params));
|
|
4114
4236
|
}
|
|
4115
4237
|
else if (stopLossTakeProfit) {
|
|
@@ -4123,7 +4245,7 @@ export default class htx extends Exchange {
|
|
|
4123
4245
|
}
|
|
4124
4246
|
}
|
|
4125
4247
|
else if (marginMode === 'cross') {
|
|
4126
|
-
if (
|
|
4248
|
+
if (trigger) {
|
|
4127
4249
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerHisorders(this.extend(request, params));
|
|
4128
4250
|
}
|
|
4129
4251
|
else if (stopLossTakeProfit) {
|
|
@@ -4139,7 +4261,7 @@ export default class htx extends Exchange {
|
|
|
4139
4261
|
}
|
|
4140
4262
|
else if (market['inverse']) {
|
|
4141
4263
|
if (market['swap']) {
|
|
4142
|
-
if (
|
|
4264
|
+
if (trigger) {
|
|
4143
4265
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerHisorders(this.extend(request, params));
|
|
4144
4266
|
}
|
|
4145
4267
|
else if (stopLossTakeProfit) {
|
|
@@ -4154,7 +4276,7 @@ export default class htx extends Exchange {
|
|
|
4154
4276
|
}
|
|
4155
4277
|
else if (market['future']) {
|
|
4156
4278
|
request['symbol'] = market['settleId'];
|
|
4157
|
-
if (
|
|
4279
|
+
if (trigger) {
|
|
4158
4280
|
response = await this.contractPrivatePostApiV1ContractTriggerHisorders(this.extend(request, params));
|
|
4159
4281
|
}
|
|
4160
4282
|
else if (stopLossTakeProfit) {
|
|
@@ -4336,7 +4458,7 @@ export default class htx extends Exchange {
|
|
|
4336
4458
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4337
4459
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4338
4460
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4339
|
-
* @param {bool} [params.
|
|
4461
|
+
* @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
4340
4462
|
* @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
4341
4463
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4342
4464
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
|
|
@@ -4410,7 +4532,7 @@ export default class htx extends Exchange {
|
|
|
4410
4532
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4411
4533
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
4412
4534
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4413
|
-
* @param {bool} [params.
|
|
4535
|
+
* @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
4414
4536
|
* @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
4415
4537
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
|
|
4416
4538
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -4459,7 +4581,7 @@ export default class htx extends Exchange {
|
|
|
4459
4581
|
request['page_size'] = limit;
|
|
4460
4582
|
}
|
|
4461
4583
|
request['contract_code'] = market['id'];
|
|
4462
|
-
const
|
|
4584
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4463
4585
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4464
4586
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4465
4587
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
@@ -4468,7 +4590,7 @@ export default class htx extends Exchange {
|
|
|
4468
4590
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
|
|
4469
4591
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
4470
4592
|
if (marginMode === 'isolated') {
|
|
4471
|
-
if (
|
|
4593
|
+
if (trigger) {
|
|
4472
4594
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
|
|
4473
4595
|
}
|
|
4474
4596
|
else if (stopLossTakeProfit) {
|
|
@@ -4482,7 +4604,7 @@ export default class htx extends Exchange {
|
|
|
4482
4604
|
}
|
|
4483
4605
|
}
|
|
4484
4606
|
else if (marginMode === 'cross') {
|
|
4485
|
-
if (
|
|
4607
|
+
if (trigger) {
|
|
4486
4608
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerOpenorders(this.extend(request, params));
|
|
4487
4609
|
}
|
|
4488
4610
|
else if (stopLossTakeProfit) {
|
|
@@ -4498,7 +4620,7 @@ export default class htx extends Exchange {
|
|
|
4498
4620
|
}
|
|
4499
4621
|
else if (market['inverse']) {
|
|
4500
4622
|
if (market['swap']) {
|
|
4501
|
-
if (
|
|
4623
|
+
if (trigger) {
|
|
4502
4624
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
|
|
4503
4625
|
}
|
|
4504
4626
|
else if (stopLossTakeProfit) {
|
|
@@ -4513,7 +4635,7 @@ export default class htx extends Exchange {
|
|
|
4513
4635
|
}
|
|
4514
4636
|
else if (market['future']) {
|
|
4515
4637
|
request['symbol'] = market['settleId'];
|
|
4516
|
-
if (
|
|
4638
|
+
if (trigger) {
|
|
4517
4639
|
response = await this.contractPrivatePostApiV1ContractTriggerOpenorders(this.extend(request, params));
|
|
4518
4640
|
}
|
|
4519
4641
|
else if (stopLossTakeProfit) {
|
|
@@ -5262,7 +5384,7 @@ export default class htx extends Exchange {
|
|
|
5262
5384
|
if (triggerPrice === undefined) {
|
|
5263
5385
|
const stopOrderTypes = this.safeValue(options, 'stopOrderTypes', {});
|
|
5264
5386
|
if (orderType in stopOrderTypes) {
|
|
5265
|
-
throw new ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice for a
|
|
5387
|
+
throw new ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice for a trigger order');
|
|
5266
5388
|
}
|
|
5267
5389
|
}
|
|
5268
5390
|
else {
|
|
@@ -5792,7 +5914,7 @@ export default class htx extends Exchange {
|
|
|
5792
5914
|
* @param {string} id order id
|
|
5793
5915
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
5794
5916
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5795
|
-
* @param {boolean} [params.
|
|
5917
|
+
* @param {boolean} [params.trigger] *contract only* if the order is a trigger trigger order or not
|
|
5796
5918
|
* @param {boolean} [params.stopLossTakeProfit] *contract only* if the order is a stop-loss or take-profit order
|
|
5797
5919
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to cancel a trailing order
|
|
5798
5920
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -5848,7 +5970,7 @@ export default class htx extends Exchange {
|
|
|
5848
5970
|
else {
|
|
5849
5971
|
request['contract_code'] = market['id'];
|
|
5850
5972
|
}
|
|
5851
|
-
const
|
|
5973
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
5852
5974
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
5853
5975
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
5854
5976
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
@@ -5857,7 +5979,7 @@ export default class htx extends Exchange {
|
|
|
5857
5979
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
5858
5980
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
5859
5981
|
if (marginMode === 'isolated') {
|
|
5860
|
-
if (
|
|
5982
|
+
if (trigger) {
|
|
5861
5983
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
5862
5984
|
}
|
|
5863
5985
|
else if (stopLossTakeProfit) {
|
|
@@ -5871,7 +5993,7 @@ export default class htx extends Exchange {
|
|
|
5871
5993
|
}
|
|
5872
5994
|
}
|
|
5873
5995
|
else if (marginMode === 'cross') {
|
|
5874
|
-
if (
|
|
5996
|
+
if (trigger) {
|
|
5875
5997
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancel(this.extend(request, params));
|
|
5876
5998
|
}
|
|
5877
5999
|
else if (stopLossTakeProfit) {
|
|
@@ -5887,7 +6009,7 @@ export default class htx extends Exchange {
|
|
|
5887
6009
|
}
|
|
5888
6010
|
else if (market['inverse']) {
|
|
5889
6011
|
if (market['swap']) {
|
|
5890
|
-
if (
|
|
6012
|
+
if (trigger) {
|
|
5891
6013
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
5892
6014
|
}
|
|
5893
6015
|
else if (stopLossTakeProfit) {
|
|
@@ -5901,7 +6023,7 @@ export default class htx extends Exchange {
|
|
|
5901
6023
|
}
|
|
5902
6024
|
}
|
|
5903
6025
|
else if (market['future']) {
|
|
5904
|
-
if (
|
|
6026
|
+
if (trigger) {
|
|
5905
6027
|
response = await this.contractPrivatePostApiV1ContractTriggerCancel(this.extend(request, params));
|
|
5906
6028
|
}
|
|
5907
6029
|
else if (stopLossTakeProfit) {
|
|
@@ -5950,7 +6072,7 @@ export default class htx extends Exchange {
|
|
|
5950
6072
|
* @param {string[]} ids order ids
|
|
5951
6073
|
* @param {string} symbol unified market symbol, default is undefined
|
|
5952
6074
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5953
|
-
* @param {bool} [params.
|
|
6075
|
+
* @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
5954
6076
|
* @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
5955
6077
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5956
6078
|
*/
|
|
@@ -6014,7 +6136,7 @@ export default class htx extends Exchange {
|
|
|
6014
6136
|
else {
|
|
6015
6137
|
request['contract_code'] = market['id'];
|
|
6016
6138
|
}
|
|
6017
|
-
const
|
|
6139
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
6018
6140
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
6019
6141
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trigger']);
|
|
6020
6142
|
if (market['linear']) {
|
|
@@ -6022,7 +6144,7 @@ export default class htx extends Exchange {
|
|
|
6022
6144
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrders', params);
|
|
6023
6145
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
6024
6146
|
if (marginMode === 'isolated') {
|
|
6025
|
-
if (
|
|
6147
|
+
if (trigger) {
|
|
6026
6148
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
6027
6149
|
}
|
|
6028
6150
|
else if (stopLossTakeProfit) {
|
|
@@ -6033,7 +6155,7 @@ export default class htx extends Exchange {
|
|
|
6033
6155
|
}
|
|
6034
6156
|
}
|
|
6035
6157
|
else if (marginMode === 'cross') {
|
|
6036
|
-
if (
|
|
6158
|
+
if (trigger) {
|
|
6037
6159
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancel(this.extend(request, params));
|
|
6038
6160
|
}
|
|
6039
6161
|
else if (stopLossTakeProfit) {
|
|
@@ -6046,7 +6168,7 @@ export default class htx extends Exchange {
|
|
|
6046
6168
|
}
|
|
6047
6169
|
else if (market['inverse']) {
|
|
6048
6170
|
if (market['swap']) {
|
|
6049
|
-
if (
|
|
6171
|
+
if (trigger) {
|
|
6050
6172
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
6051
6173
|
}
|
|
6052
6174
|
else if (stopLossTakeProfit) {
|
|
@@ -6057,7 +6179,7 @@ export default class htx extends Exchange {
|
|
|
6057
6179
|
}
|
|
6058
6180
|
}
|
|
6059
6181
|
else if (market['future']) {
|
|
6060
|
-
if (
|
|
6182
|
+
if (trigger) {
|
|
6061
6183
|
response = await this.contractPrivatePostApiV1ContractTriggerCancel(this.extend(request, params));
|
|
6062
6184
|
}
|
|
6063
6185
|
else if (stopLossTakeProfit) {
|
|
@@ -6190,7 +6312,7 @@ export default class htx extends Exchange {
|
|
|
6190
6312
|
* @description cancel all open orders
|
|
6191
6313
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
6192
6314
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6193
|
-
* @param {boolean} [params.
|
|
6315
|
+
* @param {boolean} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
6194
6316
|
* @param {boolean} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
6195
6317
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to cancel all trailing orders
|
|
6196
6318
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -6248,7 +6370,7 @@ export default class htx extends Exchange {
|
|
|
6248
6370
|
request['symbol'] = market['settleId'];
|
|
6249
6371
|
}
|
|
6250
6372
|
request['contract_code'] = market['id'];
|
|
6251
|
-
const
|
|
6373
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
6252
6374
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
6253
6375
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
6254
6376
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
@@ -6257,7 +6379,7 @@ export default class htx extends Exchange {
|
|
|
6257
6379
|
[marginMode, params] = this.handleMarginModeAndParams('cancelAllOrders', params);
|
|
6258
6380
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
6259
6381
|
if (marginMode === 'isolated') {
|
|
6260
|
-
if (
|
|
6382
|
+
if (trigger) {
|
|
6261
6383
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancelall(this.extend(request, params));
|
|
6262
6384
|
}
|
|
6263
6385
|
else if (stopLossTakeProfit) {
|
|
@@ -6271,7 +6393,7 @@ export default class htx extends Exchange {
|
|
|
6271
6393
|
}
|
|
6272
6394
|
}
|
|
6273
6395
|
else if (marginMode === 'cross') {
|
|
6274
|
-
if (
|
|
6396
|
+
if (trigger) {
|
|
6275
6397
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancelall(this.extend(request, params));
|
|
6276
6398
|
}
|
|
6277
6399
|
else if (stopLossTakeProfit) {
|
|
@@ -6287,7 +6409,7 @@ export default class htx extends Exchange {
|
|
|
6287
6409
|
}
|
|
6288
6410
|
else if (market['inverse']) {
|
|
6289
6411
|
if (market['swap']) {
|
|
6290
|
-
if (
|
|
6412
|
+
if (trigger) {
|
|
6291
6413
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerCancelall(this.extend(request, params));
|
|
6292
6414
|
}
|
|
6293
6415
|
else if (stopLossTakeProfit) {
|
|
@@ -6301,7 +6423,7 @@ export default class htx extends Exchange {
|
|
|
6301
6423
|
}
|
|
6302
6424
|
}
|
|
6303
6425
|
else if (market['future']) {
|
|
6304
|
-
if (
|
|
6426
|
+
if (trigger) {
|
|
6305
6427
|
response = await this.contractPrivatePostApiV1ContractTriggerCancelall(this.extend(request, params));
|
|
6306
6428
|
}
|
|
6307
6429
|
else if (stopLossTakeProfit) {
|
package/js/src/kucoin.js
CHANGED
package/js/src/mexc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/mexc.js';
|
|
2
|
-
import type { TransferEntry, IndexType, Int, OrderSide, Balances, OrderType, OHLCV, FundingRateHistory, Position, OrderBook, OrderRequest, FundingHistory, Order, Str, Trade, Transaction, Ticker, Tickers, Strings, Market, Currency, Leverage, Num, Account, MarginModification, Currencies,
|
|
2
|
+
import type { TransferEntry, IndexType, Int, OrderSide, Balances, OrderType, OHLCV, FundingRateHistory, Position, OrderBook, OrderRequest, FundingHistory, Order, Str, Trade, Transaction, Ticker, Tickers, Strings, Market, Currency, Leverage, Num, Account, MarginModification, Currencies, Dict, LeverageTier, LeverageTiers, int, FundingRate, DepositAddress, TradingFeeInterface } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class mexc
|
|
5
5
|
* @augments Exchange
|
|
@@ -388,14 +388,14 @@ export default class mexc extends Exchange {
|
|
|
388
388
|
fetchAccounts(params?: {}): Promise<Account[]>;
|
|
389
389
|
/**
|
|
390
390
|
* @method
|
|
391
|
-
* @name mexc#
|
|
392
|
-
* @description fetch the trading fees for
|
|
393
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#
|
|
394
|
-
* @
|
|
391
|
+
* @name mexc#fetchTradingFee
|
|
392
|
+
* @description fetch the trading fees for a market
|
|
393
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status
|
|
394
|
+
* @param {string} symbol unified market symbol
|
|
395
395
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
396
|
-
* @returns {object} a
|
|
396
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
397
397
|
*/
|
|
398
|
-
|
|
398
|
+
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
399
399
|
customParseBalance(response: any, marketType: any): Balances;
|
|
400
400
|
parseBalanceHelper(entry: any): import("./base/types.js").BalanceAccount;
|
|
401
401
|
/**
|
package/js/src/mexc.js
CHANGED
|
@@ -121,8 +121,8 @@ export default class mexc extends Exchange {
|
|
|
121
121
|
'fetchTickers': true,
|
|
122
122
|
'fetchTime': true,
|
|
123
123
|
'fetchTrades': true,
|
|
124
|
-
'fetchTradingFee':
|
|
125
|
-
'fetchTradingFees':
|
|
124
|
+
'fetchTradingFee': true,
|
|
125
|
+
'fetchTradingFees': false,
|
|
126
126
|
'fetchTradingLimits': undefined,
|
|
127
127
|
'fetchTransactionFee': 'emulated',
|
|
128
128
|
'fetchTransactionFees': true,
|
|
@@ -195,6 +195,7 @@ export default class mexc extends Exchange {
|
|
|
195
195
|
'allOrders': 10,
|
|
196
196
|
'account': 10,
|
|
197
197
|
'myTrades': 10,
|
|
198
|
+
'tradeFee': 10,
|
|
198
199
|
'sub-account/list': 1,
|
|
199
200
|
'sub-account/apiKey': 1,
|
|
200
201
|
'capital/config/getall': 10,
|
|
@@ -3607,33 +3608,43 @@ export default class mexc extends Exchange {
|
|
|
3607
3608
|
}
|
|
3608
3609
|
/**
|
|
3609
3610
|
* @method
|
|
3610
|
-
* @name mexc#
|
|
3611
|
-
* @description fetch the trading fees for
|
|
3612
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#
|
|
3613
|
-
* @
|
|
3611
|
+
* @name mexc#fetchTradingFee
|
|
3612
|
+
* @description fetch the trading fees for a market
|
|
3613
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status
|
|
3614
|
+
* @param {string} symbol unified market symbol
|
|
3614
3615
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3615
|
-
* @returns {object} a
|
|
3616
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3616
3617
|
*/
|
|
3617
|
-
async
|
|
3618
|
+
async fetchTradingFee(symbol, params = {}) {
|
|
3618
3619
|
await this.loadMarkets();
|
|
3619
|
-
const
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
makerFee = Precise.stringDiv(makerFee, '1000');
|
|
3623
|
-
takerFee = Precise.stringDiv(takerFee, '1000');
|
|
3624
|
-
const result = {};
|
|
3625
|
-
for (let i = 0; i < this.symbols.length; i++) {
|
|
3626
|
-
const symbol = this.symbols[i];
|
|
3627
|
-
result[symbol] = {
|
|
3628
|
-
'symbol': symbol,
|
|
3629
|
-
'maker': this.parseNumber(makerFee),
|
|
3630
|
-
'taker': this.parseNumber(takerFee),
|
|
3631
|
-
'percentage': true,
|
|
3632
|
-
'tierBased': false,
|
|
3633
|
-
'info': response,
|
|
3634
|
-
};
|
|
3620
|
+
const market = this.market(symbol);
|
|
3621
|
+
if (!market['spot']) {
|
|
3622
|
+
throw new BadRequest(this.id + ' fetchTradingFee() supports spot markets only');
|
|
3635
3623
|
}
|
|
3636
|
-
|
|
3624
|
+
const request = {
|
|
3625
|
+
'symbol': market['id'],
|
|
3626
|
+
};
|
|
3627
|
+
const response = await this.spotPrivateGetTradeFee(this.extend(request, params));
|
|
3628
|
+
//
|
|
3629
|
+
// {
|
|
3630
|
+
// "data":{
|
|
3631
|
+
// "makerCommission":0.003000000000000000,
|
|
3632
|
+
// "takerCommission":0.003000000000000000
|
|
3633
|
+
// },
|
|
3634
|
+
// "code":0,
|
|
3635
|
+
// "msg":"success",
|
|
3636
|
+
// "timestamp":1669109672717
|
|
3637
|
+
// }
|
|
3638
|
+
//
|
|
3639
|
+
const data = this.safeDict(response, 'data', {});
|
|
3640
|
+
return {
|
|
3641
|
+
'info': data,
|
|
3642
|
+
'symbol': symbol,
|
|
3643
|
+
'maker': this.safeNumber(data, 'makerCommission'),
|
|
3644
|
+
'taker': this.safeNumber(data, 'takerCommission'),
|
|
3645
|
+
'percentage': undefined,
|
|
3646
|
+
'tierBased': undefined,
|
|
3647
|
+
};
|
|
3637
3648
|
}
|
|
3638
3649
|
customParseBalance(response, marketType) {
|
|
3639
3650
|
//
|
package/js/src/okx.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ export default class okx extends Exchange {
|
|
|
121
121
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
122
122
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
123
123
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
124
|
+
* @param {string} [params.method] 'publicGetMarketTrades' or 'publicGetMarketHistoryTrades' default is 'publicGetMarketTrades'
|
|
124
125
|
* @param {boolean} [params.paginate] *only applies to publicGetMarketHistoryTrades* default false, when true will automatically paginate by calling this endpoint multiple times
|
|
125
126
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
126
127
|
*/
|
package/js/src/okx.js
CHANGED
|
@@ -2257,6 +2257,7 @@ export default class okx extends Exchange {
|
|
|
2257
2257
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2258
2258
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2259
2259
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2260
|
+
* @param {string} [params.method] 'publicGetMarketTrades' or 'publicGetMarketHistoryTrades' default is 'publicGetMarketTrades'
|
|
2260
2261
|
* @param {boolean} [params.paginate] *only applies to publicGetMarketHistoryTrades* default false, when true will automatically paginate by calling this endpoint multiple times
|
|
2261
2262
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2262
2263
|
*/
|
package/js/src/pro/woo.js
CHANGED
package/js/src/woo.js
CHANGED
|
@@ -116,7 +116,7 @@ export default class woo extends Exchange {
|
|
|
116
116
|
'setMargin': false,
|
|
117
117
|
'setPositionMode': true,
|
|
118
118
|
'transfer': true,
|
|
119
|
-
'withdraw': true, // exchange have that endpoint disabled atm, but was once implemented in ccxt per old docs: https://
|
|
119
|
+
'withdraw': true, // exchange have that endpoint disabled atm, but was once implemented in ccxt per old docs: https://docx.woo.io/wootrade-documents/#token-withdraw
|
|
120
120
|
},
|
|
121
121
|
'timeframes': {
|
|
122
122
|
'1m': '1m',
|
|
@@ -160,7 +160,7 @@ export default class woo extends Exchange {
|
|
|
160
160
|
'pub': {
|
|
161
161
|
'get': {
|
|
162
162
|
'hist/kline': 10,
|
|
163
|
-
'hist/trades':
|
|
163
|
+
'hist/trades': 10,
|
|
164
164
|
},
|
|
165
165
|
},
|
|
166
166
|
'public': {
|
|
@@ -210,7 +210,7 @@ export default class woo extends Exchange {
|
|
|
210
210
|
'client/futures_leverage': 60,
|
|
211
211
|
},
|
|
212
212
|
'post': {
|
|
213
|
-
'order':
|
|
213
|
+
'order': 1,
|
|
214
214
|
'order/cancel_all_after': 1,
|
|
215
215
|
'asset/main_sub_transfer': 30,
|
|
216
216
|
'asset/ltv': 30,
|
|
@@ -227,7 +227,7 @@ export default class woo extends Exchange {
|
|
|
227
227
|
'order': 1,
|
|
228
228
|
'client/order': 1,
|
|
229
229
|
'orders': 1,
|
|
230
|
-
'asset/withdraw': 120, // implemented in ccxt, disabled on the exchange side https://
|
|
230
|
+
'asset/withdraw': 120, // implemented in ccxt, disabled on the exchange side https://docx.woo.io/wootrade-documents/#cancel-withdraw-request
|
|
231
231
|
},
|
|
232
232
|
},
|
|
233
233
|
},
|
package/package.json
CHANGED