ccxt 4.3.48 → 4.3.50
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 +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +4 -7
- package/dist/cjs/src/binance.js +13 -19
- package/dist/cjs/src/bitget.js +1 -0
- package/dist/cjs/src/bitso.js +13 -1
- package/dist/cjs/src/htx.js +10 -10
- package/dist/cjs/src/hyperliquid.js +14 -2
- package/dist/cjs/src/kraken.js +4 -3
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +4 -4
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/pro/coinbaseinternational.js +5 -0
- package/dist/cjs/src/pro/gate.js +2 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.js +4 -7
- package/js/src/binance.js +14 -20
- package/js/src/bitget.js +1 -0
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +13 -1
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/htx.js +10 -10
- package/js/src/hyperliquid.d.ts +2 -2
- package/js/src/hyperliquid.js +14 -2
- package/js/src/kraken.js +4 -3
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +4 -4
- package/js/src/kucoinfutures.js +1 -1
- package/js/src/pro/coinbaseinternational.js +5 -0
- package/js/src/pro/gate.js +2 -2
- package/package.json +1 -1
package/js/src/htx.js
CHANGED
|
@@ -3996,10 +3996,10 @@ export default class htx extends Exchange {
|
|
|
3996
3996
|
'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;
|
|
3997
3997
|
};
|
|
3998
3998
|
let response = undefined;
|
|
3999
|
-
const stop = this.
|
|
3999
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
4000
4000
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4001
4001
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4002
|
-
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
4002
|
+
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
4003
4003
|
if (stop || stopLossTakeProfit || trailing) {
|
|
4004
4004
|
if (limit !== undefined) {
|
|
4005
4005
|
request['page_size'] = limit;
|
|
@@ -4371,10 +4371,10 @@ export default class htx extends Exchange {
|
|
|
4371
4371
|
request['page_size'] = limit;
|
|
4372
4372
|
}
|
|
4373
4373
|
request['contract_code'] = market['id'];
|
|
4374
|
-
const stop = this.
|
|
4374
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
4375
4375
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
4376
4376
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
4377
|
-
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
4377
|
+
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
4378
4378
|
if (market['linear']) {
|
|
4379
4379
|
let marginMode = undefined;
|
|
4380
4380
|
[marginMode, params] = this.handleMarginModeAndParams('fetchOpenOrders', params);
|
|
@@ -5754,10 +5754,10 @@ export default class htx extends Exchange {
|
|
|
5754
5754
|
else {
|
|
5755
5755
|
request['contract_code'] = market['id'];
|
|
5756
5756
|
}
|
|
5757
|
-
const stop = this.
|
|
5757
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
5758
5758
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
5759
5759
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
5760
|
-
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
5760
|
+
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
5761
5761
|
if (market['linear']) {
|
|
5762
5762
|
let marginMode = undefined;
|
|
5763
5763
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrder', params);
|
|
@@ -5920,9 +5920,9 @@ export default class htx extends Exchange {
|
|
|
5920
5920
|
else {
|
|
5921
5921
|
request['contract_code'] = market['id'];
|
|
5922
5922
|
}
|
|
5923
|
-
const stop = this.
|
|
5923
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
5924
5924
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
5925
|
-
params = this.omit(params, ['stop', 'stopLossTakeProfit']);
|
|
5925
|
+
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trigger']);
|
|
5926
5926
|
if (market['linear']) {
|
|
5927
5927
|
let marginMode = undefined;
|
|
5928
5928
|
[marginMode, params] = this.handleMarginModeAndParams('cancelOrders', params);
|
|
@@ -6079,10 +6079,10 @@ export default class htx extends Exchange {
|
|
|
6079
6079
|
request['symbol'] = market['settleId'];
|
|
6080
6080
|
}
|
|
6081
6081
|
request['contract_code'] = market['id'];
|
|
6082
|
-
const stop = this.
|
|
6082
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
6083
6083
|
const stopLossTakeProfit = this.safeValue(params, 'stopLossTakeProfit');
|
|
6084
6084
|
const trailing = this.safeBool(params, 'trailing', false);
|
|
6085
|
-
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing']);
|
|
6085
|
+
params = this.omit(params, ['stop', 'stopLossTakeProfit', 'trailing', 'trigger']);
|
|
6086
6086
|
if (market['linear']) {
|
|
6087
6087
|
let marginMode = undefined;
|
|
6088
6088
|
[marginMode, params] = this.handleMarginModeAndParams('cancelAllOrders', params);
|
package/js/src/hyperliquid.d.ts
CHANGED
|
@@ -53,8 +53,8 @@ export default class hyperliquid extends Exchange {
|
|
|
53
53
|
};
|
|
54
54
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
55
55
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
56
|
-
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any
|
|
57
|
-
cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<any>;
|
|
56
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
|
57
|
+
cancelOrders(ids: string[], symbol?: Str, params?: {}): Promise<any[]>;
|
|
58
58
|
cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<any>;
|
|
59
59
|
cancelAllOrdersAfter(timeout: Int, params?: {}): Promise<any>;
|
|
60
60
|
editOrder(id: string, symbol: string, type: string, side: string, amount?: Num, price?: Num, params?: {}): Promise<Order>;
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -1216,7 +1216,8 @@ export default class hyperliquid extends Exchange {
|
|
|
1216
1216
|
* @param {string} [params.vaultAddress] the vault address for order
|
|
1217
1217
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1218
1218
|
*/
|
|
1219
|
-
|
|
1219
|
+
const orders = await this.cancelOrders([id], symbol, params);
|
|
1220
|
+
return this.safeDict(orders, 0);
|
|
1220
1221
|
}
|
|
1221
1222
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
1222
1223
|
/**
|
|
@@ -1295,7 +1296,18 @@ export default class hyperliquid extends Exchange {
|
|
|
1295
1296
|
// }
|
|
1296
1297
|
// }
|
|
1297
1298
|
//
|
|
1298
|
-
|
|
1299
|
+
const innerResponse = this.safeDict(response, 'response');
|
|
1300
|
+
const data = this.safeDict(innerResponse, 'data');
|
|
1301
|
+
const statuses = this.safeList(data, 'statuses');
|
|
1302
|
+
const orders = [];
|
|
1303
|
+
for (let i = 0; i < statuses.length; i++) {
|
|
1304
|
+
const status = statuses[i];
|
|
1305
|
+
orders.push(this.safeOrder({
|
|
1306
|
+
'info': status,
|
|
1307
|
+
'status': status,
|
|
1308
|
+
}));
|
|
1309
|
+
}
|
|
1310
|
+
return orders;
|
|
1299
1311
|
}
|
|
1300
1312
|
async cancelOrdersForSymbols(orders, params = {}) {
|
|
1301
1313
|
/**
|
package/js/src/kraken.js
CHANGED
|
@@ -1716,6 +1716,7 @@ export default class kraken extends Exchange {
|
|
|
1716
1716
|
'filled': filled,
|
|
1717
1717
|
'average': average,
|
|
1718
1718
|
'remaining': undefined,
|
|
1719
|
+
'reduceOnly': this.safeBool2(order, 'reduceOnly', 'reduce_only'),
|
|
1719
1720
|
'fee': fee,
|
|
1720
1721
|
'trades': trades,
|
|
1721
1722
|
}, market);
|
|
@@ -2125,7 +2126,7 @@ export default class kraken extends Exchange {
|
|
|
2125
2126
|
* @method
|
|
2126
2127
|
* @name kraken#cancelOrder
|
|
2127
2128
|
* @description cancels an open order
|
|
2128
|
-
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrder
|
|
2129
|
+
* @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrder
|
|
2129
2130
|
* @param {string} id order id
|
|
2130
2131
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2131
2132
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2166,7 +2167,7 @@ export default class kraken extends Exchange {
|
|
|
2166
2167
|
* @method
|
|
2167
2168
|
* @name kraken#cancelOrders
|
|
2168
2169
|
* @description cancel multiple orders
|
|
2169
|
-
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelOrderBatch
|
|
2170
|
+
* @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelOrderBatch
|
|
2170
2171
|
* @param {string[]} ids open orders transaction ID (txid) or user reference (userref)
|
|
2171
2172
|
* @param {string} symbol unified market symbol
|
|
2172
2173
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2195,7 +2196,7 @@ export default class kraken extends Exchange {
|
|
|
2195
2196
|
* @method
|
|
2196
2197
|
* @name kraken#cancelAllOrders
|
|
2197
2198
|
* @description cancel all open orders
|
|
2198
|
-
* @see https://docs.kraken.com/rest/#tag/Trading/operation/cancelAllOrders
|
|
2199
|
+
* @see https://docs.kraken.com/rest/#tag/Spot-Trading/operation/cancelAllOrders
|
|
2199
2200
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
2200
2201
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2201
2202
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -1878,7 +1878,7 @@ export default class krakenfutures extends Exchange {
|
|
|
1878
1878
|
'type': this.parseOrderType(type),
|
|
1879
1879
|
'timeInForce': timeInForce,
|
|
1880
1880
|
'postOnly': type === 'post',
|
|
1881
|
-
'reduceOnly': this.
|
|
1881
|
+
'reduceOnly': this.safeBool2(details, 'reduceOnly', 'reduce_only'),
|
|
1882
1882
|
'side': this.safeString(details, 'side'),
|
|
1883
1883
|
'price': price,
|
|
1884
1884
|
'stopPrice': this.safeString(details, 'triggerPrice'),
|
package/js/src/kucoin.js
CHANGED
|
@@ -2512,9 +2512,9 @@ export default class kucoin extends Exchange {
|
|
|
2512
2512
|
await this.loadMarkets();
|
|
2513
2513
|
let lowercaseStatus = status.toLowerCase();
|
|
2514
2514
|
const until = this.safeInteger(params, 'until');
|
|
2515
|
-
const stop = this.
|
|
2515
|
+
const stop = this.safeBool2(params, 'stop', 'trigger', false);
|
|
2516
2516
|
const hf = this.safeBool(params, 'hf', false);
|
|
2517
|
-
params = this.omit(params, ['stop', 'hf', 'until']);
|
|
2517
|
+
params = this.omit(params, ['stop', 'hf', 'until', 'trigger']);
|
|
2518
2518
|
const [marginMode, query] = this.handleMarginModeAndParams('fetchOrdersByStatus', params);
|
|
2519
2519
|
if (lowercaseStatus === 'open') {
|
|
2520
2520
|
lowercaseStatus = 'active';
|
|
@@ -2691,7 +2691,7 @@ export default class kucoin extends Exchange {
|
|
|
2691
2691
|
await this.loadMarkets();
|
|
2692
2692
|
const request = {};
|
|
2693
2693
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
2694
|
-
const stop = this.
|
|
2694
|
+
const stop = this.safeBool2(params, 'stop', 'trigger', false);
|
|
2695
2695
|
const hf = this.safeBool(params, 'hf', false);
|
|
2696
2696
|
let market = undefined;
|
|
2697
2697
|
if (symbol !== undefined) {
|
|
@@ -2703,7 +2703,7 @@ export default class kucoin extends Exchange {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
request['symbol'] = market['id'];
|
|
2705
2705
|
}
|
|
2706
|
-
params = this.omit(params, ['stop', 'hf', 'clientOid', 'clientOrderId']);
|
|
2706
|
+
params = this.omit(params, ['stop', 'hf', 'clientOid', 'clientOrderId', 'trigger']);
|
|
2707
2707
|
let response = undefined;
|
|
2708
2708
|
if (clientOrderId !== undefined) {
|
|
2709
2709
|
request['clientOid'] = clientOrderId;
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -1768,7 +1768,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
1768
1768
|
if (paginate) {
|
|
1769
1769
|
return await this.fetchPaginatedCallDynamic('fetchOrdersByStatus', symbol, since, limit, params);
|
|
1770
1770
|
}
|
|
1771
|
-
const stop = this.
|
|
1771
|
+
const stop = this.safeBool2(params, 'stop', 'trigger');
|
|
1772
1772
|
const until = this.safeInteger(params, 'until');
|
|
1773
1773
|
params = this.omit(params, ['stop', 'until', 'trigger']);
|
|
1774
1774
|
if (status === 'closed') {
|
|
@@ -72,6 +72,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
|
|
|
72
72
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
73
73
|
* @returns {object} subscription to a websocket channel
|
|
74
74
|
*/
|
|
75
|
+
await this.loadMarkets();
|
|
75
76
|
this.checkRequiredCredentials();
|
|
76
77
|
let market = undefined;
|
|
77
78
|
let messageHash = name;
|
|
@@ -120,6 +121,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
|
|
|
120
121
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
121
122
|
* @returns {object} subscription to a websocket channel
|
|
122
123
|
*/
|
|
124
|
+
await this.loadMarkets();
|
|
123
125
|
this.checkRequiredCredentials();
|
|
124
126
|
if (this.isEmpty(symbols)) {
|
|
125
127
|
symbols = this.symbols;
|
|
@@ -163,6 +165,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
|
|
|
163
165
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
164
166
|
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
165
167
|
*/
|
|
168
|
+
await this.loadMarkets();
|
|
166
169
|
return await this.subscribe('RISK', [symbol], params);
|
|
167
170
|
}
|
|
168
171
|
async watchFundingRates(symbols, params = {}) {
|
|
@@ -175,6 +178,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
|
|
|
175
178
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
176
179
|
* @returns {object} a dictionary of [funding rates structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexe by market symbols
|
|
177
180
|
*/
|
|
181
|
+
await this.loadMarkets();
|
|
178
182
|
const fundingRate = await this.subscribeMultiple('RISK', symbols, params);
|
|
179
183
|
const symbol = this.safeString(fundingRate, 'symbol');
|
|
180
184
|
if (this.newUpdates) {
|
|
@@ -194,6 +198,7 @@ export default class coinbaseinternational extends coinbaseinternationalRest {
|
|
|
194
198
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
195
199
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
196
200
|
*/
|
|
201
|
+
await this.loadMarkets();
|
|
197
202
|
let channel = undefined;
|
|
198
203
|
[channel, params] = this.handleOptionAndParams(params, 'watchTicker', 'channel', 'LEVEL1');
|
|
199
204
|
return await this.subscribe(channel, [symbol], params);
|
package/js/src/pro/gate.js
CHANGED
|
@@ -228,8 +228,8 @@ export default class gate extends gateRest {
|
|
|
228
228
|
*/
|
|
229
229
|
await this.loadMarkets();
|
|
230
230
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
231
|
-
const stop = this.
|
|
232
|
-
params = this.omit(params, ['is_stop_order', 'stop']);
|
|
231
|
+
const stop = this.safeValueN(params, ['is_stop_order', 'stop', 'trigger'], false);
|
|
232
|
+
params = this.omit(params, ['is_stop_order', 'stop', 'trigger']);
|
|
233
233
|
const [type, query] = this.handleMarketTypeAndParams('cancelOrder', market, params);
|
|
234
234
|
const [request, requestParams] = (type === 'spot' || type === 'margin') ? this.spotOrderPrepareRequest(market, stop, query) : this.prepareRequest(market, type, query);
|
|
235
235
|
const messageType = this.getTypeByMarket(market);
|
package/package.json
CHANGED