diff --git a/MIGRATION.md b/MIGRATION.md index bc3e2aed5..04c873f02 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -51,7 +51,7 @@ For Futures (COIN-M Futures package): ``` -### **Step 3: Update Imports** +### **Step 2: Update Imports** Update your import paths: @@ -79,7 +79,7 @@ import com.binance.connector.futures.client.impl.CMFuturesClientImpl; import com.binance.connector.client.derivatives_trading_coin_futures.rest.api.DerivativesTradingCoinFuturesRestApi; ``` -### **Step 4: Update Client Initialization** +### **Step 3: Update Client Initialization** The new structure introduces a more modular approach to client initialization. @@ -129,11 +129,11 @@ The new structure introduces a more modular approach to client initialization. DerivativesTradingCoinFuturesRestApi api = new DerivativesTradingCoinFuturesRestApi(clientConfiguration); Long recvWindow = 5000L; - ApiResponse response = getApi().accountInformation(recvWindow); + ApiResponse response = api.accountInformation(recvWindow); System.out.println(response.getData()); ``` -### **Step 5: Check for API Differences** +### **Step 4: Check for API Differences** Some function names or response structures may have changed. Refer to the modular connector's documentation for details. diff --git a/clients/convert/.openapi-generator/FILES b/clients/convert/.openapi-generator/FILES deleted file mode 100644 index 85ab56d41..000000000 --- a/clients/convert/.openapi-generator/FILES +++ /dev/null @@ -1,46 +0,0 @@ -docs/AcceptQuoteRequest.md -docs/AcceptQuoteResponse.md -docs/CancelLimitOrderRequest.md -docs/CancelLimitOrderResponse.md -docs/GetConvertTradeHistoryResponse.md -docs/GetConvertTradeHistoryResponseListInner.md -docs/ListAllConvertPairsResponse.md -docs/ListAllConvertPairsResponseInner.md -docs/MarketDataApi.md -docs/OrderStatusResponse.md -docs/PlaceLimitOrderRequest.md -docs/PlaceLimitOrderResponse.md -docs/QueryLimitOpenOrdersResponse.md -docs/QueryLimitOpenOrdersResponseListInner.md -docs/QueryOrderQuantityPrecisionPerAssetResponse.md -docs/QueryOrderQuantityPrecisionPerAssetResponseInner.md -docs/SendQuoteRequestRequest.md -docs/SendQuoteRequestResponse.md -docs/TradeApi.md -example_rest.md -pom.xml -pom_example.xml -src/main/java/com/binance/connector/client/convert/rest/ConvertRestApiUtil.java -src/main/java/com/binance/connector/client/convert/rest/JSON.java -src/main/java/com/binance/connector/client/convert/rest/api/ConvertRestApi.java -src/main/java/com/binance/connector/client/convert/rest/api/MarketDataApi.java -src/main/java/com/binance/connector/client/convert/rest/api/TradeApi.java -src/main/java/com/binance/connector/client/convert/rest/example/MarketDataApiExample.java -src/main/java/com/binance/connector/client/convert/rest/example/TradeApiExample.java -src/main/java/com/binance/connector/client/convert/rest/model/AcceptQuoteRequest.java -src/main/java/com/binance/connector/client/convert/rest/model/AcceptQuoteResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/CancelLimitOrderRequest.java -src/main/java/com/binance/connector/client/convert/rest/model/CancelLimitOrderResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/GetConvertTradeHistoryResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/GetConvertTradeHistoryResponseListInner.java -src/main/java/com/binance/connector/client/convert/rest/model/ListAllConvertPairsResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/ListAllConvertPairsResponseInner.java -src/main/java/com/binance/connector/client/convert/rest/model/OrderStatusResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderRequest.java -src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersResponseListInner.java -src/main/java/com/binance/connector/client/convert/rest/model/QueryOrderQuantityPrecisionPerAssetResponse.java -src/main/java/com/binance/connector/client/convert/rest/model/QueryOrderQuantityPrecisionPerAssetResponseInner.java -src/main/java/com/binance/connector/client/convert/rest/model/SendQuoteRequestRequest.java -src/main/java/com/binance/connector/client/convert/rest/model/SendQuoteRequestResponse.java diff --git a/clients/convert/.openapi-generator/VERSION b/clients/convert/.openapi-generator/VERSION deleted file mode 100644 index 5f84a81db..000000000 --- a/clients/convert/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.12.0 diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index b5ab399d5..8f8ec8642 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 8.0.0 - 2026-01-06 + +### Changed (3) + +#### WebSocket API + +- Added parameter `activatePrice` + - affected methods: + - `newAlgoOrder()` (`algoOrder.place` method) +- Deleted parameter `activationPrice` + - affected methods: + - `newAlgoOrder()` (`algoOrder.place` method) +#### WebSocket Streams + +- Modified response for `aggregateTradeStreams()` (`@aggTrade` stream): + - property `nq` added + ## 7.0.0 - 2025-12-16 ### Added (14) diff --git a/clients/derivatives-trading-usds-futures/docs/AggregateTradeStreamsResponse.md b/clients/derivatives-trading-usds-futures/docs/AggregateTradeStreamsResponse.md index 13ed9768a..7dc3e4f50 100644 --- a/clients/derivatives-trading-usds-futures/docs/AggregateTradeStreamsResponse.md +++ b/clients/derivatives-trading-usds-futures/docs/AggregateTradeStreamsResponse.md @@ -13,6 +13,7 @@ |**aLowerCase** | **Long** | | [optional] | |**pLowerCase** | **String** | | [optional] | |**qLowerCase** | **String** | | [optional] | +|**nq** | **String** | | [optional] | |**fLowerCase** | **Long** | | [optional] | |**lLowerCase** | **Long** | | [optional] | |**T** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md index 4a9612bf0..72b2f208c 100644 --- a/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md +++ b/clients/derivatives-trading-usds-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md @@ -16,11 +16,6 @@ |**reduceOnly** | **String** | | [optional] | |**price** | **String** | | [optional] | |**newClientOrderId** | **String** | | [optional] | -|**stopPrice** | **String** | | [optional] | -|**activationPrice** | **String** | | [optional] | -|**callbackRate** | **String** | | [optional] | -|**workingType** | [**WorkingTypeEnum**](#WorkingTypeEnum) | | [optional] | -|**priceProtect** | **String** | | [optional] | |**newOrderRespType** | [**NewOrderRespTypeEnum**](#NewOrderRespTypeEnum) | | [optional] | |**priceMatch** | [**PriceMatchEnum**](#PriceMatchEnum) | | [optional] | |**selfTradePreventionMode** | [**SelfTradePreventionModeEnum**](#SelfTradePreventionModeEnum) | | [optional] | @@ -60,15 +55,6 @@ -## Enum: WorkingTypeEnum - -| Name | Value | -|---- | -----| -| MARK_PRICE | "MARK_PRICE" | -| CONTRACT_PRICE | "CONTRACT_PRICE" | - - - ## Enum: NewOrderRespTypeEnum | Name | Value | diff --git a/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseResult.md b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseResult.md index e7b7ed91a..a98706ff9 100644 --- a/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseResult.md +++ b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderResponseResult.md @@ -9,27 +9,8 @@ |------------ | ------------- | ------------- | -------------| |**algoId** | **Long** | | [optional] | |**clientAlgoId** | **String** | | [optional] | -|**algoType** | **String** | | [optional] | -|**orderType** | **String** | | [optional] | -|**symbol** | **String** | | [optional] | -|**side** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**quantity** | **String** | | [optional] | -|**algoStatus** | **String** | | [optional] | -|**triggerPrice** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**icebergQuantity** | **String** | | [optional] | -|**selfTradePreventionMode** | **String** | | [optional] | -|**workingType** | **String** | | [optional] | -|**priceMatch** | **String** | | [optional] | -|**closePosition** | **Boolean** | | [optional] | -|**priceProtect** | **Boolean** | | [optional] | -|**reduceOnly** | **Boolean** | | [optional] | -|**createTime** | **Long** | | [optional] | -|**updateTime** | **Long** | | [optional] | -|**triggerTime** | **Long** | | [optional] | -|**goodTillDate** | **Long** | | [optional] | +|**code** | **String** | | [optional] | +|**msg** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md b/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md index d38bb813f..04d7e2d2a 100644 --- a/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md +++ b/clients/derivatives-trading-usds-futures/docs/CancelOrderResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**CancelOrderResponseResult**](CancelOrderResponseResult.md) | | [optional] | -|**rateLimits** | [**List<CancelAlgoOrderResponseRateLimitsInner>**](CancelAlgoOrderResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | [**List<CancelOrderResponseRateLimitsInner>**](CancelOrderResponseRateLimitsInner.md) | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/CancelOrderResponseRateLimitsInner.md b/clients/derivatives-trading-usds-futures/docs/CancelOrderResponseRateLimitsInner.md new file mode 100644 index 000000000..7eab82b9c --- /dev/null +++ b/clients/derivatives-trading-usds-futures/docs/CancelOrderResponseRateLimitsInner.md @@ -0,0 +1,17 @@ + + +# CancelOrderResponseRateLimitsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rateLimitType** | **String** | | [optional] | +|**interval** | **String** | | [optional] | +|**intervalNum** | **Long** | | [optional] | +|**limit** | **Long** | | [optional] | +|**count** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md index 1ba878a99..4dc8a0658 100644 --- a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md +++ b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md @@ -22,7 +22,7 @@ |**closePosition** | **String** | | [optional] | |**priceProtect** | **String** | | [optional] | |**reduceOnly** | **String** | | [optional] | -|**activationPrice** | **Double** | | [optional] | +|**activatePrice** | **Double** | | [optional] | |**callbackRate** | **Double** | | [optional] | |**clientAlgoId** | **String** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponse.md b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponse.md index 25eb6f865..c5f22b246 100644 --- a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponse.md +++ b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderResponse.md @@ -10,7 +10,7 @@ |**id** | **String** | | [optional] | |**status** | **Long** | | [optional] | |**result** | [**NewAlgoOrderResponseResult**](NewAlgoOrderResponseResult.md) | | [optional] | -|**rateLimits** | [**List<CancelAlgoOrderResponseRateLimitsInner>**](CancelAlgoOrderResponseRateLimitsInner.md) | | [optional] | +|**rateLimits** | [**List<CancelOrderResponseRateLimitsInner>**](CancelOrderResponseRateLimitsInner.md) | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md b/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md index e5c625005..3182f48f7 100644 --- a/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md +++ b/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md @@ -24,8 +24,6 @@ |**timeInForce** | **String** | | [optional] | |**type** | **String** | | [optional] | |**origType** | **String** | | [optional] | -|**activatePrice** | **String** | | [optional] | -|**priceRate** | **String** | | [optional] | |**updateTime** | **Long** | | [optional] | |**workingType** | **String** | | [optional] | |**priceProtect** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/TradeApi.md b/clients/derivatives-trading-usds-futures/docs/TradeApi.md index cecdc4b0d..ef4b8f23f 100644 --- a/clients/derivatives-trading-usds-futures/docs/TradeApi.md +++ b/clients/derivatives-trading-usds-futures/docs/TradeApi.md @@ -206,7 +206,7 @@ No authorization required New Algo Order(TRADE) -Send in a new algo order. * Condition orders will be triggered when: * If parameter`priceProtect`is sent as true: * when price reaches the `triggerPrice` ,the difference rate between \"MARK_PRICE\" and \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the symbol * \"triggerProtect\" of a symbol can be got from `GET /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after order placed <= `activationPrice`, and the latest price >= the lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed >= `activationPrice`, and the latest price <= the highest price * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. ``{\"code\": -2021, \"msg\": \"Order would immediately trigger.\"}`` means that the parameters you send do not meet the following requirements: * BUY: `activationPrice` should be smaller than latest price. * SELL: `activationPrice` should be larger than latest price. * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with `closePosition`=`true`: * Follow the same rules for condition orders. * If triggered,**close all** current long position( if `SELL`) or current short position( if `BUY`). * Cannot be used with `quantity` paremeter * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with `BUY` orders in `LONG` position side. and cannot be used with `SELL` orders in `SHORT` position side * `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`. Weight: 0 +Send in a new algo order. * Condition orders will be triggered when: * If parameter`priceProtect`is sent as true: * when price reaches the `triggerPrice` ,the difference rate between \"MARK_PRICE\" and \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the symbol * \"triggerProtect\" of a symbol can be got from `GET /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after order placed <= `activatePrice`, and the latest price >= the lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed >= `activatePrice`, and the latest price <= the highest price * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. ``{\"code\": -2021, \"msg\": \"Order would immediately trigger.\"}`` means that the parameters you send do not meet the following requirements: * BUY: `activatePrice` should be smaller than latest price. * SELL: `activatePrice` should be larger than latest price. * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with `closePosition`=`true`: * Follow the same rules for condition orders. * If triggered,**close all** current long position( if `SELL`) or current short position( if `BUY`). * Cannot be used with `quantity` paremeter * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with `BUY` orders in `LONG` position side. and cannot be used with `SELL` orders in `SHORT` position side * `selfTradePreventionMode` is only effective when `timeInForce` set to `IOC` or `GTC` or `GTD`. Weight: 0 ### Example ```java diff --git a/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md b/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md index 9d2ee2395..15aecd5dc 100644 --- a/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md +++ b/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md @@ -32,7 +32,7 @@ All URIs are relative to *http://localhost* Aggregate Trade Streams -The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds. Only market trades will be aggregated, which means the insurance fund trades and ADL trades won't be aggregated. Retail Price Improvement(RPI) orders are aggregated and without special tags to be distinguished. Update Speed: 100ms +The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds. Only market trades will be aggregated, which means the insurance fund trades and ADL trades won't be aggregated. Retail Price Improvement(RPI) orders are aggregated into field `q` and without special tags to be distinguished. Update Speed: 100ms ### Example ```java @@ -962,7 +962,7 @@ No authorization required Mark Price Stream for All market -Mark price and funding rate for all symbols pushed every 3 seconds or every second. **Note**: This stream does not cover TradFi Perps. Update Speed: 3000ms or 1000ms +Mark price and funding rate for all symbols pushed every 3 seconds or every second. **Note**: TradFi symbols will be pushed through a seperate message. Update Speed: 3000ms or 1000ms ### Example ```java @@ -1210,7 +1210,7 @@ No authorization required Trading Session Stream -Trading session information of U.S. equity market and commodity market which updates every second. Trading session information of different markets is pushed in seperate messages. Session types of equity market include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\" and \"NO_TRADING\". And session types of commodity market include \"REGULAR\" and \"NO_TRADING\". Update Speed: 1s +Trading session information for the underlying assets of TradFi Perpetual contracts—covering the U.S. equity market and the commodity market—is updated every second. Trading session information for different underlying markets is pushed in separate messages. Session types for the equity market include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\", and \"NO_TRADING\". Session types for the commodity market include \"REGULAR\" and \"NO_TRADING\". Update Speed: 1s ### Example ```java diff --git a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md index 7a6636020..09d8d417b 100644 --- a/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-usds-futures/docs/rest-api/migration-guide.md @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s io.github.binance binance-derivatives-trading-usds-futures - 7.0.0 + 8.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-usds-futures - 7.0.0 + 8.0.0 ``` diff --git a/clients/derivatives-trading-usds-futures/example_rest.md b/clients/derivatives-trading-usds-futures/example_rest.md index 13999e6e7..8558d7d32 100644 --- a/clients/derivatives-trading-usds-futures/example_rest.md +++ b/clients/derivatives-trading-usds-futures/example_rest.md @@ -120,7 +120,7 @@ [GET /futures/data/topLongShortPositionRatio](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Top-Trader-Long-Short-Ratio) - topTraderLongShortRatioPositions - [TopTraderLongShortRatioPositionsExample.java:54](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TopTraderLongShortRatioPositionsExample.java#L54) -[GET /fapi/v1/tradingSchedule](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) - tradingSchedule - [TradingScheduleExample.java:51](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java#L51) +[GET /fapi/v1/tradingSchedule](https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Trading-Schedule) - tradingSchedule - [TradingScheduleExample.java:52](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java#L52) ## PortfolioMarginEndpoints @@ -168,9 +168,9 @@ [PUT /fapi/v1/order](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order) - modifyOrder - [ModifyOrderExample.java:60](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/ModifyOrderExample.java#L60) -[POST /fapi/v1/algoOrder](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) - newAlgoOrder - [NewAlgoOrderExample.java:79](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java#L79) +[POST /fapi/v1/algoOrder](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order) - newAlgoOrder - [NewAlgoOrderExample.java:82](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java#L82) -[POST /fapi/v1/order](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order) - newOrder - [NewOrderExample.java:86](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewOrderExample.java#L86) +[POST /fapi/v1/order](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order) - newOrder - [NewOrderExample.java:57](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewOrderExample.java#L57) [POST /fapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders) - placeMultipleOrders - [PlaceMultipleOrdersExample.java:53](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/PlaceMultipleOrdersExample.java#L53) diff --git a/clients/derivatives-trading-usds-futures/example_websocket_stream.md b/clients/derivatives-trading-usds-futures/example_websocket_stream.md index d874fa049..7c76d8051 100644 --- a/clients/derivatives-trading-usds-futures/example_websocket_stream.md +++ b/clients/derivatives-trading-usds-futures/example_websocket_stream.md @@ -30,7 +30,7 @@ [@markPrice@](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream) - markPriceStream - [MarkPriceStreamExample.java:44](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamExample.java#L44) -[!markPrice@arr@](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) - markPriceStreamForAllMarket - [MarkPriceStreamForAllMarketExample.java:44](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java#L44) +[!markPrice@arr@](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market) - markPriceStreamForAllMarket - [MarkPriceStreamForAllMarketExample.java:45](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java#L45) [!assetIndex@arr](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index) - multiAssetsModeAssetIndex - [MultiAssetsModeAssetIndexExample.java:43](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MultiAssetsModeAssetIndexExample.java#L43) @@ -38,5 +38,5 @@ [@rpiDepth@500ms](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams-RPI) - rpiDiffBookDepthStreams - [RpiDiffBookDepthStreamsExample.java:47](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java#L47) -[tradingSession](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) - tradingSessionStream - [TradingSessionStreamExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java#L48) +[tradingSession](https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Trading-Session-Stream) - tradingSessionStream - [TradingSessionStreamExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java#L49) diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index b4fcc3f9f..5b72db74b 100644 --- a/clients/derivatives-trading-usds-futures/pom.xml +++ b/clients/derivatives-trading-usds-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-usds-futures derivatives-trading-usds-futures - 7.0.0 + 8.0.0 jar diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java index 81911ea4b..3ead98776 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/AccountApi.java @@ -64,7 +64,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java index 26eb56e14..2bb2dc404 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/ConvertApi.java @@ -49,7 +49,7 @@ public class ConvertApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java index a6104a6ab..ada11b0a0 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/DerivativesTradingUsdsFuturesRestApi.java @@ -1726,9 +1726,10 @@ public ApiResponse topTraderLongShortR } /** - * Trading Schedule Trading session schedules for a one-week period starting from the day prior - * to the query time, covering both the U.S. equity and commodity markets. Equity market session - * types include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", + * Trading Schedule Trading session schedules for the underlying assets of TradFi Perps are + * provided for a one-week period starting from the day prior to the query time, covering both + * the U.S. equity and commodity markets. Equity market session types include + * \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", * \"OVERNIGHT\", and \"NO_TRADING\", while commodity market session types * include \"REGULAR\" and \"NO_TRADING\". Weight: 5 * @@ -2356,8 +2357,11 @@ public ApiResponse modifyOrder(ModifyOrderRequest modifyOrd } /** - * New Algo Order(TRADE) Send in a new Algo order. * Condition orders will be triggered when: * - * If parameter`priceProtect`is sent as true: * when price reaches the + * New Algo Order(TRADE) Send in a new Algo order. * Algo order with type `STOP`, + * parameter `timeInForce` can be sent ( default `GTC`). * Algo order with + * type `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default + * `GTC`). * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the * symbol * \"triggerProtect\" of a symbol can be got from `GET @@ -2369,14 +2373,14 @@ public ApiResponse modifyOrder(ModifyOrderRequest modifyOrd * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after - * order placed <= `activationPrice`, and the latest price >= the - * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed - * >= `activationPrice`, and the latest price <= the highest price * - * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error * code. ``{\"code\": -2021, \"msg\": \"Order would * immediately trigger.\"}`` means that the parameters you send do not meet the - * following requirements: * BUY: `activationPrice` should be smaller than latest - * price. * SELL: `activationPrice` should be larger than latest price. * + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with * `closePosition`=`true`: * Follow the same rules for condition * orders. * If triggered,**close all** current long position( if `SELL`) or current @@ -2409,40 +2413,10 @@ public ApiResponse newAlgoOrder(NewAlgoOrderRequest newAlg } /** - * New Order(TRADE) Send in a new order. * Order with type `STOP`, parameter - * `timeInForce` can be sent ( default `GTC`). * Order with type - * `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default - * `GTC`). * Condition orders will be triggered when: * If - * parameter`priceProtect`is sent as true: * when price reaches the - * `stopPrice` ,the difference rate between \"MARK_PRICE\" and - * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the - * symbol * \"triggerProtect\" of a symbol can be got from `GET - * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price - * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `stopPrice` * - * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= - * `stopPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: - * latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= - * `stopPrice` * SELL: latest price (\"MARK_PRICE\" or - * \"CONTRACT_PRICE\") >= `stopPrice` * - * `TRAILING_STOP_MARKET`: * BUY: the lowest price after order placed `<= - * `activationPrice`, and the latest price >`= the lowest price * (1 + - * `callbackRate`) * SELL: the highest price after order placed >= - * `activationPrice`, and the latest price <= the highest price * (1 - - * `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. - * ``{\"code\": -2021, \"msg\": \"Order would immediately - * trigger.\"}`` means that the parameters you send do not meet the following - * requirements: * BUY: `activationPrice` should be smaller than latest price. * SELL: - * `activationPrice` should be larger than latest price. * If `newOrderRespType - * ` is sent as `RESULT` : * `MARKET` order: the final FILLED result of - * the order will be return directly. * `LIMIT` order with special - * `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be - * returned directly. * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with - * `closePosition`=`true`: * Follow the same rules for condition - * orders. * If triggered,**close all** current long position( if `SELL`) or current - * short position( if `BUY`). * Cannot be used with `quantity` paremeter * - * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with - * `BUY` orders in `LONG` position side. and cannot be used with - * `SELL` orders in `SHORT` position side * + * New Order(TRADE) Send in a new order. * If `newOrderRespType ` is sent as + * `RESULT` : * `MARKET` order: the final FILLED result of the order will be + * return directly. * `LIMIT` order with special `timeInForce`: the final + * status result of the order(FILLED or EXPIRED) will be returned directly. * * `selfTradePreventionMode` is only effective when `timeInForce` set to * `IOC` or `GTC` or `GTD`. * In extreme market conditions, * timeInForce `GTD` order auto cancel time might be delayed comparing to diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java index 0d8915e81..1fb52c6af 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/MarketDataApi.java @@ -77,7 +77,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -5244,9 +5244,10 @@ private okhttp3.Call tradingScheduleValidateBeforeCall() throws ApiException { } /** - * Trading Schedule Trading session schedules for a one-week period starting from the day prior - * to the query time, covering both the U.S. equity and commodity markets. Equity market session - * types include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", + * Trading Schedule Trading session schedules for the underlying assets of TradFi Perps are + * provided for a one-week period starting from the day prior to the query time, covering both + * the U.S. equity and commodity markets. Equity market session types include + * \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", * \"OVERNIGHT\", and \"NO_TRADING\", while commodity market session types * include \"REGULAR\" and \"NO_TRADING\". Weight: 5 * diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java index c3393389a..6a893ba85 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java index ae631f312..229f2f79c 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/TradeApi.java @@ -92,7 +92,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -3478,11 +3478,10 @@ private okhttp3.Call newAlgoOrderCall(NewAlgoOrderRequest newAlgoOrderRequest) localVarFormParams.put("reduceOnly", newAlgoOrderRequest.getReduceOnly()); } - if (newAlgoOrderRequest.getActivationPrice() != null) { + if (newAlgoOrderRequest.getActivatePrice() != null) { localVarFormParams.put( - "activationPrice", - DecimalFormatter.getFormatter() - .format(newAlgoOrderRequest.getActivationPrice())); + "activatePrice", + DecimalFormatter.getFormatter().format(newAlgoOrderRequest.getActivatePrice())); } if (newAlgoOrderRequest.getCallbackRate() != null) { @@ -3570,8 +3569,11 @@ private okhttp3.Call newAlgoOrderValidateBeforeCall(NewAlgoOrderRequest newAlgoO } /** - * New Algo Order(TRADE) Send in a new Algo order. * Condition orders will be triggered when: * - * If parameter`priceProtect`is sent as true: * when price reaches the + * New Algo Order(TRADE) Send in a new Algo order. * Algo order with type `STOP`, + * parameter `timeInForce` can be sent ( default `GTC`). * Algo order with + * type `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default + * `GTC`). * Condition orders will be triggered when: * If + * parameter`priceProtect`is sent as true: * when price reaches the * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the * symbol * \"triggerProtect\" of a symbol can be got from `GET @@ -3583,14 +3585,14 @@ private okhttp3.Call newAlgoOrderValidateBeforeCall(NewAlgoOrderRequest newAlgoO * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after - * order placed <= `activationPrice`, and the latest price >= the - * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed - * >= `activationPrice`, and the latest price <= the highest price * - * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error * code. ``{\"code\": -2021, \"msg\": \"Order would * immediately trigger.\"}`` means that the parameters you send do not meet the - * following requirements: * BUY: `activationPrice` should be smaller than latest - * price. * SELL: `activationPrice` should be larger than latest price. * + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with * `closePosition`=`true`: * Follow the same rules for condition * orders. * If triggered,**close all** current long position( if `SELL`) or current @@ -3706,36 +3708,6 @@ private okhttp3.Call newOrderCall(NewOrderRequest newOrderRequest) throws ApiExc localVarFormParams.put("newClientOrderId", newOrderRequest.getNewClientOrderId()); } - if (newOrderRequest.getStopPrice() != null) { - localVarFormParams.put( - "stopPrice", - DecimalFormatter.getFormatter().format(newOrderRequest.getStopPrice())); - } - - if (newOrderRequest.getClosePosition() != null) { - localVarFormParams.put("closePosition", newOrderRequest.getClosePosition()); - } - - if (newOrderRequest.getActivationPrice() != null) { - localVarFormParams.put( - "activationPrice", - DecimalFormatter.getFormatter().format(newOrderRequest.getActivationPrice())); - } - - if (newOrderRequest.getCallbackRate() != null) { - localVarFormParams.put( - "callbackRate", - DecimalFormatter.getFormatter().format(newOrderRequest.getCallbackRate())); - } - - if (newOrderRequest.getWorkingType() != null) { - localVarFormParams.put("workingType", newOrderRequest.getWorkingType()); - } - - if (newOrderRequest.getPriceProtect() != null) { - localVarFormParams.put("priceProtect", newOrderRequest.getPriceProtect()); - } - if (newOrderRequest.getNewOrderRespType() != null) { localVarFormParams.put("newOrderRespType", newOrderRequest.getNewOrderRespType()); } @@ -3819,40 +3791,10 @@ private okhttp3.Call newOrderValidateBeforeCall(NewOrderRequest newOrderRequest) } /** - * New Order(TRADE) Send in a new order. * Order with type `STOP`, parameter - * `timeInForce` can be sent ( default `GTC`). * Order with type - * `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default - * `GTC`). * Condition orders will be triggered when: * If - * parameter`priceProtect`is sent as true: * when price reaches the - * `stopPrice` ,the difference rate between \"MARK_PRICE\" and - * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the - * symbol * \"triggerProtect\" of a symbol can be got from `GET - * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price - * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `stopPrice` * - * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= - * `stopPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: - * latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= - * `stopPrice` * SELL: latest price (\"MARK_PRICE\" or - * \"CONTRACT_PRICE\") >= `stopPrice` * - * `TRAILING_STOP_MARKET`: * BUY: the lowest price after order placed `<= - * `activationPrice`, and the latest price >`= the lowest price * (1 + - * `callbackRate`) * SELL: the highest price after order placed >= - * `activationPrice`, and the latest price <= the highest price * (1 - - * `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. - * ``{\"code\": -2021, \"msg\": \"Order would immediately - * trigger.\"}`` means that the parameters you send do not meet the following - * requirements: * BUY: `activationPrice` should be smaller than latest price. * SELL: - * `activationPrice` should be larger than latest price. * If `newOrderRespType - * ` is sent as `RESULT` : * `MARKET` order: the final FILLED result of - * the order will be return directly. * `LIMIT` order with special - * `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be - * returned directly. * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with - * `closePosition`=`true`: * Follow the same rules for condition - * orders. * If triggered,**close all** current long position( if `SELL`) or current - * short position( if `BUY`). * Cannot be used with `quantity` paremeter * - * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with - * `BUY` orders in `LONG` position side. and cannot be used with - * `SELL` orders in `SHORT` position side * + * New Order(TRADE) Send in a new order. * If `newOrderRespType ` is sent as + * `RESULT` : * `MARKET` order: the final FILLED result of the order will be + * return directly. * `LIMIT` order with special `timeInForce`: the final + * status result of the order(FILLED or EXPIRED) will be returned directly. * * `selfTradePreventionMode` is only effective when `timeInForce` set to * `IOC` or `GTC` or `GTD`. * In extreme market conditions, * timeInForce `GTD` order auto cancel time might be delayed comparing to diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java index bc423897d..e454ca062 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/api/UserDataStreamsApi.java @@ -43,7 +43,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java index 0defa032f..47090dc12 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java @@ -254,87 +254,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @jakarta.annotation.Nullable private String newClientOrderId; - public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; - - @SerializedName(SERIALIZED_NAME_STOP_PRICE) - @jakarta.annotation.Nullable - private String stopPrice; - - public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; - - @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) - @jakarta.annotation.Nullable - private String activationPrice; - - public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; - - @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) - @jakarta.annotation.Nullable - private String callbackRate; - - /** Gets or Sets workingType */ - @JsonAdapter(WorkingTypeEnum.Adapter.class) - public enum WorkingTypeEnum { - MARK_PRICE("MARK_PRICE"), - - CONTRACT_PRICE("CONTRACT_PRICE"); - - private String value; - - WorkingTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - public static WorkingTypeEnum fromValue(String value) { - for (WorkingTypeEnum b : WorkingTypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final WorkingTypeEnum enumeration) - throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public WorkingTypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return WorkingTypeEnum.fromValue(value); - } - } - - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - String value = jsonElement.getAsString(); - WorkingTypeEnum.fromValue(value); - } - } - - public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; - - @SerializedName(SERIALIZED_NAME_WORKING_TYPE) - @jakarta.annotation.Nullable - private WorkingTypeEnum workingType; - - public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; - - @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) - @jakarta.annotation.Nullable - private String priceProtect; - /** Gets or Sets newOrderRespType */ @JsonAdapter(NewOrderRespTypeEnum.Adapter.class) public enum NewOrderRespTypeEnum { @@ -709,106 +628,6 @@ public void setNewClientOrderId(@jakarta.annotation.Nullable String newClientOrd this.newClientOrderId = newClientOrderId; } - public BatchOrdersPlaceMultipleOrdersInner stopPrice( - @jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; - return this; - } - - /** - * Get stopPrice - * - * @return stopPrice - */ - @jakarta.annotation.Nullable - public String getStopPrice() { - return stopPrice; - } - - public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; - } - - public BatchOrdersPlaceMultipleOrdersInner activationPrice( - @jakarta.annotation.Nullable String activationPrice) { - this.activationPrice = activationPrice; - return this; - } - - /** - * Get activationPrice - * - * @return activationPrice - */ - @jakarta.annotation.Nullable - public String getActivationPrice() { - return activationPrice; - } - - public void setActivationPrice(@jakarta.annotation.Nullable String activationPrice) { - this.activationPrice = activationPrice; - } - - public BatchOrdersPlaceMultipleOrdersInner callbackRate( - @jakarta.annotation.Nullable String callbackRate) { - this.callbackRate = callbackRate; - return this; - } - - /** - * Get callbackRate - * - * @return callbackRate - */ - @jakarta.annotation.Nullable - public String getCallbackRate() { - return callbackRate; - } - - public void setCallbackRate(@jakarta.annotation.Nullable String callbackRate) { - this.callbackRate = callbackRate; - } - - public BatchOrdersPlaceMultipleOrdersInner workingType( - @jakarta.annotation.Nullable WorkingTypeEnum workingType) { - this.workingType = workingType; - return this; - } - - /** - * Get workingType - * - * @return workingType - */ - @jakarta.annotation.Nullable - public WorkingTypeEnum getWorkingType() { - return workingType; - } - - public void setWorkingType(@jakarta.annotation.Nullable WorkingTypeEnum workingType) { - this.workingType = workingType; - } - - public BatchOrdersPlaceMultipleOrdersInner priceProtect( - @jakarta.annotation.Nullable String priceProtect) { - this.priceProtect = priceProtect; - return this; - } - - /** - * Get priceProtect - * - * @return priceProtect - */ - @jakarta.annotation.Nullable - public String getPriceProtect() { - return priceProtect; - } - - public void setPriceProtect(@jakarta.annotation.Nullable String priceProtect) { - this.priceProtect = priceProtect; - } - public BatchOrdersPlaceMultipleOrdersInner newOrderRespType( @jakarta.annotation.Nullable NewOrderRespTypeEnum newOrderRespType) { this.newOrderRespType = newOrderRespType; @@ -912,14 +731,6 @@ public boolean equals(Object o) { && Objects.equals(this.price, batchOrdersPlaceMultipleOrdersInner.price) && Objects.equals( this.newClientOrderId, batchOrdersPlaceMultipleOrdersInner.newClientOrderId) - && Objects.equals(this.stopPrice, batchOrdersPlaceMultipleOrdersInner.stopPrice) - && Objects.equals( - this.activationPrice, batchOrdersPlaceMultipleOrdersInner.activationPrice) - && Objects.equals( - this.callbackRate, batchOrdersPlaceMultipleOrdersInner.callbackRate) - && Objects.equals(this.workingType, batchOrdersPlaceMultipleOrdersInner.workingType) - && Objects.equals( - this.priceProtect, batchOrdersPlaceMultipleOrdersInner.priceProtect) && Objects.equals( this.newOrderRespType, batchOrdersPlaceMultipleOrdersInner.newOrderRespType) && Objects.equals(this.priceMatch, batchOrdersPlaceMultipleOrdersInner.priceMatch) @@ -942,11 +753,6 @@ public int hashCode() { reduceOnly, price, newClientOrderId, - stopPrice, - activationPrice, - callbackRate, - workingType, - priceProtect, newOrderRespType, priceMatch, selfTradePreventionMode, @@ -966,11 +772,6 @@ public String toString() { sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" newClientOrderId: ").append(toIndentedString(newClientOrderId)).append("\n"); - sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); - sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); - sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); - sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); - sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); sb.append(" selfTradePreventionMode: ") @@ -1020,26 +821,6 @@ public String toUrlQueryString() { String newClientOrderIdValueAsString = ""; newClientOrderIdValueAsString = newClientOrderIdValue.toString(); sb.append("newClientOrderId=").append(urlEncode(newClientOrderIdValueAsString)).append(""); - Object stopPriceValue = getStopPrice(); - String stopPriceValueAsString = ""; - stopPriceValueAsString = stopPriceValue.toString(); - sb.append("stopPrice=").append(urlEncode(stopPriceValueAsString)).append(""); - Object activationPriceValue = getActivationPrice(); - String activationPriceValueAsString = ""; - activationPriceValueAsString = activationPriceValue.toString(); - sb.append("activationPrice=").append(urlEncode(activationPriceValueAsString)).append(""); - Object callbackRateValue = getCallbackRate(); - String callbackRateValueAsString = ""; - callbackRateValueAsString = callbackRateValue.toString(); - sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); - Object workingTypeValue = getWorkingType(); - String workingTypeValueAsString = ""; - workingTypeValueAsString = workingTypeValue.toString(); - sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); - Object priceProtectValue = getPriceProtect(); - String priceProtectValueAsString = ""; - priceProtectValueAsString = priceProtectValue.toString(); - sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); Object newOrderRespTypeValue = getNewOrderRespType(); String newOrderRespTypeValueAsString = ""; newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); @@ -1095,11 +876,6 @@ private String toIndentedString(Object o) { openapiFields.add("reduceOnly"); openapiFields.add("price"); openapiFields.add("newClientOrderId"); - openapiFields.add("stopPrice"); - openapiFields.add("activationPrice"); - openapiFields.add("callbackRate"); - openapiFields.add("workingType"); - openapiFields.add("priceProtect"); openapiFields.add("newOrderRespType"); openapiFields.add("priceMatch"); openapiFields.add("selfTradePreventionMode"); @@ -1214,50 +990,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("newClientOrderId").toString())); } - if ((jsonObj.get("stopPrice") != null && !jsonObj.get("stopPrice").isJsonNull()) - && !jsonObj.get("stopPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stopPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("stopPrice").toString())); - } - if ((jsonObj.get("activationPrice") != null && !jsonObj.get("activationPrice").isJsonNull()) - && !jsonObj.get("activationPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activationPrice` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("activationPrice").toString())); - } - if ((jsonObj.get("callbackRate") != null && !jsonObj.get("callbackRate").isJsonNull()) - && !jsonObj.get("callbackRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `callbackRate` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("callbackRate").toString())); - } - if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) - && !jsonObj.get("workingType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `workingType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("workingType").toString())); - } - // validate the optional field `workingType` - if (jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) { - WorkingTypeEnum.validateJsonElement(jsonObj.get("workingType")); - } - if ((jsonObj.get("priceProtect") != null && !jsonObj.get("priceProtect").isJsonNull()) - && !jsonObj.get("priceProtect").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `priceProtect` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("priceProtect").toString())); - } if ((jsonObj.get("newOrderRespType") != null && !jsonObj.get("newOrderRespType").isJsonNull()) && !jsonObj.get("newOrderRespType").isJsonPrimitive()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java index 61e881cde..d0a7a62f3 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java @@ -121,11 +121,11 @@ public class NewAlgoOrderRequest { @jakarta.annotation.Nullable private String reduceOnly; - public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; + public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; - @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) + @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) @jakarta.annotation.Nullable - private Double activationPrice; + private Double activatePrice; public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; @@ -439,25 +439,24 @@ public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { this.reduceOnly = reduceOnly; } - public NewAlgoOrderRequest activationPrice( - @jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; + public NewAlgoOrderRequest activatePrice(@jakarta.annotation.Nullable Double activatePrice) { + this.activatePrice = activatePrice; return this; } /** - * Get activationPrice + * Get activatePrice * - * @return activationPrice + * @return activatePrice */ @jakarta.annotation.Nullable @Valid - public Double getActivationPrice() { - return activationPrice; + public Double getActivatePrice() { + return activatePrice; } - public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; + public void setActivatePrice(@jakarta.annotation.Nullable Double activatePrice) { + this.activatePrice = activatePrice; } public NewAlgoOrderRequest callbackRate(@jakarta.annotation.Nullable Double callbackRate) { @@ -582,7 +581,7 @@ public boolean equals(Object o) { && Objects.equals(this.closePosition, newAlgoOrderRequest.closePosition) && Objects.equals(this.priceProtect, newAlgoOrderRequest.priceProtect) && Objects.equals(this.reduceOnly, newAlgoOrderRequest.reduceOnly) - && Objects.equals(this.activationPrice, newAlgoOrderRequest.activationPrice) + && Objects.equals(this.activatePrice, newAlgoOrderRequest.activatePrice) && Objects.equals(this.callbackRate, newAlgoOrderRequest.callbackRate) && Objects.equals(this.clientAlgoId, newAlgoOrderRequest.clientAlgoId) && Objects.equals( @@ -608,7 +607,7 @@ public int hashCode() { closePosition, priceProtect, reduceOnly, - activationPrice, + activatePrice, callbackRate, clientAlgoId, selfTradePreventionMode, @@ -634,7 +633,7 @@ public String toString() { sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); + sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); sb.append(" selfTradePreventionMode: ") @@ -705,10 +704,10 @@ public String toUrlQueryString() { String reduceOnlyValueAsString = ""; reduceOnlyValueAsString = reduceOnlyValue.toString(); sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object activationPriceValue = getActivationPrice(); - String activationPriceValueAsString = ""; - activationPriceValueAsString = activationPriceValue.toString(); - sb.append("activationPrice=").append(urlEncode(activationPriceValueAsString)).append(""); + Object activatePriceValue = getActivatePrice(); + String activatePriceValueAsString = ""; + activatePriceValueAsString = activatePriceValue.toString(); + sb.append("activatePrice=").append(urlEncode(activatePriceValueAsString)).append(""); Object callbackRateValue = getCallbackRate(); String callbackRateValueAsString = ""; callbackRateValueAsString = callbackRateValue.toString(); @@ -773,7 +772,7 @@ private String toIndentedString(Object o) { openapiFields.add("closePosition"); openapiFields.add("priceProtect"); openapiFields.add("reduceOnly"); - openapiFields.add("activationPrice"); + openapiFields.add("activatePrice"); openapiFields.add("callbackRate"); openapiFields.add("clientAlgoId"); openapiFields.add("selfTradePreventionMode"); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java index 69e2420ba..787aab6e1 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderRequest.java @@ -91,42 +91,6 @@ public class NewOrderRequest { @jakarta.annotation.Nullable private String newClientOrderId; - public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; - - @SerializedName(SERIALIZED_NAME_STOP_PRICE) - @jakarta.annotation.Nullable - private Double stopPrice; - - public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; - - @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) - @jakarta.annotation.Nullable - private String closePosition; - - public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; - - @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) - @jakarta.annotation.Nullable - private Double activationPrice; - - public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; - - @SerializedName(SERIALIZED_NAME_CALLBACK_RATE) - @jakarta.annotation.Nullable - private Double callbackRate; - - public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; - - @SerializedName(SERIALIZED_NAME_WORKING_TYPE) - @jakarta.annotation.Nullable - private WorkingType workingType; - - public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; - - @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) - @jakarta.annotation.Nullable - private String priceProtect; - public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) @@ -339,124 +303,6 @@ public void setNewClientOrderId(@jakarta.annotation.Nullable String newClientOrd this.newClientOrderId = newClientOrderId; } - public NewOrderRequest stopPrice(@jakarta.annotation.Nullable Double stopPrice) { - this.stopPrice = stopPrice; - return this; - } - - /** - * Get stopPrice - * - * @return stopPrice - */ - @jakarta.annotation.Nullable - @Valid - public Double getStopPrice() { - return stopPrice; - } - - public void setStopPrice(@jakarta.annotation.Nullable Double stopPrice) { - this.stopPrice = stopPrice; - } - - public NewOrderRequest closePosition(@jakarta.annotation.Nullable String closePosition) { - this.closePosition = closePosition; - return this; - } - - /** - * Get closePosition - * - * @return closePosition - */ - @jakarta.annotation.Nullable - public String getClosePosition() { - return closePosition; - } - - public void setClosePosition(@jakarta.annotation.Nullable String closePosition) { - this.closePosition = closePosition; - } - - public NewOrderRequest activationPrice(@jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; - return this; - } - - /** - * Get activationPrice - * - * @return activationPrice - */ - @jakarta.annotation.Nullable - @Valid - public Double getActivationPrice() { - return activationPrice; - } - - public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; - } - - public NewOrderRequest callbackRate(@jakarta.annotation.Nullable Double callbackRate) { - this.callbackRate = callbackRate; - return this; - } - - /** - * Get callbackRate - * - * @return callbackRate - */ - @jakarta.annotation.Nullable - @Valid - public Double getCallbackRate() { - return callbackRate; - } - - public void setCallbackRate(@jakarta.annotation.Nullable Double callbackRate) { - this.callbackRate = callbackRate; - } - - public NewOrderRequest workingType(@jakarta.annotation.Nullable WorkingType workingType) { - this.workingType = workingType; - return this; - } - - /** - * Get workingType - * - * @return workingType - */ - @jakarta.annotation.Nullable - @Valid - public WorkingType getWorkingType() { - return workingType; - } - - public void setWorkingType(@jakarta.annotation.Nullable WorkingType workingType) { - this.workingType = workingType; - } - - public NewOrderRequest priceProtect(@jakarta.annotation.Nullable String priceProtect) { - this.priceProtect = priceProtect; - return this; - } - - /** - * Get priceProtect - * - * @return priceProtect - */ - @jakarta.annotation.Nullable - public String getPriceProtect() { - return priceProtect; - } - - public void setPriceProtect(@jakarta.annotation.Nullable String priceProtect) { - this.priceProtect = priceProtect; - } - public NewOrderRequest newOrderRespType( @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { this.newOrderRespType = newOrderRespType; @@ -577,12 +423,6 @@ public boolean equals(Object o) { && Objects.equals(this.reduceOnly, newOrderRequest.reduceOnly) && Objects.equals(this.price, newOrderRequest.price) && Objects.equals(this.newClientOrderId, newOrderRequest.newClientOrderId) - && Objects.equals(this.stopPrice, newOrderRequest.stopPrice) - && Objects.equals(this.closePosition, newOrderRequest.closePosition) - && Objects.equals(this.activationPrice, newOrderRequest.activationPrice) - && Objects.equals(this.callbackRate, newOrderRequest.callbackRate) - && Objects.equals(this.workingType, newOrderRequest.workingType) - && Objects.equals(this.priceProtect, newOrderRequest.priceProtect) && Objects.equals(this.newOrderRespType, newOrderRequest.newOrderRespType) && Objects.equals(this.priceMatch, newOrderRequest.priceMatch) && Objects.equals( @@ -603,12 +443,6 @@ public int hashCode() { reduceOnly, price, newClientOrderId, - stopPrice, - closePosition, - activationPrice, - callbackRate, - workingType, - priceProtect, newOrderRespType, priceMatch, selfTradePreventionMode, @@ -629,12 +463,6 @@ public String toString() { sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" newClientOrderId: ").append(toIndentedString(newClientOrderId)).append("\n"); - sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); - sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); - sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); - sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); - sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); - sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); sb.append(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); sb.append(" selfTradePreventionMode: ") @@ -685,30 +513,6 @@ public String toUrlQueryString() { String newClientOrderIdValueAsString = ""; newClientOrderIdValueAsString = newClientOrderIdValue.toString(); sb.append("newClientOrderId=").append(urlEncode(newClientOrderIdValueAsString)).append(""); - Object stopPriceValue = getStopPrice(); - String stopPriceValueAsString = ""; - stopPriceValueAsString = stopPriceValue.toString(); - sb.append("stopPrice=").append(urlEncode(stopPriceValueAsString)).append(""); - Object closePositionValue = getClosePosition(); - String closePositionValueAsString = ""; - closePositionValueAsString = closePositionValue.toString(); - sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); - Object activationPriceValue = getActivationPrice(); - String activationPriceValueAsString = ""; - activationPriceValueAsString = activationPriceValue.toString(); - sb.append("activationPrice=").append(urlEncode(activationPriceValueAsString)).append(""); - Object callbackRateValue = getCallbackRate(); - String callbackRateValueAsString = ""; - callbackRateValueAsString = callbackRateValue.toString(); - sb.append("callbackRate=").append(urlEncode(callbackRateValueAsString)).append(""); - Object workingTypeValue = getWorkingType(); - String workingTypeValueAsString = ""; - workingTypeValueAsString = workingTypeValue.toString(); - sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); - Object priceProtectValue = getPriceProtect(); - String priceProtectValueAsString = ""; - priceProtectValueAsString = priceProtectValue.toString(); - sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); Object newOrderRespTypeValue = getNewOrderRespType(); String newOrderRespTypeValueAsString = ""; newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); @@ -768,12 +572,6 @@ private String toIndentedString(Object o) { openapiFields.add("reduceOnly"); openapiFields.add("price"); openapiFields.add("newClientOrderId"); - openapiFields.add("stopPrice"); - openapiFields.add("closePosition"); - openapiFields.add("activationPrice"); - openapiFields.add("callbackRate"); - openapiFields.add("workingType"); - openapiFields.add("priceProtect"); openapiFields.add("newOrderRespType"); openapiFields.add("priceMatch"); openapiFields.add("selfTradePreventionMode"); @@ -856,26 +654,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " JSON string but got `%s`", jsonObj.get("newClientOrderId").toString())); } - if ((jsonObj.get("closePosition") != null && !jsonObj.get("closePosition").isJsonNull()) - && !jsonObj.get("closePosition").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `closePosition` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("closePosition").toString())); - } - // validate the optional field `workingType` - if (jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) { - WorkingType.validateJsonElement(jsonObj.get("workingType")); - } - if ((jsonObj.get("priceProtect") != null && !jsonObj.get("priceProtect").isJsonNull()) - && !jsonObj.get("priceProtect").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `priceProtect` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("priceProtect").toString())); - } // validate the optional field `newOrderRespType` if (jsonObj.get("newOrderRespType") != null && !jsonObj.get("newOrderRespType").isJsonNull()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java index dd4ba297e..3e9fa476b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewOrderResponse.java @@ -144,18 +144,6 @@ public class NewOrderResponse { @jakarta.annotation.Nullable private String origType; - public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; - - @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) - @jakarta.annotation.Nullable - private String activatePrice; - - public static final String SERIALIZED_NAME_PRICE_RATE = "priceRate"; - - @SerializedName(SERIALIZED_NAME_PRICE_RATE) - @jakarta.annotation.Nullable - private String priceRate; - public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; @SerializedName(SERIALIZED_NAME_UPDATE_TIME) @@ -537,44 +525,6 @@ public void setOrigType(@jakarta.annotation.Nullable String origType) { this.origType = origType; } - public NewOrderResponse activatePrice(@jakarta.annotation.Nullable String activatePrice) { - this.activatePrice = activatePrice; - return this; - } - - /** - * Get activatePrice - * - * @return activatePrice - */ - @jakarta.annotation.Nullable - public String getActivatePrice() { - return activatePrice; - } - - public void setActivatePrice(@jakarta.annotation.Nullable String activatePrice) { - this.activatePrice = activatePrice; - } - - public NewOrderResponse priceRate(@jakarta.annotation.Nullable String priceRate) { - this.priceRate = priceRate; - return this; - } - - /** - * Get priceRate - * - * @return priceRate - */ - @jakarta.annotation.Nullable - public String getPriceRate() { - return priceRate; - } - - public void setPriceRate(@jakarta.annotation.Nullable String priceRate) { - this.priceRate = priceRate; - } - public NewOrderResponse updateTime(@jakarta.annotation.Nullable Long updateTime) { this.updateTime = updateTime; return this; @@ -718,8 +668,6 @@ public boolean equals(Object o) { && Objects.equals(this.timeInForce, newOrderResponse.timeInForce) && Objects.equals(this.type, newOrderResponse.type) && Objects.equals(this.origType, newOrderResponse.origType) - && Objects.equals(this.activatePrice, newOrderResponse.activatePrice) - && Objects.equals(this.priceRate, newOrderResponse.priceRate) && Objects.equals(this.updateTime, newOrderResponse.updateTime) && Objects.equals(this.workingType, newOrderResponse.workingType) && Objects.equals(this.priceProtect, newOrderResponse.priceProtect) @@ -750,8 +698,6 @@ public int hashCode() { timeInForce, type, origType, - activatePrice, - priceRate, updateTime, workingType, priceProtect, @@ -782,8 +728,6 @@ public String toString() { sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" origType: ").append(toIndentedString(origType)).append("\n"); - sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); - sb.append(" priceRate: ").append(toIndentedString(priceRate)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); @@ -871,14 +815,6 @@ public String toUrlQueryString() { String origTypeValueAsString = ""; origTypeValueAsString = origTypeValue.toString(); sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); - Object activatePriceValue = getActivatePrice(); - String activatePriceValueAsString = ""; - activatePriceValueAsString = activatePriceValue.toString(); - sb.append("activatePrice=").append(urlEncode(activatePriceValueAsString)).append(""); - Object priceRateValue = getPriceRate(); - String priceRateValueAsString = ""; - priceRateValueAsString = priceRateValue.toString(); - sb.append("priceRate=").append(urlEncode(priceRateValueAsString)).append(""); Object updateTimeValue = getUpdateTime(); String updateTimeValueAsString = ""; updateTimeValueAsString = updateTimeValue.toString(); @@ -951,8 +887,6 @@ private String toIndentedString(Object o) { openapiFields.add("timeInForce"); openapiFields.add("type"); openapiFields.add("origType"); - openapiFields.add("activatePrice"); - openapiFields.add("priceRate"); openapiFields.add("updateTime"); openapiFields.add("workingType"); openapiFields.add("priceProtect"); @@ -1102,22 +1036,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("origType").toString())); } - if ((jsonObj.get("activatePrice") != null && !jsonObj.get("activatePrice").isJsonNull()) - && !jsonObj.get("activatePrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activatePrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("activatePrice").toString())); - } - if ((jsonObj.get("priceRate") != null && !jsonObj.get("priceRate").isJsonNull()) - && !jsonObj.get("priceRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `priceRate` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("priceRate").toString())); - } if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) && !jsonObj.get("workingType").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponseInner.java index b1b835c35..5b8396ebb 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/PlaceMultipleOrdersResponseInner.java @@ -138,18 +138,6 @@ public class PlaceMultipleOrdersResponseInner { @jakarta.annotation.Nullable private String origType; - public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; - - @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) - @jakarta.annotation.Nullable - private String activatePrice; - - public static final String SERIALIZED_NAME_PRICE_RATE = "priceRate"; - - @SerializedName(SERIALIZED_NAME_PRICE_RATE) - @jakarta.annotation.Nullable - private String priceRate; - public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; @SerializedName(SERIALIZED_NAME_UPDATE_TIME) @@ -530,46 +518,6 @@ public void setOrigType(@jakarta.annotation.Nullable String origType) { this.origType = origType; } - public PlaceMultipleOrdersResponseInner activatePrice( - @jakarta.annotation.Nullable String activatePrice) { - this.activatePrice = activatePrice; - return this; - } - - /** - * Get activatePrice - * - * @return activatePrice - */ - @jakarta.annotation.Nullable - public String getActivatePrice() { - return activatePrice; - } - - public void setActivatePrice(@jakarta.annotation.Nullable String activatePrice) { - this.activatePrice = activatePrice; - } - - public PlaceMultipleOrdersResponseInner priceRate( - @jakarta.annotation.Nullable String priceRate) { - this.priceRate = priceRate; - return this; - } - - /** - * Get priceRate - * - * @return priceRate - */ - @jakarta.annotation.Nullable - public String getPriceRate() { - return priceRate; - } - - public void setPriceRate(@jakarta.annotation.Nullable String priceRate) { - this.priceRate = priceRate; - } - public PlaceMultipleOrdersResponseInner updateTime( @jakarta.annotation.Nullable Long updateTime) { this.updateTime = updateTime; @@ -756,9 +704,6 @@ public boolean equals(Object o) { && Objects.equals(this.timeInForce, placeMultipleOrdersResponseInner.timeInForce) && Objects.equals(this.type, placeMultipleOrdersResponseInner.type) && Objects.equals(this.origType, placeMultipleOrdersResponseInner.origType) - && Objects.equals( - this.activatePrice, placeMultipleOrdersResponseInner.activatePrice) - && Objects.equals(this.priceRate, placeMultipleOrdersResponseInner.priceRate) && Objects.equals(this.updateTime, placeMultipleOrdersResponseInner.updateTime) && Objects.equals(this.workingType, placeMultipleOrdersResponseInner.workingType) && Objects.equals(this.priceProtect, placeMultipleOrdersResponseInner.priceProtect) @@ -791,8 +736,6 @@ public int hashCode() { timeInForce, type, origType, - activatePrice, - priceRate, updateTime, workingType, priceProtect, @@ -824,8 +767,6 @@ public String toString() { sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" origType: ").append(toIndentedString(origType)).append("\n"); - sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); - sb.append(" priceRate: ").append(toIndentedString(priceRate)).append("\n"); sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); @@ -911,14 +852,6 @@ public String toUrlQueryString() { String origTypeValueAsString = ""; origTypeValueAsString = origTypeValue.toString(); sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); - Object activatePriceValue = getActivatePrice(); - String activatePriceValueAsString = ""; - activatePriceValueAsString = activatePriceValue.toString(); - sb.append("activatePrice=").append(urlEncode(activatePriceValueAsString)).append(""); - Object priceRateValue = getPriceRate(); - String priceRateValueAsString = ""; - priceRateValueAsString = priceRateValue.toString(); - sb.append("priceRate=").append(urlEncode(priceRateValueAsString)).append(""); Object updateTimeValue = getUpdateTime(); String updateTimeValueAsString = ""; updateTimeValueAsString = updateTimeValue.toString(); @@ -998,8 +931,6 @@ private String toIndentedString(Object o) { openapiFields.add("timeInForce"); openapiFields.add("type"); openapiFields.add("origType"); - openapiFields.add("activatePrice"); - openapiFields.add("priceRate"); openapiFields.add("updateTime"); openapiFields.add("workingType"); openapiFields.add("priceProtect"); @@ -1152,22 +1083,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("origType").toString())); } - if ((jsonObj.get("activatePrice") != null && !jsonObj.get("activatePrice").isJsonNull()) - && !jsonObj.get("activatePrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activatePrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("activatePrice").toString())); - } - if ((jsonObj.get("priceRate") != null && !jsonObj.get("priceRate").isJsonNull()) - && !jsonObj.get("priceRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `priceRate` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("priceRate").toString())); - } if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) && !jsonObj.get("workingType").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java index 66ef220ab..3f557b7b4 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/JSON.java @@ -164,6 +164,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api .model.CancelOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api + .model.CancelOrderResponseRateLimitsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.websocket.api .model.CancelOrderResponseResult.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java index 3ab821975..39a63f3f7 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/DerivativesTradingUsdsFuturesWebSocketApi.java @@ -50,7 +50,7 @@ public class DerivativesTradingUsdsFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java index bf1389dd9..321bc7bcf 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApi.java @@ -261,14 +261,14 @@ private void modifyOrderValidateBeforeCall(ModifyOrderRequest modifyOrderRequest * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after - * order placed <= `activationPrice`, and the latest price >= the - * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed - * >= `activationPrice`, and the latest price <= the highest price * - * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error * code. ``{\"code\": -2021, \"msg\": \"Order would * immediately trigger.\"}`` means that the parameters you send do not meet the - * following requirements: * BUY: `activationPrice` should be smaller than latest - * price. * SELL: `activationPrice` should be larger than latest price. * + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with * `closePosition`=`true`: * Follow the same rules for condition * orders. * If triggered,**close all** current long position( if `SELL`) or current diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseResult.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseResult.java index 9314c2310..3e38e7a88 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseResult.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderResponseResult.java @@ -51,132 +51,17 @@ public class CancelAlgoOrderResponseResult extends BaseDTO { @jakarta.annotation.Nullable private String clientAlgoId; - public static final String SERIALIZED_NAME_ALGO_TYPE = "algoType"; + public static final String SERIALIZED_NAME_CODE = "code"; - @SerializedName(SERIALIZED_NAME_ALGO_TYPE) + @SerializedName(SERIALIZED_NAME_CODE) @jakarta.annotation.Nullable - private String algoType; + private String code; - public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + public static final String SERIALIZED_NAME_MSG = "msg"; - @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + @SerializedName(SERIALIZED_NAME_MSG) @jakarta.annotation.Nullable - private String orderType; - - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - - @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nullable - private String symbol; - - public static final String SERIALIZED_NAME_SIDE = "side"; - - @SerializedName(SERIALIZED_NAME_SIDE) - @jakarta.annotation.Nullable - private String side; - - public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; - - @SerializedName(SERIALIZED_NAME_POSITION_SIDE) - @jakarta.annotation.Nullable - private String positionSide; - - public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; - - @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) - @jakarta.annotation.Nullable - private String timeInForce; - - public static final String SERIALIZED_NAME_QUANTITY = "quantity"; - - @SerializedName(SERIALIZED_NAME_QUANTITY) - @jakarta.annotation.Nullable - private String quantity; - - public static final String SERIALIZED_NAME_ALGO_STATUS = "algoStatus"; - - @SerializedName(SERIALIZED_NAME_ALGO_STATUS) - @jakarta.annotation.Nullable - private String algoStatus; - - public static final String SERIALIZED_NAME_TRIGGER_PRICE = "triggerPrice"; - - @SerializedName(SERIALIZED_NAME_TRIGGER_PRICE) - @jakarta.annotation.Nullable - private String triggerPrice; - - public static final String SERIALIZED_NAME_PRICE = "price"; - - @SerializedName(SERIALIZED_NAME_PRICE) - @jakarta.annotation.Nullable - private String price; - - public static final String SERIALIZED_NAME_ICEBERG_QUANTITY = "icebergQuantity"; - - @SerializedName(SERIALIZED_NAME_ICEBERG_QUANTITY) - @jakarta.annotation.Nullable - private String icebergQuantity; - - public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = - "selfTradePreventionMode"; - - @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) - @jakarta.annotation.Nullable - private String selfTradePreventionMode; - - public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; - - @SerializedName(SERIALIZED_NAME_WORKING_TYPE) - @jakarta.annotation.Nullable - private String workingType; - - public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; - - @SerializedName(SERIALIZED_NAME_PRICE_MATCH) - @jakarta.annotation.Nullable - private String priceMatch; - - public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; - - @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) - @jakarta.annotation.Nullable - private Boolean closePosition; - - public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; - - @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) - @jakarta.annotation.Nullable - private Boolean priceProtect; - - public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; - - @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) - @jakarta.annotation.Nullable - private Boolean reduceOnly; - - public static final String SERIALIZED_NAME_CREATE_TIME = "createTime"; - - @SerializedName(SERIALIZED_NAME_CREATE_TIME) - @jakarta.annotation.Nullable - private Long createTime; - - public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; - - @SerializedName(SERIALIZED_NAME_UPDATE_TIME) - @jakarta.annotation.Nullable - private Long updateTime; - - public static final String SERIALIZED_NAME_TRIGGER_TIME = "triggerTime"; - - @SerializedName(SERIALIZED_NAME_TRIGGER_TIME) - @jakarta.annotation.Nullable - private Long triggerTime; - - public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; - - @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) - @jakarta.annotation.Nullable - private Long goodTillDate; + private String msg; public CancelAlgoOrderResponseResult() {} @@ -219,417 +104,42 @@ public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { this.clientAlgoId = clientAlgoId; } - public CancelAlgoOrderResponseResult algoType(@jakarta.annotation.Nullable String algoType) { - this.algoType = algoType; - return this; - } - - /** - * Get algoType - * - * @return algoType - */ - @jakarta.annotation.Nullable - public String getAlgoType() { - return algoType; - } - - public void setAlgoType(@jakarta.annotation.Nullable String algoType) { - this.algoType = algoType; - } - - public CancelAlgoOrderResponseResult orderType(@jakarta.annotation.Nullable String orderType) { - this.orderType = orderType; - return this; - } - - /** - * Get orderType - * - * @return orderType - */ - @jakarta.annotation.Nullable - public String getOrderType() { - return orderType; - } - - public void setOrderType(@jakarta.annotation.Nullable String orderType) { - this.orderType = orderType; - } - - public CancelAlgoOrderResponseResult symbol(@jakarta.annotation.Nullable String symbol) { - this.symbol = symbol; - return this; - } - - /** - * Get symbol - * - * @return symbol - */ - @jakarta.annotation.Nullable - public String getSymbol() { - return symbol; - } - - public void setSymbol(@jakarta.annotation.Nullable String symbol) { - this.symbol = symbol; - } - - public CancelAlgoOrderResponseResult side(@jakarta.annotation.Nullable String side) { - this.side = side; - return this; - } - - /** - * Get side - * - * @return side - */ - @jakarta.annotation.Nullable - public String getSide() { - return side; - } - - public void setSide(@jakarta.annotation.Nullable String side) { - this.side = side; - } - - public CancelAlgoOrderResponseResult positionSide( - @jakarta.annotation.Nullable String positionSide) { - this.positionSide = positionSide; - return this; - } - - /** - * Get positionSide - * - * @return positionSide - */ - @jakarta.annotation.Nullable - public String getPositionSide() { - return positionSide; - } - - public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { - this.positionSide = positionSide; - } - - public CancelAlgoOrderResponseResult timeInForce( - @jakarta.annotation.Nullable String timeInForce) { - this.timeInForce = timeInForce; - return this; - } - - /** - * Get timeInForce - * - * @return timeInForce - */ - @jakarta.annotation.Nullable - public String getTimeInForce() { - return timeInForce; - } - - public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { - this.timeInForce = timeInForce; - } - - public CancelAlgoOrderResponseResult quantity(@jakarta.annotation.Nullable String quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * - * @return quantity - */ - @jakarta.annotation.Nullable - public String getQuantity() { - return quantity; - } - - public void setQuantity(@jakarta.annotation.Nullable String quantity) { - this.quantity = quantity; - } - - public CancelAlgoOrderResponseResult algoStatus( - @jakarta.annotation.Nullable String algoStatus) { - this.algoStatus = algoStatus; - return this; - } - - /** - * Get algoStatus - * - * @return algoStatus - */ - @jakarta.annotation.Nullable - public String getAlgoStatus() { - return algoStatus; - } - - public void setAlgoStatus(@jakarta.annotation.Nullable String algoStatus) { - this.algoStatus = algoStatus; - } - - public CancelAlgoOrderResponseResult triggerPrice( - @jakarta.annotation.Nullable String triggerPrice) { - this.triggerPrice = triggerPrice; - return this; - } - - /** - * Get triggerPrice - * - * @return triggerPrice - */ - @jakarta.annotation.Nullable - public String getTriggerPrice() { - return triggerPrice; - } - - public void setTriggerPrice(@jakarta.annotation.Nullable String triggerPrice) { - this.triggerPrice = triggerPrice; - } - - public CancelAlgoOrderResponseResult price(@jakarta.annotation.Nullable String price) { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price - */ - @jakarta.annotation.Nullable - public String getPrice() { - return price; - } - - public void setPrice(@jakarta.annotation.Nullable String price) { - this.price = price; - } - - public CancelAlgoOrderResponseResult icebergQuantity( - @jakarta.annotation.Nullable String icebergQuantity) { - this.icebergQuantity = icebergQuantity; + public CancelAlgoOrderResponseResult code(@jakarta.annotation.Nullable String code) { + this.code = code; return this; } /** - * Get icebergQuantity + * Get code * - * @return icebergQuantity + * @return code */ @jakarta.annotation.Nullable - public String getIcebergQuantity() { - return icebergQuantity; + public String getCode() { + return code; } - public void setIcebergQuantity(@jakarta.annotation.Nullable String icebergQuantity) { - this.icebergQuantity = icebergQuantity; + public void setCode(@jakarta.annotation.Nullable String code) { + this.code = code; } - public CancelAlgoOrderResponseResult selfTradePreventionMode( - @jakarta.annotation.Nullable String selfTradePreventionMode) { - this.selfTradePreventionMode = selfTradePreventionMode; + public CancelAlgoOrderResponseResult msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; return this; } /** - * Get selfTradePreventionMode + * Get msg * - * @return selfTradePreventionMode + * @return msg */ @jakarta.annotation.Nullable - public String getSelfTradePreventionMode() { - return selfTradePreventionMode; - } - - public void setSelfTradePreventionMode( - @jakarta.annotation.Nullable String selfTradePreventionMode) { - this.selfTradePreventionMode = selfTradePreventionMode; + public String getMsg() { + return msg; } - public CancelAlgoOrderResponseResult workingType( - @jakarta.annotation.Nullable String workingType) { - this.workingType = workingType; - return this; - } - - /** - * Get workingType - * - * @return workingType - */ - @jakarta.annotation.Nullable - public String getWorkingType() { - return workingType; - } - - public void setWorkingType(@jakarta.annotation.Nullable String workingType) { - this.workingType = workingType; - } - - public CancelAlgoOrderResponseResult priceMatch( - @jakarta.annotation.Nullable String priceMatch) { - this.priceMatch = priceMatch; - return this; - } - - /** - * Get priceMatch - * - * @return priceMatch - */ - @jakarta.annotation.Nullable - public String getPriceMatch() { - return priceMatch; - } - - public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { - this.priceMatch = priceMatch; - } - - public CancelAlgoOrderResponseResult closePosition( - @jakarta.annotation.Nullable Boolean closePosition) { - this.closePosition = closePosition; - return this; - } - - /** - * Get closePosition - * - * @return closePosition - */ - @jakarta.annotation.Nullable - public Boolean getClosePosition() { - return closePosition; - } - - public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { - this.closePosition = closePosition; - } - - public CancelAlgoOrderResponseResult priceProtect( - @jakarta.annotation.Nullable Boolean priceProtect) { - this.priceProtect = priceProtect; - return this; - } - - /** - * Get priceProtect - * - * @return priceProtect - */ - @jakarta.annotation.Nullable - public Boolean getPriceProtect() { - return priceProtect; - } - - public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { - this.priceProtect = priceProtect; - } - - public CancelAlgoOrderResponseResult reduceOnly( - @jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; - return this; - } - - /** - * Get reduceOnly - * - * @return reduceOnly - */ - @jakarta.annotation.Nullable - public Boolean getReduceOnly() { - return reduceOnly; - } - - public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; - } - - public CancelAlgoOrderResponseResult createTime(@jakarta.annotation.Nullable Long createTime) { - this.createTime = createTime; - return this; - } - - /** - * Get createTime - * - * @return createTime - */ - @jakarta.annotation.Nullable - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(@jakarta.annotation.Nullable Long createTime) { - this.createTime = createTime; - } - - public CancelAlgoOrderResponseResult updateTime(@jakarta.annotation.Nullable Long updateTime) { - this.updateTime = updateTime; - return this; - } - - /** - * Get updateTime - * - * @return updateTime - */ - @jakarta.annotation.Nullable - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { - this.updateTime = updateTime; - } - - public CancelAlgoOrderResponseResult triggerTime( - @jakarta.annotation.Nullable Long triggerTime) { - this.triggerTime = triggerTime; - return this; - } - - /** - * Get triggerTime - * - * @return triggerTime - */ - @jakarta.annotation.Nullable - public Long getTriggerTime() { - return triggerTime; - } - - public void setTriggerTime(@jakarta.annotation.Nullable Long triggerTime) { - this.triggerTime = triggerTime; - } - - public CancelAlgoOrderResponseResult goodTillDate( - @jakarta.annotation.Nullable Long goodTillDate) { - this.goodTillDate = goodTillDate; - return this; - } - - /** - * Get goodTillDate - * - * @return goodTillDate - */ - @jakarta.annotation.Nullable - public Long getGoodTillDate() { - return goodTillDate; - } - - public void setGoodTillDate(@jakarta.annotation.Nullable Long goodTillDate) { - this.goodTillDate = goodTillDate; + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; } @Override @@ -644,58 +154,13 @@ public boolean equals(Object o) { (CancelAlgoOrderResponseResult) o; return Objects.equals(this.algoId, cancelAlgoOrderResponseResult.algoId) && Objects.equals(this.clientAlgoId, cancelAlgoOrderResponseResult.clientAlgoId) - && Objects.equals(this.algoType, cancelAlgoOrderResponseResult.algoType) - && Objects.equals(this.orderType, cancelAlgoOrderResponseResult.orderType) - && Objects.equals(this.symbol, cancelAlgoOrderResponseResult.symbol) - && Objects.equals(this.side, cancelAlgoOrderResponseResult.side) - && Objects.equals(this.positionSide, cancelAlgoOrderResponseResult.positionSide) - && Objects.equals(this.timeInForce, cancelAlgoOrderResponseResult.timeInForce) - && Objects.equals(this.quantity, cancelAlgoOrderResponseResult.quantity) - && Objects.equals(this.algoStatus, cancelAlgoOrderResponseResult.algoStatus) - && Objects.equals(this.triggerPrice, cancelAlgoOrderResponseResult.triggerPrice) - && Objects.equals(this.price, cancelAlgoOrderResponseResult.price) - && Objects.equals( - this.icebergQuantity, cancelAlgoOrderResponseResult.icebergQuantity) - && Objects.equals( - this.selfTradePreventionMode, - cancelAlgoOrderResponseResult.selfTradePreventionMode) - && Objects.equals(this.workingType, cancelAlgoOrderResponseResult.workingType) - && Objects.equals(this.priceMatch, cancelAlgoOrderResponseResult.priceMatch) - && Objects.equals(this.closePosition, cancelAlgoOrderResponseResult.closePosition) - && Objects.equals(this.priceProtect, cancelAlgoOrderResponseResult.priceProtect) - && Objects.equals(this.reduceOnly, cancelAlgoOrderResponseResult.reduceOnly) - && Objects.equals(this.createTime, cancelAlgoOrderResponseResult.createTime) - && Objects.equals(this.updateTime, cancelAlgoOrderResponseResult.updateTime) - && Objects.equals(this.triggerTime, cancelAlgoOrderResponseResult.triggerTime) - && Objects.equals(this.goodTillDate, cancelAlgoOrderResponseResult.goodTillDate); + && Objects.equals(this.code, cancelAlgoOrderResponseResult.code) + && Objects.equals(this.msg, cancelAlgoOrderResponseResult.msg); } @Override public int hashCode() { - return Objects.hash( - algoId, - clientAlgoId, - algoType, - orderType, - symbol, - side, - positionSide, - timeInForce, - quantity, - algoStatus, - triggerPrice, - price, - icebergQuantity, - selfTradePreventionMode, - workingType, - priceMatch, - closePosition, - priceProtect, - reduceOnly, - createTime, - updateTime, - triggerTime, - goodTillDate); + return Objects.hash(algoId, clientAlgoId, code, msg); } @Override @@ -704,29 +169,8 @@ public String toString() { sb.append("class CancelAlgoOrderResponseResult {\n"); sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); - sb.append(" algoType: ").append(toIndentedString(algoType)).append("\n"); - sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); - sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" algoStatus: ").append(toIndentedString(algoStatus)).append("\n"); - sb.append(" triggerPrice: ").append(toIndentedString(triggerPrice)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" icebergQuantity: ").append(toIndentedString(icebergQuantity)).append("\n"); - sb.append(" selfTradePreventionMode: ") - .append(toIndentedString(selfTradePreventionMode)) - .append("\n"); - sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); - sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); - sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); - sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); - sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" createTime: ").append(toIndentedString(createTime)).append("\n"); - sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); - sb.append(" triggerTime: ").append(toIndentedString(triggerTime)).append("\n"); - sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); sb.append("}"); return sb.toString(); } @@ -745,110 +189,15 @@ public String toUrlQueryString() { String clientAlgoIdValueAsString = clientAlgoIdValue.toString(); valMap.put("clientAlgoId", clientAlgoIdValueAsString); } - String algoTypeValue = getAlgoType(); - if (algoTypeValue != null) { - String algoTypeValueAsString = algoTypeValue.toString(); - valMap.put("algoType", algoTypeValueAsString); - } - String orderTypeValue = getOrderType(); - if (orderTypeValue != null) { - String orderTypeValueAsString = orderTypeValue.toString(); - valMap.put("orderType", orderTypeValueAsString); - } - String symbolValue = getSymbol(); - if (symbolValue != null) { - String symbolValueAsString = symbolValue.toString(); - valMap.put("symbol", symbolValueAsString); - } - String sideValue = getSide(); - if (sideValue != null) { - String sideValueAsString = sideValue.toString(); - valMap.put("side", sideValueAsString); - } - String positionSideValue = getPositionSide(); - if (positionSideValue != null) { - String positionSideValueAsString = positionSideValue.toString(); - valMap.put("positionSide", positionSideValueAsString); - } - String timeInForceValue = getTimeInForce(); - if (timeInForceValue != null) { - String timeInForceValueAsString = timeInForceValue.toString(); - valMap.put("timeInForce", timeInForceValueAsString); - } - String quantityValue = getQuantity(); - if (quantityValue != null) { - String quantityValueAsString = quantityValue.toString(); - valMap.put("quantity", quantityValueAsString); - } - String algoStatusValue = getAlgoStatus(); - if (algoStatusValue != null) { - String algoStatusValueAsString = algoStatusValue.toString(); - valMap.put("algoStatus", algoStatusValueAsString); - } - String triggerPriceValue = getTriggerPrice(); - if (triggerPriceValue != null) { - String triggerPriceValueAsString = triggerPriceValue.toString(); - valMap.put("triggerPrice", triggerPriceValueAsString); - } - String priceValue = getPrice(); - if (priceValue != null) { - String priceValueAsString = priceValue.toString(); - valMap.put("price", priceValueAsString); + String codeValue = getCode(); + if (codeValue != null) { + String codeValueAsString = codeValue.toString(); + valMap.put("code", codeValueAsString); } - String icebergQuantityValue = getIcebergQuantity(); - if (icebergQuantityValue != null) { - String icebergQuantityValueAsString = icebergQuantityValue.toString(); - valMap.put("icebergQuantity", icebergQuantityValueAsString); - } - String selfTradePreventionModeValue = getSelfTradePreventionMode(); - if (selfTradePreventionModeValue != null) { - String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); - valMap.put("selfTradePreventionMode", selfTradePreventionModeValueAsString); - } - String workingTypeValue = getWorkingType(); - if (workingTypeValue != null) { - String workingTypeValueAsString = workingTypeValue.toString(); - valMap.put("workingType", workingTypeValueAsString); - } - String priceMatchValue = getPriceMatch(); - if (priceMatchValue != null) { - String priceMatchValueAsString = priceMatchValue.toString(); - valMap.put("priceMatch", priceMatchValueAsString); - } - Boolean closePositionValue = getClosePosition(); - if (closePositionValue != null) { - String closePositionValueAsString = closePositionValue.toString(); - valMap.put("closePosition", closePositionValueAsString); - } - Boolean priceProtectValue = getPriceProtect(); - if (priceProtectValue != null) { - String priceProtectValueAsString = priceProtectValue.toString(); - valMap.put("priceProtect", priceProtectValueAsString); - } - Boolean reduceOnlyValue = getReduceOnly(); - if (reduceOnlyValue != null) { - String reduceOnlyValueAsString = reduceOnlyValue.toString(); - valMap.put("reduceOnly", reduceOnlyValueAsString); - } - Long createTimeValue = getCreateTime(); - if (createTimeValue != null) { - String createTimeValueAsString = createTimeValue.toString(); - valMap.put("createTime", createTimeValueAsString); - } - Long updateTimeValue = getUpdateTime(); - if (updateTimeValue != null) { - String updateTimeValueAsString = updateTimeValue.toString(); - valMap.put("updateTime", updateTimeValueAsString); - } - Long triggerTimeValue = getTriggerTime(); - if (triggerTimeValue != null) { - String triggerTimeValueAsString = triggerTimeValue.toString(); - valMap.put("triggerTime", triggerTimeValueAsString); - } - Long goodTillDateValue = getGoodTillDate(); - if (goodTillDateValue != null) { - String goodTillDateValueAsString = goodTillDateValue.toString(); - valMap.put("goodTillDate", goodTillDateValueAsString); + String msgValue = getMsg(); + if (msgValue != null) { + String msgValueAsString = msgValue.toString(); + valMap.put("msg", msgValueAsString); } valMap.put("timestamp", getTimestamp()); @@ -869,89 +218,13 @@ public Map toMap() { if (clientAlgoIdValue != null) { valMap.put("clientAlgoId", clientAlgoIdValue); } - Object algoTypeValue = getAlgoType(); - if (algoTypeValue != null) { - valMap.put("algoType", algoTypeValue); - } - Object orderTypeValue = getOrderType(); - if (orderTypeValue != null) { - valMap.put("orderType", orderTypeValue); + Object codeValue = getCode(); + if (codeValue != null) { + valMap.put("code", codeValue); } - Object symbolValue = getSymbol(); - if (symbolValue != null) { - valMap.put("symbol", symbolValue); - } - Object sideValue = getSide(); - if (sideValue != null) { - valMap.put("side", sideValue); - } - Object positionSideValue = getPositionSide(); - if (positionSideValue != null) { - valMap.put("positionSide", positionSideValue); - } - Object timeInForceValue = getTimeInForce(); - if (timeInForceValue != null) { - valMap.put("timeInForce", timeInForceValue); - } - Object quantityValue = getQuantity(); - if (quantityValue != null) { - valMap.put("quantity", quantityValue); - } - Object algoStatusValue = getAlgoStatus(); - if (algoStatusValue != null) { - valMap.put("algoStatus", algoStatusValue); - } - Object triggerPriceValue = getTriggerPrice(); - if (triggerPriceValue != null) { - valMap.put("triggerPrice", triggerPriceValue); - } - Object priceValue = getPrice(); - if (priceValue != null) { - valMap.put("price", priceValue); - } - Object icebergQuantityValue = getIcebergQuantity(); - if (icebergQuantityValue != null) { - valMap.put("icebergQuantity", icebergQuantityValue); - } - Object selfTradePreventionModeValue = getSelfTradePreventionMode(); - if (selfTradePreventionModeValue != null) { - valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); - } - Object workingTypeValue = getWorkingType(); - if (workingTypeValue != null) { - valMap.put("workingType", workingTypeValue); - } - Object priceMatchValue = getPriceMatch(); - if (priceMatchValue != null) { - valMap.put("priceMatch", priceMatchValue); - } - Object closePositionValue = getClosePosition(); - if (closePositionValue != null) { - valMap.put("closePosition", closePositionValue); - } - Object priceProtectValue = getPriceProtect(); - if (priceProtectValue != null) { - valMap.put("priceProtect", priceProtectValue); - } - Object reduceOnlyValue = getReduceOnly(); - if (reduceOnlyValue != null) { - valMap.put("reduceOnly", reduceOnlyValue); - } - Object createTimeValue = getCreateTime(); - if (createTimeValue != null) { - valMap.put("createTime", createTimeValue); - } - Object updateTimeValue = getUpdateTime(); - if (updateTimeValue != null) { - valMap.put("updateTime", updateTimeValue); - } - Object triggerTimeValue = getTriggerTime(); - if (triggerTimeValue != null) { - valMap.put("triggerTime", triggerTimeValue); - } - Object goodTillDateValue = getGoodTillDate(); - if (goodTillDateValue != null) { - valMap.put("goodTillDate", goodTillDateValue); + Object msgValue = getMsg(); + if (msgValue != null) { + valMap.put("msg", msgValue); } valMap.put("timestamp", getTimestamp()); @@ -981,27 +254,8 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("algoId"); openapiFields.add("clientAlgoId"); - openapiFields.add("algoType"); - openapiFields.add("orderType"); - openapiFields.add("symbol"); - openapiFields.add("side"); - openapiFields.add("positionSide"); - openapiFields.add("timeInForce"); - openapiFields.add("quantity"); - openapiFields.add("algoStatus"); - openapiFields.add("triggerPrice"); - openapiFields.add("price"); - openapiFields.add("icebergQuantity"); - openapiFields.add("selfTradePreventionMode"); - openapiFields.add("workingType"); - openapiFields.add("priceMatch"); - openapiFields.add("closePosition"); - openapiFields.add("priceProtect"); - openapiFields.add("reduceOnly"); - openapiFields.add("createTime"); - openapiFields.add("updateTime"); - openapiFields.add("triggerTime"); - openapiFields.add("goodTillDate"); + openapiFields.add("code"); + openapiFields.add("msg"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -1046,118 +300,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientAlgoId").toString())); } - if ((jsonObj.get("algoType") != null && !jsonObj.get("algoType").isJsonNull()) - && !jsonObj.get("algoType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `algoType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("algoType").toString())); - } - if ((jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonNull()) - && !jsonObj.get("orderType").isJsonPrimitive()) { + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) + && !jsonObj.get("code").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `orderType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("orderType").toString())); - } - if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) - && !jsonObj.get("symbol").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `symbol` to be a primitive type in the JSON string" + "Expected the field `code` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("symbol").toString())); - } - if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) - && !jsonObj.get("side").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `side` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("side").toString())); - } - if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) - && !jsonObj.get("positionSide").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `positionSide` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("positionSide").toString())); - } - if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) - && !jsonObj.get("timeInForce").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `timeInForce` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("timeInForce").toString())); + jsonObj.get("code").toString())); } - if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) - && !jsonObj.get("quantity").isJsonPrimitive()) { + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `quantity` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("quantity").toString())); - } - if ((jsonObj.get("algoStatus") != null && !jsonObj.get("algoStatus").isJsonNull()) - && !jsonObj.get("algoStatus").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `algoStatus` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("algoStatus").toString())); - } - if ((jsonObj.get("triggerPrice") != null && !jsonObj.get("triggerPrice").isJsonNull()) - && !jsonObj.get("triggerPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `triggerPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("triggerPrice").toString())); - } - if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) - && !jsonObj.get("price").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `price` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("price").toString())); - } - if ((jsonObj.get("icebergQuantity") != null && !jsonObj.get("icebergQuantity").isJsonNull()) - && !jsonObj.get("icebergQuantity").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `icebergQuantity` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("icebergQuantity").toString())); - } - if ((jsonObj.get("selfTradePreventionMode") != null - && !jsonObj.get("selfTradePreventionMode").isJsonNull()) - && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `selfTradePreventionMode` to be a primitive type in" - + " the JSON string but got `%s`", - jsonObj.get("selfTradePreventionMode").toString())); - } - if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) - && !jsonObj.get("workingType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `workingType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("workingType").toString())); - } - if ((jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) - && !jsonObj.get("priceMatch").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `priceMatch` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("priceMatch").toString())); + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); } } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java index c3aa53ca3..c4fa5d74e 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponse.java @@ -65,7 +65,7 @@ public class CancelOrderResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits; + private List<@Valid CancelOrderResponseRateLimitsInner> rateLimits; public CancelOrderResponse() {} @@ -130,13 +130,13 @@ public void setResult(@jakarta.annotation.Nullable CancelOrderResponseResult res public CancelOrderResponse rateLimits( @jakarta.annotation.Nullable - List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + List<@Valid CancelOrderResponseRateLimitsInner> rateLimits) { this.rateLimits = rateLimits; return this; } public CancelOrderResponse addRateLimitsItem( - CancelAlgoOrderResponseRateLimitsInner rateLimitsItem) { + CancelOrderResponseRateLimitsInner rateLimitsItem) { if (this.rateLimits == null) { this.rateLimits = new ArrayList<>(); } @@ -151,13 +151,13 @@ public CancelOrderResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid CancelAlgoOrderResponseRateLimitsInner> getRateLimits() { + public List<@Valid CancelOrderResponseRateLimitsInner> getRateLimits() { return rateLimits; } public void setRateLimits( @jakarta.annotation.Nullable - List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + List<@Valid CancelOrderResponseRateLimitsInner> rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +212,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + List<@Valid CancelOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -335,7 +335,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rateLimits` (array) for (int i = 0; i < jsonArrayrateLimits.size(); i++) { - CancelAlgoOrderResponseRateLimitsInner.validateJsonElement( + CancelOrderResponseRateLimitsInner.validateJsonElement( jsonArrayrateLimits.get(i)); } ; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponseRateLimitsInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponseRateLimitsInner.java new file mode 100644 index 000000000..c68e661af --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelOrderResponseRateLimitsInner.java @@ -0,0 +1,407 @@ +/* + * Binance Derivatives Trading USDS Futures WebSocket API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket API + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model; + +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** CancelOrderResponseRateLimitsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class CancelOrderResponseRateLimitsInner extends BaseDTO { + public static final String SERIALIZED_NAME_RATE_LIMIT_TYPE = "rateLimitType"; + + @SerializedName(SERIALIZED_NAME_RATE_LIMIT_TYPE) + @jakarta.annotation.Nullable + private String rateLimitType; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + + @SerializedName(SERIALIZED_NAME_INTERVAL) + @jakarta.annotation.Nullable + private String interval; + + public static final String SERIALIZED_NAME_INTERVAL_NUM = "intervalNum"; + + @SerializedName(SERIALIZED_NAME_INTERVAL_NUM) + @jakarta.annotation.Nullable + private Long intervalNum; + + public static final String SERIALIZED_NAME_LIMIT = "limit"; + + @SerializedName(SERIALIZED_NAME_LIMIT) + @jakarta.annotation.Nullable + private Long limit; + + public static final String SERIALIZED_NAME_COUNT = "count"; + + @SerializedName(SERIALIZED_NAME_COUNT) + @jakarta.annotation.Nullable + private Long count; + + public CancelOrderResponseRateLimitsInner() {} + + public CancelOrderResponseRateLimitsInner rateLimitType( + @jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + return this; + } + + /** + * Get rateLimitType + * + * @return rateLimitType + */ + @jakarta.annotation.Nullable + public String getRateLimitType() { + return rateLimitType; + } + + public void setRateLimitType(@jakarta.annotation.Nullable String rateLimitType) { + this.rateLimitType = rateLimitType; + } + + public CancelOrderResponseRateLimitsInner interval( + @jakarta.annotation.Nullable String interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * + * @return interval + */ + @jakarta.annotation.Nullable + public String getInterval() { + return interval; + } + + public void setInterval(@jakarta.annotation.Nullable String interval) { + this.interval = interval; + } + + public CancelOrderResponseRateLimitsInner intervalNum( + @jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + return this; + } + + /** + * Get intervalNum + * + * @return intervalNum + */ + @jakarta.annotation.Nullable + public Long getIntervalNum() { + return intervalNum; + } + + public void setIntervalNum(@jakarta.annotation.Nullable Long intervalNum) { + this.intervalNum = intervalNum; + } + + public CancelOrderResponseRateLimitsInner limit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + return this; + } + + /** + * Get limit + * + * @return limit + */ + @jakarta.annotation.Nullable + public Long getLimit() { + return limit; + } + + public void setLimit(@jakarta.annotation.Nullable Long limit) { + this.limit = limit; + } + + public CancelOrderResponseRateLimitsInner count(@jakarta.annotation.Nullable Long count) { + this.count = count; + return this; + } + + /** + * Get count + * + * @return count + */ + @jakarta.annotation.Nullable + public Long getCount() { + return count; + } + + public void setCount(@jakarta.annotation.Nullable Long count) { + this.count = count; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelOrderResponseRateLimitsInner cancelOrderResponseRateLimitsInner = + (CancelOrderResponseRateLimitsInner) o; + return Objects.equals(this.rateLimitType, cancelOrderResponseRateLimitsInner.rateLimitType) + && Objects.equals(this.interval, cancelOrderResponseRateLimitsInner.interval) + && Objects.equals(this.intervalNum, cancelOrderResponseRateLimitsInner.intervalNum) + && Objects.equals(this.limit, cancelOrderResponseRateLimitsInner.limit) + && Objects.equals(this.count, cancelOrderResponseRateLimitsInner.count); + } + + @Override + public int hashCode() { + return Objects.hash(rateLimitType, interval, intervalNum, limit, count); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CancelOrderResponseRateLimitsInner {\n"); + sb.append(" rateLimitType: ").append(toIndentedString(rateLimitType)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" intervalNum: ").append(toIndentedString(intervalNum)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + String rateLimitTypeValue = getRateLimitType(); + if (rateLimitTypeValue != null) { + String rateLimitTypeValueAsString = rateLimitTypeValue.toString(); + valMap.put("rateLimitType", rateLimitTypeValueAsString); + } + String intervalValue = getInterval(); + if (intervalValue != null) { + String intervalValueAsString = intervalValue.toString(); + valMap.put("interval", intervalValueAsString); + } + Long intervalNumValue = getIntervalNum(); + if (intervalNumValue != null) { + String intervalNumValueAsString = intervalNumValue.toString(); + valMap.put("intervalNum", intervalNumValueAsString); + } + Long limitValue = getLimit(); + if (limitValue != null) { + String limitValueAsString = limitValue.toString(); + valMap.put("limit", limitValueAsString); + } + Long countValue = getCount(); + if (countValue != null) { + String countValueAsString = countValue.toString(); + valMap.put("count", countValueAsString); + } + + valMap.put("timestamp", getTimestamp()); + return asciiEncode( + valMap.keySet().stream() + .map(key -> key + "=" + valMap.get(key)) + .collect(Collectors.joining("&"))); + } + + public Map toMap() { + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Object rateLimitTypeValue = getRateLimitType(); + if (rateLimitTypeValue != null) { + valMap.put("rateLimitType", rateLimitTypeValue); + } + Object intervalValue = getInterval(); + if (intervalValue != null) { + valMap.put("interval", intervalValue); + } + Object intervalNumValue = getIntervalNum(); + if (intervalNumValue != null) { + valMap.put("intervalNum", intervalNumValue); + } + Object limitValue = getLimit(); + if (limitValue != null) { + valMap.put("limit", limitValue); + } + Object countValue = getCount(); + if (countValue != null) { + valMap.put("count", countValue); + } + + valMap.put("timestamp", getTimestamp()); + return valMap; + } + + public static String asciiEncode(String s) { + return new String(s.getBytes(), StandardCharsets.US_ASCII); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("rateLimitType"); + openapiFields.add("interval"); + openapiFields.add("intervalNum"); + openapiFields.add("limit"); + openapiFields.add("count"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to + * CancelOrderResponseRateLimitsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CancelOrderResponseRateLimitsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in CancelOrderResponseRateLimitsInner is" + + " not found in the empty JSON string", + CancelOrderResponseRateLimitsInner.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!CancelOrderResponseRateLimitsInner.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `CancelOrderResponseRateLimitsInner` properties. JSON: %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("rateLimitType") != null && !jsonObj.get("rateLimitType").isJsonNull()) + && !jsonObj.get("rateLimitType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rateLimitType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("rateLimitType").toString())); + } + if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) + && !jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interval` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interval").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CancelOrderResponseRateLimitsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CancelOrderResponseRateLimitsInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(CancelOrderResponseRateLimitsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, CancelOrderResponseRateLimitsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CancelOrderResponseRateLimitsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of CancelOrderResponseRateLimitsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of CancelOrderResponseRateLimitsInner + * @throws IOException if the JSON string is invalid with respect to + * CancelOrderResponseRateLimitsInner + */ + public static CancelOrderResponseRateLimitsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, CancelOrderResponseRateLimitsInner.class); + } + + /** + * Convert an instance of CancelOrderResponseRateLimitsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderRequest.java index 28e485b95..a4971badf 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderRequest.java @@ -131,11 +131,11 @@ public class NewAlgoOrderRequest extends BaseDTO { @jakarta.annotation.Nullable private String reduceOnly; - public static final String SERIALIZED_NAME_ACTIVATION_PRICE = "activationPrice"; + public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; - @SerializedName(SERIALIZED_NAME_ACTIVATION_PRICE) + @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) @jakarta.annotation.Nullable - private Double activationPrice; + private Double activatePrice; public static final String SERIALIZED_NAME_CALLBACK_RATE = "callbackRate"; @@ -468,25 +468,24 @@ public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { this.reduceOnly = reduceOnly; } - public NewAlgoOrderRequest activationPrice( - @jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; + public NewAlgoOrderRequest activatePrice(@jakarta.annotation.Nullable Double activatePrice) { + this.activatePrice = activatePrice; return this; } /** - * Get activationPrice + * Get activatePrice * - * @return activationPrice + * @return activatePrice */ @jakarta.annotation.Nullable @Valid - public Double getActivationPrice() { - return activationPrice; + public Double getActivatePrice() { + return activatePrice; } - public void setActivationPrice(@jakarta.annotation.Nullable Double activationPrice) { - this.activationPrice = activationPrice; + public void setActivatePrice(@jakarta.annotation.Nullable Double activatePrice) { + this.activatePrice = activatePrice; } public NewAlgoOrderRequest callbackRate(@jakarta.annotation.Nullable Double callbackRate) { @@ -612,7 +611,7 @@ public boolean equals(Object o) { && Objects.equals(this.closePosition, newAlgoOrderRequest.closePosition) && Objects.equals(this.priceProtect, newAlgoOrderRequest.priceProtect) && Objects.equals(this.reduceOnly, newAlgoOrderRequest.reduceOnly) - && Objects.equals(this.activationPrice, newAlgoOrderRequest.activationPrice) + && Objects.equals(this.activatePrice, newAlgoOrderRequest.activatePrice) && Objects.equals(this.callbackRate, newAlgoOrderRequest.callbackRate) && Objects.equals(this.clientAlgoId, newAlgoOrderRequest.clientAlgoId) && Objects.equals( @@ -639,7 +638,7 @@ public int hashCode() { closePosition, priceProtect, reduceOnly, - activationPrice, + activatePrice, callbackRate, clientAlgoId, selfTradePreventionMode, @@ -666,7 +665,7 @@ public String toString() { sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" activationPrice: ").append(toIndentedString(activationPrice)).append("\n"); + sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); sb.append(" callbackRate: ").append(toIndentedString(callbackRate)).append("\n"); sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); sb.append(" selfTradePreventionMode: ") @@ -758,11 +757,11 @@ public String toUrlQueryString() { String reduceOnlyValueAsString = reduceOnlyValue.toString(); valMap.put("reduceOnly", reduceOnlyValueAsString); } - Double activationPriceValue = getActivationPrice(); - if (activationPriceValue != null) { - String activationPriceValueAsString = - DecimalFormatter.getFormatter().format(activationPriceValue); - valMap.put("activationPrice", activationPriceValueAsString); + Double activatePriceValue = getActivatePrice(); + if (activatePriceValue != null) { + String activatePriceValueAsString = + DecimalFormatter.getFormatter().format(activatePriceValue); + valMap.put("activatePrice", activatePriceValueAsString); } Double callbackRateValue = getCallbackRate(); if (callbackRateValue != null) { @@ -861,9 +860,9 @@ public Map toMap() { if (reduceOnlyValue != null) { valMap.put("reduceOnly", reduceOnlyValue); } - Object activationPriceValue = getActivationPrice(); - if (activationPriceValue != null) { - valMap.put("activationPrice", activationPriceValue); + Object activatePriceValue = getActivatePrice(); + if (activatePriceValue != null) { + valMap.put("activatePrice", activatePriceValue); } Object callbackRateValue = getCallbackRate(); if (callbackRateValue != null) { @@ -926,7 +925,7 @@ private String toIndentedString(Object o) { openapiFields.add("closePosition"); openapiFields.add("priceProtect"); openapiFields.add("reduceOnly"); - openapiFields.add("activationPrice"); + openapiFields.add("activatePrice"); openapiFields.add("callbackRate"); openapiFields.add("clientAlgoId"); openapiFields.add("selfTradePreventionMode"); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponse.java index 9efe6ab5b..e49854efc 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/NewAlgoOrderResponse.java @@ -65,7 +65,7 @@ public class NewAlgoOrderResponse extends BaseDTO { @SerializedName(SERIALIZED_NAME_RATE_LIMITS) @jakarta.annotation.Nullable - private List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits; + private List<@Valid CancelOrderResponseRateLimitsInner> rateLimits; public NewAlgoOrderResponse() {} @@ -130,13 +130,13 @@ public void setResult(@jakarta.annotation.Nullable NewAlgoOrderResponseResult re public NewAlgoOrderResponse rateLimits( @jakarta.annotation.Nullable - List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + List<@Valid CancelOrderResponseRateLimitsInner> rateLimits) { this.rateLimits = rateLimits; return this; } public NewAlgoOrderResponse addRateLimitsItem( - CancelAlgoOrderResponseRateLimitsInner rateLimitsItem) { + CancelOrderResponseRateLimitsInner rateLimitsItem) { if (this.rateLimits == null) { this.rateLimits = new ArrayList<>(); } @@ -151,13 +151,13 @@ public NewAlgoOrderResponse addRateLimitsItem( */ @jakarta.annotation.Nullable @Valid - public List<@Valid CancelAlgoOrderResponseRateLimitsInner> getRateLimits() { + public List<@Valid CancelOrderResponseRateLimitsInner> getRateLimits() { return rateLimits; } public void setRateLimits( @jakarta.annotation.Nullable - List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimits) { + List<@Valid CancelOrderResponseRateLimitsInner> rateLimits) { this.rateLimits = rateLimits; } @@ -212,7 +212,7 @@ public String toUrlQueryString() { String resultValueAsString = JSON.getGson().toJson(resultValue); valMap.put("result", resultValueAsString); } - List<@Valid CancelAlgoOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); + List<@Valid CancelOrderResponseRateLimitsInner> rateLimitsValue = getRateLimits(); if (rateLimitsValue != null) { String rateLimitsValueAsString = JSON.getGson().toJson(rateLimitsValue); valMap.put("rateLimits", rateLimitsValueAsString); @@ -335,7 +335,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti // validate the optional field `rateLimits` (array) for (int i = 0; i < jsonArrayrateLimits.size(); i++) { - CancelAlgoOrderResponseRateLimitsInner.validateJsonElement( + CancelOrderResponseRateLimitsInner.validateJsonElement( jsonArrayrateLimits.get(i)); } ; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java index 919ad3369..0f57e5418 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/DerivativesTradingUsdsFuturesWebSocketStreams.java @@ -60,7 +60,7 @@ public class DerivativesTradingUsdsFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-usds-futures/7.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/8.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java index 22461bbbb..5080538cc 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java @@ -82,8 +82,8 @@ public WebsocketMarketStreamsApi(StreamConnectionInterface connection) { * Aggregate Trade Streams The Aggregate Trade Streams push market trade information that is * aggregated for fills with same price and taking side every 100 milliseconds. Only market * trades will be aggregated, which means the insurance fund trades and ADL trades won't be - * aggregated. Retail Price Improvement(RPI) orders are aggregated and without special tags to - * be distinguished. Update Speed: 100ms + * aggregated. Retail Price Improvement(RPI) orders are aggregated into field `q` and + * without special tags to be distinguished. Update Speed: 100ms * * @param aggregateTradeStreamsRequest (required) * @return AggregateTradeStreamsResponse @@ -1427,8 +1427,8 @@ private void markPriceStreamValidateBeforeCall(MarkPriceStreamRequest markPriceS /** * Mark Price Stream for All market Mark price and funding rate for all symbols pushed every 3 - * seconds or every second. **Note**: This stream does not cover TradFi Perps. Update Speed: - * 3000ms or 1000ms + * seconds or every second. **Note**: TradFi symbols will be pushed through a seperate message. + * Update Speed: 3000ms or 1000ms * * @param markPriceStreamForAllMarketRequest (required) * @return MarkPriceStreamForAllMarketResponse @@ -1781,12 +1781,13 @@ private void rpiDiffBookDepthStreamsValidateBeforeCall( } /** - * Trading Session Stream Trading session information of U.S. equity market and commodity market - * which updates every second. Trading session information of different markets is pushed in - * seperate messages. Session types of equity market include \"PRE_MARKET\", - * \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\" and - * \"NO_TRADING\". And session types of commodity market include \"REGULAR\" - * and \"NO_TRADING\". Update Speed: 1s + * Trading Session Stream Trading session information for the underlying assets of TradFi + * Perpetual contracts—covering the U.S. equity market and the commodity market—is updated every + * second. Trading session information for different underlying markets is pushed in separate + * messages. Session types for the equity market include \"PRE_MARKET\", + * \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\", and + * \"NO_TRADING\". Session types for the commodity market include + * \"REGULAR\" and \"NO_TRADING\". Update Speed: 1s * * @param tradingSessionStreamRequest (required) * @return TradingSessionStreamResponse diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AggregateTradeStreamsResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AggregateTradeStreamsResponse.java index d6b55bfb9..b1421d0d3 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AggregateTradeStreamsResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/model/AggregateTradeStreamsResponse.java @@ -75,6 +75,12 @@ public class AggregateTradeStreamsResponse extends BaseDTO { @jakarta.annotation.Nullable private String qLowerCase; + public static final String SERIALIZED_NAME_NQ = "nq"; + + @SerializedName(SERIALIZED_NAME_NQ) + @jakarta.annotation.Nullable + private String nq; + public static final String SERIALIZED_NAME_F_LOWER_CASE = "f"; @SerializedName(SERIALIZED_NAME_F_LOWER_CASE) @@ -219,6 +225,25 @@ public void setqLowerCase(@jakarta.annotation.Nullable String qLowerCase) { this.qLowerCase = qLowerCase; } + public AggregateTradeStreamsResponse nq(@jakarta.annotation.Nullable String nq) { + this.nq = nq; + return this; + } + + /** + * Get nq + * + * @return nq + */ + @jakarta.annotation.Nullable + public String getNq() { + return nq; + } + + public void setNq(@jakarta.annotation.Nullable String nq) { + this.nq = nq; + } + public AggregateTradeStreamsResponse fLowerCase(@jakarta.annotation.Nullable Long fLowerCase) { this.fLowerCase = fLowerCase; return this; @@ -312,6 +337,7 @@ public boolean equals(Object o) { && Objects.equals(this.aLowerCase, aggregateTradeStreamsResponse.aLowerCase) && Objects.equals(this.pLowerCase, aggregateTradeStreamsResponse.pLowerCase) && Objects.equals(this.qLowerCase, aggregateTradeStreamsResponse.qLowerCase) + && Objects.equals(this.nq, aggregateTradeStreamsResponse.nq) && Objects.equals(this.fLowerCase, aggregateTradeStreamsResponse.fLowerCase) && Objects.equals(this.lLowerCase, aggregateTradeStreamsResponse.lLowerCase) && Objects.equals(this.T, aggregateTradeStreamsResponse.T) @@ -327,6 +353,7 @@ public int hashCode() { aLowerCase, pLowerCase, qLowerCase, + nq, fLowerCase, lLowerCase, T, @@ -343,6 +370,7 @@ public String toString() { sb.append(" aLowerCase: ").append(toIndentedString(aLowerCase)).append("\n"); sb.append(" pLowerCase: ").append(toIndentedString(pLowerCase)).append("\n"); sb.append(" qLowerCase: ").append(toIndentedString(qLowerCase)).append("\n"); + sb.append(" nq: ").append(toIndentedString(nq)).append("\n"); sb.append(" fLowerCase: ").append(toIndentedString(fLowerCase)).append("\n"); sb.append(" lLowerCase: ").append(toIndentedString(lLowerCase)).append("\n"); sb.append(" T: ").append(toIndentedString(T)).append("\n"); @@ -385,6 +413,11 @@ public String toUrlQueryString() { String qLowerCaseValueAsString = qLowerCaseValue.toString(); valMap.put("qLowerCase", qLowerCaseValueAsString); } + String nqValue = getNq(); + if (nqValue != null) { + String nqValueAsString = nqValue.toString(); + valMap.put("nq", nqValueAsString); + } Long fLowerCaseValue = getfLowerCase(); if (fLowerCaseValue != null) { String fLowerCaseValueAsString = fLowerCaseValue.toString(); @@ -440,6 +473,10 @@ public Map toMap() { if (qLowerCaseValue != null) { valMap.put("qLowerCase", qLowerCaseValue); } + Object nqValue = getNq(); + if (nqValue != null) { + valMap.put("nq", nqValue); + } Object fLowerCaseValue = getfLowerCase(); if (fLowerCaseValue != null) { valMap.put("fLowerCase", fLowerCaseValue); @@ -488,6 +525,7 @@ private String toIndentedString(Object o) { openapiFields.add("a"); openapiFields.add("p"); openapiFields.add("q"); + openapiFields.add("nq"); openapiFields.add("f"); openapiFields.add("l"); openapiFields.add("T"); @@ -560,6 +598,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("q").toString())); } + if ((jsonObj.get("nq") != null && !jsonObj.get("nq").isJsonNull()) + && !jsonObj.get("nq").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `nq` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("nq").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { diff --git a/examples/derivatives-trading-usds-futures/pom.xml b/examples/derivatives-trading-usds-futures/pom.xml index 3bd5e0a41..5c054e8ce 100644 --- a/examples/derivatives-trading-usds-futures/pom.xml +++ b/examples/derivatives-trading-usds-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-usds-futures - 7.0.0 + 8.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java index 50b7953cb..baf6dd719 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/TradingScheduleExample.java @@ -40,11 +40,12 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * Trading Schedule * - *

