@@ -22617,12 +22617,16 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22617
22617
},
22618
22618
'hedged': true,
22619
22619
'leverage': false,
22620
- 'marketBuyRequiresPrice': false,
22621
22620
'marketBuyByCost': true,
22622
- // exchange-supported features
22623
- 'selfTradePrevention': true,
22624
- 'trailing': true,
22625
- 'iceberg': true, // todo implementation
22621
+ 'marketBuyRequiresPrice': false,
22622
+ 'selfTradePrevention': {
22623
+ 'expire_maker': true,
22624
+ 'expire_taker': true,
22625
+ 'expire_both': true,
22626
+ 'none': true,
22627
+ },
22628
+ 'trailing': false,
22629
+ 'icebergAmount': true,
22626
22630
},
22627
22631
'createOrders': undefined,
22628
22632
'fetchMyTrades': {
@@ -22663,7 +22667,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22663
22667
'limit': 1000,
22664
22668
},
22665
22669
},
22666
- 'default ': {
22670
+ 'forDerivatives ': {
22667
22671
'sandbox': true,
22668
22672
'createOrder': {
22669
22673
'marginMode': false,
@@ -22735,18 +22739,18 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
22735
22739
},
22736
22740
'swap': {
22737
22741
'linear': {
22738
- 'extends': 'default ',
22742
+ 'extends': 'forDerivatives ',
22739
22743
},
22740
22744
'inverse': {
22741
- 'extends': 'default ',
22745
+ 'extends': 'forDerivatives ',
22742
22746
},
22743
22747
},
22744
22748
'future': {
22745
22749
'linear': {
22746
- 'extends': 'default ',
22750
+ 'extends': 'forDerivatives ',
22747
22751
},
22748
22752
'inverse': {
22749
- 'extends': 'default ',
22753
+ 'extends': 'forDerivatives ',
22750
22754
},
22751
22755
},
22752
22756
},
@@ -27275,7 +27279,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27275
27279
* @method
27276
27280
* @name binance#createOrder
27277
27281
* @description create a trade order
27278
- * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api -endpoints#new-order-trade
27282
+ * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading -endpoints#new-order-trade
27279
27283
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade
27280
27284
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
27281
27285
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
@@ -27303,6 +27307,8 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27303
27307
* @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at
27304
27308
* @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at
27305
27309
* @param {boolean} [params.portfolioMargin] set to true if you would like to create an order in a portfolio margin account
27310
+ * @param {string} [params.selfTradePrevention] set unified value for stp (see .features for available values)
27311
+ * @param {float} [params.icebergAmount] set iceberg amount for limit orders
27306
27312
* @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
27307
27313
* @param {string} [params.positionSide] *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
27308
27314
* @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
@@ -27689,7 +27695,7 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27689
27695
}
27690
27696
}
27691
27697
if (timeInForceIsRequired && (this.safeString(params, 'timeInForce') === undefined) && (this.safeString(request, 'timeInForce') === undefined)) {
27692
- request['timeInForce'] = this.options[ 'defaultTimeInForce'] ; // 'GTC' = Good To Cancel (default), 'IOC' = Immediate Or Cancel
27698
+ request['timeInForce'] = this.safeString(this. options, 'defaultTimeInForce') ; // 'GTC' = Good To Cancel (default), 'IOC' = Immediate Or Cancel
27693
27699
}
27694
27700
if (!isPortfolioMargin && market['contract'] && postOnly) {
27695
27701
request['timeInForce'] = 'GTX';
@@ -27706,7 +27712,21 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
27706
27712
}
27707
27713
request['positionSide'] = (side === 'buy') ? 'LONG' : 'SHORT';
27708
27714
}
27709
- const requestParams = this.omit(params, ['type', 'newClientOrderId', 'clientOrderId', 'postOnly', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'triggerPrice', 'trailingTriggerPrice', 'trailingPercent', 'quoteOrderQty', 'cost', 'test', 'hedged']);
27715
+ // unified stp
27716
+ const selfTradePrevention = this.safeString(params, 'selfTradePrevention');
27717
+ if (selfTradePrevention !== undefined) {
27718
+ if (market['spot']) {
27719
+ request['selfTradePreventionMode'] = selfTradePrevention.toUpperCase(); // binance enums exactly match the unified ccxt enums (but needs uppercase)
27720
+ }
27721
+ }
27722
+ // unified iceberg
27723
+ const icebergAmount = this.safeNumber(params, 'icebergAmount');
27724
+ if (icebergAmount !== undefined) {
27725
+ if (market['spot']) {
27726
+ request['icebergQty'] = this.amountToPrecision(symbol, icebergAmount);
27727
+ }
27728
+ }
27729
+ const requestParams = this.omit(params, ['type', 'newClientOrderId', 'clientOrderId', 'postOnly', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'triggerPrice', 'trailingTriggerPrice', 'trailingPercent', 'quoteOrderQty', 'cost', 'test', 'hedged', 'selfTradePrevention', 'icebergAmount']);
27710
27730
return this.extend(request, requestParams);
27711
27731
}
27712
27732
/**
@@ -181322,7 +181342,7 @@ class hollaex extends _abstract_hollaex_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
181322
181342
181323
181343
// ---------------------------------------------------------------------------
181324
181344
/**
181325
- * @class huobi
181345
+ * @class htx
181326
181346
* @augments Exchange
181327
181347
*/
181328
181348
class htx extends _abstract_htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
@@ -309654,7 +309674,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
309654
309674
}
309655
309675
/**
309656
309676
* @method
309657
- * @name huobi #watchTicker
309677
+ * @name htx #watchTicker
309658
309678
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
309659
309679
* @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53561-7773-11ed-9966-0242ac110003
309660
309680
* @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33ab2-77ae-11ed-9966-0242ac110003
@@ -309724,7 +309744,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
309724
309744
}
309725
309745
/**
309726
309746
* @method
309727
- * @name huobi #watchTrades
309747
+ * @name htx #watchTrades
309728
309748
* @description get the list of most recent trades for a particular symbol
309729
309749
* @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53b69-7773-11ed-9966-0242ac110003
309730
309750
* @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33c21-77ae-11ed-9966-0242ac110003
@@ -309790,7 +309810,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
309790
309810
}
309791
309811
/**
309792
309812
* @method
309793
- * @name huobi #watchOHLCV
309813
+ * @name htx #watchOHLCV
309794
309814
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
309795
309815
* @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53241-7773-11ed-9966-0242ac110003
309796
309816
* @see https://www.htx.com/en-us/opend/newApiPages/?id=28c3346a-77ae-11ed-9966-0242ac110003
@@ -309853,7 +309873,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
309853
309873
}
309854
309874
/**
309855
309875
* @method
309856
- * @name huobi #watchOrderBook
309876
+ * @name htx #watchOrderBook
309857
309877
* @see https://huobiapi.github.io/docs/dm/v1/en/#subscribe-market-depth-data
309858
309878
* @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#subscribe-incremental-market-depth-data
309859
309879
* @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-subscribe-incremental-market-depth-data
@@ -310199,7 +310219,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
310199
310219
}
310200
310220
/**
310201
310221
* @method
310202
- * @name huobi #watchMyTrades
310222
+ * @name htx #watchMyTrades
310203
310223
* @description watches information on multiple trades made by the user
310204
310224
* @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53dd5-7773-11ed-9966-0242ac110003
310205
310225
* @param {string} symbol unified market symbol of the market trades were made in
@@ -310303,7 +310323,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
310303
310323
}
310304
310324
/**
310305
310325
* @method
310306
- * @name huobi #watchOrders
310326
+ * @name htx #watchOrders
310307
310327
* @description watches information on multiple orders made by the user
310308
310328
* @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53c8f-7773-11ed-9966-0242ac110003
310309
310329
* @param {string} symbol unified market symbol of the market orders were made in
@@ -310757,7 +310777,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
310757
310777
}
310758
310778
/**
310759
310779
* @method
310760
- * @name huobi #watchPositions
310780
+ * @name htx #watchPositions
310761
310781
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7de1c-77b5-11ed-9966-0242ac110003
310762
310782
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7df0f-77b5-11ed-9966-0242ac110003
310763
310783
* @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
@@ -310880,7 +310900,7 @@ class htx extends _htx_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A {
310880
310900
}
310881
310901
/**
310882
310902
* @method
310883
- * @name huobi #watchBalance
310903
+ * @name htx #watchBalance
310884
310904
* @description watch balance and get the amount of funds available for trading or funds locked in orders
310885
310905
* @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec52e28-7773-11ed-9966-0242ac110003
310886
310906
* @see https://www.htx.com/en-us/opend/newApiPages/?id=10000084-77b7-11ed-9966-0242ac110003
0 commit comments