ccxt 4.3.56 → 4.3.58
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 +5 -1
- package/dist/cjs/src/base/ws/Client.js +34 -4
- package/dist/cjs/src/bigone.js +21 -1
- package/dist/cjs/src/bingx.js +127 -27
- package/dist/cjs/src/bitget.js +56 -47
- package/dist/cjs/src/coinmate.js +28 -35
- package/dist/cjs/src/coinone.js +13 -19
- package/dist/cjs/src/gate.js +117 -4
- package/dist/cjs/src/htx.js +91 -26
- package/dist/cjs/src/huobijp.js +65 -2
- package/dist/cjs/src/kucoin.js +3 -0
- package/dist/cjs/src/latoken.js +5 -1
- package/dist/cjs/src/okx.js +3 -0
- package/dist/cjs/src/pro/okx.js +3 -3
- package/dist/cjs/src/woo.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/kucoin.d.ts +1 -0
- package/js/src/abstract/kucoinfutures.d.ts +1 -0
- package/js/src/alpaca.d.ts +1 -1
- package/js/src/alpaca.js +5 -1
- package/js/src/base/ws/Client.d.ts +2 -0
- package/js/src/base/ws/Client.js +34 -4
- package/js/src/bigone.d.ts +1 -1
- package/js/src/bigone.js +21 -1
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +127 -27
- package/js/src/bitget.d.ts +1 -1
- package/js/src/bitget.js +56 -47
- package/js/src/coinmate.js +28 -35
- package/js/src/coinone.js +13 -19
- package/js/src/gate.d.ts +3 -1
- package/js/src/gate.js +117 -4
- package/js/src/htx.d.ts +3 -2
- package/js/src/htx.js +91 -26
- package/js/src/huobijp.d.ts +3 -2
- package/js/src/huobijp.js +65 -2
- package/js/src/kucoin.js +3 -0
- package/js/src/latoken.d.ts +1 -1
- package/js/src/latoken.js +5 -1
- package/js/src/okx.js +3 -0
- package/js/src/pro/okx.js +3 -3
- package/js/src/woo.js +2 -2
- package/package.json +1 -1
package/dist/cjs/src/coinone.js
CHANGED
|
@@ -18,8 +18,7 @@ class coinone extends coinone$1 {
|
|
|
18
18
|
'id': 'coinone',
|
|
19
19
|
'name': 'CoinOne',
|
|
20
20
|
'countries': ['KR'],
|
|
21
|
-
|
|
22
|
-
'rateLimit': 667,
|
|
21
|
+
'rateLimit': 50,
|
|
23
22
|
'version': 'v2',
|
|
24
23
|
'pro': false,
|
|
25
24
|
'has': {
|
|
@@ -191,10 +190,10 @@ class coinone extends coinone$1 {
|
|
|
191
190
|
},
|
|
192
191
|
'precisionMode': number.TICK_SIZE,
|
|
193
192
|
'exceptions': {
|
|
194
|
-
'405': errors.OnMaintenance,
|
|
195
193
|
'104': errors.OrderNotFound,
|
|
194
|
+
'107': errors.BadRequest,
|
|
196
195
|
'108': errors.BadSymbol,
|
|
197
|
-
'
|
|
196
|
+
'405': errors.OnMaintenance,
|
|
198
197
|
},
|
|
199
198
|
'commonCurrencies': {
|
|
200
199
|
'SOC': 'Soda Coin',
|
|
@@ -1164,22 +1163,17 @@ class coinone extends coinone$1 {
|
|
|
1164
1163
|
}
|
|
1165
1164
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
1166
1165
|
if (response === undefined) {
|
|
1167
|
-
return undefined;
|
|
1168
|
-
}
|
|
1169
|
-
if ('result' in response) {
|
|
1170
|
-
const result = response['result'];
|
|
1171
|
-
if (result !== 'success') {
|
|
1172
|
-
//
|
|
1173
|
-
// { "errorCode": "405", "status": "maintenance", "result": "error"}
|
|
1174
|
-
//
|
|
1175
|
-
const errorCode = this.safeString(response, 'errorCode');
|
|
1176
|
-
const feedback = this.id + ' ' + body;
|
|
1177
|
-
this.throwExactlyMatchedException(this.exceptions, errorCode, feedback);
|
|
1178
|
-
throw new errors.ExchangeError(feedback);
|
|
1179
|
-
}
|
|
1166
|
+
return undefined; // fallback to default error handler
|
|
1180
1167
|
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1168
|
+
//
|
|
1169
|
+
// {"result":"error","error_code":"107","error_msg":"Parameter value is wrong"}
|
|
1170
|
+
// {"result":"error","error_code":"108","error_msg":"Unknown CryptoCurrency"}
|
|
1171
|
+
//
|
|
1172
|
+
const errorCode = this.safeString(response, 'error_code');
|
|
1173
|
+
if (errorCode !== undefined && errorCode !== '0') {
|
|
1174
|
+
const feedback = this.id + ' ' + body;
|
|
1175
|
+
this.throwExactlyMatchedException(this.exceptions, errorCode, feedback);
|
|
1176
|
+
throw new errors.ExchangeError(feedback); // unknown message
|
|
1183
1177
|
}
|
|
1184
1178
|
return undefined;
|
|
1185
1179
|
}
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -81,6 +81,8 @@ class gate extends gate$1 {
|
|
|
81
81
|
'borrowIsolatedMargin': true,
|
|
82
82
|
'cancelAllOrders': true,
|
|
83
83
|
'cancelOrder': true,
|
|
84
|
+
'cancelOrders': true,
|
|
85
|
+
'cancelOrdersForSymbols': true,
|
|
84
86
|
'createMarketBuyOrderWithCost': true,
|
|
85
87
|
'createMarketOrder': true,
|
|
86
88
|
'createMarketOrderWithCost': false,
|
|
@@ -4017,7 +4019,7 @@ class gate extends gate$1 {
|
|
|
4017
4019
|
request['price'] = price; // set to 0 for market orders
|
|
4018
4020
|
}
|
|
4019
4021
|
else {
|
|
4020
|
-
request['price'] = this.priceToPrecision(symbol, price);
|
|
4022
|
+
request['price'] = (price === 0) ? '0' : this.priceToPrecision(symbol, price);
|
|
4021
4023
|
}
|
|
4022
4024
|
if (reduceOnly !== undefined) {
|
|
4023
4025
|
request['reduce_only'] = reduceOnly;
|
|
@@ -4108,8 +4110,8 @@ class gate extends gate$1 {
|
|
|
4108
4110
|
request = {
|
|
4109
4111
|
'initial': {
|
|
4110
4112
|
'contract': market['id'],
|
|
4111
|
-
'size': amount,
|
|
4112
|
-
'price': this.priceToPrecision(symbol, price), // set to 0 to use market price
|
|
4113
|
+
'size': amount, // positive = buy, negative = sell, set to 0 to close the position
|
|
4114
|
+
// 'price': (price === 0) ? '0' : this.priceToPrecision (symbol, price), // set to 0 to use market price
|
|
4113
4115
|
// 'close': false, // set to true if trying to close the position
|
|
4114
4116
|
// 'tif': 'gtc', // gtc, ioc, if using market price, only ioc is supported
|
|
4115
4117
|
// 'text': clientOrderId, // web, api, app
|
|
@@ -4117,6 +4119,12 @@ class gate extends gate$1 {
|
|
|
4117
4119
|
},
|
|
4118
4120
|
'settle': market['settleId'],
|
|
4119
4121
|
};
|
|
4122
|
+
if (type === 'market') {
|
|
4123
|
+
request['initial']['price'] = '0';
|
|
4124
|
+
}
|
|
4125
|
+
else {
|
|
4126
|
+
request['initial']['price'] = (price === 0) ? '0' : this.priceToPrecision(symbol, price);
|
|
4127
|
+
}
|
|
4120
4128
|
if (trigger === undefined) {
|
|
4121
4129
|
let rule = undefined;
|
|
4122
4130
|
let triggerOrderPrice = undefined;
|
|
@@ -4467,6 +4475,8 @@ class gate extends gate$1 {
|
|
|
4467
4475
|
// "message": "Not enough balance"
|
|
4468
4476
|
// }
|
|
4469
4477
|
//
|
|
4478
|
+
// {"user_id":10406147,"id":"id","succeeded":false,"message":"INVALID_PROTOCOL","label":"INVALID_PROTOCOL"}
|
|
4479
|
+
//
|
|
4470
4480
|
const succeeded = this.safeBool(order, 'succeeded', true);
|
|
4471
4481
|
if (!succeeded) {
|
|
4472
4482
|
// cancelOrders response
|
|
@@ -4474,6 +4484,7 @@ class gate extends gate$1 {
|
|
|
4474
4484
|
'clientOrderId': this.safeString(order, 'text'),
|
|
4475
4485
|
'info': order,
|
|
4476
4486
|
'status': 'rejected',
|
|
4487
|
+
'id': this.safeString(order, 'id'),
|
|
4477
4488
|
});
|
|
4478
4489
|
}
|
|
4479
4490
|
const put = this.safeValue2(order, 'put', 'initial', {});
|
|
@@ -5073,6 +5084,92 @@ class gate extends gate$1 {
|
|
|
5073
5084
|
//
|
|
5074
5085
|
return this.parseOrder(response, market);
|
|
5075
5086
|
}
|
|
5087
|
+
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
5088
|
+
/**
|
|
5089
|
+
* @method
|
|
5090
|
+
* @name gate#cancelOrders
|
|
5091
|
+
* @description cancel multiple orders
|
|
5092
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5093
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
|
|
5094
|
+
* @param {string[]} ids order ids
|
|
5095
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
5096
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5097
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5098
|
+
*/
|
|
5099
|
+
await this.loadMarkets();
|
|
5100
|
+
let market = undefined;
|
|
5101
|
+
if (symbol !== undefined) {
|
|
5102
|
+
market = this.market(symbol);
|
|
5103
|
+
}
|
|
5104
|
+
let type = undefined;
|
|
5105
|
+
const defaultSettle = (market === undefined) ? 'usdt' : market['settle'];
|
|
5106
|
+
const settle = this.safeStringLower(params, 'settle', defaultSettle);
|
|
5107
|
+
[type, params] = this.handleMarketTypeAndParams('cancelOrders', market, params);
|
|
5108
|
+
const isSpot = (type === 'spot');
|
|
5109
|
+
if (isSpot && (symbol === undefined)) {
|
|
5110
|
+
throw new errors.ArgumentsRequired(this.id + ' cancelOrders requires a symbol argument for spot markets');
|
|
5111
|
+
}
|
|
5112
|
+
if (isSpot) {
|
|
5113
|
+
const ordersRequests = [];
|
|
5114
|
+
for (let i = 0; i < ids.length; i++) {
|
|
5115
|
+
const id = ids[i];
|
|
5116
|
+
const orderItem = {
|
|
5117
|
+
'id': id,
|
|
5118
|
+
'symbol': symbol,
|
|
5119
|
+
};
|
|
5120
|
+
ordersRequests.push(orderItem);
|
|
5121
|
+
}
|
|
5122
|
+
return await this.cancelOrdersForSymbols(ordersRequests, params);
|
|
5123
|
+
}
|
|
5124
|
+
const request = {
|
|
5125
|
+
'settle': settle,
|
|
5126
|
+
};
|
|
5127
|
+
const finalList = [request]; // hacky but needs to be done here
|
|
5128
|
+
for (let i = 0; i < ids.length; i++) {
|
|
5129
|
+
finalList.push(ids[i]);
|
|
5130
|
+
}
|
|
5131
|
+
const response = await this.privateFuturesPostSettleBatchCancelOrders(finalList);
|
|
5132
|
+
return this.parseOrders(response);
|
|
5133
|
+
}
|
|
5134
|
+
async cancelOrdersForSymbols(orders, params = {}) {
|
|
5135
|
+
/**
|
|
5136
|
+
* @method
|
|
5137
|
+
* @name gate#cancelOrdersForSymbols
|
|
5138
|
+
* @description cancel multiple orders for multiple symbols
|
|
5139
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5140
|
+
* @param {string[]} ids order ids
|
|
5141
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
5142
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5143
|
+
* @param {string[]} [params.clientOrderIds] client order ids
|
|
5144
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5145
|
+
*/
|
|
5146
|
+
await this.loadMarkets();
|
|
5147
|
+
const ordersRequests = [];
|
|
5148
|
+
for (let i = 0; i < orders.length; i++) {
|
|
5149
|
+
const order = orders[i];
|
|
5150
|
+
const symbol = this.safeString(order, 'symbol');
|
|
5151
|
+
const market = this.market(symbol);
|
|
5152
|
+
if (!market['spot']) {
|
|
5153
|
+
throw new errors.NotSupported(this.id + ' cancelOrdersForSymbols() supports only spot markets');
|
|
5154
|
+
}
|
|
5155
|
+
const id = this.safeString(order, 'id');
|
|
5156
|
+
const orderItem = {
|
|
5157
|
+
'id': id,
|
|
5158
|
+
'currency_pair': market['id'],
|
|
5159
|
+
};
|
|
5160
|
+
ordersRequests.push(orderItem);
|
|
5161
|
+
}
|
|
5162
|
+
const response = await this.privateSpotPostCancelBatchOrders(ordersRequests);
|
|
5163
|
+
//
|
|
5164
|
+
// [
|
|
5165
|
+
// {
|
|
5166
|
+
// "currency_pair": "BTC_USDT",
|
|
5167
|
+
// "id": "123456"
|
|
5168
|
+
// }
|
|
5169
|
+
// ]
|
|
5170
|
+
//
|
|
5171
|
+
return this.parseOrders(response);
|
|
5172
|
+
}
|
|
5076
5173
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
5077
5174
|
/**
|
|
5078
5175
|
* @method
|
|
@@ -6077,7 +6174,22 @@ class gate extends gate$1 {
|
|
|
6077
6174
|
const authentication = api[0]; // public, private
|
|
6078
6175
|
const type = api[1]; // spot, margin, future, delivery
|
|
6079
6176
|
let query = this.omit(params, this.extractParams(path));
|
|
6080
|
-
|
|
6177
|
+
const containsSettle = path.indexOf('settle') > -1;
|
|
6178
|
+
if (containsSettle && path.endsWith('batch_cancel_orders')) { // weird check to prevent $settle in php and converting {settle} to array(settle)
|
|
6179
|
+
// special case where we need to extract the settle from the path
|
|
6180
|
+
// but the body is an array of strings
|
|
6181
|
+
const settle = this.safeDict(params, 0);
|
|
6182
|
+
path = this.implodeParams(path, settle);
|
|
6183
|
+
// remove the first element from params
|
|
6184
|
+
const newParams = [];
|
|
6185
|
+
const anyParams = params;
|
|
6186
|
+
for (let i = 1; i < anyParams.length; i++) {
|
|
6187
|
+
newParams.push(params[i]);
|
|
6188
|
+
}
|
|
6189
|
+
params = newParams;
|
|
6190
|
+
query = newParams;
|
|
6191
|
+
}
|
|
6192
|
+
else if (Array.isArray(params)) {
|
|
6081
6193
|
// endpoints like createOrders use an array instead of an object
|
|
6082
6194
|
// so we infer the settle from one of the elements
|
|
6083
6195
|
// they have to be all the same so relying on the first one is fine
|
|
@@ -7550,6 +7662,7 @@ class gate extends gate$1 {
|
|
|
7550
7662
|
// {"label": "INVALID_PARAM_VALUE", "message": "invalid argument: Trigger.rule"}
|
|
7551
7663
|
// {"label": "INVALID_PARAM_VALUE", "message": "invalid argument: trigger.expiration invalid range"}
|
|
7552
7664
|
// {"label": "INVALID_ARGUMENT", "detail": "invalid size"}
|
|
7665
|
+
// {"user_id":10406147,"id":"id","succeeded":false,"message":"INVALID_PROTOCOL","label":"INVALID_PROTOCOL"}
|
|
7553
7666
|
//
|
|
7554
7667
|
const label = this.safeString(response, 'label');
|
|
7555
7668
|
if (label !== undefined) {
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -3230,6 +3230,7 @@ class htx extends htx$1 {
|
|
|
3230
3230
|
const instStatus = this.safeString(entry, 'instStatus');
|
|
3231
3231
|
const currencyActive = instStatus === 'normal';
|
|
3232
3232
|
let minPrecision = undefined;
|
|
3233
|
+
let minDeposit = undefined;
|
|
3233
3234
|
let minWithdraw = undefined;
|
|
3234
3235
|
let maxWithdraw = undefined;
|
|
3235
3236
|
let deposit = false;
|
|
@@ -3241,6 +3242,7 @@ class htx extends htx$1 {
|
|
|
3241
3242
|
this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
|
|
3242
3243
|
this.options['networkNamesByChainIds'][uniqueChainId] = title;
|
|
3243
3244
|
const networkCode = this.networkIdToCode(uniqueChainId);
|
|
3245
|
+
minDeposit = this.safeNumber(chainEntry, 'minDepositAmt');
|
|
3244
3246
|
minWithdraw = this.safeNumber(chainEntry, 'minWithdrawAmt');
|
|
3245
3247
|
maxWithdraw = this.safeNumber(chainEntry, 'maxWithdrawAmt');
|
|
3246
3248
|
const withdrawStatus = this.safeString(chainEntry, 'withdrawStatus');
|
|
@@ -3261,7 +3263,7 @@ class htx extends htx$1 {
|
|
|
3261
3263
|
'network': networkCode,
|
|
3262
3264
|
'limits': {
|
|
3263
3265
|
'deposit': {
|
|
3264
|
-
'min':
|
|
3266
|
+
'min': minDeposit,
|
|
3265
3267
|
'max': undefined,
|
|
3266
3268
|
},
|
|
3267
3269
|
'withdraw': {
|
|
@@ -6026,7 +6028,66 @@ class htx extends htx$1 {
|
|
|
6026
6028
|
// "ts": 1604367997451
|
|
6027
6029
|
// }
|
|
6028
6030
|
//
|
|
6029
|
-
|
|
6031
|
+
const data = this.safeDict(response, 'data');
|
|
6032
|
+
return this.parseCancelOrders(data);
|
|
6033
|
+
}
|
|
6034
|
+
parseCancelOrders(orders) {
|
|
6035
|
+
//
|
|
6036
|
+
// {
|
|
6037
|
+
// "success": [
|
|
6038
|
+
// "5983466"
|
|
6039
|
+
// ],
|
|
6040
|
+
// "failed": [
|
|
6041
|
+
// {
|
|
6042
|
+
// "err-msg": "Incorrect order state",
|
|
6043
|
+
// "order-state": 7,
|
|
6044
|
+
// "order-id": "",
|
|
6045
|
+
// "err-code": "order-orderstate-error",
|
|
6046
|
+
// "client-order-id": "first"
|
|
6047
|
+
// },
|
|
6048
|
+
// ...
|
|
6049
|
+
// ]
|
|
6050
|
+
// }
|
|
6051
|
+
//
|
|
6052
|
+
// {
|
|
6053
|
+
// "errors": [
|
|
6054
|
+
// {
|
|
6055
|
+
// "order_id": "769206471845261312",
|
|
6056
|
+
// "err_code": 1061,
|
|
6057
|
+
// "err_msg": "This order doesnt exist."
|
|
6058
|
+
// }
|
|
6059
|
+
// ],
|
|
6060
|
+
// "successes": "1258075374411399168,1258075393254871040"
|
|
6061
|
+
// }
|
|
6062
|
+
//
|
|
6063
|
+
const successes = this.safeString(orders, 'successes');
|
|
6064
|
+
let success = undefined;
|
|
6065
|
+
if (successes !== undefined) {
|
|
6066
|
+
success = successes.split(',');
|
|
6067
|
+
}
|
|
6068
|
+
else {
|
|
6069
|
+
success = this.safeList(orders, 'success', []);
|
|
6070
|
+
}
|
|
6071
|
+
const failed = this.safeList2(orders, 'errors', 'failed', []);
|
|
6072
|
+
const result = [];
|
|
6073
|
+
for (let i = 0; i < success.length; i++) {
|
|
6074
|
+
const order = success[i];
|
|
6075
|
+
result.push(this.safeOrder({
|
|
6076
|
+
'info': order,
|
|
6077
|
+
'id': order,
|
|
6078
|
+
'status': 'canceled',
|
|
6079
|
+
}));
|
|
6080
|
+
}
|
|
6081
|
+
for (let i = 0; i < failed.length; i++) {
|
|
6082
|
+
const order = failed[i];
|
|
6083
|
+
result.push(this.safeOrder({
|
|
6084
|
+
'info': order,
|
|
6085
|
+
'id': this.safeString2(order, 'order-id', 'order_id'),
|
|
6086
|
+
'status': 'failed',
|
|
6087
|
+
'clientOrderId': this.safeString(order, 'client-order-id'),
|
|
6088
|
+
}));
|
|
6089
|
+
}
|
|
6090
|
+
return result;
|
|
6030
6091
|
}
|
|
6031
6092
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
6032
6093
|
/**
|
|
@@ -6067,6 +6128,22 @@ class htx extends htx$1 {
|
|
|
6067
6128
|
request['symbol'] = market['id'];
|
|
6068
6129
|
}
|
|
6069
6130
|
response = await this.spotPrivatePostV1OrderOrdersBatchCancelOpenOrders(this.extend(request, params));
|
|
6131
|
+
//
|
|
6132
|
+
// {
|
|
6133
|
+
// "code": 200,
|
|
6134
|
+
// "data": {
|
|
6135
|
+
// "success-count": 2,
|
|
6136
|
+
// "failed-count": 0,
|
|
6137
|
+
// "next-id": 5454600
|
|
6138
|
+
// }
|
|
6139
|
+
// }
|
|
6140
|
+
//
|
|
6141
|
+
const data = this.safeDict(response, 'data');
|
|
6142
|
+
return [
|
|
6143
|
+
this.safeOrder({
|
|
6144
|
+
'info': data,
|
|
6145
|
+
}),
|
|
6146
|
+
];
|
|
6070
6147
|
}
|
|
6071
6148
|
else {
|
|
6072
6149
|
if (symbol === undefined) {
|
|
@@ -6146,31 +6223,19 @@ class htx extends htx$1 {
|
|
|
6146
6223
|
else {
|
|
6147
6224
|
throw new errors.NotSupported(this.id + ' cancelAllOrders() does not support ' + marketType + ' markets');
|
|
6148
6225
|
}
|
|
6226
|
+
//
|
|
6227
|
+
// {
|
|
6228
|
+
// "status": "ok",
|
|
6229
|
+
// "data": {
|
|
6230
|
+
// "errors": [],
|
|
6231
|
+
// "successes": "1104754904426696704"
|
|
6232
|
+
// },
|
|
6233
|
+
// "ts": "1683435723755"
|
|
6234
|
+
// }
|
|
6235
|
+
//
|
|
6236
|
+
const data = this.safeDict(response, 'data');
|
|
6237
|
+
return this.parseCancelOrders(data);
|
|
6149
6238
|
}
|
|
6150
|
-
//
|
|
6151
|
-
// spot
|
|
6152
|
-
//
|
|
6153
|
-
// {
|
|
6154
|
-
// "code": 200,
|
|
6155
|
-
// "data": {
|
|
6156
|
-
// "success-count": 2,
|
|
6157
|
-
// "failed-count": 0,
|
|
6158
|
-
// "next-id": 5454600
|
|
6159
|
-
// }
|
|
6160
|
-
// }
|
|
6161
|
-
//
|
|
6162
|
-
// future and swap
|
|
6163
|
-
//
|
|
6164
|
-
// {
|
|
6165
|
-
// "status": "ok",
|
|
6166
|
-
// "data": {
|
|
6167
|
-
// "errors": [],
|
|
6168
|
-
// "successes": "1104754904426696704"
|
|
6169
|
-
// },
|
|
6170
|
-
// "ts": "1683435723755"
|
|
6171
|
-
// }
|
|
6172
|
-
//
|
|
6173
|
-
return response;
|
|
6174
6239
|
}
|
|
6175
6240
|
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
6176
6241
|
/**
|
package/dist/cjs/src/huobijp.js
CHANGED
|
@@ -1545,7 +1545,65 @@ class huobijp extends huobijp$1 {
|
|
|
1545
1545
|
// }
|
|
1546
1546
|
// }
|
|
1547
1547
|
//
|
|
1548
|
-
return response;
|
|
1548
|
+
return this.parseCancelOrders(response);
|
|
1549
|
+
}
|
|
1550
|
+
parseCancelOrders(orders) {
|
|
1551
|
+
//
|
|
1552
|
+
// {
|
|
1553
|
+
// "success": [
|
|
1554
|
+
// "5983466"
|
|
1555
|
+
// ],
|
|
1556
|
+
// "failed": [
|
|
1557
|
+
// {
|
|
1558
|
+
// "err-msg": "Incorrect order state",
|
|
1559
|
+
// "order-state": 7,
|
|
1560
|
+
// "order-id": "",
|
|
1561
|
+
// "err-code": "order-orderstate-error",
|
|
1562
|
+
// "client-order-id": "first"
|
|
1563
|
+
// },
|
|
1564
|
+
// ...
|
|
1565
|
+
// ]
|
|
1566
|
+
// }
|
|
1567
|
+
//
|
|
1568
|
+
// {
|
|
1569
|
+
// "errors": [
|
|
1570
|
+
// {
|
|
1571
|
+
// "order_id": "769206471845261312",
|
|
1572
|
+
// "err_code": 1061,
|
|
1573
|
+
// "err_msg": "This order doesnt exist."
|
|
1574
|
+
// }
|
|
1575
|
+
// ],
|
|
1576
|
+
// "successes": "1258075374411399168,1258075393254871040"
|
|
1577
|
+
// }
|
|
1578
|
+
//
|
|
1579
|
+
const successes = this.safeString(orders, 'successes');
|
|
1580
|
+
let success = undefined;
|
|
1581
|
+
if (successes !== undefined) {
|
|
1582
|
+
success = successes.split(',');
|
|
1583
|
+
}
|
|
1584
|
+
else {
|
|
1585
|
+
success = this.safeList(orders, 'success', []);
|
|
1586
|
+
}
|
|
1587
|
+
const failed = this.safeList2(orders, 'errors', 'failed', []);
|
|
1588
|
+
const result = [];
|
|
1589
|
+
for (let i = 0; i < success.length; i++) {
|
|
1590
|
+
const order = success[i];
|
|
1591
|
+
result.push(this.safeOrder({
|
|
1592
|
+
'info': order,
|
|
1593
|
+
'id': order,
|
|
1594
|
+
'status': 'canceled',
|
|
1595
|
+
}));
|
|
1596
|
+
}
|
|
1597
|
+
for (let i = 0; i < failed.length; i++) {
|
|
1598
|
+
const order = failed[i];
|
|
1599
|
+
result.push(this.safeOrder({
|
|
1600
|
+
'info': order,
|
|
1601
|
+
'id': this.safeString2(order, 'order-id', 'order_id'),
|
|
1602
|
+
'status': 'failed',
|
|
1603
|
+
'clientOrderId': this.safeString(order, 'client-order-id'),
|
|
1604
|
+
}));
|
|
1605
|
+
}
|
|
1606
|
+
return result;
|
|
1549
1607
|
}
|
|
1550
1608
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1551
1609
|
/**
|
|
@@ -1580,7 +1638,12 @@ class huobijp extends huobijp$1 {
|
|
|
1580
1638
|
// }
|
|
1581
1639
|
// }
|
|
1582
1640
|
//
|
|
1583
|
-
|
|
1641
|
+
const data = this.safeDict(response, 'data', {});
|
|
1642
|
+
return [
|
|
1643
|
+
this.safeOrder({
|
|
1644
|
+
'info': data,
|
|
1645
|
+
}),
|
|
1646
|
+
];
|
|
1584
1647
|
}
|
|
1585
1648
|
currencyToPrecision(code, fee, networkCode = undefined) {
|
|
1586
1649
|
return this.decimalToPrecision(fee, 0, this.currencies[code]['precision'], this.precisionMode);
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -240,6 +240,8 @@ class kucoin extends kucoin$1 {
|
|
|
240
240
|
'purchase/orders': 10,
|
|
241
241
|
// broker
|
|
242
242
|
'broker/api/rebase/download': 3,
|
|
243
|
+
// affiliate
|
|
244
|
+
'affiliate/inviter/statistics': 30,
|
|
243
245
|
},
|
|
244
246
|
'post': {
|
|
245
247
|
// account
|
|
@@ -681,6 +683,7 @@ class kucoin extends kucoin$1 {
|
|
|
681
683
|
'redeem/orders': 'v3',
|
|
682
684
|
'purchase/orders': 'v3',
|
|
683
685
|
'margin/symbols': 'v3',
|
|
686
|
+
'affiliate/inviter/statistics': 'v2',
|
|
684
687
|
},
|
|
685
688
|
'POST': {
|
|
686
689
|
// account
|
package/dist/cjs/src/latoken.js
CHANGED
|
@@ -1416,7 +1416,11 @@ class latoken extends latoken$1 {
|
|
|
1416
1416
|
// "status":"SUCCESS"
|
|
1417
1417
|
// }
|
|
1418
1418
|
//
|
|
1419
|
-
return
|
|
1419
|
+
return [
|
|
1420
|
+
this.safeOrder({
|
|
1421
|
+
'info': response,
|
|
1422
|
+
}),
|
|
1423
|
+
];
|
|
1420
1424
|
}
|
|
1421
1425
|
async fetchTransactions(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1422
1426
|
/**
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -7353,6 +7353,9 @@ class okx extends okx$1 {
|
|
|
7353
7353
|
}
|
|
7354
7354
|
depositWithdrawFees[code]['info'][currencyId] = feeInfo;
|
|
7355
7355
|
const chain = this.safeString(feeInfo, 'chain');
|
|
7356
|
+
if (chain === undefined) {
|
|
7357
|
+
continue;
|
|
7358
|
+
}
|
|
7356
7359
|
const chainSplit = chain.split('-');
|
|
7357
7360
|
const networkId = this.safeValue(chainSplit, 1);
|
|
7358
7361
|
const withdrawFee = this.safeNumber(feeInfo, 'minFee');
|
package/dist/cjs/src/pro/okx.js
CHANGED
|
@@ -1682,7 +1682,7 @@ class okx extends okx$1 {
|
|
|
1682
1682
|
if (this.isEmpty(args)) {
|
|
1683
1683
|
const method = this.safeString(message, 'op');
|
|
1684
1684
|
const stringMsg = this.json(message);
|
|
1685
|
-
this.handleErrors(undefined, undefined, client.url, method, undefined, stringMsg,
|
|
1685
|
+
this.handleErrors(undefined, undefined, client.url, method, undefined, stringMsg, message, undefined, undefined);
|
|
1686
1686
|
}
|
|
1687
1687
|
const orders = this.parseOrders(args, undefined, undefined, undefined);
|
|
1688
1688
|
const first = this.safeDict(orders, 0, {});
|
|
@@ -1857,8 +1857,8 @@ class okx extends okx$1 {
|
|
|
1857
1857
|
future.resolve(true);
|
|
1858
1858
|
}
|
|
1859
1859
|
ping(client) {
|
|
1860
|
-
//
|
|
1861
|
-
//
|
|
1860
|
+
// OKX does not support the built-in WebSocket protocol-level ping-pong.
|
|
1861
|
+
// Instead, it requires a custom text-based ping-pong mechanism.
|
|
1862
1862
|
return 'ping';
|
|
1863
1863
|
}
|
|
1864
1864
|
handlePong(client, message) {
|
package/dist/cjs/src/woo.js
CHANGED
|
@@ -306,7 +306,7 @@ class woo extends woo$1 {
|
|
|
306
306
|
'commonCurrencies': {},
|
|
307
307
|
'exceptions': {
|
|
308
308
|
'exact': {
|
|
309
|
-
'-1000': errors.
|
|
309
|
+
'-1000': errors.OperationFailed,
|
|
310
310
|
'-1001': errors.AuthenticationError,
|
|
311
311
|
'-1002': errors.AuthenticationError,
|
|
312
312
|
'-1003': errors.RateLimitExceeded,
|
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, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, TransferEntries, LeverageTiers } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.3.
|
|
7
|
+
declare const version = "4.3.57";
|
|
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, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, ProxyError, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.3.
|
|
41
|
+
const version = '4.3.58';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
|
@@ -86,6 +86,7 @@ interface Exchange {
|
|
|
86
86
|
privateGetRedeemOrders(params?: {}): Promise<implicitReturnType>;
|
|
87
87
|
privateGetPurchaseOrders(params?: {}): Promise<implicitReturnType>;
|
|
88
88
|
privateGetBrokerApiRebaseDownload(params?: {}): Promise<implicitReturnType>;
|
|
89
|
+
privateGetAffiliateInviterStatistics(params?: {}): Promise<implicitReturnType>;
|
|
89
90
|
privatePostSubUserCreated(params?: {}): Promise<implicitReturnType>;
|
|
90
91
|
privatePostSubApiKey(params?: {}): Promise<implicitReturnType>;
|
|
91
92
|
privatePostSubApiKeyUpdate(params?: {}): Promise<implicitReturnType>;
|
|
@@ -86,6 +86,7 @@ interface kucoin {
|
|
|
86
86
|
privateGetRedeemOrders(params?: {}): Promise<implicitReturnType>;
|
|
87
87
|
privateGetPurchaseOrders(params?: {}): Promise<implicitReturnType>;
|
|
88
88
|
privateGetBrokerApiRebaseDownload(params?: {}): Promise<implicitReturnType>;
|
|
89
|
+
privateGetAffiliateInviterStatistics(params?: {}): Promise<implicitReturnType>;
|
|
89
90
|
privatePostSubUserCreated(params?: {}): Promise<implicitReturnType>;
|
|
90
91
|
privatePostSubApiKey(params?: {}): Promise<implicitReturnType>;
|
|
91
92
|
privatePostSubApiKeyUpdate(params?: {}): Promise<implicitReturnType>;
|
package/js/src/alpaca.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export default class alpaca extends Exchange {
|
|
|
15
15
|
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
16
16
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
17
17
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
18
|
-
cancelAllOrders(symbol?: Str, params?: {}): Promise<
|
|
18
|
+
cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
|
|
19
19
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
20
20
|
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
21
21
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/alpaca.js
CHANGED
|
@@ -812,7 +812,11 @@ export default class alpaca extends Exchange {
|
|
|
812
812
|
return this.parseOrders(response, undefined);
|
|
813
813
|
}
|
|
814
814
|
else {
|
|
815
|
-
return
|
|
815
|
+
return [
|
|
816
|
+
this.safeOrder({
|
|
817
|
+
'info': response,
|
|
818
|
+
}),
|
|
819
|
+
];
|
|
816
820
|
}
|
|
817
821
|
}
|
|
818
822
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
@@ -5,6 +5,8 @@ export default class Client {
|
|
|
5
5
|
disconnected: ReturnType<typeof Future>;
|
|
6
6
|
futures: Dictionary<any>;
|
|
7
7
|
rejections: Dictionary<any>;
|
|
8
|
+
messageQueue: Dictionary<string, any>;
|
|
9
|
+
useMessageQueue: boolean;
|
|
8
10
|
keepAlive: number;
|
|
9
11
|
connection: any;
|
|
10
12
|
connectionTimeout: any;
|