Trading session schedules for a one-week period starting from the day prior to the query - * time, covering both the U.S. equity and commodity markets. Equity market session types - * include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", - * \"OVERNIGHT\", and \"NO_TRADING\", while commodity market session types - * include \"REGULAR\" and \"NO_TRADING\". Weight: 5 + *

Trading session schedules for the underlying assets of TradFi Perps are provided for a + * one-week period starting from the day prior to the query time, covering both the U.S. equity + * and commodity markets. Equity market session types include \"PRE_MARKET\", + * \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\", and + * \"NO_TRADING\", while commodity market session types include \"REGULAR\" + * and \"NO_TRADING\". Weight: 5 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java index 3df4ab759..1be328206 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewAlgoOrderExample.java @@ -42,7 +42,10 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * New Algo Order(TRADE) * - *

Send in a new Algo order. * Condition orders will be triggered when: * If + *

Send in a new Algo order. * Algo order with type `STOP`, parameter + * `timeInForce` can be sent ( default `GTC`). * Algo order with type + * `TAKE_PROFIT`, parameter `timeInForce` can be sent ( default + * `GTC`). * Condition orders will be triggered when: * If * parameter`priceProtect`is sent as true: * when price reaches the * `triggerPrice` ,the difference rate between \"MARK_PRICE\" and * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the @@ -55,14 +58,14 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after - * order placed <= `activationPrice`, and the latest price >= the - * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed - * >= `activationPrice`, and the latest price <= the highest price * - * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error * code. ``{\"code\": -2021, \"msg\": \"Order would * immediately trigger.\"}`` means that the parameters you send do not meet the - * following requirements: * BUY: `activationPrice` should be smaller than latest - * price. * SELL: `activationPrice` should be larger than latest price. * + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with * `closePosition`=`true`: * Follow the same rules for condition * orders. * If triggered,**close all** current long position( if `SELL`) or current diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewOrderExample.java index bdbbf3e0a..2c4be78c8 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/NewOrderExample.java @@ -42,44 +42,15 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * New Order(TRADE) * - *

