ccxt 4.3.49 → 4.3.51
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 +5 -5
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/bigone.js +1 -1
- package/dist/cjs/src/binance.js +290 -329
- package/dist/cjs/src/binancecoinm.js +1 -0
- package/dist/cjs/src/binanceusdm.js +2 -0
- package/dist/cjs/src/bitget.js +1 -0
- package/dist/cjs/src/bybit.js +34 -0
- package/dist/cjs/src/exmo.js +1 -1
- package/dist/cjs/src/htx.js +10 -10
- package/dist/cjs/src/kucoin.js +4 -4
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/pro/binance.js +36 -36
- package/dist/cjs/src/pro/binancecoinm.js +1 -0
- package/dist/cjs/src/pro/binanceusdm.js +2 -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/bigone.js +1 -1
- package/js/src/binance.js +290 -329
- package/js/src/binancecoinm.js +1 -0
- package/js/src/binanceusdm.js +2 -0
- package/js/src/bitget.js +1 -0
- package/js/src/bybit.d.ts +1 -0
- package/js/src/bybit.js +34 -0
- package/js/src/exmo.js +1 -1
- package/js/src/htx.js +10 -10
- package/js/src/kucoin.js +4 -4
- package/js/src/kucoinfutures.js +1 -1
- package/js/src/pro/binance.js +36 -36
- package/js/src/pro/binancecoinm.js +1 -0
- package/js/src/pro/binanceusdm.js +2 -0
- package/js/src/pro/gate.js +2 -2
- package/package.json +1 -1
package/js/src/binancecoinm.js
CHANGED
package/js/src/binanceusdm.js
CHANGED
|
@@ -18,6 +18,7 @@ export default class binanceusdm extends binance {
|
|
|
18
18
|
'doc': [
|
|
19
19
|
'https://binance-docs.github.io/apidocs/futures/en/',
|
|
20
20
|
'https://binance-docs.github.io/apidocs/spot/en',
|
|
21
|
+
'https://developers.binance.com/en',
|
|
21
22
|
],
|
|
22
23
|
},
|
|
23
24
|
'has': {
|
|
@@ -39,6 +40,7 @@ export default class binanceusdm extends binance {
|
|
|
39
40
|
'marginModes': {},
|
|
40
41
|
},
|
|
41
42
|
// https://binance-docs.github.io/apidocs/futures/en/#error-codes
|
|
43
|
+
// https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code
|
|
42
44
|
'exceptions': {
|
|
43
45
|
'exact': {
|
|
44
46
|
'-5021': InvalidOrder,
|
package/js/src/bitget.js
CHANGED
|
@@ -4154,6 +4154,7 @@ export default class bitget extends Exchange {
|
|
|
4154
4154
|
* @param {string} [params.trailingTriggerPrice] *swap and future only* the price to trigger a trailing stop order, default uses the price argument
|
|
4155
4155
|
* @param {string} [params.triggerType] *swap and future only* 'fill_price', 'mark_price' or 'index_price'
|
|
4156
4156
|
* @param {boolean} [params.oneWayMode] *swap and future only* required to set this to true in one_way_mode and you can leave this as undefined in hedge_mode, can adjust the mode using the setPositionMode() method
|
|
4157
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
4157
4158
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4158
4159
|
*/
|
|
4159
4160
|
await this.loadMarkets();
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export default class bybit extends Exchange {
|
|
|
68
68
|
cancelOrderRequest(id: string, symbol?: Str, params?: {}): any;
|
|
69
69
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
70
70
|
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
|
|
71
|
+
cancelAllOrdersAfter(timeout: Int, params?: {}): Promise<any>;
|
|
71
72
|
cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<Order[]>;
|
|
72
73
|
cancelAllUsdcOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
73
74
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
package/js/src/bybit.js
CHANGED
|
@@ -37,6 +37,7 @@ export default class bybit extends Exchange {
|
|
|
37
37
|
'option': true,
|
|
38
38
|
'borrowCrossMargin': true,
|
|
39
39
|
'cancelAllOrders': true,
|
|
40
|
+
'cancelAllOrdersAfter': true,
|
|
40
41
|
'cancelOrder': true,
|
|
41
42
|
'cancelOrders': true,
|
|
42
43
|
'cancelOrdersForSymbols': true,
|
|
@@ -4405,6 +4406,39 @@ export default class bybit extends Exchange {
|
|
|
4405
4406
|
const row = this.safeList(result, 'list', []);
|
|
4406
4407
|
return this.parseOrders(row, market);
|
|
4407
4408
|
}
|
|
4409
|
+
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
4410
|
+
/**
|
|
4411
|
+
* @method
|
|
4412
|
+
* @name bybit#cancelAllOrdersAfter
|
|
4413
|
+
* @description dead man's switch, cancel all orders after the given timeout
|
|
4414
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/dcp
|
|
4415
|
+
* @param {number} timeout time in milliseconds
|
|
4416
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4417
|
+
* @param {string} [params.product] OPTIONS, DERIVATIVES, SPOT, default is 'DERIVATIVES'
|
|
4418
|
+
* @returns {object} the api result
|
|
4419
|
+
*/
|
|
4420
|
+
await this.loadMarkets();
|
|
4421
|
+
const request = {
|
|
4422
|
+
'timeWindow': this.parseToInt(timeout / 1000),
|
|
4423
|
+
};
|
|
4424
|
+
let type = undefined;
|
|
4425
|
+
[type, params] = this.handleMarketTypeAndParams('cancelAllOrdersAfter', undefined, params, 'swap');
|
|
4426
|
+
const productMap = {
|
|
4427
|
+
'spot': 'SPOT',
|
|
4428
|
+
'swap': 'DERIVATIVES',
|
|
4429
|
+
'option': 'OPTIONS',
|
|
4430
|
+
};
|
|
4431
|
+
const product = this.safeString(productMap, type, type);
|
|
4432
|
+
request['product'] = product;
|
|
4433
|
+
const response = await this.privatePostV5OrderDisconnectedCancelAll(this.extend(request, params));
|
|
4434
|
+
//
|
|
4435
|
+
// {
|
|
4436
|
+
// "retCode": 0,
|
|
4437
|
+
// "retMsg": "success"
|
|
4438
|
+
// }
|
|
4439
|
+
//
|
|
4440
|
+
return response;
|
|
4441
|
+
}
|
|
4408
4442
|
async cancelOrdersForSymbols(orders, params = {}) {
|
|
4409
4443
|
/**
|
|
4410
4444
|
* @method
|
package/js/src/exmo.js
CHANGED
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/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') {
|
package/js/src/pro/binance.js
CHANGED
|
@@ -85,6 +85,7 @@ export default class binance extends binanceRest {
|
|
|
85
85
|
'papi': 'wss://fstream.binance.com/pm/ws',
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
|
+
'doc': 'https://developers.binance.com/en',
|
|
88
89
|
},
|
|
89
90
|
'streaming': {
|
|
90
91
|
'keepAlive': 180000,
|
|
@@ -196,8 +197,8 @@ export default class binance extends binanceRest {
|
|
|
196
197
|
* @method
|
|
197
198
|
* @name binance#watchLiquidations
|
|
198
199
|
* @description watch the public liquidations of a trading pair
|
|
199
|
-
* @see https://binance
|
|
200
|
-
* @see https://binance
|
|
200
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams
|
|
201
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Liquidation-Order-Streams
|
|
201
202
|
* @param {string} symbol unified CCXT market symbol
|
|
202
203
|
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
203
204
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
@@ -211,8 +212,8 @@ export default class binance extends binanceRest {
|
|
|
211
212
|
* @method
|
|
212
213
|
* @name binance#watchLiquidationsForSymbols
|
|
213
214
|
* @description watch the public liquidations of a trading pair
|
|
214
|
-
* @see https://binance
|
|
215
|
-
* @see https://binance
|
|
215
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams
|
|
216
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams
|
|
216
217
|
* @param {string} symbol unified CCXT market symbol
|
|
217
218
|
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
218
219
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
@@ -417,8 +418,8 @@ export default class binance extends binanceRest {
|
|
|
417
418
|
* @method
|
|
418
419
|
* @name binance#watchMyLiquidations
|
|
419
420
|
* @description watch the private liquidations of a trading pair
|
|
420
|
-
* @see https://binance
|
|
421
|
-
* @see https://binance
|
|
421
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update
|
|
422
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update
|
|
422
423
|
* @param {string} symbol unified CCXT market symbol
|
|
423
424
|
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
424
425
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
@@ -432,8 +433,8 @@ export default class binance extends binanceRest {
|
|
|
432
433
|
* @method
|
|
433
434
|
* @name binance#watchMyLiquidationsForSymbols
|
|
434
435
|
* @description watch the private liquidations of a trading pair
|
|
435
|
-
* @see https://binance
|
|
436
|
-
* @see https://binance
|
|
436
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update
|
|
437
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Event-Order-Update
|
|
437
438
|
* @param {string} symbol unified CCXT market symbol
|
|
438
439
|
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
439
440
|
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
@@ -644,7 +645,8 @@ export default class binance extends binanceRest {
|
|
|
644
645
|
* @method
|
|
645
646
|
* @name binance#fetchOrderBookWs
|
|
646
647
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
647
|
-
* @see https://binance
|
|
648
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#order-book
|
|
649
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/websocket-api/Order-Book
|
|
648
650
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
649
651
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
650
652
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1298,7 +1300,6 @@ export default class binance extends binanceRest {
|
|
|
1298
1300
|
* @method
|
|
1299
1301
|
* @name binance#fetchTickerWs
|
|
1300
1302
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1301
|
-
* @see https://binance-docs.github.io/apidocs/voptions/en/#24hr-ticker-price-change-statistics
|
|
1302
1303
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1303
1304
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1304
1305
|
* @param {string} [params.method] method to use can be ticker.price or ticker.book
|
|
@@ -1338,8 +1339,8 @@ export default class binance extends binanceRest {
|
|
|
1338
1339
|
/**
|
|
1339
1340
|
* @method
|
|
1340
1341
|
* @name binance#fetchOHLCVWs
|
|
1341
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#klines
|
|
1342
1342
|
* @description query historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1343
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#klines
|
|
1343
1344
|
* @param {string} symbol unified symbol of the market to query OHLCV data for
|
|
1344
1345
|
* @param {string} timeframe the length of time each candle represents
|
|
1345
1346
|
* @param {int} since timestamp in ms of the earliest candle to fetch
|
|
@@ -1465,10 +1466,10 @@ export default class binance extends binanceRest {
|
|
|
1465
1466
|
/**
|
|
1466
1467
|
* @method
|
|
1467
1468
|
* @name binance#watchBidsAsks
|
|
1468
|
-
* @see https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams
|
|
1469
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#all-book-tickers-stream
|
|
1470
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#all-book-tickers-stream
|
|
1471
1469
|
* @description watches best bid & ask for symbols
|
|
1470
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#symbol-order-book-ticker
|
|
1471
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
|
|
1472
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/All-Book-Tickers-Stream
|
|
1472
1473
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
1473
1474
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1474
1475
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -1988,9 +1989,8 @@ export default class binance extends binanceRest {
|
|
|
1988
1989
|
* @method
|
|
1989
1990
|
* @name binance#fetchBalanceWs
|
|
1990
1991
|
* @description fetch balance and get the amount of funds available for trading or funds locked in orders
|
|
1991
|
-
* @see https://binance
|
|
1992
|
-
* @see https://binance
|
|
1993
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#futures-account-balance-user_data
|
|
1992
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
|
|
1993
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-information-user_data
|
|
1994
1994
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1995
1995
|
* @param {string|undefined} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
|
|
1996
1996
|
* @param {string|undefined} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
@@ -2088,7 +2088,7 @@ export default class binance extends binanceRest {
|
|
|
2088
2088
|
/**
|
|
2089
2089
|
* @method
|
|
2090
2090
|
* @name binance#fetchPositionWs
|
|
2091
|
-
* @see https://binance
|
|
2091
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information
|
|
2092
2092
|
* @description fetch data on an open position
|
|
2093
2093
|
* @param {string} symbol unified market symbol of the market the position is held in
|
|
2094
2094
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2101,7 +2101,7 @@ export default class binance extends binanceRest {
|
|
|
2101
2101
|
* @method
|
|
2102
2102
|
* @name binance#fetchPositionsWs
|
|
2103
2103
|
* @description fetch all open positions
|
|
2104
|
-
* @see https://binance
|
|
2104
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information
|
|
2105
2105
|
* @param {string[]} [symbols] list of unified market symbols
|
|
2106
2106
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2107
2107
|
* @param {boolean} [params.returnRateLimits] set to true to return rate limit informations, defaults to false.
|
|
@@ -2340,9 +2340,9 @@ export default class binance extends binanceRest {
|
|
|
2340
2340
|
/**
|
|
2341
2341
|
* @method
|
|
2342
2342
|
* @name binance#createOrderWs
|
|
2343
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#place-new-order-trade
|
|
2344
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#new-order-trade-2
|
|
2345
2343
|
* @description create a trade order
|
|
2344
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#place-new-order-trade
|
|
2345
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
|
|
2346
2346
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
2347
2347
|
* @param {string} type 'market' or 'limit'
|
|
2348
2348
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -2489,8 +2489,8 @@ export default class binance extends binanceRest {
|
|
|
2489
2489
|
* @method
|
|
2490
2490
|
* @name binance#editOrderWs
|
|
2491
2491
|
* @description edit a trade order
|
|
2492
|
-
* @see https://binance
|
|
2493
|
-
* @see https://binance
|
|
2492
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-and-replace-order-trade
|
|
2493
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
|
|
2494
2494
|
* @param {string} id order id
|
|
2495
2495
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
2496
2496
|
* @param {string} type 'market' or 'limit'
|
|
@@ -2644,9 +2644,9 @@ export default class binance extends binanceRest {
|
|
|
2644
2644
|
/**
|
|
2645
2645
|
* @method
|
|
2646
2646
|
* @name binance#cancelOrderWs
|
|
2647
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-order-trade
|
|
2648
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#cancel-order-trade-2
|
|
2649
2647
|
* @description cancel multiple orders
|
|
2648
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-order-trade
|
|
2649
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
|
|
2650
2650
|
* @param {string} id order id
|
|
2651
2651
|
* @param {string} symbol unified market symbol, default is undefined
|
|
2652
2652
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -2690,8 +2690,8 @@ export default class binance extends binanceRest {
|
|
|
2690
2690
|
/**
|
|
2691
2691
|
* @method
|
|
2692
2692
|
* @name binance#cancelAllOrdersWs
|
|
2693
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data
|
|
2694
2693
|
* @description cancel all open orders in a market
|
|
2694
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-open-orders-trade
|
|
2695
2695
|
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
2696
2696
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2697
2697
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2725,9 +2725,9 @@ export default class binance extends binanceRest {
|
|
|
2725
2725
|
/**
|
|
2726
2726
|
* @method
|
|
2727
2727
|
* @name binance#fetchOrderWs
|
|
2728
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#query-order-user_data
|
|
2729
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#query-order-user_data-2
|
|
2730
2728
|
* @description fetches information on an order made by the user
|
|
2729
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-user_data
|
|
2730
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
|
|
2731
2731
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2732
2732
|
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
2733
2733
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2771,8 +2771,8 @@ export default class binance extends binanceRest {
|
|
|
2771
2771
|
/**
|
|
2772
2772
|
* @method
|
|
2773
2773
|
* @name binance#fetchOrdersWs
|
|
2774
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data
|
|
2775
2774
|
* @description fetches information on multiple orders made by the user
|
|
2775
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-list-user_data
|
|
2776
2776
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2777
2777
|
* @param {int|undefined} [since] the earliest time in ms to fetch orders for
|
|
2778
2778
|
* @param {int|undefined} [limit] the maximum number of order structures to retrieve
|
|
@@ -2816,8 +2816,8 @@ export default class binance extends binanceRest {
|
|
|
2816
2816
|
/**
|
|
2817
2817
|
* @method
|
|
2818
2818
|
* @name binance#fetchClosedOrdersWs
|
|
2819
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data
|
|
2820
2819
|
* @description fetch closed orders
|
|
2820
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-list-user_data
|
|
2821
2821
|
* @param {string} symbol unified market symbol
|
|
2822
2822
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2823
2823
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -2838,8 +2838,8 @@ export default class binance extends binanceRest {
|
|
|
2838
2838
|
/**
|
|
2839
2839
|
* @method
|
|
2840
2840
|
* @name binance#fetchOpenOrdersWs
|
|
2841
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data
|
|
2842
2841
|
* @description fetch all unfilled currently open orders
|
|
2842
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#current-open-orders-user_data
|
|
2843
2843
|
* @param {string} symbol unified market symbol
|
|
2844
2844
|
* @param {int|undefined} [since] the earliest time in ms to fetch open orders for
|
|
2845
2845
|
* @param {int|undefined} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -2879,9 +2879,9 @@ export default class binance extends binanceRest {
|
|
|
2879
2879
|
* @method
|
|
2880
2880
|
* @name binance#watchOrders
|
|
2881
2881
|
* @description watches information on multiple orders made by the user
|
|
2882
|
-
* @see https://binance
|
|
2883
|
-
* @see https://binance
|
|
2884
|
-
* @see https://binance
|
|
2882
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream#order-update
|
|
2883
|
+
* @see https://developers.binance.com/docs/margin_trading/trade-data-stream/Event-Order-Update
|
|
2884
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/user-data-streams/Event-Order-Update
|
|
2885
2885
|
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
2886
2886
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2887
2887
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -3401,8 +3401,8 @@ export default class binance extends binanceRest {
|
|
|
3401
3401
|
/**
|
|
3402
3402
|
* @method
|
|
3403
3403
|
* @name binance#fetchMyTradesWs
|
|
3404
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#account-trade-history-user_data
|
|
3405
3404
|
* @description fetch all trades made by the user
|
|
3405
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-trade-history-user_data
|
|
3406
3406
|
* @param {string} symbol unified market symbol
|
|
3407
3407
|
* @param {int|undefined} [since] the earliest time in ms to fetch trades for
|
|
3408
3408
|
* @param {int|undefined} [limit] the maximum number of trades structures to retrieve
|
|
@@ -3454,8 +3454,8 @@ export default class binance extends binanceRest {
|
|
|
3454
3454
|
/**
|
|
3455
3455
|
* @method
|
|
3456
3456
|
* @name binance#fetchTradesWs
|
|
3457
|
-
* @see https://binance-docs.github.io/apidocs/websocket_api/en/#recent-trades
|
|
3458
3457
|
* @description fetch all trades made by the user
|
|
3458
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#recent-trades
|
|
3459
3459
|
* @param {string} symbol unified market symbol
|
|
3460
3460
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3461
3461
|
* @param {int} [limit] the maximum number of trades structures to retrieve, default=500, max=1000
|
|
@@ -19,6 +19,7 @@ export default class binancecoinm extends binance {
|
|
|
19
19
|
'name': 'Binance COIN-M',
|
|
20
20
|
'urls': {
|
|
21
21
|
'logo': 'https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg',
|
|
22
|
+
'doc': 'https://developers.binance.com/en',
|
|
22
23
|
},
|
|
23
24
|
'options': {
|
|
24
25
|
'fetchMarkets': ['inverse'],
|
|
@@ -15,12 +15,14 @@ export default class binanceusdm extends binance {
|
|
|
15
15
|
'name': 'Binance USDⓈ-M',
|
|
16
16
|
'urls': {
|
|
17
17
|
'logo': 'https://user-images.githubusercontent.com/1294454/117738721-668c8d80-b205-11eb-8c49-3fad84c4a07f.jpg',
|
|
18
|
+
'doc': 'https://developers.binance.com/en',
|
|
18
19
|
},
|
|
19
20
|
'options': {
|
|
20
21
|
'fetchMarkets': ['linear'],
|
|
21
22
|
'defaultSubType': 'linear',
|
|
22
23
|
},
|
|
23
24
|
// https://binance-docs.github.io/apidocs/futures/en/#error-codes
|
|
25
|
+
// https://developers.binance.com/docs/derivatives/usds-margined-futures/error-code
|
|
24
26
|
'exceptions': {
|
|
25
27
|
'exact': {
|
|
26
28
|
'-5021': InvalidOrder,
|
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