ccxt 4.3.84 → 4.3.86
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 +7 -5
- package/dist/ccxt.browser.min.js +15 -15
- package/dist/cjs/ccxt.js +7 -1
- package/dist/cjs/src/abstract/hashkey.js +9 -0
- package/dist/cjs/src/base/Exchange.js +1 -1
- package/dist/cjs/src/base/errors.js +8 -1
- package/dist/cjs/src/binance.js +4 -2
- package/dist/cjs/src/bitfinex.js +2 -2
- package/dist/cjs/src/bitmex.js +4 -0
- package/dist/cjs/src/bybit.js +15 -14
- package/dist/cjs/src/cryptocom.js +117 -2
- package/dist/cjs/src/hashkey.js +4328 -0
- package/dist/cjs/src/hyperliquid.js +85 -65
- package/dist/cjs/src/indodax.js +37 -9
- package/dist/cjs/src/kraken.js +29 -1
- package/dist/cjs/src/krakenfutures.js +12 -10
- package/dist/cjs/src/kucoinfutures.js +5 -0
- package/dist/cjs/src/mexc.js +2 -2
- package/dist/cjs/src/pro/ascendex.js +45 -5
- package/dist/cjs/src/pro/binance.js +1 -1
- package/dist/cjs/src/pro/bingx.js +13 -12
- package/dist/cjs/src/pro/bitget.js +113 -4
- package/dist/cjs/src/pro/hashkey.js +839 -0
- package/dist/cjs/src/pro/hyperliquid.js +123 -0
- package/dist/cjs/src/pro/mexc.js +13 -7
- package/dist/cjs/src/pro/okx.js +25 -4
- package/dist/cjs/src/pro/woo.js +1 -0
- package/dist/cjs/src/pro/woofipro.js +1 -0
- package/dist/cjs/src/pro/xt.js +1 -0
- package/js/ccxt.d.ts +9 -3
- package/js/ccxt.js +7 -3
- package/js/src/abstract/cryptocom.d.ts +2 -0
- package/js/src/abstract/hashkey.d.ts +70 -0
- package/js/src/abstract/hashkey.js +11 -0
- package/js/src/abstract/kucoinfutures.d.ts +2 -0
- package/js/src/base/Exchange.js +1 -1
- package/js/src/base/errorHierarchy.d.ts +1 -0
- package/js/src/base/errorHierarchy.js +1 -0
- package/js/src/base/errors.d.ts +5 -1
- package/js/src/base/errors.js +8 -2
- package/js/src/binance.js +4 -2
- package/js/src/bitfinex.js +2 -2
- package/js/src/bitmex.js +4 -0
- package/js/src/bybit.js +16 -15
- package/js/src/cryptocom.d.ts +5 -1
- package/js/src/cryptocom.js +117 -2
- package/js/src/hashkey.d.ts +178 -0
- package/js/src/hashkey.js +4329 -0
- package/js/src/hyperliquid.d.ts +3 -0
- package/js/src/hyperliquid.js +85 -65
- package/js/src/indodax.js +37 -9
- package/js/src/kraken.js +29 -1
- package/js/src/krakenfutures.js +12 -10
- package/js/src/kucoinfutures.js +5 -0
- package/js/src/mexc.js +2 -2
- package/js/src/pro/ascendex.d.ts +2 -0
- package/js/src/pro/ascendex.js +45 -5
- package/js/src/pro/binance.js +1 -1
- package/js/src/pro/bingx.js +13 -12
- package/js/src/pro/bitget.d.ts +4 -0
- package/js/src/pro/bitget.js +113 -4
- package/js/src/pro/hashkey.d.ts +34 -0
- package/js/src/pro/hashkey.js +840 -0
- package/js/src/pro/hyperliquid.d.ts +7 -1
- package/js/src/pro/hyperliquid.js +123 -0
- package/js/src/pro/mexc.js +13 -7
- package/js/src/pro/okx.js +25 -4
- package/js/src/pro/woo.js +1 -0
- package/js/src/pro/woofipro.js +1 -0
- package/js/src/pro/xt.js +1 -0
- package/package.json +1 -1
|
@@ -1089,25 +1089,9 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1089
1089
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1090
1090
|
*/
|
|
1091
1091
|
await this.loadMarkets();
|
|
1092
|
-
const
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
symbol = market['symbol'];
|
|
1096
|
-
const order = {
|
|
1097
|
-
'symbol': symbol,
|
|
1098
|
-
'type': type,
|
|
1099
|
-
'side': side,
|
|
1100
|
-
'amount': amount,
|
|
1101
|
-
'price': price,
|
|
1102
|
-
'params': params,
|
|
1103
|
-
};
|
|
1104
|
-
const globalParams = {};
|
|
1105
|
-
if (vaultAddress !== undefined) {
|
|
1106
|
-
globalParams['vaultAddress'] = vaultAddress;
|
|
1107
|
-
}
|
|
1108
|
-
const response = await this.createOrders([order], globalParams);
|
|
1109
|
-
const first = this.safeDict(response, 0);
|
|
1110
|
-
return first;
|
|
1092
|
+
const [order, globalParams] = this.parseCreateOrderArgs(symbol, type, side, amount, price, params);
|
|
1093
|
+
const orders = await this.createOrders([order], globalParams);
|
|
1094
|
+
return orders[0];
|
|
1111
1095
|
}
|
|
1112
1096
|
async createOrders(orders, params = {}) {
|
|
1113
1097
|
/**
|
|
@@ -1118,8 +1102,41 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1118
1102
|
* @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
1119
1103
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1120
1104
|
*/
|
|
1121
|
-
this.checkRequiredCredentials();
|
|
1122
1105
|
await this.loadMarkets();
|
|
1106
|
+
const request = this.createOrdersRequest(orders, params);
|
|
1107
|
+
const response = await this.privatePostExchange(request);
|
|
1108
|
+
//
|
|
1109
|
+
// {
|
|
1110
|
+
// "status": "ok",
|
|
1111
|
+
// "response": {
|
|
1112
|
+
// "type": "order",
|
|
1113
|
+
// "data": {
|
|
1114
|
+
// "statuses": [
|
|
1115
|
+
// {
|
|
1116
|
+
// "resting": {
|
|
1117
|
+
// "oid": 5063830287
|
|
1118
|
+
// }
|
|
1119
|
+
// }
|
|
1120
|
+
// ]
|
|
1121
|
+
// }
|
|
1122
|
+
// }
|
|
1123
|
+
// }
|
|
1124
|
+
//
|
|
1125
|
+
const responseObj = this.safeDict(response, 'response', {});
|
|
1126
|
+
const data = this.safeDict(responseObj, 'data', {});
|
|
1127
|
+
const statuses = this.safeList(data, 'statuses', []);
|
|
1128
|
+
return this.parseOrders(statuses, undefined);
|
|
1129
|
+
}
|
|
1130
|
+
createOrdersRequest(orders, params = {}) {
|
|
1131
|
+
/**
|
|
1132
|
+
* @method
|
|
1133
|
+
* @name hyperliquid#createOrders
|
|
1134
|
+
* @description create a list of trade orders
|
|
1135
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
1136
|
+
* @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
1137
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1138
|
+
*/
|
|
1139
|
+
this.checkRequiredCredentials();
|
|
1123
1140
|
let defaultSlippage = this.safeString(this.options, 'defaultSlippage');
|
|
1124
1141
|
defaultSlippage = this.safeString(params, 'slippage', defaultSlippage);
|
|
1125
1142
|
let hasClientOrderId = false;
|
|
@@ -1239,28 +1256,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1239
1256
|
params = this.omit(params, 'vaultAddress');
|
|
1240
1257
|
request['vaultAddress'] = vaultAddress;
|
|
1241
1258
|
}
|
|
1242
|
-
|
|
1243
|
-
//
|
|
1244
|
-
// {
|
|
1245
|
-
// "status": "ok",
|
|
1246
|
-
// "response": {
|
|
1247
|
-
// "type": "order",
|
|
1248
|
-
// "data": {
|
|
1249
|
-
// "statuses": [
|
|
1250
|
-
// {
|
|
1251
|
-
// "resting": {
|
|
1252
|
-
// "oid": 5063830287
|
|
1253
|
-
// }
|
|
1254
|
-
// }
|
|
1255
|
-
// ]
|
|
1256
|
-
// }
|
|
1257
|
-
// }
|
|
1258
|
-
// }
|
|
1259
|
-
//
|
|
1260
|
-
const responseObj = this.safeDict(response, 'response', {});
|
|
1261
|
-
const data = this.safeDict(responseObj, 'data', {});
|
|
1262
|
-
const statuses = this.safeList(data, 'statuses', []);
|
|
1263
|
-
return this.parseOrders(statuses, undefined);
|
|
1259
|
+
return request;
|
|
1264
1260
|
}
|
|
1265
1261
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
1266
1262
|
/**
|
|
@@ -1481,33 +1477,11 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1481
1477
|
//
|
|
1482
1478
|
return response;
|
|
1483
1479
|
}
|
|
1484
|
-
|
|
1485
|
-
/**
|
|
1486
|
-
* @method
|
|
1487
|
-
* @name hyperliquid#editOrder
|
|
1488
|
-
* @description edit a trade order
|
|
1489
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
1490
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
1491
|
-
* @param {string} id cancel order id
|
|
1492
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
1493
|
-
* @param {string} type 'market' or 'limit'
|
|
1494
|
-
* @param {string} side 'buy' or 'sell'
|
|
1495
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1496
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1497
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1498
|
-
* @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
|
|
1499
|
-
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
1500
|
-
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
1501
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1502
|
-
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1503
|
-
* @param {string} [params.vaultAddress] the vault address for order
|
|
1504
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1505
|
-
*/
|
|
1480
|
+
editOrderRequest(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
1506
1481
|
this.checkRequiredCredentials();
|
|
1507
1482
|
if (id === undefined) {
|
|
1508
1483
|
throw new errors.ArgumentsRequired(this.id + ' editOrder() requires an id argument');
|
|
1509
1484
|
}
|
|
1510
|
-
await this.loadMarkets();
|
|
1511
1485
|
const market = this.market(symbol);
|
|
1512
1486
|
type = type.toUpperCase();
|
|
1513
1487
|
const isMarket = (type === 'MARKET');
|
|
@@ -1594,6 +1568,33 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
1594
1568
|
params = this.omit(params, 'vaultAddress');
|
|
1595
1569
|
request['vaultAddress'] = vaultAddress;
|
|
1596
1570
|
}
|
|
1571
|
+
return request;
|
|
1572
|
+
}
|
|
1573
|
+
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
1574
|
+
/**
|
|
1575
|
+
* @method
|
|
1576
|
+
* @name hyperliquid#editOrder
|
|
1577
|
+
* @description edit a trade order
|
|
1578
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
1579
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
1580
|
+
* @param {string} id cancel order id
|
|
1581
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1582
|
+
* @param {string} type 'market' or 'limit'
|
|
1583
|
+
* @param {string} side 'buy' or 'sell'
|
|
1584
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1585
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1586
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1587
|
+
* @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
|
|
1588
|
+
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
1589
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
1590
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1591
|
+
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1592
|
+
* @param {string} [params.vaultAddress] the vault address for order
|
|
1593
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1594
|
+
*/
|
|
1595
|
+
await this.loadMarkets();
|
|
1596
|
+
const market = this.market(symbol);
|
|
1597
|
+
const request = this.editOrderRequest(id, symbol, type, side, amount, price, params);
|
|
1597
1598
|
const response = await this.privatePostExchange(request);
|
|
1598
1599
|
//
|
|
1599
1600
|
// {
|
|
@@ -2755,6 +2756,25 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2755
2756
|
}
|
|
2756
2757
|
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
|
|
2757
2758
|
}
|
|
2759
|
+
parseCreateOrderArgs(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2760
|
+
const market = this.market(symbol);
|
|
2761
|
+
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
2762
|
+
params = this.omit(params, 'vaultAddress');
|
|
2763
|
+
symbol = market['symbol'];
|
|
2764
|
+
const order = {
|
|
2765
|
+
'symbol': symbol,
|
|
2766
|
+
'type': type,
|
|
2767
|
+
'side': side,
|
|
2768
|
+
'amount': amount,
|
|
2769
|
+
'price': price,
|
|
2770
|
+
'params': params,
|
|
2771
|
+
};
|
|
2772
|
+
const globalParams = {};
|
|
2773
|
+
if (vaultAddress !== undefined) {
|
|
2774
|
+
globalParams['vaultAddress'] = vaultAddress;
|
|
2775
|
+
}
|
|
2776
|
+
return [order, globalParams];
|
|
2777
|
+
}
|
|
2758
2778
|
}
|
|
2759
2779
|
|
|
2760
2780
|
module.exports = hyperliquid;
|
package/dist/cjs/src/indodax.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var indodax$1 = require('./abstract/indodax.js');
|
|
4
4
|
var errors = require('./base/errors.js');
|
|
5
5
|
var number = require('./base/functions/number.js');
|
|
6
|
+
var Precise = require('./base/Precise.js');
|
|
6
7
|
var sha512 = require('./static_dependencies/noble-hashes/sha512.js');
|
|
7
8
|
|
|
8
9
|
// ---------------------------------------------------------------------------
|
|
@@ -832,9 +833,6 @@ class indodax extends indodax$1 {
|
|
|
832
833
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
833
834
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
834
835
|
*/
|
|
835
|
-
if (type !== 'limit') {
|
|
836
|
-
throw new errors.ExchangeError(this.id + ' createOrder() allows limit orders only');
|
|
837
|
-
}
|
|
838
836
|
await this.loadMarkets();
|
|
839
837
|
const market = this.market(symbol);
|
|
840
838
|
const request = {
|
|
@@ -842,14 +840,44 @@ class indodax extends indodax$1 {
|
|
|
842
840
|
'type': side,
|
|
843
841
|
'price': price,
|
|
844
842
|
};
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
843
|
+
let priceIsRequired = false;
|
|
844
|
+
let quantityIsRequired = false;
|
|
845
|
+
if (type === 'market') {
|
|
846
|
+
if (side === 'buy') {
|
|
847
|
+
let quoteAmount = undefined;
|
|
848
|
+
const cost = this.safeNumber(params, 'cost');
|
|
849
|
+
params = this.omit(params, 'cost');
|
|
850
|
+
if (cost !== undefined) {
|
|
851
|
+
quoteAmount = this.costToPrecision(symbol, cost);
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
if (price === undefined) {
|
|
855
|
+
throw new errors.InvalidOrder(this.id + ' createOrder() requires the price argument for market buy orders to calculate the total cost to spend (amount * price).');
|
|
856
|
+
}
|
|
857
|
+
const amountString = this.numberToString(amount);
|
|
858
|
+
const priceString = this.numberToString(price);
|
|
859
|
+
const costRequest = Precise["default"].stringMul(amountString, priceString);
|
|
860
|
+
quoteAmount = this.costToPrecision(symbol, costRequest);
|
|
861
|
+
}
|
|
862
|
+
request[market['quoteId']] = quoteAmount;
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
quantityIsRequired = true;
|
|
866
|
+
}
|
|
848
867
|
}
|
|
849
|
-
else {
|
|
850
|
-
|
|
868
|
+
else if (type === 'limit') {
|
|
869
|
+
priceIsRequired = true;
|
|
870
|
+
quantityIsRequired = true;
|
|
871
|
+
}
|
|
872
|
+
if (priceIsRequired) {
|
|
873
|
+
if (price === undefined) {
|
|
874
|
+
throw new errors.InvalidOrder(this.id + ' createOrder() requires a price argument for a ' + type + ' order');
|
|
875
|
+
}
|
|
876
|
+
request['price'] = price;
|
|
877
|
+
}
|
|
878
|
+
if (quantityIsRequired) {
|
|
879
|
+
request[market['baseId']] = this.amountToPrecision(symbol, amount);
|
|
851
880
|
}
|
|
852
|
-
request[currency] = amount;
|
|
853
881
|
const result = await this.privatePostTrade(this.extend(request, params));
|
|
854
882
|
const data = this.safeValue(result, 'return', {});
|
|
855
883
|
const id = this.safeString(data, 'order_id');
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -1208,6 +1208,26 @@ class kraken extends kraken$1 {
|
|
|
1208
1208
|
// "misc": ''
|
|
1209
1209
|
// }
|
|
1210
1210
|
//
|
|
1211
|
+
// fetchMyTrades
|
|
1212
|
+
//
|
|
1213
|
+
// {
|
|
1214
|
+
// "ordertxid": "OSJVN7-A2AE-63WZV",
|
|
1215
|
+
// "postxid": "TBP7O6-PNXI-CONU",
|
|
1216
|
+
// "pair": "XXBTZUSD",
|
|
1217
|
+
// "time": 1710429248.3052235,
|
|
1218
|
+
// "type": "sell",
|
|
1219
|
+
// "ordertype": "liquidation market",
|
|
1220
|
+
// "price": "72026.50000",
|
|
1221
|
+
// "cost": "7.20265",
|
|
1222
|
+
// "fee": "0.01873",
|
|
1223
|
+
// "vol": "0.00010000",
|
|
1224
|
+
// "margin": "1.44053",
|
|
1225
|
+
// "leverage": "5",
|
|
1226
|
+
// "misc": "closing",
|
|
1227
|
+
// "trade_id": 68230622,
|
|
1228
|
+
// "maker": false
|
|
1229
|
+
// }
|
|
1230
|
+
//
|
|
1211
1231
|
let timestamp = undefined;
|
|
1212
1232
|
let side = undefined;
|
|
1213
1233
|
let type = undefined;
|
|
@@ -1263,6 +1283,11 @@ class kraken extends kraken$1 {
|
|
|
1263
1283
|
symbol = market['symbol'];
|
|
1264
1284
|
}
|
|
1265
1285
|
const cost = this.safeString(trade, 'cost');
|
|
1286
|
+
const maker = this.safeBool(trade, 'maker');
|
|
1287
|
+
let takerOrMaker = undefined;
|
|
1288
|
+
if (maker !== undefined) {
|
|
1289
|
+
takerOrMaker = maker ? 'maker' : 'taker';
|
|
1290
|
+
}
|
|
1266
1291
|
return this.safeTrade({
|
|
1267
1292
|
'id': id,
|
|
1268
1293
|
'order': orderId,
|
|
@@ -1272,7 +1297,7 @@ class kraken extends kraken$1 {
|
|
|
1272
1297
|
'symbol': symbol,
|
|
1273
1298
|
'type': type,
|
|
1274
1299
|
'side': side,
|
|
1275
|
-
'takerOrMaker':
|
|
1300
|
+
'takerOrMaker': takerOrMaker,
|
|
1276
1301
|
'price': price,
|
|
1277
1302
|
'amount': amount,
|
|
1278
1303
|
'cost': cost,
|
|
@@ -2128,7 +2153,10 @@ class kraken extends kraken$1 {
|
|
|
2128
2153
|
// "fee": "0.000026",
|
|
2129
2154
|
// "vol": "16.00000000",
|
|
2130
2155
|
// "margin": "0.000000",
|
|
2156
|
+
// "leverage": "5",
|
|
2131
2157
|
// "misc": ""
|
|
2158
|
+
// "trade_id": 68230622,
|
|
2159
|
+
// "maker": false
|
|
2132
2160
|
// },
|
|
2133
2161
|
// ...
|
|
2134
2162
|
// },
|
|
@@ -1767,17 +1767,19 @@ class krakenfutures extends krakenfutures$1 {
|
|
|
1767
1767
|
}
|
|
1768
1768
|
// Final order (after placement / editing / execution / canceling)
|
|
1769
1769
|
const orderTrigger = this.safeValue(item, 'orderTrigger');
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
isPrior = false;
|
|
1773
|
-
fixed = true;
|
|
1774
|
-
}
|
|
1775
|
-
else if (!fixed) {
|
|
1776
|
-
const orderPriorExecution = this.safeValue(item, 'orderPriorExecution');
|
|
1777
|
-
details = this.safeValue2(item, 'orderPriorExecution', 'orderPriorEdit');
|
|
1778
|
-
price = this.safeString(orderPriorExecution, 'limitPrice');
|
|
1770
|
+
if (details === undefined) {
|
|
1771
|
+
details = this.safeValue2(item, 'new', 'order', orderTrigger);
|
|
1779
1772
|
if (details !== undefined) {
|
|
1780
|
-
isPrior =
|
|
1773
|
+
isPrior = false;
|
|
1774
|
+
fixed = true;
|
|
1775
|
+
}
|
|
1776
|
+
else if (!fixed) {
|
|
1777
|
+
const orderPriorExecution = this.safeValue(item, 'orderPriorExecution');
|
|
1778
|
+
details = this.safeValue2(item, 'orderPriorExecution', 'orderPriorEdit');
|
|
1779
|
+
price = this.safeString(orderPriorExecution, 'limitPrice');
|
|
1780
|
+
if (details !== undefined) {
|
|
1781
|
+
isPrior = true;
|
|
1782
|
+
}
|
|
1781
1783
|
}
|
|
1782
1784
|
}
|
|
1783
1785
|
}
|
|
@@ -124,6 +124,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
124
124
|
'contracts/{symbol}': 1,
|
|
125
125
|
'contracts/risk-limit/{symbol}': 1,
|
|
126
126
|
'ticker': 1,
|
|
127
|
+
'allTickers': 1,
|
|
127
128
|
'level2/snapshot': 1.33,
|
|
128
129
|
'level2/depth{limit}': 1,
|
|
129
130
|
'level2/message/query': 1,
|
|
@@ -167,6 +168,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
167
168
|
'trade-statistics': 1,
|
|
168
169
|
'trade-fees': 1,
|
|
169
170
|
'history-positions': 1,
|
|
171
|
+
'getMaxOpenSize': 1,
|
|
170
172
|
},
|
|
171
173
|
'post': {
|
|
172
174
|
'withdrawals': 1,
|
|
@@ -312,6 +314,9 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
312
314
|
// endpoint versions
|
|
313
315
|
'versions': {
|
|
314
316
|
'futuresPrivate': {
|
|
317
|
+
'GET': {
|
|
318
|
+
'getMaxOpenSize': 'v2',
|
|
319
|
+
},
|
|
315
320
|
'POST': {
|
|
316
321
|
'transfer-out': 'v2',
|
|
317
322
|
},
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -1165,7 +1165,7 @@ class mexc extends mexc$1 {
|
|
|
1165
1165
|
// "symbols": [
|
|
1166
1166
|
// {
|
|
1167
1167
|
// "symbol": "OGNUSDT",
|
|
1168
|
-
// "status": "
|
|
1168
|
+
// "status": "1",
|
|
1169
1169
|
// "baseAsset": "OGN",
|
|
1170
1170
|
// "baseAssetPrecision": "2",
|
|
1171
1171
|
// "quoteAsset": "USDT",
|
|
@@ -1210,7 +1210,7 @@ class mexc extends mexc$1 {
|
|
|
1210
1210
|
const status = this.safeString(market, 'status');
|
|
1211
1211
|
const isSpotTradingAllowed = this.safeValue(market, 'isSpotTradingAllowed');
|
|
1212
1212
|
let active = false;
|
|
1213
|
-
if ((status === '
|
|
1213
|
+
if ((status === '1') && (isSpotTradingAllowed)) {
|
|
1214
1214
|
active = true;
|
|
1215
1215
|
}
|
|
1216
1216
|
const isMarginTradingAllowed = this.safeValue(market, 'isMarginTradingAllowed');
|
|
@@ -18,6 +18,7 @@ class ascendex extends ascendex$1 {
|
|
|
18
18
|
'watchOrders': true,
|
|
19
19
|
'watchTicker': false,
|
|
20
20
|
'watchTrades': true,
|
|
21
|
+
'watchTradesForSymbols': true,
|
|
21
22
|
},
|
|
22
23
|
'urls': {
|
|
23
24
|
'api': {
|
|
@@ -55,6 +56,16 @@ class ascendex extends ascendex$1 {
|
|
|
55
56
|
const message = this.extend(request, params);
|
|
56
57
|
return await this.watch(url, messageHash, message, messageHash);
|
|
57
58
|
}
|
|
59
|
+
async watchPublicMultiple(messageHashes, params = {}) {
|
|
60
|
+
const url = this.urls['api']['ws']['public'];
|
|
61
|
+
const id = this.nonce();
|
|
62
|
+
const request = {
|
|
63
|
+
'id': id.toString(),
|
|
64
|
+
'op': 'sub',
|
|
65
|
+
};
|
|
66
|
+
const message = this.extend(request, params);
|
|
67
|
+
return await this.watchMultiple(url, messageHashes, message, messageHashes);
|
|
68
|
+
}
|
|
58
69
|
async watchPrivate(channel, messageHash, params = {}) {
|
|
59
70
|
await this.loadAccounts();
|
|
60
71
|
const accountGroup = this.safeString(this.options, 'account-group');
|
|
@@ -75,6 +86,7 @@ class ascendex extends ascendex$1 {
|
|
|
75
86
|
* @method
|
|
76
87
|
* @name ascendex#watchOHLCV
|
|
77
88
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
89
|
+
* @see https://ascendex.github.io/ascendex-pro-api/#channel-bar-data
|
|
78
90
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
79
91
|
* @param {string} timeframe the length of time each candle represents
|
|
80
92
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -140,22 +152,48 @@ class ascendex extends ascendex$1 {
|
|
|
140
152
|
* @method
|
|
141
153
|
* @name ascendex#watchTrades
|
|
142
154
|
* @description get the list of most recent trades for a particular symbol
|
|
155
|
+
* @see https://ascendex.github.io/ascendex-pro-api/#channel-market-trades
|
|
143
156
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
144
157
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
145
158
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
146
159
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
147
160
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
148
161
|
*/
|
|
162
|
+
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
163
|
+
}
|
|
164
|
+
async watchTradesForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
|
|
165
|
+
/**
|
|
166
|
+
* @method
|
|
167
|
+
* @name ascendex#watchTradesForSymbols
|
|
168
|
+
* @description get the list of most recent trades for a list of symbols
|
|
169
|
+
* @see https://ascendex.github.io/ascendex-pro-api/#channel-market-trades
|
|
170
|
+
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
171
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
172
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
173
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
174
|
+
* @param {string} [params.name] the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
|
|
175
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
176
|
+
*/
|
|
149
177
|
await this.loadMarkets();
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
178
|
+
symbols = this.marketSymbols(symbols, undefined, false, true, true);
|
|
179
|
+
const marketIds = [];
|
|
180
|
+
const messageHashes = [];
|
|
181
|
+
if (symbols !== undefined) {
|
|
182
|
+
for (let i = 0; i < symbols.length; i++) {
|
|
183
|
+
const market = this.market(symbols[i]);
|
|
184
|
+
marketIds.push(market['id']);
|
|
185
|
+
messageHashes.push('trades:' + market['id']);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const channel = 'trades:' + marketIds.join(',');
|
|
153
189
|
params = this.extend(params, {
|
|
154
190
|
'ch': channel,
|
|
155
191
|
});
|
|
156
|
-
const trades = await this.
|
|
192
|
+
const trades = await this.watchPublicMultiple(messageHashes, params);
|
|
157
193
|
if (this.newUpdates) {
|
|
158
|
-
|
|
194
|
+
const first = this.safeValue(trades, 0);
|
|
195
|
+
const tradeSymbol = this.safeString(first, 'symbol');
|
|
196
|
+
limit = trades.getLimit(tradeSymbol, limit);
|
|
159
197
|
}
|
|
160
198
|
return this.filterBySinceLimit(trades, since, limit, 'timestamp', true);
|
|
161
199
|
}
|
|
@@ -201,6 +239,7 @@ class ascendex extends ascendex$1 {
|
|
|
201
239
|
* @method
|
|
202
240
|
* @name ascendex#watchOrderBook
|
|
203
241
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
242
|
+
* @see https://ascendex.github.io/ascendex-pro-api/#channel-level-2-order-book-updates
|
|
204
243
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
205
244
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
206
245
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -357,6 +396,7 @@ class ascendex extends ascendex$1 {
|
|
|
357
396
|
* @method
|
|
358
397
|
* @name ascendex#watchBalance
|
|
359
398
|
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
399
|
+
* @see https://ascendex.github.io/ascendex-pro-api/#channel-order-and-balance
|
|
360
400
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
361
401
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
362
402
|
*/
|
|
@@ -230,7 +230,7 @@ class binance extends binance$1 {
|
|
|
230
230
|
else {
|
|
231
231
|
for (let i = 0; i < symbols.length; i++) {
|
|
232
232
|
const market = this.market(symbols[i]);
|
|
233
|
-
subscriptionHashes.push(market['
|
|
233
|
+
subscriptionHashes.push(market['lowercaseId'] + '@forceOrder');
|
|
234
234
|
messageHashes.push('liquidations::' + symbols[i]);
|
|
235
235
|
}
|
|
236
236
|
streamHash += '::' + symbols.join(',');
|
|
@@ -13,6 +13,7 @@ class bingx extends bingx$1 {
|
|
|
13
13
|
'has': {
|
|
14
14
|
'ws': true,
|
|
15
15
|
'watchTrades': true,
|
|
16
|
+
'watchTradesForSymbols': false,
|
|
16
17
|
'watchOrderBook': true,
|
|
17
18
|
'watchOrderBookForSymbols': true,
|
|
18
19
|
'watchOHLCV': true,
|
|
@@ -435,8 +436,8 @@ class bingx extends bingx$1 {
|
|
|
435
436
|
* @method
|
|
436
437
|
* @name bingx#watchTrades
|
|
437
438
|
* @description watches information on multiple trades made in a market
|
|
438
|
-
* @see https://bingx-api.github.io/docs/#/spot/socket/market.html#
|
|
439
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
|
|
439
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscription%20transaction%20by%20transaction
|
|
440
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20the%20Latest%20Trade%20Detail
|
|
440
441
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
441
442
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
442
443
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -558,8 +559,8 @@ class bingx extends bingx$1 {
|
|
|
558
559
|
* @method
|
|
559
560
|
* @name bingx#watchOrderBook
|
|
560
561
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
561
|
-
* @see https://bingx-api.github.io/docs/#/spot/socket/market.html#Subscribe%20Market%20Depth%20Data
|
|
562
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20Market%20Depth%20Data
|
|
562
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#Subscribe%20Market%20Depth%20Data
|
|
563
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20Market%20Depth%20Data
|
|
563
564
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
564
565
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
565
566
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -790,8 +791,8 @@ class bingx extends bingx$1 {
|
|
|
790
791
|
* @method
|
|
791
792
|
* @name bingx#watchOHLCV
|
|
792
793
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
793
|
-
* @see https://bingx-api.github.io/docs/#/spot/socket/market.html#K%
|
|
794
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/socket/market.html#Subscribe%20K-Line%20Data
|
|
794
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/socket/market.html#K-line%20Streams
|
|
795
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/market.html#Subscribe%20K-Line%20Data
|
|
795
796
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
796
797
|
* @param {string} timeframe the length of time each candle represents
|
|
797
798
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -834,8 +835,8 @@ class bingx extends bingx$1 {
|
|
|
834
835
|
/**
|
|
835
836
|
* @method
|
|
836
837
|
* @name bingx#watchOrders
|
|
837
|
-
* @see https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%20order%20update%20data
|
|
838
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
838
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/socket/account.html#Subscription%20order%20update%20data
|
|
839
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
839
840
|
* @description watches information on multiple orders made by the user
|
|
840
841
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
841
842
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -881,8 +882,8 @@ class bingx extends bingx$1 {
|
|
|
881
882
|
/**
|
|
882
883
|
* @method
|
|
883
884
|
* @name bingx#watchMyTrades
|
|
884
|
-
* @see https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%20order%20update%20data
|
|
885
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
885
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/socket/account.html#Subscription%20order%20update%20data
|
|
886
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
886
887
|
* @description watches information on multiple trades made by the user
|
|
887
888
|
* @param {string} symbol unified market symbol of the market trades were made in
|
|
888
889
|
* @param {int} [since] the earliest time in ms to trades orders for
|
|
@@ -928,8 +929,8 @@ class bingx extends bingx$1 {
|
|
|
928
929
|
/**
|
|
929
930
|
* @method
|
|
930
931
|
* @name bingx#watchBalance
|
|
931
|
-
* @see https://bingx-api.github.io/docs/#/spot/socket/account.html#Subscription%
|
|
932
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
932
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/socket/account.html#Subscription%20account%20balance%20push
|
|
933
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/socket/account.html#Account%20balance%20and%20position%20update%20push
|
|
933
934
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
934
935
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
935
936
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|