Send in a new order. * Order with type `STOP`, parameter `timeInForce` - * can be sent ( default `GTC`). * Order with type `TAKE_PROFIT`, parameter - * `timeInForce` can be sent ( default `GTC`). * Condition orders will be - * triggered when: * If parameter`priceProtect`is sent as true: * when price reaches - * the `stopPrice` ,the difference rate between \"MARK_PRICE\" and - * \"CONTRACT_PRICE\" cannot be larger than the \"triggerProtect\" of the - * symbol * \"triggerProtect\" of a symbol can be got from `GET - * /fapi/v1/exchangeInfo` * `STOP`, `STOP_MARKET`: * BUY: latest price - * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= `stopPrice` * - * SELL: latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= - * `stopPrice` * `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`: * BUY: - * latest price (\"MARK_PRICE\" or \"CONTRACT_PRICE\") <= - * `stopPrice` * SELL: latest price (\"MARK_PRICE\" or - * \"CONTRACT_PRICE\") >= `stopPrice` * - * `TRAILING_STOP_MARKET`: * BUY: the lowest price after order placed `<= - * `activationPrice`, and the latest price >`= the lowest price * (1 + - * `callbackRate`) * SELL: the highest price after order placed >= - * `activationPrice`, and the latest price <= the highest price * (1 - - * `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error code. - * ``{\"code\": -2021, \"msg\": \"Order would immediately - * trigger.\"}`` means that the parameters you send do not meet the following - * requirements: * BUY: `activationPrice` should be smaller than latest price. * SELL: - * `activationPrice` should be larger than latest price. * If `newOrderRespType - * ` is sent as `RESULT` : * `MARKET` order: the final FILLED result of - * the order will be return directly. * `LIMIT` order with special - * `timeInForce`: the final status result of the order(FILLED or EXPIRED) will be - * returned directly. * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with - * `closePosition`=`true`: * Follow the same rules for condition - * orders. * If triggered,**close all** current long position( if `SELL`) or current - * short position( if `BUY`). * Cannot be used with `quantity` paremeter * - * Cannot be used with `reduceOnly` parameter * In Hedge Mode,cannot be used with - * `BUY` orders in `LONG` position side. and cannot be used with - * `SELL` orders in `SHORT` position side * - * `selfTradePreventionMode` is only effective when `timeInForce` set to - * `IOC` or `GTC` or `GTD`. * In extreme market conditions, - * timeInForce `GTD` order auto cancel time might be delayed comparing to - * `goodTillDate` Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min - * order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m) + *

