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/dist/cjs/src/htx.js
CHANGED
|
@@ -1232,6 +1232,128 @@ class htx extends htx$1 {
|
|
|
1232
1232
|
'BIFI': 'BITCOINFILE',
|
|
1233
1233
|
'FUD': 'FTX Users Debt',
|
|
1234
1234
|
},
|
|
1235
|
+
'features': {
|
|
1236
|
+
'spot': {
|
|
1237
|
+
'sandbox': true,
|
|
1238
|
+
'createOrder': {
|
|
1239
|
+
'marginMode': true,
|
|
1240
|
+
'triggerPrice': true,
|
|
1241
|
+
'triggerDirection': true,
|
|
1242
|
+
'triggerPriceType': undefined,
|
|
1243
|
+
'stopLossPrice': false,
|
|
1244
|
+
'takeProfitPrice': false,
|
|
1245
|
+
'attachedStopLossTakeProfit': undefined,
|
|
1246
|
+
'timeInForce': {
|
|
1247
|
+
'IOC': true,
|
|
1248
|
+
'FOK': true,
|
|
1249
|
+
'PO': true,
|
|
1250
|
+
'GTD': false,
|
|
1251
|
+
},
|
|
1252
|
+
'hedged': false,
|
|
1253
|
+
'trailing': false,
|
|
1254
|
+
// exchange-specific features
|
|
1255
|
+
'iceberg': false,
|
|
1256
|
+
'selfTradePrevention': true,
|
|
1257
|
+
},
|
|
1258
|
+
'createOrders': {
|
|
1259
|
+
'max': 10,
|
|
1260
|
+
},
|
|
1261
|
+
'fetchMyTrades': {
|
|
1262
|
+
'marginMode': false,
|
|
1263
|
+
'limit': 500,
|
|
1264
|
+
'daysBack': 120,
|
|
1265
|
+
'untilDays': 2,
|
|
1266
|
+
},
|
|
1267
|
+
'fetchOrder': {
|
|
1268
|
+
'marginMode': false,
|
|
1269
|
+
'trigger': false,
|
|
1270
|
+
'trailing': false,
|
|
1271
|
+
},
|
|
1272
|
+
'fetchOpenOrders': {
|
|
1273
|
+
'marginMode': false,
|
|
1274
|
+
'trigger': true,
|
|
1275
|
+
'trailing': false,
|
|
1276
|
+
'limit': 500,
|
|
1277
|
+
},
|
|
1278
|
+
'fetchOrders': {
|
|
1279
|
+
'marginMode': false,
|
|
1280
|
+
'trigger': true,
|
|
1281
|
+
'trailing': false,
|
|
1282
|
+
'limit': 500,
|
|
1283
|
+
'untilDays': 2,
|
|
1284
|
+
'daysBack': 180,
|
|
1285
|
+
},
|
|
1286
|
+
'fetchClosedOrders': {
|
|
1287
|
+
'marginMode': false,
|
|
1288
|
+
'trigger': true,
|
|
1289
|
+
'trailing': false,
|
|
1290
|
+
'untilDays': 2,
|
|
1291
|
+
'limit': 500,
|
|
1292
|
+
'daysBackClosed': 180,
|
|
1293
|
+
'daysBackCanceled': 1 / 12,
|
|
1294
|
+
},
|
|
1295
|
+
'fetchOHLCV': {
|
|
1296
|
+
'limit': 1000, // 2000 for non-historical
|
|
1297
|
+
},
|
|
1298
|
+
},
|
|
1299
|
+
'forDerivatives': {
|
|
1300
|
+
'extends': 'spot',
|
|
1301
|
+
'createOrder': {
|
|
1302
|
+
'stopLossPrice': true,
|
|
1303
|
+
'takeProfitPrice': true,
|
|
1304
|
+
'trailing': true,
|
|
1305
|
+
'hedged': true,
|
|
1306
|
+
// 'leverage': true, // todo
|
|
1307
|
+
},
|
|
1308
|
+
'createOrders': {
|
|
1309
|
+
'max': 25,
|
|
1310
|
+
},
|
|
1311
|
+
'fetchOrder': {
|
|
1312
|
+
'marginMode': true,
|
|
1313
|
+
},
|
|
1314
|
+
'fetchOpenOrders': {
|
|
1315
|
+
'marginMode': true,
|
|
1316
|
+
'trigger': false,
|
|
1317
|
+
'trailing': false,
|
|
1318
|
+
'limit': 50,
|
|
1319
|
+
},
|
|
1320
|
+
'fetchOrders': {
|
|
1321
|
+
'marginMode': true,
|
|
1322
|
+
'trigger': false,
|
|
1323
|
+
'trailing': false,
|
|
1324
|
+
'limit': 50,
|
|
1325
|
+
'daysBack': 90,
|
|
1326
|
+
},
|
|
1327
|
+
'fetchClosedOrders': {
|
|
1328
|
+
'marginMode': true,
|
|
1329
|
+
'trigger': false,
|
|
1330
|
+
'trailing': false,
|
|
1331
|
+
'untilDays': 2,
|
|
1332
|
+
'limit': 50,
|
|
1333
|
+
'daysBackClosed': 90,
|
|
1334
|
+
'daysBackCanceled': 1 / 12,
|
|
1335
|
+
},
|
|
1336
|
+
'fetchOHLCV': {
|
|
1337
|
+
'limit': 2000,
|
|
1338
|
+
},
|
|
1339
|
+
},
|
|
1340
|
+
'swap': {
|
|
1341
|
+
'linear': {
|
|
1342
|
+
'extends': 'forDerivatives',
|
|
1343
|
+
},
|
|
1344
|
+
'inverse': {
|
|
1345
|
+
'extends': 'forDerivatives',
|
|
1346
|
+
},
|
|
1347
|
+
},
|
|
1348
|
+
'future': {
|
|
1349
|
+
'linear': {
|
|
1350
|
+
'extends': 'forDerivatives',
|
|
1351
|
+
},
|
|
1352
|
+
'inverse': {
|
|
1353
|
+
'extends': 'forDerivatives',
|
|
1354
|
+
},
|
|
1355
|
+
},
|
|
1356
|
+
},
|
|
1235
1357
|
});
|
|
1236
1358
|
}
|
|
1237
1359
|
/**
|
|
@@ -4081,11 +4203,11 @@ class htx extends htx$1 {
|
|
|
4081
4203
|
'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;
|
|
4082
4204
|
};
|
|
4083
4205
|
let response = undefined;
|
|
4084
|
-
const
|
|
4206
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4085
4207
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4086
4208
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4087
4209
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
4088
|
-
if (
|
|
4210
|
+
if (trigger || stopLossTakeProfit || trailing) {
|
|
4089
4211
|
if (limit !== undefined) {
|
|
4090
4212
|
request['page_size'] = limit;
|
|
4091
4213
|
}
|
|
@@ -4106,7 +4228,7 @@ class htx extends htx$1 {
|
|
|
4106
4228
|
[marginMode, params] = this.handleMarginModeAndParams('fetchContractOrders', params);
|
|
4107
4229
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
4108
4230
|
if (marginMode === 'isolated') {
|
|
4109
|
-
if (
|
|
4231
|
+
if (trigger) {
|
|
4110
4232
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerHisorders(this.extend(request, params));
|
|
4111
4233
|
}
|
|
4112
4234
|
else if (stopLossTakeProfit) {
|
|
@@ -4120,7 +4242,7 @@ class htx extends htx$1 {
|
|
|
4120
4242
|
}
|
|
4121
4243
|
}
|
|
4122
4244
|
else if (marginMode === 'cross') {
|
|
4123
|
-
if (
|
|
4245
|
+
if (trigger) {
|
|
4124
4246
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerHisorders(this.extend(request, params));
|
|
4125
4247
|
}
|
|
4126
4248
|
else if (stopLossTakeProfit) {
|
|
@@ -4136,7 +4258,7 @@ class htx extends htx$1 {
|
|
|
4136
4258
|
}
|
|
4137
4259
|
else if (market['inverse']) {
|
|
4138
4260
|
if (market['swap']) {
|
|
4139
|
-
if (
|
|
4261
|
+
if (trigger) {
|
|
4140
4262
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerHisorders(this.extend(request, params));
|
|
4141
4263
|
}
|
|
4142
4264
|
else if (stopLossTakeProfit) {
|
|
@@ -4151,7 +4273,7 @@ class htx extends htx$1 {
|
|
|
4151
4273
|
}
|
|
4152
4274
|
else if (market['future']) {
|
|
4153
4275
|
request['symbol'] = market['settleId'];
|
|
4154
|
-
if (
|
|
4276
|
+
if (trigger) {
|
|
4155
4277
|
response = await this.contractPrivatePostApiV1ContractTriggerHisorders(this.extend(request, params));
|
|
4156
4278
|
}
|
|
4157
4279
|
else if (stopLossTakeProfit) {
|
|
@@ -4333,7 +4455,7 @@ class htx extends htx$1 {
|
|
|
4333
4455
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4334
4456
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4335
4457
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4336
|
-
* @param {bool} [params.
|
|
4458
|
+
* @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
4337
4459
|
* @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
4338
4460
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4339
4461
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
|
|
@@ -4407,7 +4529,7 @@ class htx extends htx$1 {
|
|
|
4407
4529
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4408
4530
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
4409
4531
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4410
|
-
* @param {bool} [params.
|
|
4532
|
+
* @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
4411
4533
|
* @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
4412
4534
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to fetch trailing stop orders
|
|
4413
4535
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -4456,7 +4578,7 @@ class htx extends htx$1 {
|
|
|
4456
4578
|
request['page_size'] = limit;
|
|
4457
4579
|
}
|
|
4458
4580
|
request['contract_code'] = market['id'];
|
|
4459
|
-
const
|
|
4581
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
4460
4582
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4461
4583
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4462
4584
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
@@ -4465,7 +4587,7 @@ class htx extends htx$1 {
|
|
|
4465
4587
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
|
|
4466
4588
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
4467
4589
|
if (marginMode === 'isolated') {
|
|
4468
|
-
if (
|
|
4590
|
+
if (trigger) {
|
|
4469
4591
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
|
|
4470
4592
|
}
|
|
4471
4593
|
else if (stopLossTakeProfit) {
|
|
@@ -4479,7 +4601,7 @@ class htx extends htx$1 {
|
|
|
4479
4601
|
}
|
|
4480
4602
|
}
|
|
4481
4603
|
else if (marginMode === 'cross') {
|
|
4482
|
-
if (
|
|
4604
|
+
if (trigger) {
|
|
4483
4605
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerOpenorders(this.extend(request, params));
|
|
4484
4606
|
}
|
|
4485
4607
|
else if (stopLossTakeProfit) {
|
|
@@ -4495,7 +4617,7 @@ class htx extends htx$1 {
|
|
|
4495
4617
|
}
|
|
4496
4618
|
else if (market['inverse']) {
|
|
4497
4619
|
if (market['swap']) {
|
|
4498
|
-
if (
|
|
4620
|
+
if (trigger) {
|
|
4499
4621
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerOpenorders(this.extend(request, params));
|
|
4500
4622
|
}
|
|
4501
4623
|
else if (stopLossTakeProfit) {
|
|
@@ -4510,7 +4632,7 @@ class htx extends htx$1 {
|
|
|
4510
4632
|
}
|
|
4511
4633
|
else if (market['future']) {
|
|
4512
4634
|
request['symbol'] = market['settleId'];
|
|
4513
|
-
if (
|
|
4635
|
+
if (trigger) {
|
|
4514
4636
|
response = await this.contractPrivatePostApiV1ContractTriggerOpenorders(this.extend(request, params));
|
|
4515
4637
|
}
|
|
4516
4638
|
else if (stopLossTakeProfit) {
|
|
@@ -5259,7 +5381,7 @@ class htx extends htx$1 {
|
|
|
5259
5381
|
if (triggerPrice === undefined) {
|
|
5260
5382
|
const stopOrderTypes = this.safeValue(options, 'stopOrderTypes', {});
|
|
5261
5383
|
if (orderType in stopOrderTypes) {
|
|
5262
|
-
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice for a
|
|
5384
|
+
throw new errors.ArgumentsRequired(this.id + ' createOrder() requires a triggerPrice for a trigger order');
|
|
5263
5385
|
}
|
|
5264
5386
|
}
|
|
5265
5387
|
else {
|
|
@@ -5789,7 +5911,7 @@ class htx extends htx$1 {
|
|
|
5789
5911
|
* @param {string} id order id
|
|
5790
5912
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
5791
5913
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5792
|
-
* @param {boolean} [params.
|
|
5914
|
+
* @param {boolean} [params.trigger] *contract only* if the order is a trigger trigger order or not
|
|
5793
5915
|
* @param {boolean} [params.stopLossTakeProfit] *contract only* if the order is a stop-loss or take-profit order
|
|
5794
5916
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to cancel a trailing order
|
|
5795
5917
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -5845,7 +5967,7 @@ class htx extends htx$1 {
|
|
|
5845
5967
|
else {
|
|
5846
5968
|
request['contract_code'] = market['id'];
|
|
5847
5969
|
}
|
|
5848
|
-
const
|
|
5970
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
5849
5971
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
5850
5972
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
5851
5973
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
@@ -5854,7 +5976,7 @@ class htx extends htx$1 {
|
|
|
5854
5976
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
5855
5977
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
5856
5978
|
if (marginMode === 'isolated') {
|
|
5857
|
-
if (
|
|
5979
|
+
if (trigger) {
|
|
5858
5980
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
5859
5981
|
}
|
|
5860
5982
|
else if (stopLossTakeProfit) {
|
|
@@ -5868,7 +5990,7 @@ class htx extends htx$1 {
|
|
|
5868
5990
|
}
|
|
5869
5991
|
}
|
|
5870
5992
|
else if (marginMode === 'cross') {
|
|
5871
|
-
if (
|
|
5993
|
+
if (trigger) {
|
|
5872
5994
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancel(this.extend(request, params));
|
|
5873
5995
|
}
|
|
5874
5996
|
else if (stopLossTakeProfit) {
|
|
@@ -5884,7 +6006,7 @@ class htx extends htx$1 {
|
|
|
5884
6006
|
}
|
|
5885
6007
|
else if (market['inverse']) {
|
|
5886
6008
|
if (market['swap']) {
|
|
5887
|
-
if (
|
|
6009
|
+
if (trigger) {
|
|
5888
6010
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
5889
6011
|
}
|
|
5890
6012
|
else if (stopLossTakeProfit) {
|
|
@@ -5898,7 +6020,7 @@ class htx extends htx$1 {
|
|
|
5898
6020
|
}
|
|
5899
6021
|
}
|
|
5900
6022
|
else if (market['future']) {
|
|
5901
|
-
if (
|
|
6023
|
+
if (trigger) {
|
|
5902
6024
|
response = await this.contractPrivatePostApiV1ContractTriggerCancel(this.extend(request, params));
|
|
5903
6025
|
}
|
|
5904
6026
|
else if (stopLossTakeProfit) {
|
|
@@ -5947,7 +6069,7 @@ class htx extends htx$1 {
|
|
|
5947
6069
|
* @param {string[]} ids order ids
|
|
5948
6070
|
* @param {string} symbol unified market symbol, default is undefined
|
|
5949
6071
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5950
|
-
* @param {bool} [params.
|
|
6072
|
+
* @param {bool} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
5951
6073
|
* @param {bool} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
5952
6074
|
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5953
6075
|
*/
|
|
@@ -6011,7 +6133,7 @@ class htx extends htx$1 {
|
|
|
6011
6133
|
else {
|
|
6012
6134
|
request['contract_code'] = market['id'];
|
|
6013
6135
|
}
|
|
6014
|
-
const
|
|
6136
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
6015
6137
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
6016
6138
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trigger']);
|
|
6017
6139
|
if (market['linear']) {
|
|
@@ -6019,7 +6141,7 @@ class htx extends htx$1 {
|
|
|
6019
6141
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrders', params);
|
|
6020
6142
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
6021
6143
|
if (marginMode === 'isolated') {
|
|
6022
|
-
if (
|
|
6144
|
+
if (trigger) {
|
|
6023
6145
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
6024
6146
|
}
|
|
6025
6147
|
else if (stopLossTakeProfit) {
|
|
@@ -6030,7 +6152,7 @@ class htx extends htx$1 {
|
|
|
6030
6152
|
}
|
|
6031
6153
|
}
|
|
6032
6154
|
else if (marginMode === 'cross') {
|
|
6033
|
-
if (
|
|
6155
|
+
if (trigger) {
|
|
6034
6156
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancel(this.extend(request, params));
|
|
6035
6157
|
}
|
|
6036
6158
|
else if (stopLossTakeProfit) {
|
|
@@ -6043,7 +6165,7 @@ class htx extends htx$1 {
|
|
|
6043
6165
|
}
|
|
6044
6166
|
else if (market['inverse']) {
|
|
6045
6167
|
if (market['swap']) {
|
|
6046
|
-
if (
|
|
6168
|
+
if (trigger) {
|
|
6047
6169
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerCancel(this.extend(request, params));
|
|
6048
6170
|
}
|
|
6049
6171
|
else if (stopLossTakeProfit) {
|
|
@@ -6054,7 +6176,7 @@ class htx extends htx$1 {
|
|
|
6054
6176
|
}
|
|
6055
6177
|
}
|
|
6056
6178
|
else if (market['future']) {
|
|
6057
|
-
if (
|
|
6179
|
+
if (trigger) {
|
|
6058
6180
|
response = await this.contractPrivatePostApiV1ContractTriggerCancel(this.extend(request, params));
|
|
6059
6181
|
}
|
|
6060
6182
|
else if (stopLossTakeProfit) {
|
|
@@ -6187,7 +6309,7 @@ class htx extends htx$1 {
|
|
|
6187
6309
|
* @description cancel all open orders
|
|
6188
6310
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
6189
6311
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6190
|
-
* @param {boolean} [params.
|
|
6312
|
+
* @param {boolean} [params.trigger] *contract only* if the orders are trigger trigger orders or not
|
|
6191
6313
|
* @param {boolean} [params.stopLossTakeProfit] *contract only* if the orders are stop-loss or take-profit orders
|
|
6192
6314
|
* @param {boolean} [params.trailing] *contract only* set to true if you want to cancel all trailing orders
|
|
6193
6315
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -6245,7 +6367,7 @@ class htx extends htx$1 {
|
|
|
6245
6367
|
request['symbol'] = market['settleId'];
|
|
6246
6368
|
}
|
|
6247
6369
|
request['contract_code'] = market['id'];
|
|
6248
|
-
const
|
|
6370
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger');
|
|
6249
6371
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
6250
6372
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
6251
6373
|
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
@@ -6254,7 +6376,7 @@ class htx extends htx$1 {
|
|
|
6254
6376
|
[marginMode, params] = this.handleMarginModeAndParams('cancelAllOrders', params);
|
|
6255
6377
|
marginMode = (marginMode === undefined) ? 'cross' : marginMode;
|
|
6256
6378
|
if (marginMode === 'isolated') {
|
|
6257
|
-
if (
|
|
6379
|
+
if (trigger) {
|
|
6258
6380
|
response = await this.contractPrivatePostLinearSwapApiV1SwapTriggerCancelall(this.extend(request, params));
|
|
6259
6381
|
}
|
|
6260
6382
|
else if (stopLossTakeProfit) {
|
|
@@ -6268,7 +6390,7 @@ class htx extends htx$1 {
|
|
|
6268
6390
|
}
|
|
6269
6391
|
}
|
|
6270
6392
|
else if (marginMode === 'cross') {
|
|
6271
|
-
if (
|
|
6393
|
+
if (trigger) {
|
|
6272
6394
|
response = await this.contractPrivatePostLinearSwapApiV1SwapCrossTriggerCancelall(this.extend(request, params));
|
|
6273
6395
|
}
|
|
6274
6396
|
else if (stopLossTakeProfit) {
|
|
@@ -6284,7 +6406,7 @@ class htx extends htx$1 {
|
|
|
6284
6406
|
}
|
|
6285
6407
|
else if (market['inverse']) {
|
|
6286
6408
|
if (market['swap']) {
|
|
6287
|
-
if (
|
|
6409
|
+
if (trigger) {
|
|
6288
6410
|
response = await this.contractPrivatePostSwapApiV1SwapTriggerCancelall(this.extend(request, params));
|
|
6289
6411
|
}
|
|
6290
6412
|
else if (stopLossTakeProfit) {
|
|
@@ -6298,7 +6420,7 @@ class htx extends htx$1 {
|
|
|
6298
6420
|
}
|
|
6299
6421
|
}
|
|
6300
6422
|
else if (market['future']) {
|
|
6301
|
-
if (
|
|
6423
|
+
if (trigger) {
|
|
6302
6424
|
response = await this.contractPrivatePostApiV1ContractTriggerCancelall(this.extend(request, params));
|
|
6303
6425
|
}
|
|
6304
6426
|
else if (stopLossTakeProfit) {
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -557,6 +557,7 @@ class kucoin extends kucoin$1 {
|
|
|
557
557
|
'400008': errors.NotSupported,
|
|
558
558
|
'400100': errors.InsufficientFunds,
|
|
559
559
|
'400200': errors.InvalidOrder,
|
|
560
|
+
'400330': errors.InvalidOrder,
|
|
560
561
|
'400350': errors.InvalidOrder,
|
|
561
562
|
'400370': errors.InvalidOrder,
|
|
562
563
|
'400400': errors.BadRequest,
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -118,8 +118,8 @@ class mexc extends mexc$1 {
|
|
|
118
118
|
'fetchTickers': true,
|
|
119
119
|
'fetchTime': true,
|
|
120
120
|
'fetchTrades': true,
|
|
121
|
-
'fetchTradingFee':
|
|
122
|
-
'fetchTradingFees':
|
|
121
|
+
'fetchTradingFee': true,
|
|
122
|
+
'fetchTradingFees': false,
|
|
123
123
|
'fetchTradingLimits': undefined,
|
|
124
124
|
'fetchTransactionFee': 'emulated',
|
|
125
125
|
'fetchTransactionFees': true,
|
|
@@ -192,6 +192,7 @@ class mexc extends mexc$1 {
|
|
|
192
192
|
'allOrders': 10,
|
|
193
193
|
'account': 10,
|
|
194
194
|
'myTrades': 10,
|
|
195
|
+
'tradeFee': 10,
|
|
195
196
|
'sub-account/list': 1,
|
|
196
197
|
'sub-account/apiKey': 1,
|
|
197
198
|
'capital/config/getall': 10,
|
|
@@ -3603,33 +3604,43 @@ class mexc extends mexc$1 {
|
|
|
3603
3604
|
}
|
|
3604
3605
|
/**
|
|
3605
3606
|
* @method
|
|
3606
|
-
* @name mexc#
|
|
3607
|
-
* @description fetch the trading fees for
|
|
3608
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#
|
|
3609
|
-
* @
|
|
3607
|
+
* @name mexc#fetchTradingFee
|
|
3608
|
+
* @description fetch the trading fees for a market
|
|
3609
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status
|
|
3610
|
+
* @param {string} symbol unified market symbol
|
|
3610
3611
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3611
|
-
* @returns {object} a
|
|
3612
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3612
3613
|
*/
|
|
3613
|
-
async
|
|
3614
|
+
async fetchTradingFee(symbol, params = {}) {
|
|
3614
3615
|
await this.loadMarkets();
|
|
3615
|
-
const
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
makerFee = Precise["default"].stringDiv(makerFee, '1000');
|
|
3619
|
-
takerFee = Precise["default"].stringDiv(takerFee, '1000');
|
|
3620
|
-
const result = {};
|
|
3621
|
-
for (let i = 0; i < this.symbols.length; i++) {
|
|
3622
|
-
const symbol = this.symbols[i];
|
|
3623
|
-
result[symbol] = {
|
|
3624
|
-
'symbol': symbol,
|
|
3625
|
-
'maker': this.parseNumber(makerFee),
|
|
3626
|
-
'taker': this.parseNumber(takerFee),
|
|
3627
|
-
'percentage': true,
|
|
3628
|
-
'tierBased': false,
|
|
3629
|
-
'info': response,
|
|
3630
|
-
};
|
|
3616
|
+
const market = this.market(symbol);
|
|
3617
|
+
if (!market['spot']) {
|
|
3618
|
+
throw new errors.BadRequest(this.id + ' fetchTradingFee() supports spot markets only');
|
|
3631
3619
|
}
|
|
3632
|
-
|
|
3620
|
+
const request = {
|
|
3621
|
+
'symbol': market['id'],
|
|
3622
|
+
};
|
|
3623
|
+
const response = await this.spotPrivateGetTradeFee(this.extend(request, params));
|
|
3624
|
+
//
|
|
3625
|
+
// {
|
|
3626
|
+
// "data":{
|
|
3627
|
+
// "makerCommission":0.003000000000000000,
|
|
3628
|
+
// "takerCommission":0.003000000000000000
|
|
3629
|
+
// },
|
|
3630
|
+
// "code":0,
|
|
3631
|
+
// "msg":"success",
|
|
3632
|
+
// "timestamp":1669109672717
|
|
3633
|
+
// }
|
|
3634
|
+
//
|
|
3635
|
+
const data = this.safeDict(response, 'data', {});
|
|
3636
|
+
return {
|
|
3637
|
+
'info': data,
|
|
3638
|
+
'symbol': symbol,
|
|
3639
|
+
'maker': this.safeNumber(data, 'makerCommission'),
|
|
3640
|
+
'taker': this.safeNumber(data, 'takerCommission'),
|
|
3641
|
+
'percentage': undefined,
|
|
3642
|
+
'tierBased': undefined,
|
|
3643
|
+
};
|
|
3633
3644
|
}
|
|
3634
3645
|
customParseBalance(response, marketType) {
|
|
3635
3646
|
//
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -2254,6 +2254,7 @@ class okx extends okx$1 {
|
|
|
2254
2254
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2255
2255
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2256
2256
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2257
|
+
* @param {string} [params.method] 'publicGetMarketTrades' or 'publicGetMarketHistoryTrades' default is 'publicGetMarketTrades'
|
|
2257
2258
|
* @param {boolean} [params.paginate] *only applies to publicGetMarketHistoryTrades* default false, when true will automatically paginate by calling this endpoint multiple times
|
|
2258
2259
|
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2259
2260
|
*/
|
package/dist/cjs/src/pro/woo.js
CHANGED
package/dist/cjs/src/woo.js
CHANGED
|
@@ -113,7 +113,7 @@ class woo extends woo$1 {
|
|
|
113
113
|
'setMargin': false,
|
|
114
114
|
'setPositionMode': true,
|
|
115
115
|
'transfer': true,
|
|
116
|
-
'withdraw': true, // exchange have that endpoint disabled atm, but was once implemented in ccxt per old docs: https://
|
|
116
|
+
'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
|
|
117
117
|
},
|
|
118
118
|
'timeframes': {
|
|
119
119
|
'1m': '1m',
|
|
@@ -157,7 +157,7 @@ class woo extends woo$1 {
|
|
|
157
157
|
'pub': {
|
|
158
158
|
'get': {
|
|
159
159
|
'hist/kline': 10,
|
|
160
|
-
'hist/trades':
|
|
160
|
+
'hist/trades': 10,
|
|
161
161
|
},
|
|
162
162
|
},
|
|
163
163
|
'public': {
|
|
@@ -207,7 +207,7 @@ class woo extends woo$1 {
|
|
|
207
207
|
'client/futures_leverage': 60,
|
|
208
208
|
},
|
|
209
209
|
'post': {
|
|
210
|
-
'order':
|
|
210
|
+
'order': 1,
|
|
211
211
|
'order/cancel_all_after': 1,
|
|
212
212
|
'asset/main_sub_transfer': 30,
|
|
213
213
|
'asset/ltv': 30,
|
|
@@ -224,7 +224,7 @@ class woo extends woo$1 {
|
|
|
224
224
|
'order': 1,
|
|
225
225
|
'client/order': 1,
|
|
226
226
|
'orders': 1,
|
|
227
|
-
'asset/withdraw': 120, // implemented in ccxt, disabled on the exchange side https://
|
|
227
|
+
'asset/withdraw': 120, // implemented in ccxt, disabled on the exchange side https://docx.woo.io/wootrade-documents/#cancel-withdraw-request
|
|
228
228
|
},
|
|
229
229
|
},
|
|
230
230
|
},
|
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, DepositAddressResponse, 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 } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, 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.4.
|
|
7
|
+
declare const version = "4.4.38";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.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, 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.4.
|
|
41
|
+
const version = '4.4.39';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -70,6 +70,7 @@ interface Exchange {
|
|
|
70
70
|
privateSwapGetTradeHistoryTrades(params?: {}): Promise<implicitReturnType>;
|
|
71
71
|
privateSwapGetTradeOpenOrders(params?: {}): Promise<implicitReturnType>;
|
|
72
72
|
privateSwapGetTradeOrderInfo(params?: {}): Promise<implicitReturnType>;
|
|
73
|
+
privateSwapPostAccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
73
74
|
privateSwapPostAccountLeverage(params?: {}): Promise<implicitReturnType>;
|
|
74
75
|
privateSwapPostAccountPositionMode(params?: {}): Promise<implicitReturnType>;
|
|
75
76
|
privateSwapPostAccountPositionMargin(params?: {}): Promise<implicitReturnType>;
|
|
@@ -19,6 +19,7 @@ interface Exchange {
|
|
|
19
19
|
spotPrivateGetAllOrders(params?: {}): Promise<implicitReturnType>;
|
|
20
20
|
spotPrivateGetAccount(params?: {}): Promise<implicitReturnType>;
|
|
21
21
|
spotPrivateGetMyTrades(params?: {}): Promise<implicitReturnType>;
|
|
22
|
+
spotPrivateGetTradeFee(params?: {}): Promise<implicitReturnType>;
|
|
22
23
|
spotPrivateGetSubAccountList(params?: {}): Promise<implicitReturnType>;
|
|
23
24
|
spotPrivateGetSubAccountApiKey(params?: {}): Promise<implicitReturnType>;
|
|
24
25
|
spotPrivateGetCapitalConfigGetall(params?: {}): Promise<implicitReturnType>;
|
package/js/src/alpaca.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/alpaca.js';
|
|
2
|
-
import type { Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Trade, int, Strings, Ticker, Tickers, Currency, DepositAddress, Transaction } from './base/types.js';
|
|
2
|
+
import type { Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Trade, int, Strings, Ticker, Tickers, Currency, DepositAddress, Transaction, Balances } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class alpaca
|
|
5
5
|
* @augments Exchange
|
|
@@ -276,6 +276,16 @@ export default class alpaca extends Exchange {
|
|
|
276
276
|
parseTransaction(transaction: Dict, currency?: Currency): Transaction;
|
|
277
277
|
parseTransactionStatus(status: Str): string;
|
|
278
278
|
parseTransactionType(type: any): string;
|
|
279
|
+
/**
|
|
280
|
+
* @method
|
|
281
|
+
* @name alpaca#fetchBalance
|
|
282
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
283
|
+
* @see https://docs.alpaca.markets/reference/getaccount-1
|
|
284
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
285
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
286
|
+
*/
|
|
287
|
+
fetchBalance(params?: {}): Promise<Balances>;
|
|
288
|
+
parseBalance(response: any): Balances;
|
|
279
289
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
280
290
|
url: string;
|
|
281
291
|
method: string;
|