@@ -269819,6 +269819,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
269819
269819
'ws-api': {
269820
269820
'spot': 'wss://testnet.binance.vision/ws-api/v3',
269821
269821
'future': 'wss://testnet.binancefuture.com/ws-fapi/v1',
269822
+ 'delivery': 'wss://testnet.binancefuture.com/ws-dapi/v1',
269822
269823
},
269823
269824
},
269824
269825
},
@@ -269831,6 +269832,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
269831
269832
'ws-api': {
269832
269833
'spot': 'wss://ws-api.binance.com:443/ws-api/v3',
269833
269834
'future': 'wss://ws-fapi.binance.com/ws-fapi/v1',
269835
+ 'delivery': 'wss://ws-dapi.binance.com/ws-dapi/v1',
269834
269836
},
269835
269837
'papi': 'wss://fstream.binance.com/pm/ws',
269836
269838
},
@@ -272254,6 +272256,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272254
272256
* @description fetch balance and get the amount of funds available for trading or funds locked in orders
272255
272257
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance
272256
272258
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-information-user_data
272259
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/websocket-api
272257
272260
* @param {object} [params] extra parameters specific to the exchange API endpoint
272258
272261
* @param {string|undefined} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
272259
272262
* @param {string|undefined} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
@@ -272264,7 +272267,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272264
272267
async fetchBalanceWs(params = {}) {
272265
272268
await this.loadMarkets();
272266
272269
const type = this.getMarketType('fetchBalanceWs', undefined, params);
272267
- if (type !== 'spot' && type !== 'future') {
272270
+ if (type !== 'spot' && type !== 'future' && type !== 'delivery' ) {
272268
272271
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' fetchBalanceWs only supports spot or swap markets');
272269
272272
}
272270
272273
const url = this.urls['api']['ws']['ws-api'][type];
@@ -272373,6 +272376,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272373
272376
* @name binance#fetchPositionsWs
272374
272377
* @description fetch all open positions
272375
272378
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information
272379
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Position-Information
272376
272380
* @param {string[]} [symbols] list of unified market symbols
272377
272381
* @param {object} [params] extra parameters specific to the exchange API endpoint
272378
272382
* @param {boolean} [params.returnRateLimits] set to true to return rate limit informations, defaults to false.
@@ -272381,17 +272385,23 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272381
272385
*/
272382
272386
async fetchPositionsWs(symbols = undefined, params = {}) {
272383
272387
await this.loadMarkets();
272384
- symbols = this.marketSymbols(symbols, 'swap', true, true, true);
272385
- const url = this.urls['api']['ws']['ws-api']['future'];
272386
- const requestId = this.requestId(url);
272387
- const messageHash = requestId.toString();
272388
272388
const payload = {};
272389
+ let market = undefined;
272390
+ symbols = this.marketSymbols(symbols, 'swap', true, true, true);
272389
272391
if (symbols !== undefined) {
272390
272392
const symbolsLength = symbols.length;
272391
272393
if (symbolsLength === 1) {
272392
- payload['symbol'] = this.marketId(symbols[0]);
272394
+ market = this.market(symbols[0]);
272395
+ payload['symbol'] = market['id'];
272393
272396
}
272394
272397
}
272398
+ const type = this.getMarketType('fetchPositionsWs', market, params);
272399
+ if (type !== 'future' && type !== 'delivery') {
272400
+ throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' fetchPositionsWs only supports swap markets');
272401
+ }
272402
+ const url = this.urls['api']['ws']['ws-api'][type];
272403
+ const requestId = this.requestId(url);
272404
+ const messageHash = requestId.toString();
272395
272405
let returnRateLimits = false;
272396
272406
[returnRateLimits, params] = this.handleOptionAndParams(params, 'fetchPositionsWs', 'returnRateLimits', false);
272397
272407
payload['returnRateLimits'] = returnRateLimits;
@@ -272617,6 +272627,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272617
272627
* @description create a trade order
272618
272628
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#place-new-order-trade
272619
272629
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/New-Order
272630
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api
272620
272631
* @param {string} symbol unified symbol of the market to create an order in
272621
272632
* @param {string} type 'market' or 'limit'
272622
272633
* @param {string} side 'buy' or 'sell'
@@ -272631,7 +272642,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272631
272642
await this.loadMarkets();
272632
272643
const market = this.market(symbol);
272633
272644
const marketType = this.getMarketType('createOrderWs', market, params);
272634
- if (marketType !== 'spot' && marketType !== 'future') {
272645
+ if (marketType !== 'spot' && marketType !== 'future' && marketType !== 'delivery' ) {
272635
272646
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' createOrderWs only supports spot or swap markets');
272636
272647
}
272637
272648
const url = this.urls['api']['ws']['ws-api'][marketType];
@@ -272765,6 +272776,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272765
272776
* @description edit a trade order
272766
272777
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-and-replace-order-trade
272767
272778
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Modify-Order
272779
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Modify-Order
272768
272780
* @param {string} id order id
272769
272781
* @param {string} symbol unified symbol of the market to create an order in
272770
272782
* @param {string} type 'market' or 'limit'
@@ -272778,25 +272790,26 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272778
272790
await this.loadMarkets();
272779
272791
const market = this.market(symbol);
272780
272792
const marketType = this.getMarketType('editOrderWs', market, params);
272781
- if (marketType !== 'spot' && marketType !== 'future') {
272793
+ if (marketType !== 'spot' && marketType !== 'future' && marketType !== 'delivery' ) {
272782
272794
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' editOrderWs only supports spot or swap markets');
272783
272795
}
272784
272796
const url = this.urls['api']['ws']['ws-api'][marketType];
272785
272797
const requestId = this.requestId(url);
272786
272798
const messageHash = requestId.toString();
272799
+ const isSwap = (marketType === 'future' || marketType === 'delivery');
272787
272800
let payload = undefined;
272788
272801
if (marketType === 'spot') {
272789
272802
payload = this.editSpotOrderRequest(id, symbol, type, side, amount, price, params);
272790
272803
}
272791
- else if (marketType === 'future' ) {
272804
+ else if (isSwap ) {
272792
272805
payload = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
272793
272806
}
272794
272807
let returnRateLimits = false;
272795
272808
[returnRateLimits, params] = this.handleOptionAndParams(params, 'editOrderWs', 'returnRateLimits', false);
272796
272809
payload['returnRateLimits'] = returnRateLimits;
272797
272810
const message = {
272798
272811
'id': messageHash,
272799
- 'method': (marketType === 'future' ) ? 'order.modify' : 'order.cancelReplace',
272812
+ 'method': (isSwap ) ? 'order.modify' : 'order.cancelReplace',
272800
272813
'params': this.signParams(this.extend(payload, params)),
272801
272814
};
272802
272815
const subscription = {
@@ -272921,6 +272934,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
272921
272934
* @description cancel multiple orders
272922
272935
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-order-trade
272923
272936
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Cancel-Order
272937
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Cancel-Order
272924
272938
* @param {string} id order id
272925
272939
* @param {string} [symbol] unified market symbol, default is undefined
272926
272940
* @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -273002,6 +273016,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
273002
273016
* @description fetches information on an order made by the user
273003
273017
* @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-user_data
273004
273018
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order
273019
+ * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/websocket-api/Query-Order
273005
273020
* @param {string} id order id
273006
273021
* @param {string} [symbol] unified symbol of the market the order was made in
273007
273022
* @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -273014,7 +273029,7 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
273014
273029
}
273015
273030
const market = this.market(symbol);
273016
273031
const type = this.getMarketType('fetchOrderWs', market, params);
273017
- if (type !== 'spot' && type !== 'future') {
273032
+ if (type !== 'spot' && type !== 'future' && type !== 'delivery' ) {
273018
273033
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.BadRequest(this.id + ' fetchOrderWs only supports spot or swap markets');
273019
273034
}
273020
273035
const url = this.urls['api']['ws']['ws-api'][type];
0 commit comments