Send in a new order. * If `newOrderRespType ` is sent as `RESULT` : * + * `MARKET` order: the final FILLED result of the order will be return directly. * + * `LIMIT` order with special `timeInForce`: the final status result of the + * order(FILLED or EXPIRED) will be returned directly. * `selfTradePreventionMode` is + * only effective when `timeInForce` set to `IOC` or `GTC` or + * `GTD`. * In extreme market conditions, timeInForce `GTD` order auto + * cancel time might be delayed comparing to `goodTillDate` Weight: 1 on 10s order + * rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP + * rate limit(x-mbx-used-weight-1m) * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java index 5f1330cc6..a6ca0593e 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/NewAlgoOrderExample.java @@ -57,14 +57,14 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after - * order placed <= `activationPrice`, and the latest price >= the - * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed - * >= `activationPrice`, and the latest price <= the highest price * - * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error * code. ``{\"code\": -2021, \"msg\": \"Order would * immediately trigger.\"}`` means that the parameters you send do not meet the - * following requirements: * BUY: `activationPrice` should be smaller than latest - * price. * SELL: `activationPrice` should be larger than latest price. * + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with * `closePosition`=`true`: * Follow the same rules for condition * orders. * If triggered,**close all** current long position( if `SELL`) or current @@ -108,14 +108,14 @@ public void newAlgoOrderExampleAsync() { * \"CONTRACT_PRICE\") <= `triggerPrice` * SELL: latest price * (\"MARK_PRICE\" or \"CONTRACT_PRICE\") >= * `triggerPrice` * `TRAILING_STOP_MARKET`: * BUY: the lowest price after - * order placed <= `activationPrice`, and the latest price >= the - * lowest price * (1 + `callbackRate`) * SELL: the highest price after order placed - * >= `activationPrice`, and the latest price <= the highest price * - * (1 - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error + * order placed <= `activatePrice`, and the latest price >= the lowest + * price * (1 + `callbackRate`) * SELL: the highest price after order placed + * >= `activatePrice`, and the latest price <= the highest price * (1 + * - `callbackRate`) * For `TRAILING_STOP_MARKET`, if you got such error * code. ``{\"code\": -2021, \"msg\": \"Order would * immediately trigger.\"}`` means that the parameters you send do not meet the - * following requirements: * BUY: `activationPrice` should be smaller than latest - * price. * SELL: `activationPrice` should be larger than latest price. * + * following requirements: * BUY: `activatePrice` should be smaller than latest price. + * * SELL: `activatePrice` should be larger than latest price. * * `STOP_MARKET`, `TAKE_PROFIT_MARKET` with * `closePosition`=`true`: * Follow the same rules for condition * orders. * If triggered,**close all** current long position( if `SELL`) or current diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java index 7c719c714..7503864fc 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java @@ -39,8 +39,8 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { *

The Aggregate Trade Streams push market trade information that is aggregated for fills * with same price and taking side every 100 milliseconds. Only market trades will be * aggregated, which means the insurance fund trades and ADL trades won't be aggregated. - * Retail Price Improvement(RPI) orders are aggregated and without special tags to be - * distinguished. Update Speed: 100ms + * Retail Price Improvement(RPI) orders are aggregated into field `q` and without + * special tags to be distinguished. Update Speed: 100ms * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java index f6ef451e8..e4f421739 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java @@ -37,7 +37,8 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { * Mark Price Stream for All market * *

Mark price and funding rate for all symbols pushed every 3 seconds or every second. - * **Note**: This stream does not cover TradFi Perps. Update Speed: 3000ms or 1000ms + * **Note**: TradFi symbols will be pushed through a seperate message. Update Speed: 3000ms or + * 1000ms * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java index d1c4ca8ee..eb0d433b8 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java @@ -36,12 +36,13 @@ public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { /** * Trading Session Stream * - *

Trading session information of U.S. equity market and commodity market which updates every - * second. Trading session information of different markets is pushed in seperate messages. - * Session types of equity market include \"PRE_MARKET\", \"REGULAR\", - * \"AFTER_MARKET\", \"OVERNIGHT\" and \"NO_TRADING\". And session - * types of commodity market include \"REGULAR\" and \"NO_TRADING\". Update - * Speed: 1s + *

Trading session information for the underlying assets of TradFi Perpetual + * contracts—covering the U.S. equity market and the commodity market—is updated every second. + * Trading session information for different underlying markets is pushed in separate messages. + * Session types for the equity market include \"PRE_MARKET\", \"REGULAR\", + * \"AFTER_MARKET\", \"OVERNIGHT\", and \"NO_TRADING\". Session + * types for the commodity market include \"REGULAR\" and \"NO_TRADING\". + * Update Speed: 1s * * @throws ApiException if the Api call fails */