diff --git a/MIGRATION.md b/MIGRATION.md index 04c873f02..cd981a333 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -37,7 +37,7 @@ For Spot (Spot package): io.github.binance binance-spot - 8.0.0 + 9.0.0 ``` diff --git a/README.md b/README.md index d46c43a31..925fe6202 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Each connector is published as a separate maven dependency. For example: io.github.binance binance-spot - 8.0.0 + 9.0.0 ``` diff --git a/clients/convert/CHANGELOG.md b/clients/convert/CHANGELOG.md index f26956034..67a2269e9 100644 --- a/clients/convert/CHANGELOG.md +++ b/clients/convert/CHANGELOG.md @@ -1,6 +1,21 @@ # Changelog +## 2.0.0 - 2026-02-12 + +### Changed (1) + +- Modified response for `placeLimitOrder()` (`POST /sapi/v1/convert/limit/placeOrder`): + - property `orderId` added + - property `status` added + - property `inverseRatio` deleted + - property `quoteId` deleted + - property `ratio` deleted + - property `toAmount` deleted + - property `validTimestamp` deleted + - property `fromAmount` deleted + ## 1.2.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. @@ -17,4 +32,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/convert/docs/PlaceLimitOrderResponse.md b/clients/convert/docs/PlaceLimitOrderResponse.md index a1650317c..a2be6e2b6 100644 --- a/clients/convert/docs/PlaceLimitOrderResponse.md +++ b/clients/convert/docs/PlaceLimitOrderResponse.md @@ -7,12 +7,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**quoteId** | **String** | | [optional] | -|**ratio** | **String** | | [optional] | -|**inverseRatio** | **String** | | [optional] | -|**validTimestamp** | **Long** | | [optional] | -|**toAmount** | **String** | | [optional] | -|**fromAmount** | **String** | | [optional] | +|**orderId** | **Long** | | [optional] | +|**status** | **String** | | [optional] | diff --git a/clients/convert/docs/TradeApi.md b/clients/convert/docs/TradeApi.md index c7258469d..b71980902 100644 --- a/clients/convert/docs/TradeApi.md +++ b/clients/convert/docs/TradeApi.md @@ -9,7 +9,7 @@ All URIs are relative to *https://api.binance.com* | [**getConvertTradeHistory**](TradeApi.md#getConvertTradeHistory) | **GET** /sapi/v1/convert/tradeFlow | Get Convert Trade History(USER_DATA) | | [**orderStatus**](TradeApi.md#orderStatus) | **GET** /sapi/v1/convert/orderStatus | Order status(USER_DATA) | | [**placeLimitOrder**](TradeApi.md#placeLimitOrder) | **POST** /sapi/v1/convert/limit/placeOrder | Place limit order (USER_DATA) | -| [**queryLimitOpenOrders**](TradeApi.md#queryLimitOpenOrders) | **POST** /sapi/v1/convert/limit/queryOpenOrders | Query limit open orders (USER_DATA) | +| [**queryLimitOpenOrders**](TradeApi.md#queryLimitOpenOrders) | **GET** /sapi/v1/convert/limit/queryOpenOrders | Query limit open orders (USER_DATA) | | [**sendQuoteRequest**](TradeApi.md#sendQuoteRequest) | **POST** /sapi/v1/convert/getQuote | Send Quote Request(USER_DATA) | @@ -333,7 +333,7 @@ No authorization required # **queryLimitOpenOrders** -> QueryLimitOpenOrdersResponse queryLimitOpenOrders(queryLimitOpenOrdersRequest) +> QueryLimitOpenOrdersResponse queryLimitOpenOrders(recvWindow) Query limit open orders (USER_DATA) @@ -354,9 +354,9 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TradeApi apiInstance = new TradeApi(defaultClient); - QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest = new QueryLimitOpenOrdersRequest(); // QueryLimitOpenOrdersRequest | + Long recvWindow = 56L; // Long | The value cannot be greater than 60000 try { - QueryLimitOpenOrdersResponse result = apiInstance.queryLimitOpenOrders(queryLimitOpenOrdersRequest); + QueryLimitOpenOrdersResponse result = apiInstance.queryLimitOpenOrders(recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TradeApi#queryLimitOpenOrders"); @@ -373,7 +373,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **queryLimitOpenOrdersRequest** | [**QueryLimitOpenOrdersRequest**](QueryLimitOpenOrdersRequest.md)| | | +| **recvWindow** | **Long**| The value cannot be greater than 60000 | [optional] | ### Return type diff --git a/clients/convert/docs/rest-api/migration-guide.md b/clients/convert/docs/rest-api/migration-guide.md index fb5d60b3e..270ea57ef 100644 --- a/clients/convert/docs/rest-api/migration-guide.md +++ b/clients/convert/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-convert - 1.2.1 + 2.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-convert - 1.2.1 + 2.0.0 ``` diff --git a/clients/convert/example_rest.md b/clients/convert/example_rest.md index b2152f611..c02776ba2 100644 --- a/clients/convert/example_rest.md +++ b/clients/convert/example_rest.md @@ -16,7 +16,7 @@ [POST /sapi/v1/convert/limit/placeOrder](https://developers.binance.com/docs/convert/trade/Place-Order) - placeLimitOrder - [PlaceLimitOrderExample.java:50](/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/PlaceLimitOrderExample.java#L50) -[POST /sapi/v1/convert/limit/queryOpenOrders](https://developers.binance.com/docs/convert/trade/Query-Order) - queryLimitOpenOrders - [QueryLimitOpenOrdersExample.java:47](/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/QueryLimitOpenOrdersExample.java#L47) +[GET /sapi/v1/convert/limit/queryOpenOrders](https://developers.binance.com/docs/convert/trade/Query-Order) - queryLimitOpenOrders - [QueryLimitOpenOrdersExample.java:46](/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/QueryLimitOpenOrdersExample.java#L46) [POST /sapi/v1/convert/getQuote](https://developers.binance.com/docs/convert/trade/Send-quote-request) - sendQuoteRequest - [SendQuoteRequestExample.java:49](/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/SendQuoteRequestExample.java#L49) diff --git a/clients/convert/pom.xml b/clients/convert/pom.xml index 6a150ad6c..16ec279d2 100644 --- a/clients/convert/pom.xml +++ b/clients/convert/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-convert convert - 1.2.1 + 2.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.3.1 \ No newline at end of file diff --git a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/JSON.java b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/JSON.java index ad40136bd..043299b0f 100644 --- a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/JSON.java +++ b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/JSON.java @@ -141,9 +141,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.convert.rest.model.PlaceLimitOrderResponse .CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersRequest - .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersResponse .CustomTypeAdapterFactory()); diff --git a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/ConvertRestApi.java b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/ConvertRestApi.java index 063c9f8c3..b367d472b 100644 --- a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/ConvertRestApi.java +++ b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/ConvertRestApi.java @@ -14,7 +14,6 @@ import com.binance.connector.client.convert.rest.model.OrderStatusResponse; import com.binance.connector.client.convert.rest.model.PlaceLimitOrderRequest; import com.binance.connector.client.convert.rest.model.PlaceLimitOrderResponse; -import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersRequest; import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersResponse; import com.binance.connector.client.convert.rest.model.QueryOrderQuantityPrecisionPerAssetResponse; import com.binance.connector.client.convert.rest.model.SendQuoteRequestRequest; @@ -207,7 +206,7 @@ public ApiResponse placeLimitOrder( * Query limit open orders (USER_DATA) Request a quote for the requested token pairs Weight: * 3000(UID) * - * @param queryLimitOpenOrdersRequest (required) + * @param recvWindow The value cannot be greater than 60000 (optional) * @return ApiResponse<QueryLimitOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -221,9 +220,9 @@ public ApiResponse placeLimitOrder( * @see Query limit open * orders (USER_DATA) Documentation */ - public ApiResponse queryLimitOpenOrders( - QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest) throws ApiException { - return tradeApi.queryLimitOpenOrders(queryLimitOpenOrdersRequest); + public ApiResponse queryLimitOpenOrders(Long recvWindow) + throws ApiException { + return tradeApi.queryLimitOpenOrders(recvWindow); } /** diff --git a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/MarketDataApi.java b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/MarketDataApi.java index 8f3ea8240..ef5f7e166 100644 --- a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/MarketDataApi.java +++ b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/MarketDataApi.java @@ -43,7 +43,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-convert/1.2.1 (Java/%s; %s; %s)", + "binance-convert/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/TradeApi.java b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/TradeApi.java index 838b0f6e0..3d62d0bd8 100644 --- a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/TradeApi.java +++ b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/api/TradeApi.java @@ -28,7 +28,6 @@ import com.binance.connector.client.convert.rest.model.OrderStatusResponse; import com.binance.connector.client.convert.rest.model.PlaceLimitOrderRequest; import com.binance.connector.client.convert.rest.model.PlaceLimitOrderResponse; -import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersRequest; import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersResponse; import com.binance.connector.client.convert.rest.model.SendQuoteRequestRequest; import com.binance.connector.client.convert.rest.model.SendQuoteRequestResponse; @@ -55,7 +54,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-convert/1.2.1 (Java/%s; %s; %s)", + "binance-convert/2.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -842,7 +841,7 @@ public ApiResponse placeLimitOrder( /** * Build call for queryLimitOpenOrders * - * @param queryLimitOpenOrdersRequest (required) + * @param recvWindow The value cannot be greater than 60000 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details @@ -855,8 +854,7 @@ public ApiResponse placeLimitOrder( * @see Query limit open * orders (USER_DATA) Documentation */ - private okhttp3.Call queryLimitOpenOrdersCall( - QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest) throws ApiException { + private okhttp3.Call queryLimitOpenOrdersCall(Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -881,8 +879,8 @@ private okhttp3.Call queryLimitOpenOrdersCall( Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (queryLimitOpenOrdersRequest.getRecvWindow() != null) { - localVarFormParams.put("recvWindow", queryLimitOpenOrdersRequest.getRecvWindow()); + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } final String[] localVarAccepts = {"application/json"}; @@ -905,7 +903,7 @@ private okhttp3.Call queryLimitOpenOrdersCall( return localVarApiClient.buildCall( basePath, localVarPath, - "POST", + "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, @@ -916,8 +914,8 @@ private okhttp3.Call queryLimitOpenOrdersCall( } @SuppressWarnings("rawtypes") - private okhttp3.Call queryLimitOpenOrdersValidateBeforeCall( - QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest) throws ApiException { + private okhttp3.Call queryLimitOpenOrdersValidateBeforeCall(Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -927,15 +925,13 @@ private okhttp3.Call queryLimitOpenOrdersValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {queryLimitOpenOrdersRequest}; - Method method = - this.getClass() - .getMethod("queryLimitOpenOrders", QueryLimitOpenOrdersRequest.class); + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("queryLimitOpenOrders", Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return queryLimitOpenOrdersCall(queryLimitOpenOrdersRequest); + return queryLimitOpenOrdersCall(recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -952,7 +948,7 @@ private okhttp3.Call queryLimitOpenOrdersValidateBeforeCall( * Query limit open orders (USER_DATA) Request a quote for the requested token pairs Weight: * 3000(UID) * - * @param queryLimitOpenOrdersRequest (required) + * @param recvWindow The value cannot be greater than 60000 (optional) * @return ApiResponse<QueryLimitOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -966,11 +962,9 @@ private okhttp3.Call queryLimitOpenOrdersValidateBeforeCall( * @see Query limit open * orders (USER_DATA) Documentation */ - public ApiResponse queryLimitOpenOrders( - @Valid @NotNull QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest) + public ApiResponse queryLimitOpenOrders(Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = - queryLimitOpenOrdersValidateBeforeCall(queryLimitOpenOrdersRequest); + okhttp3.Call localVarCall = queryLimitOpenOrdersValidateBeforeCall(recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); diff --git a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderResponse.java b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderResponse.java index 0cc3856ca..35d1cc1da 100644 --- a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderResponse.java +++ b/clients/convert/src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderResponse.java @@ -36,157 +36,56 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class PlaceLimitOrderResponse { - public static final String SERIALIZED_NAME_QUOTE_ID = "quoteId"; + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; - @SerializedName(SERIALIZED_NAME_QUOTE_ID) + @SerializedName(SERIALIZED_NAME_ORDER_ID) @jakarta.annotation.Nullable - private String quoteId; + private Long orderId; - public static final String SERIALIZED_NAME_RATIO = "ratio"; + public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_RATIO) + @SerializedName(SERIALIZED_NAME_STATUS) @jakarta.annotation.Nullable - private String ratio; - - public static final String SERIALIZED_NAME_INVERSE_RATIO = "inverseRatio"; - - @SerializedName(SERIALIZED_NAME_INVERSE_RATIO) - @jakarta.annotation.Nullable - private String inverseRatio; - - public static final String SERIALIZED_NAME_VALID_TIMESTAMP = "validTimestamp"; - - @SerializedName(SERIALIZED_NAME_VALID_TIMESTAMP) - @jakarta.annotation.Nullable - private Long validTimestamp; - - public static final String SERIALIZED_NAME_TO_AMOUNT = "toAmount"; - - @SerializedName(SERIALIZED_NAME_TO_AMOUNT) - @jakarta.annotation.Nullable - private String toAmount; - - public static final String SERIALIZED_NAME_FROM_AMOUNT = "fromAmount"; - - @SerializedName(SERIALIZED_NAME_FROM_AMOUNT) - @jakarta.annotation.Nullable - private String fromAmount; + private String status; public PlaceLimitOrderResponse() {} - public PlaceLimitOrderResponse quoteId(@jakarta.annotation.Nullable String quoteId) { - this.quoteId = quoteId; + public PlaceLimitOrderResponse orderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; return this; } /** - * Get quoteId + * Get orderId * - * @return quoteId + * @return orderId */ @jakarta.annotation.Nullable - public String getQuoteId() { - return quoteId; + public Long getOrderId() { + return orderId; } - public void setQuoteId(@jakarta.annotation.Nullable String quoteId) { - this.quoteId = quoteId; + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; } - public PlaceLimitOrderResponse ratio(@jakarta.annotation.Nullable String ratio) { - this.ratio = ratio; + public PlaceLimitOrderResponse status(@jakarta.annotation.Nullable String status) { + this.status = status; return this; } /** - * Get ratio + * Get status * - * @return ratio + * @return status */ @jakarta.annotation.Nullable - public String getRatio() { - return ratio; + public String getStatus() { + return status; } - public void setRatio(@jakarta.annotation.Nullable String ratio) { - this.ratio = ratio; - } - - public PlaceLimitOrderResponse inverseRatio(@jakarta.annotation.Nullable String inverseRatio) { - this.inverseRatio = inverseRatio; - return this; - } - - /** - * Get inverseRatio - * - * @return inverseRatio - */ - @jakarta.annotation.Nullable - public String getInverseRatio() { - return inverseRatio; - } - - public void setInverseRatio(@jakarta.annotation.Nullable String inverseRatio) { - this.inverseRatio = inverseRatio; - } - - public PlaceLimitOrderResponse validTimestamp( - @jakarta.annotation.Nullable Long validTimestamp) { - this.validTimestamp = validTimestamp; - return this; - } - - /** - * Get validTimestamp - * - * @return validTimestamp - */ - @jakarta.annotation.Nullable - public Long getValidTimestamp() { - return validTimestamp; - } - - public void setValidTimestamp(@jakarta.annotation.Nullable Long validTimestamp) { - this.validTimestamp = validTimestamp; - } - - public PlaceLimitOrderResponse toAmount(@jakarta.annotation.Nullable String toAmount) { - this.toAmount = toAmount; - return this; - } - - /** - * Get toAmount - * - * @return toAmount - */ - @jakarta.annotation.Nullable - public String getToAmount() { - return toAmount; - } - - public void setToAmount(@jakarta.annotation.Nullable String toAmount) { - this.toAmount = toAmount; - } - - public PlaceLimitOrderResponse fromAmount(@jakarta.annotation.Nullable String fromAmount) { - this.fromAmount = fromAmount; - return this; - } - - /** - * Get fromAmount - * - * @return fromAmount - */ - @jakarta.annotation.Nullable - public String getFromAmount() { - return fromAmount; - } - - public void setFromAmount(@jakarta.annotation.Nullable String fromAmount) { - this.fromAmount = fromAmount; + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; } @Override @@ -198,29 +97,21 @@ public boolean equals(Object o) { return false; } PlaceLimitOrderResponse placeLimitOrderResponse = (PlaceLimitOrderResponse) o; - return Objects.equals(this.quoteId, placeLimitOrderResponse.quoteId) - && Objects.equals(this.ratio, placeLimitOrderResponse.ratio) - && Objects.equals(this.inverseRatio, placeLimitOrderResponse.inverseRatio) - && Objects.equals(this.validTimestamp, placeLimitOrderResponse.validTimestamp) - && Objects.equals(this.toAmount, placeLimitOrderResponse.toAmount) - && Objects.equals(this.fromAmount, placeLimitOrderResponse.fromAmount); + return Objects.equals(this.orderId, placeLimitOrderResponse.orderId) + && Objects.equals(this.status, placeLimitOrderResponse.status); } @Override public int hashCode() { - return Objects.hash(quoteId, ratio, inverseRatio, validTimestamp, toAmount, fromAmount); + return Objects.hash(orderId, status); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PlaceLimitOrderResponse {\n"); - sb.append(" quoteId: ").append(toIndentedString(quoteId)).append("\n"); - sb.append(" ratio: ").append(toIndentedString(ratio)).append("\n"); - sb.append(" inverseRatio: ").append(toIndentedString(inverseRatio)).append("\n"); - sb.append(" validTimestamp: ").append(toIndentedString(validTimestamp)).append("\n"); - sb.append(" toAmount: ").append(toIndentedString(toAmount)).append("\n"); - sb.append(" fromAmount: ").append(toIndentedString(fromAmount)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}"); return sb.toString(); } @@ -228,30 +119,14 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object quoteIdValue = getQuoteId(); - String quoteIdValueAsString = ""; - quoteIdValueAsString = quoteIdValue.toString(); - sb.append("quoteId=").append(urlEncode(quoteIdValueAsString)).append(""); - Object ratioValue = getRatio(); - String ratioValueAsString = ""; - ratioValueAsString = ratioValue.toString(); - sb.append("ratio=").append(urlEncode(ratioValueAsString)).append(""); - Object inverseRatioValue = getInverseRatio(); - String inverseRatioValueAsString = ""; - inverseRatioValueAsString = inverseRatioValue.toString(); - sb.append("inverseRatio=").append(urlEncode(inverseRatioValueAsString)).append(""); - Object validTimestampValue = getValidTimestamp(); - String validTimestampValueAsString = ""; - validTimestampValueAsString = validTimestampValue.toString(); - sb.append("validTimestamp=").append(urlEncode(validTimestampValueAsString)).append(""); - Object toAmountValue = getToAmount(); - String toAmountValueAsString = ""; - toAmountValueAsString = toAmountValue.toString(); - sb.append("toAmount=").append(urlEncode(toAmountValueAsString)).append(""); - Object fromAmountValue = getFromAmount(); - String fromAmountValueAsString = ""; - fromAmountValueAsString = fromAmountValue.toString(); - sb.append("fromAmount=").append(urlEncode(fromAmountValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).append(""); return sb.toString(); } @@ -280,12 +155,8 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("quoteId"); - openapiFields.add("ratio"); - openapiFields.add("inverseRatio"); - openapiFields.add("validTimestamp"); - openapiFields.add("toAmount"); - openapiFields.add("fromAmount"); + openapiFields.add("orderId"); + openapiFields.add("status"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -309,45 +180,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("quoteId") != null && !jsonObj.get("quoteId").isJsonNull()) - && !jsonObj.get("quoteId").isJsonPrimitive()) { + if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `quoteId` to be a primitive type in the JSON string" + "Expected the field `status` to be a primitive type in the JSON string" + " but got `%s`", - jsonObj.get("quoteId").toString())); - } - if ((jsonObj.get("ratio") != null && !jsonObj.get("ratio").isJsonNull()) - && !jsonObj.get("ratio").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `ratio` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("ratio").toString())); - } - if ((jsonObj.get("inverseRatio") != null && !jsonObj.get("inverseRatio").isJsonNull()) - && !jsonObj.get("inverseRatio").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `inverseRatio` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("inverseRatio").toString())); - } - if ((jsonObj.get("toAmount") != null && !jsonObj.get("toAmount").isJsonNull()) - && !jsonObj.get("toAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `toAmount` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("toAmount").toString())); - } - if ((jsonObj.get("fromAmount") != null && !jsonObj.get("fromAmount").isJsonNull()) - && !jsonObj.get("fromAmount").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fromAmount` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("fromAmount").toString())); + jsonObj.get("status").toString())); } } diff --git a/clients/convert/src/test/java/com/binance/connector/client/convert/rest/api/TradeApiTest.java b/clients/convert/src/test/java/com/binance/connector/client/convert/rest/api/TradeApiTest.java index ae0a01b46..94ac43337 100644 --- a/clients/convert/src/test/java/com/binance/connector/client/convert/rest/api/TradeApiTest.java +++ b/clients/convert/src/test/java/com/binance/connector/client/convert/rest/api/TradeApiTest.java @@ -31,7 +31,6 @@ import com.binance.connector.client.convert.rest.model.OrderStatusResponse; import com.binance.connector.client.convert.rest.model.PlaceLimitOrderRequest; import com.binance.connector.client.convert.rest.model.PlaceLimitOrderResponse; -import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersRequest; import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersResponse; import com.binance.connector.client.convert.rest.model.SendQuoteRequestRequest; import com.binance.connector.client.convert.rest.model.SendQuoteRequestResponse; @@ -267,10 +266,8 @@ public void placeLimitOrderTest() throws ApiException, CryptoException { */ @Test public void queryLimitOpenOrdersTest() throws ApiException, CryptoException { - QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest = new QueryLimitOpenOrdersRequest(); - ApiResponse response = - api.queryLimitOpenOrders(queryLimitOpenOrdersRequest); + api.queryLimitOpenOrders(null); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) diff --git a/clients/crypto-loan/CHANGELOG.md b/clients/crypto-loan/CHANGELOG.md index 7379054f7..00913c67d 100644 --- a/clients/crypto-loan/CHANGELOG.md +++ b/clients/crypto-loan/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 4.0.0 - 2026-02-12 + +### Added (1) + +- `getFlexibleLoanInterestRateHistory()` (`GET /sapi/v2/loan/interestRateHistory`) + ## 3.0.0 - 2025-09-22 ### Changed (2) @@ -12,6 +18,7 @@ - `flexibleLoanBorrow()` (`POST /sapi/v2/loan/flexible/borrow`) ## 2.1.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/crypto-loan/docs/FlexibleRateApi.md b/clients/crypto-loan/docs/FlexibleRateApi.md index 3525c4bc2..920eb31c1 100644 --- a/clients/crypto-loan/docs/FlexibleRateApi.md +++ b/clients/crypto-loan/docs/FlexibleRateApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.binance.com* | [**getFlexibleLoanAssetsData**](FlexibleRateApi.md#getFlexibleLoanAssetsData) | **GET** /sapi/v2/loan/flexible/loanable/data | Get Flexible Loan Assets Data(USER_DATA) | | [**getFlexibleLoanBorrowHistory**](FlexibleRateApi.md#getFlexibleLoanBorrowHistory) | **GET** /sapi/v2/loan/flexible/borrow/history | Get Flexible Loan Borrow History(USER_DATA) | | [**getFlexibleLoanCollateralAssetsData**](FlexibleRateApi.md#getFlexibleLoanCollateralAssetsData) | **GET** /sapi/v2/loan/flexible/collateral/data | Get Flexible Loan Collateral Assets Data(USER_DATA) | +| [**getFlexibleLoanInterestRateHistory**](FlexibleRateApi.md#getFlexibleLoanInterestRateHistory) | **GET** /sapi/v2/loan/interestRateHistory | Get Flexible Loan Interest Rate History (USER_DATA) | | [**getFlexibleLoanLiquidationHistory**](FlexibleRateApi.md#getFlexibleLoanLiquidationHistory) | **GET** /sapi/v2/loan/flexible/liquidation/history | Get Flexible Loan Liquidation History (USER_DATA) | | [**getFlexibleLoanLtvAdjustmentHistory**](FlexibleRateApi.md#getFlexibleLoanLtvAdjustmentHistory) | **GET** /sapi/v2/loan/flexible/ltv/adjustment/history | Get Flexible Loan LTV Adjustment History(USER_DATA) | | [**getFlexibleLoanOngoingOrders**](FlexibleRateApi.md#getFlexibleLoanOngoingOrders) | **GET** /sapi/v2/loan/flexible/ongoing/orders | Get Flexible Loan Ongoing Orders(USER_DATA) | @@ -471,6 +472,78 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Flexible Loan Collateral Assets Data | - | + +# **getFlexibleLoanInterestRateHistory** +> GetFlexibleLoanInterestRateHistoryResponse getFlexibleLoanInterestRateHistory(coin, recvWindow, startTime, endTime, current, limit) + +Get Flexible Loan Interest Rate History (USER_DATA) + +Check Flexible Loan interest rate history * If startTime and endTime are not sent, the recent 90-day data will be returned * The max interval between startTime and endTime is 90 days. * Time based on UTC+0. Weight: 400 + +### Example +```java +// Import classes: +import com.binance.connector.client.crypto_loan.ApiClient; +import com.binance.connector.client.crypto_loan.ApiException; +import com.binance.connector.client.crypto_loan.Configuration; +import com.binance.connector.client.crypto_loan.models.*; +import com.binance.connector.client.crypto_loan.rest.api.FlexibleRateApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + FlexibleRateApi apiInstance = new FlexibleRateApi(defaultClient); + String coin = "coin_example"; // String | + Long recvWindow = 56L; // Long | + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Current querying page. Start from 1; default: 1; max: 1000 + Long limit = 56L; // Long | Default: 10; max: 100 + try { + GetFlexibleLoanInterestRateHistoryResponse result = apiInstance.getFlexibleLoanInterestRateHistory(coin, recvWindow, startTime, endTime, current, limit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FlexibleRateApi#getFlexibleLoanInterestRateHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **coin** | **String**| | | +| **recvWindow** | **Long**| | | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Current querying page. Start from 1; default: 1; max: 1000 | [optional] | +| **limit** | **Long**| Default: 10; max: 100 | [optional] | + +### Return type + +[**GetFlexibleLoanInterestRateHistoryResponse**](GetFlexibleLoanInterestRateHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Flexible Loan Interest Rate History | - | + # **getFlexibleLoanLiquidationHistory** > GetFlexibleLoanLiquidationHistoryResponse getFlexibleLoanLiquidationHistory(loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) diff --git a/clients/crypto-loan/docs/GetFlexibleLoanInterestRateHistoryResponse.md b/clients/crypto-loan/docs/GetFlexibleLoanInterestRateHistoryResponse.md new file mode 100644 index 000000000..8dd6eeb39 --- /dev/null +++ b/clients/crypto-loan/docs/GetFlexibleLoanInterestRateHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetFlexibleLoanInterestRateHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetFlexibleLoanInterestRateHistoryResponseRowsInner>**](GetFlexibleLoanInterestRateHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/crypto-loan/docs/GetFlexibleLoanInterestRateHistoryResponseRowsInner.md b/clients/crypto-loan/docs/GetFlexibleLoanInterestRateHistoryResponseRowsInner.md new file mode 100644 index 000000000..27bd5f545 --- /dev/null +++ b/clients/crypto-loan/docs/GetFlexibleLoanInterestRateHistoryResponseRowsInner.md @@ -0,0 +1,15 @@ + + +# GetFlexibleLoanInterestRateHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**coin** | **String** | | [optional] | +|**annualizedInterestRate** | **String** | | [optional] | +|**time** | **Long** | | [optional] | + + + diff --git a/clients/crypto-loan/docs/rest-api/migration-guide.md b/clients/crypto-loan/docs/rest-api/migration-guide.md index e3d0863dd..c7b1cb403 100644 --- a/clients/crypto-loan/docs/rest-api/migration-guide.md +++ b/clients/crypto-loan/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-crypto-loan - 3.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-crypto-loan - 3.0.0 + 4.0.0 ``` diff --git a/clients/crypto-loan/example_rest.md b/clients/crypto-loan/example_rest.md index 569549767..b87c09266 100644 --- a/clients/crypto-loan/example_rest.md +++ b/clients/crypto-loan/example_rest.md @@ -14,6 +14,8 @@ [GET /sapi/v2/loan/flexible/collateral/data](https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Collateral-Assets-Data) - getFlexibleLoanCollateralAssetsData - [GetFlexibleLoanCollateralAssetsDataExample.java:48](/examples/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/flexiblerate/GetFlexibleLoanCollateralAssetsDataExample.java#L48) +[GET /sapi/v2/loan/interestRateHistory](https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Interest-Rate-History) - getFlexibleLoanInterestRateHistory - [GetFlexibleLoanInterestRateHistoryExample.java:49](/examples/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/flexiblerate/GetFlexibleLoanInterestRateHistoryExample.java#L49) + [GET /sapi/v2/loan/flexible/liquidation/history](https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Liquidation-History) - getFlexibleLoanLiquidationHistory - [GetFlexibleLoanLiquidationHistoryExample.java:47](/examples/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/flexiblerate/GetFlexibleLoanLiquidationHistoryExample.java#L47) [GET /sapi/v2/loan/flexible/ltv/adjustment/history](https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-LTV-Adjustment-History) - getFlexibleLoanLtvAdjustmentHistory - [GetFlexibleLoanLtvAdjustmentHistoryExample.java:49](/examples/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/flexiblerate/GetFlexibleLoanLtvAdjustmentHistoryExample.java#L49) diff --git a/clients/crypto-loan/pom.xml b/clients/crypto-loan/pom.xml index 52bdfe5dd..09b98bc25 100644 --- a/clients/crypto-loan/pom.xml +++ b/clients/crypto-loan/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-crypto-loan crypto-loan - 3.0.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.3.1 \ No newline at end of file diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/JSON.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/JSON.java index c98a7233c..1193fa542 100644 --- a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/JSON.java +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/JSON.java @@ -157,6 +157,13 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.crypto_loan.rest.model .GetFlexibleLoanCollateralAssetsDataResponseRowsInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.crypto_loan.rest.model + .GetFlexibleLoanInterestRateHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.crypto_loan.rest.model + .GetFlexibleLoanInterestRateHistoryResponseRowsInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.crypto_loan.rest.model .GetFlexibleLoanLiquidationHistoryResponse.CustomTypeAdapterFactory()); diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/CryptoLoanRestApi.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/CryptoLoanRestApi.java index dc2c3c12a..cf7fdd9a3 100644 --- a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/CryptoLoanRestApi.java +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/CryptoLoanRestApi.java @@ -17,6 +17,7 @@ import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanAssetsDataResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanBorrowHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanCollateralAssetsDataResponse; +import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanInterestRateHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanLiquidationHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanLtvAdjustmentHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanOngoingOrdersResponse; @@ -227,6 +228,44 @@ public ApiResponse getFlexibleLoanBorrowHi return flexibleRateApi.getFlexibleLoanCollateralAssetsData(collateralCoin, recvWindow); } + /** + * Get Flexible Loan Interest Rate History (USER_DATA) Check Flexible Loan interest rate history + * * If startTime and endTime are not sent, the recent 90-day data will be returned * The max + * interval between startTime and endTime is 90 days. * Time based on UTC+0. Weight: 400 + * + * @param coin (required) + * @param recvWindow (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @return ApiResponse<GetFlexibleLoanInterestRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Loan Interest Rate History -
+ * + * @see Get + * Flexible Loan Interest Rate History (USER_DATA) Documentation + */ + public ApiResponse + getFlexibleLoanInterestRateHistory( + String coin, + Long recvWindow, + Long startTime, + Long endTime, + Long current, + Long limit) + throws ApiException { + return flexibleRateApi.getFlexibleLoanInterestRateHistory( + coin, recvWindow, startTime, endTime, current, limit); + } + /** * Get Flexible Loan Liquidation History (USER_DATA) Weight: 400 * diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java index 9d98056a6..3d8259492 100644 --- a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/FlexibleRateApi.java @@ -30,6 +30,7 @@ import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanAssetsDataResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanBorrowHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanCollateralAssetsDataResponse; +import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanInterestRateHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanLiquidationHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanLtvAdjustmentHistoryResponse; import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanOngoingOrdersResponse; @@ -57,7 +58,7 @@ public class FlexibleRateApi { private static final String USER_AGENT = String.format( - "binance-crypto-loan/3.0.0 (Java/%s; %s; %s)", + "binance-crypto-loan/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1235,6 +1236,193 @@ private okhttp3.Call getFlexibleLoanCollateralAssetsDataValidateBeforeCall( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for getFlexibleLoanInterestRateHistory + * + * @param coin (required) + * @param recvWindow (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Loan Interest Rate History -
+ * + * @see Get + * Flexible Loan Interest Rate History (USER_DATA) Documentation + */ + private okhttp3.Call getFlexibleLoanInterestRateHistoryCall( + String coin, Long recvWindow, Long startTime, Long endTime, Long current, Long limit) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v2/loan/interestRateHistory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (coin != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("coin", coin)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getFlexibleLoanInterestRateHistoryValidateBeforeCall( + String coin, Long recvWindow, Long startTime, Long endTime, Long current, Long limit) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {coin, recvWindow, startTime, endTime, current, limit}; + Method method = + this.getClass() + .getMethod( + "getFlexibleLoanInterestRateHistory", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getFlexibleLoanInterestRateHistoryCall( + coin, recvWindow, startTime, endTime, current, limit); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Flexible Loan Interest Rate History (USER_DATA) Check Flexible Loan interest rate history + * * If startTime and endTime are not sent, the recent 90-day data will be returned * The max + * interval between startTime and endTime is 90 days. * Time based on UTC+0. Weight: 400 + * + * @param coin (required) + * @param recvWindow (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @return ApiResponse<GetFlexibleLoanInterestRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Flexible Loan Interest Rate History -
+ * + * @see Get + * Flexible Loan Interest Rate History (USER_DATA) Documentation + */ + public ApiResponse + getFlexibleLoanInterestRateHistory( + @NotNull String coin, + @NotNull Long recvWindow, + Long startTime, + Long endTime, + Long current, + Long limit) + throws ApiException { + okhttp3.Call localVarCall = + getFlexibleLoanInterestRateHistoryValidateBeforeCall( + coin, recvWindow, startTime, endTime, current, limit); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getFlexibleLoanLiquidationHistory * diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java index 85b727696..27443e60b 100644 --- a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/api/StableRateApi.java @@ -47,7 +47,7 @@ public class StableRateApi { private static final String USER_AGENT = String.format( - "binance-crypto-loan/3.0.0 (Java/%s; %s; %s)", + "binance-crypto-loan/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/GetFlexibleLoanInterestRateHistoryResponse.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/GetFlexibleLoanInterestRateHistoryResponse.java new file mode 100644 index 000000000..8f629b3bf --- /dev/null +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/GetFlexibleLoanInterestRateHistoryResponse.java @@ -0,0 +1,290 @@ +/* + * Binance Crypto Loan REST API + * OpenAPI Specification for the Binance Crypto Loan REST 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.crypto_loan.rest.model; + +import com.binance.connector.client.crypto_loan.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +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.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetFlexibleLoanInterestRateHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetFlexibleLoanInterestRateHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetFlexibleLoanInterestRateHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetFlexibleLoanInterestRateHistoryResponse() {} + + public GetFlexibleLoanInterestRateHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetFlexibleLoanInterestRateHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetFlexibleLoanInterestRateHistoryResponse addRowsItem( + GetFlexibleLoanInterestRateHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetFlexibleLoanInterestRateHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetFlexibleLoanInterestRateHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetFlexibleLoanInterestRateHistoryResponse total( + @jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFlexibleLoanInterestRateHistoryResponse getFlexibleLoanInterestRateHistoryResponse = + (GetFlexibleLoanInterestRateHistoryResponse) o; + return Objects.equals(this.rows, getFlexibleLoanInterestRateHistoryResponse.rows) + && Objects.equals(this.total, getFlexibleLoanInterestRateHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFlexibleLoanInterestRateHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("rows"); + openapiFields.add("total"); + + // 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 + * GetFlexibleLoanInterestRateHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetFlexibleLoanInterestRateHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetFlexibleLoanInterestRateHistoryResponse is not found in" + + " the empty JSON string", + GetFlexibleLoanInterestRateHistoryResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetFlexibleLoanInterestRateHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFlexibleLoanInterestRateHistoryResponse.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetFlexibleLoanInterestRateHistoryResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetFlexibleLoanInterestRateHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetFlexibleLoanInterestRateHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFlexibleLoanInterestRateHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFlexibleLoanInterestRateHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetFlexibleLoanInterestRateHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetFlexibleLoanInterestRateHistoryResponse + */ + public static GetFlexibleLoanInterestRateHistoryResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetFlexibleLoanInterestRateHistoryResponse.class); + } + + /** + * Convert an instance of GetFlexibleLoanInterestRateHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/GetFlexibleLoanInterestRateHistoryResponseRowsInner.java b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/GetFlexibleLoanInterestRateHistoryResponseRowsInner.java new file mode 100644 index 000000000..91e16c6b2 --- /dev/null +++ b/clients/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/model/GetFlexibleLoanInterestRateHistoryResponseRowsInner.java @@ -0,0 +1,313 @@ +/* + * Binance Crypto Loan REST API + * OpenAPI Specification for the Binance Crypto Loan REST 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.crypto_loan.rest.model; + +import com.binance.connector.client.crypto_loan.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetFlexibleLoanInterestRateHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetFlexibleLoanInterestRateHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_COIN = "coin"; + + @SerializedName(SERIALIZED_NAME_COIN) + @jakarta.annotation.Nullable + private String coin; + + public static final String SERIALIZED_NAME_ANNUALIZED_INTEREST_RATE = "annualizedInterestRate"; + + @SerializedName(SERIALIZED_NAME_ANNUALIZED_INTEREST_RATE) + @jakarta.annotation.Nullable + private String annualizedInterestRate; + + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public GetFlexibleLoanInterestRateHistoryResponseRowsInner() {} + + public GetFlexibleLoanInterestRateHistoryResponseRowsInner coin( + @jakarta.annotation.Nullable String coin) { + this.coin = coin; + return this; + } + + /** + * Get coin + * + * @return coin + */ + @jakarta.annotation.Nullable + public String getCoin() { + return coin; + } + + public void setCoin(@jakarta.annotation.Nullable String coin) { + this.coin = coin; + } + + public GetFlexibleLoanInterestRateHistoryResponseRowsInner annualizedInterestRate( + @jakarta.annotation.Nullable String annualizedInterestRate) { + this.annualizedInterestRate = annualizedInterestRate; + return this; + } + + /** + * Get annualizedInterestRate + * + * @return annualizedInterestRate + */ + @jakarta.annotation.Nullable + public String getAnnualizedInterestRate() { + return annualizedInterestRate; + } + + public void setAnnualizedInterestRate( + @jakarta.annotation.Nullable String annualizedInterestRate) { + this.annualizedInterestRate = annualizedInterestRate; + } + + public GetFlexibleLoanInterestRateHistoryResponseRowsInner time( + @jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFlexibleLoanInterestRateHistoryResponseRowsInner + getFlexibleLoanInterestRateHistoryResponseRowsInner = + (GetFlexibleLoanInterestRateHistoryResponseRowsInner) o; + return Objects.equals(this.coin, getFlexibleLoanInterestRateHistoryResponseRowsInner.coin) + && Objects.equals( + this.annualizedInterestRate, + getFlexibleLoanInterestRateHistoryResponseRowsInner.annualizedInterestRate) + && Objects.equals( + this.time, getFlexibleLoanInterestRateHistoryResponseRowsInner.time); + } + + @Override + public int hashCode() { + return Objects.hash(coin, annualizedInterestRate, time); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetFlexibleLoanInterestRateHistoryResponseRowsInner {\n"); + sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); + sb.append(" annualizedInterestRate: ") + .append(toIndentedString(annualizedInterestRate)) + .append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object coinValue = getCoin(); + String coinValueAsString = ""; + coinValueAsString = coinValue.toString(); + sb.append("coin=").append(urlEncode(coinValueAsString)).append(""); + Object annualizedInterestRateValue = getAnnualizedInterestRate(); + String annualizedInterestRateValueAsString = ""; + annualizedInterestRateValueAsString = annualizedInterestRateValue.toString(); + sb.append("annualizedInterestRate=") + .append(urlEncode(annualizedInterestRateValueAsString)) + .append(""); + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("coin"); + openapiFields.add("annualizedInterestRate"); + openapiFields.add("time"); + + // 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 + * GetFlexibleLoanInterestRateHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetFlexibleLoanInterestRateHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetFlexibleLoanInterestRateHistoryResponseRowsInner is not" + + " found in the empty JSON string", + GetFlexibleLoanInterestRateHistoryResponseRowsInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("coin") != null && !jsonObj.get("coin").isJsonNull()) + && !jsonObj.get("coin").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `coin` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("coin").toString())); + } + if ((jsonObj.get("annualizedInterestRate") != null + && !jsonObj.get("annualizedInterestRate").isJsonNull()) + && !jsonObj.get("annualizedInterestRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `annualizedInterestRate` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("annualizedInterestRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetFlexibleLoanInterestRateHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetFlexibleLoanInterestRateHistoryResponseRowsInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetFlexibleLoanInterestRateHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetFlexibleLoanInterestRateHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetFlexibleLoanInterestRateHistoryResponseRowsInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetFlexibleLoanInterestRateHistoryResponseRowsInner given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of GetFlexibleLoanInterestRateHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetFlexibleLoanInterestRateHistoryResponseRowsInner + */ + public static GetFlexibleLoanInterestRateHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetFlexibleLoanInterestRateHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetFlexibleLoanInterestRateHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index 46f71b8a7..a5dd1fc97 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 6.0.0 - 2026-02-12 + +### Changed (2) + +#### REST API + +- Modified response for `cancelMultipleOrders()` (`DELETE /dapi/v1/batchOrders`): + - items: property `pair` added + - items: item property `pair` added + +- Modified response for `currentAllOpenOrders()` (`GET /dapi/v1/openOrders`): + - items: property `pair` added + - items: item property `pair` added + ## 5.0.0 - 2025-12-16 ### Changed (1) diff --git a/clients/derivatives-trading-coin-futures/docs/AutoCancelAllOpenOrdersResponse.md b/clients/derivatives-trading-coin-futures/docs/AutoCancelAllOpenOrdersResponse.md new file mode 100644 index 000000000..80717cd32 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/AutoCancelAllOpenOrdersResponse.md @@ -0,0 +1,14 @@ + + +# AutoCancelAllOpenOrdersResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**countdownTime** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/KeepaliveMarginUserDataStreamRequest.md b/clients/derivatives-trading-coin-futures/docs/BatchOrdersPlaceMultipleOrders.md similarity index 62% rename from clients/margin-trading/docs/KeepaliveMarginUserDataStreamRequest.md rename to clients/derivatives-trading-coin-futures/docs/BatchOrdersPlaceMultipleOrders.md index b7415a0f6..d41e556fc 100644 --- a/clients/margin-trading/docs/KeepaliveMarginUserDataStreamRequest.md +++ b/clients/derivatives-trading-coin-futures/docs/BatchOrdersPlaceMultipleOrders.md @@ -1,13 +1,12 @@ -# KeepaliveMarginUserDataStreamRequest +# BatchOrdersPlaceMultipleOrders ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | | diff --git a/clients/derivatives-trading-coin-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md b/clients/derivatives-trading-coin-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md new file mode 100644 index 000000000..d54581b14 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/docs/BatchOrdersPlaceMultipleOrdersInner.md @@ -0,0 +1,118 @@ + + +# BatchOrdersPlaceMultipleOrdersInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**side** | [**SideEnum**](#SideEnum) | | [optional] | +|**positionSide** | [**PositionSideEnum**](#PositionSideEnum) | | [optional] | +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**timeInForce** | [**TimeInForceEnum**](#TimeInForceEnum) | | [optional] | +|**quantity** | **String** | | [optional] | +|**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] | + + + +## Enum: SideEnum + +| Name | Value | +|---- | -----| +| BUY | "BUY" | +| SELL | "SELL" | + + + +## Enum: PositionSideEnum + +| Name | Value | +|---- | -----| +| BOTH | "BOTH" | +| LONG | "LONG" | +| SHORT | "SHORT" | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| LIMIT | "LIMIT" | +| MARKET | "MARKET" | +| STOP | "STOP" | +| STOP_MARKET | "STOP_MARKET" | +| TAKE_PROFIT | "TAKE_PROFIT" | +| TAKE_PROFIT_MARKET | "TAKE_PROFIT_MARKET" | +| TRAILING_STOP_MARKET | "TRAILING_STOP_MARKET" | + + + +## Enum: TimeInForceEnum + +| Name | Value | +|---- | -----| +| GTC | "GTC" | +| IOC | "IOC" | +| FOK | "FOK" | +| GTX | "GTX" | + + + +## Enum: WorkingTypeEnum + +| Name | Value | +|---- | -----| +| MARK_PRICE | "MARK_PRICE" | +| CONTRACT_PRICE | "CONTRACT_PRICE" | + + + +## Enum: NewOrderRespTypeEnum + +| Name | Value | +|---- | -----| +| ACK | "ACK" | +| RESULT | "RESULT" | + + + +## Enum: PriceMatchEnum + +| Name | Value | +|---- | -----| +| NONE | "NONE" | +| OPPONENT | "OPPONENT" | +| OPPONENT_5 | "OPPONENT_5" | +| OPPONENT_10 | "OPPONENT_10" | +| OPPONENT_20 | "OPPONENT_20" | +| QUEUE | "QUEUE" | +| QUEUE_5 | "QUEUE_5" | +| QUEUE_10 | "QUEUE_10" | +| QUEUE_20 | "QUEUE_20" | + + + +## Enum: SelfTradePreventionModeEnum + +| Name | Value | +|---- | -----| +| NONE | "NONE" | +| EXPIRE_TAKER | "EXPIRE_TAKER" | +| EXPIRE_BOTH | "EXPIRE_BOTH" | +| EXPIRE_MAKER | "EXPIRE_MAKER" | + + + diff --git a/clients/derivatives-trading-coin-futures/docs/CancelMultipleOrdersResponseInner.md b/clients/derivatives-trading-coin-futures/docs/CancelMultipleOrdersResponseInner.md index 83db8e76e..ca94020b3 100644 --- a/clients/derivatives-trading-coin-futures/docs/CancelMultipleOrdersResponseInner.md +++ b/clients/derivatives-trading-coin-futures/docs/CancelMultipleOrdersResponseInner.md @@ -23,6 +23,7 @@ |**stopPrice** | **String** | | [optional] | |**closePosition** | **Boolean** | | [optional] | |**symbol** | **String** | | [optional] | +|**pair** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**type** | **String** | | [optional] | |**activatePrice** | **String** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginRequest.md b/clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersRequest.md similarity index 53% rename from clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginRequest.md rename to clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersRequest.md index d02b337ed..22e63396a 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginRequest.md +++ b/clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersRequest.md @@ -1,15 +1,13 @@ -# MintBfusdForPortfolioMarginRequest +# PlaceMultipleOrdersRequest ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**fromAsset** | **String** | | | -|**targetAsset** | **String** | | | -|**amount** | **Double** | | | +|**batchOrders** | **BatchOrdersPlaceMultipleOrders** | | | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/margin-trading/docs/StartIsolatedMarginUserDataStreamRequest.md b/clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersResponse.md similarity index 61% rename from clients/margin-trading/docs/StartIsolatedMarginUserDataStreamRequest.md rename to clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersResponse.md index 91f37dc45..81dcf0881 100644 --- a/clients/margin-trading/docs/StartIsolatedMarginUserDataStreamRequest.md +++ b/clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersResponse.md @@ -1,13 +1,12 @@ -# StartIsolatedMarginUserDataStreamRequest +# PlaceMultipleOrdersResponse ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | | diff --git a/clients/derivatives-trading-coin-futures/docs/CurrentAllOpenOrdersResponseInner.md b/clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersResponseInner.md similarity index 85% rename from clients/derivatives-trading-coin-futures/docs/CurrentAllOpenOrdersResponseInner.md rename to clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersResponseInner.md index 4f61c1cc9..1e8afb8e0 100644 --- a/clients/derivatives-trading-coin-futures/docs/CurrentAllOpenOrdersResponseInner.md +++ b/clients/derivatives-trading-coin-futures/docs/PlaceMultipleOrdersResponseInner.md @@ -1,30 +1,30 @@ -# CurrentAllOpenOrdersResponseInner +# PlaceMultipleOrdersResponseInner ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**avgPrice** | **String** | | [optional] | |**clientOrderId** | **String** | | [optional] | +|**cumQty** | **String** | | [optional] | |**cumBase** | **String** | | [optional] | |**executedQty** | **String** | | [optional] | |**orderId** | **Long** | | [optional] | +|**avgPrice** | **String** | | [optional] | |**origQty** | **String** | | [optional] | -|**origType** | **String** | | [optional] | |**price** | **String** | | [optional] | |**reduceOnly** | **Boolean** | | [optional] | |**side** | **String** | | [optional] | |**positionSide** | **String** | | [optional] | |**status** | **String** | | [optional] | |**stopPrice** | **String** | | [optional] | -|**closePosition** | **Boolean** | | [optional] | |**symbol** | **String** | | [optional] | -|**time** | **Long** | | [optional] | +|**pair** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**type** | **String** | | [optional] | +|**origType** | **String** | | [optional] | |**activatePrice** | **String** | | [optional] | |**priceRate** | **String** | | [optional] | |**updateTime** | **Long** | | [optional] | @@ -32,6 +32,8 @@ |**priceProtect** | **Boolean** | | [optional] | |**priceMatch** | **String** | | [optional] | |**selfTradePreventionMode** | **String** | | [optional] | +|**code** | **Long** | | [optional] | +|**msg** | **String** | | [optional] | diff --git a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md b/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md index 4cf462e39..b1a919496 100644 --- a/clients/derivatives-trading-coin-futures/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-coin-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-coin-futures - 5.0.0 + 6.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-coin-futures - 5.0.0 + 6.0.0 ``` diff --git a/clients/derivatives-trading-coin-futures/example_rest.md b/clients/derivatives-trading-coin-futures/example_rest.md index 1c5848373..232f2b3bd 100644 --- a/clients/derivatives-trading-coin-futures/example_rest.md +++ b/clients/derivatives-trading-coin-futures/example_rest.md @@ -90,7 +90,7 @@ [GET /dapi/v1/allOrders](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders) - allOrders - [AllOrdersExample.java:55](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/AllOrdersExample.java#L55) -[POST /dapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) - autoCancelAllOpenOrders - [AutoCancelAllOpenOrdersExample.java:55](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/AutoCancelAllOpenOrdersExample.java#L55) +[POST /dapi/v1/countdownCancelAll](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Auto-Cancel-All-Open-Orders) - autoCancelAllOpenOrders - [AutoCancelAllOpenOrdersExample.java:57](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/AutoCancelAllOpenOrdersExample.java#L57) [DELETE /dapi/v1/allOpenOrders](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders) - cancelAllOpenOrders - [CancelAllOpenOrdersExample.java:47](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/CancelAllOpenOrdersExample.java#L47) @@ -118,6 +118,8 @@ [POST /dapi/v1/order](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/New-Order) - newOrder - [NewOrderExample.java:85](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/NewOrderExample.java#L85) +[POST /dapi/v1/batchOrders](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders) - placeMultipleOrders - [PlaceMultipleOrdersExample.java:51](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/PlaceMultipleOrdersExample.java#L51) + [GET /dapi/v1/adlQuantile](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation) - positionAdlQuantileEstimation - [PositionAdlQuantileEstimationExample.java:55](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/PositionAdlQuantileEstimationExample.java#L55) [GET /dapi/v1/positionRisk](https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Position-Information) - positionInformation - [PositionInformationExample.java:52](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/PositionInformationExample.java#L52) @@ -132,7 +134,7 @@ [DELETE /dapi/v1/listenKey](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream) - closeUserDataStream - [CloseUserDataStreamExample.java:45](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/CloseUserDataStreamExample.java#L45) -[PUT /dapi/v1/listenKey](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:46](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/KeepaliveUserDataStreamExample.java#L46) +[PUT /dapi/v1/listenKey](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream) - keepaliveUserDataStream - [KeepaliveUserDataStreamExample.java:48](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/KeepaliveUserDataStreamExample.java#L48) [POST /dapi/v1/listenKey](https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream) - startUserDataStream - [StartUserDataStreamExample.java:49](/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/StartUserDataStreamExample.java#L49) diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index 01f5fb8fc..7455e2d52 100644 --- a/clients/derivatives-trading-coin-futures/pom.xml +++ b/clients/derivatives-trading-coin-futures/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-coin-futures derivatives-trading-coin-futures - 5.0.0 + 6.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/JSON.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/JSON.java index f33b6a1f0..11a409ef7 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/JSON.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/JSON.java @@ -132,6 +132,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .AutoCancelAllOpenOrdersRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.rest.model + .AutoCancelAllOpenOrdersResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .BasisResponse.CustomTypeAdapterFactory()); @@ -144,6 +147,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .BatchOrdersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.rest.model + .BatchOrdersPlaceMultipleOrders.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.rest.model + .BatchOrdersPlaceMultipleOrdersInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .CancelAllOpenOrdersResponse.CustomTypeAdapterFactory()); @@ -201,9 +210,6 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .CurrentAllOpenOrdersResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory( - new com.binance.connector.client.derivatives_trading_coin_futures.rest.model - .CurrentAllOpenOrdersResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .ExchangeInformationResponse.CustomTypeAdapterFactory()); @@ -305,6 +311,9 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .IndexPriceKlineCandlestickDataResponseItemInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.rest.model + .KeepaliveUserDataStreamResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .KlineCandlestickDataResponse.CustomTypeAdapterFactory()); @@ -399,6 +408,15 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .OrigClientOrderIdList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.rest.model + .PlaceMultipleOrdersRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.rest.model + .PlaceMultipleOrdersResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_coin_futures.rest.model + .PlaceMultipleOrdersResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_coin_futures.rest.model .PositionAdlQuantileEstimationResponse.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java index 7654bd34d..e47d23245 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/AccountApi.java @@ -54,7 +54,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/6.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-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java index 1f6c52e63..97ea12516 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/DerivativesTradingCoinFuturesRestApi.java @@ -9,6 +9,7 @@ import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AccountTradeListResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AllOrdersResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCancelAllOpenOrdersRequest; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCloseType; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.BasisResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.CancelAllOpenOrdersResponse; @@ -43,6 +44,7 @@ import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.IndexPriceAndMarkPriceResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.IndexPriceKlineCandlestickDataResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.Interval; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.KeepaliveUserDataStreamResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.KlineCandlestickDataResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.LongShortRatioResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.MarkPriceKlineCandlestickDataResponse; @@ -63,6 +65,8 @@ import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.OrderIdList; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.OrigClientOrderIdList; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.Period; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PlaceMultipleOrdersRequest; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PlaceMultipleOrdersResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PositionAdlQuantileEstimationResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PositionInformationResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PremiumIndexKlineDataResponse; @@ -1384,23 +1388,23 @@ public ApiResponse allOrders( * with an countdownTime of 0, the countdown timer will be stopped. Weight: 10 * * @param autoCancelAllOpenOrdersRequest (required) - * @return ApiResponse<Void> + * @return ApiResponse<AutoCancelAllOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 OK -
200 Auto-Cancel All Open Orders -
* * @see Auto-Cancel * All Open Orders (TRADE) Documentation */ - public void autoCancelAllOpenOrders( + public ApiResponse autoCancelAllOpenOrders( AutoCancelAllOpenOrdersRequest autoCancelAllOpenOrdersRequest) throws ApiException { - tradeApi.autoCancelAllOpenOrders(autoCancelAllOpenOrdersRequest); + return tradeApi.autoCancelAllOpenOrders(autoCancelAllOpenOrdersRequest); } /** @@ -1803,6 +1807,32 @@ public ApiResponse newOrder(NewOrderRequest newOrderRequest) return tradeApi.newOrder(newOrderRequest); } + /** + * Place Multiple Orders(TRADE) Place multiple orders * Parameter rules are same with `New + * Order` * Batch orders are processed concurrently, and the order of matching is not + * guaranteed. * The order of returned contents for batch orders is the same as the order of the + * order list. Weight: 5 + * + * @param placeMultipleOrdersRequest (required) + * @return ApiResponse<PlaceMultipleOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Place Multiple Orders -
+ * + * @see Place + * Multiple Orders(TRADE) Documentation + */ + public ApiResponse placeMultipleOrders( + PlaceMultipleOrdersRequest placeMultipleOrdersRequest) throws ApiException { + return tradeApi.placeMultipleOrders(placeMultipleOrdersRequest); + } + /** * Position ADL Quantile Estimation(USER_DATA) Query position ADL quantile estimation * Values * update every 30s. * Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from @@ -1989,22 +2019,23 @@ public void closeUserDataStream() throws ApiException { * Keepalive User Data Stream (USER_STREAM) Keepalive a user data stream to prevent a time out. * User data streams will close after 60 minutes. Weight: 1 * - * @return ApiResponse<Void> + * @return ApiResponse<KeepaliveUserDataStreamResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body * @http.response.details * * * - * + * *
Response Details
Status Code Description Response Headers
200 OK -
200 Keepalive User Data Stream -
* * @see Keepalive * User Data Stream (USER_STREAM) Documentation */ - public void keepaliveUserDataStream() throws ApiException { - userDataStreamsApi.keepaliveUserDataStream(); + public ApiResponse keepaliveUserDataStream() + throws ApiException { + return userDataStreamsApi.keepaliveUserDataStream(); } /** diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java index 6e0ed5a37..6f1d90074 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/MarketDataApi.java @@ -69,7 +69,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/6.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-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java index bdbf292ee..997507abc 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/PortfolioMarginEndpointsApi.java @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/6.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-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java index 51a757efa..0d7bbe58f 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApi.java @@ -24,6 +24,7 @@ import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AccountTradeListResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AllOrdersResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCancelAllOpenOrdersRequest; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCloseType; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.CancelAllOpenOrdersResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.CancelMultipleOrdersResponse; @@ -47,6 +48,8 @@ import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.NewOrderResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.OrderIdList; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.OrigClientOrderIdList; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PlaceMultipleOrdersRequest; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PlaceMultipleOrdersResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PositionAdlQuantileEstimationResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PositionInformationResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.QueryCurrentOpenOrderResponse; @@ -76,7 +79,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -557,7 +560,7 @@ public ApiResponse allOrders( * * * - * + * *
Response Details
Status Code Description Response Headers
200 OK -
200 Auto-Cancel All Open Orders -
* * @see * Response Details * Status Code Description Response Headers - * 200 OK - + * 200 Auto-Cancel All Open Orders - * * * @see Auto-Cancel * All Open Orders (TRADE) Documentation */ - public ApiResponse autoCancelAllOpenOrders( + public ApiResponse autoCancelAllOpenOrders( @Valid @NotNull AutoCancelAllOpenOrdersRequest autoCancelAllOpenOrdersRequest) throws ApiException { okhttp3.Call localVarCall = autoCancelAllOpenOrdersValidateBeforeCall(autoCancelAllOpenOrdersRequest); - return localVarApiClient.execute(localVarCall); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** @@ -2908,6 +2913,152 @@ public ApiResponse newOrder(@Valid @NotNull NewOrderRequest ne return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for placeMultipleOrders + * + * @param placeMultipleOrdersRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Place Multiple Orders -
+ * + * @see Place + * Multiple Orders(TRADE) Documentation + */ + private okhttp3.Call placeMultipleOrdersCall( + PlaceMultipleOrdersRequest placeMultipleOrdersRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/dapi/v1/batchOrders"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (placeMultipleOrdersRequest.getBatchOrders() != null) { + String json = JSON.getGson().toJson(placeMultipleOrdersRequest.getBatchOrders()); + localVarFormParams.put("batchOrders", json); + } + + if (placeMultipleOrdersRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", placeMultipleOrdersRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call placeMultipleOrdersValidateBeforeCall( + PlaceMultipleOrdersRequest placeMultipleOrdersRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {placeMultipleOrdersRequest}; + Method method = + this.getClass() + .getMethod("placeMultipleOrders", PlaceMultipleOrdersRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return placeMultipleOrdersCall(placeMultipleOrdersRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Place Multiple Orders(TRADE) Place multiple orders * Parameter rules are same with `New + * Order` * Batch orders are processed concurrently, and the order of matching is not + * guaranteed. * The order of returned contents for batch orders is the same as the order of the + * order list. Weight: 5 + * + * @param placeMultipleOrdersRequest (required) + * @return ApiResponse<PlaceMultipleOrdersResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Place Multiple Orders -
+ * + * @see Place + * Multiple Orders(TRADE) Documentation + */ + public ApiResponse placeMultipleOrders( + @Valid @NotNull PlaceMultipleOrdersRequest placeMultipleOrdersRequest) + throws ApiException { + okhttp3.Call localVarCall = + placeMultipleOrdersValidateBeforeCall(placeMultipleOrdersRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for positionAdlQuantileEstimation * diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java index 349def3d4..ee13e380a 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApi.java @@ -19,6 +19,7 @@ import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.exception.ConstraintViolationException; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.KeepaliveUserDataStreamResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.StartUserDataStreamResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; @@ -42,7 +43,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -210,7 +211,7 @@ public ApiResponse closeUserDataStream() throws ApiException { * * * - * + * *
Response Details
Status Code Description Response Headers
200 OK -
200 Keepalive User Data Stream -
* * @see * Response Details * Status Code Description Response Headers - * 200 OK - + * 200 Keepalive User Data Stream - * * * @see Keepalive * User Data Stream (USER_STREAM) Documentation */ - public ApiResponse keepaliveUserDataStream() throws ApiException { + public ApiResponse keepaliveUserDataStream() + throws ApiException { okhttp3.Call localVarCall = keepaliveUserDataStreamValidateBeforeCall(); - return localVarApiClient.execute(localVarCall); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartIsolatedMarginUserDataStreamRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AutoCancelAllOpenOrdersResponse.java similarity index 55% rename from clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartIsolatedMarginUserDataStreamRequest.java rename to clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AutoCancelAllOpenOrdersResponse.java index f65927a23..48e12c14d 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartIsolatedMarginUserDataStreamRequest.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/AutoCancelAllOpenOrdersResponse.java @@ -1,6 +1,6 @@ /* - * Binance Margin Trading REST API - * OpenAPI Specification for the Binance Margin Trading REST API + * Binance Derivatives Trading COIN Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures REST API * * The version of the OpenAPI document: 1.0.0 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.margin_trading.rest.model; +package com.binance.connector.client.derivatives_trading_coin_futures.rest.model; -import com.binance.connector.client.margin_trading.rest.JSON; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -31,21 +31,26 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** StartIsolatedMarginUserDataStreamRequest */ +/** AutoCancelAllOpenOrdersResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class StartIsolatedMarginUserDataStreamRequest { +public class AutoCancelAllOpenOrdersResponse { public static final String SERIALIZED_NAME_SYMBOL = "symbol"; @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nonnull + @jakarta.annotation.Nullable private String symbol; - public StartIsolatedMarginUserDataStreamRequest() {} + public static final String SERIALIZED_NAME_COUNTDOWN_TIME = "countdownTime"; - public StartIsolatedMarginUserDataStreamRequest symbol( - @jakarta.annotation.Nonnull String symbol) { + @SerializedName(SERIALIZED_NAME_COUNTDOWN_TIME) + @jakarta.annotation.Nullable + private String countdownTime; + + public AutoCancelAllOpenOrdersResponse() {} + + public AutoCancelAllOpenOrdersResponse symbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; return this; } @@ -55,16 +60,35 @@ public StartIsolatedMarginUserDataStreamRequest symbol( * * @return symbol */ - @jakarta.annotation.Nonnull - @NotNull + @jakarta.annotation.Nullable public String getSymbol() { return symbol; } - public void setSymbol(@jakarta.annotation.Nonnull String symbol) { + public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public AutoCancelAllOpenOrdersResponse countdownTime( + @jakarta.annotation.Nullable String countdownTime) { + this.countdownTime = countdownTime; + return this; + } + + /** + * Get countdownTime + * + * @return countdownTime + */ + @jakarta.annotation.Nullable + public String getCountdownTime() { + return countdownTime; + } + + public void setCountdownTime(@jakarta.annotation.Nullable String countdownTime) { + this.countdownTime = countdownTime; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -73,21 +97,24 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest = - (StartIsolatedMarginUserDataStreamRequest) o; - return Objects.equals(this.symbol, startIsolatedMarginUserDataStreamRequest.symbol); + AutoCancelAllOpenOrdersResponse autoCancelAllOpenOrdersResponse = + (AutoCancelAllOpenOrdersResponse) o; + return Objects.equals(this.symbol, autoCancelAllOpenOrdersResponse.symbol) + && Objects.equals( + this.countdownTime, autoCancelAllOpenOrdersResponse.countdownTime); } @Override public int hashCode() { - return Objects.hash(symbol); + return Objects.hash(symbol, countdownTime); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class StartIsolatedMarginUserDataStreamRequest {\n"); + sb.append("class AutoCancelAllOpenOrdersResponse {\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" countdownTime: ").append(toIndentedString(countdownTime)).append("\n"); sb.append("}"); return sb.toString(); } @@ -99,6 +126,10 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object countdownTimeValue = getCountdownTime(); + String countdownTimeValueAsString = ""; + countdownTimeValueAsString = countdownTimeValue.toString(); + sb.append("countdownTime=").append(urlEncode(countdownTimeValueAsString)).append(""); return sb.toString(); } @@ -128,10 +159,10 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("symbol"); + openapiFields.add("countdownTime"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("symbol"); } /** @@ -139,68 +170,62 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * StartIsolatedMarginUserDataStreamRequest + * AutoCancelAllOpenOrdersResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!StartIsolatedMarginUserDataStreamRequest.openapiRequiredFields + if (!AutoCancelAllOpenOrdersResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in" - + " StartIsolatedMarginUserDataStreamRequest is not found in" - + " the empty JSON string", - StartIsolatedMarginUserDataStreamRequest.openapiRequiredFields - .toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - StartIsolatedMarginUserDataStreamRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); + "The required field(s) %s in AutoCancelAllOpenOrdersResponse is not" + + " found in the empty JSON string", + AutoCancelAllOpenOrdersResponse.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("symbol").isJsonPrimitive()) { + 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" + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("countdownTime") != null && !jsonObj.get("countdownTime").isJsonNull()) + && !jsonObj.get("countdownTime").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `countdownTime` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("countdownTime").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!StartIsolatedMarginUserDataStreamRequest.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'StartIsolatedMarginUserDataStreamRequest' and its subtypes + if (!AutoCancelAllOpenOrdersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AutoCancelAllOpenOrdersResponse' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(StartIsolatedMarginUserDataStreamRequest.class)); + this, TypeToken.get(AutoCancelAllOpenOrdersResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, StartIsolatedMarginUserDataStreamRequest value) + public void write(JsonWriter out, AutoCancelAllOpenOrdersResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public StartIsolatedMarginUserDataStreamRequest read(JsonReader in) + public AutoCancelAllOpenOrdersResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -211,20 +236,19 @@ public StartIsolatedMarginUserDataStreamRequest read(JsonReader in) } /** - * Create an instance of StartIsolatedMarginUserDataStreamRequest given an JSON string + * Create an instance of AutoCancelAllOpenOrdersResponse given an JSON string * * @param jsonString JSON string - * @return An instance of StartIsolatedMarginUserDataStreamRequest + * @return An instance of AutoCancelAllOpenOrdersResponse * @throws IOException if the JSON string is invalid with respect to - * StartIsolatedMarginUserDataStreamRequest + * AutoCancelAllOpenOrdersResponse */ - public static StartIsolatedMarginUserDataStreamRequest fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, StartIsolatedMarginUserDataStreamRequest.class); + public static AutoCancelAllOpenOrdersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AutoCancelAllOpenOrdersResponse.class); } /** - * Convert an instance of StartIsolatedMarginUserDataStreamRequest to an JSON string + * Convert an instance of AutoCancelAllOpenOrdersResponse to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersPlaceMultipleOrders.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersPlaceMultipleOrders.java new file mode 100644 index 000000000..6cf7c5fb3 --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersPlaceMultipleOrders.java @@ -0,0 +1,187 @@ +/* + * Binance Derivatives Trading COIN Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures REST 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_coin_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_coin_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** BatchOrdersPlaceMultipleOrders */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchOrdersPlaceMultipleOrders extends ArrayList { + public BatchOrdersPlaceMultipleOrders() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchOrdersPlaceMultipleOrders {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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(); + + // 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 + * BatchOrdersPlaceMultipleOrders + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + BatchOrdersPlaceMultipleOrdersInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!BatchOrdersPlaceMultipleOrders.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BatchOrdersPlaceMultipleOrders is not" + + " found in the empty JSON string", + BatchOrdersPlaceMultipleOrders.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchOrdersPlaceMultipleOrders.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchOrdersPlaceMultipleOrders' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BatchOrdersPlaceMultipleOrders.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchOrdersPlaceMultipleOrders value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public BatchOrdersPlaceMultipleOrders read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BatchOrdersPlaceMultipleOrders given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchOrdersPlaceMultipleOrders + * @throws IOException if the JSON string is invalid with respect to + * BatchOrdersPlaceMultipleOrders + */ + public static BatchOrdersPlaceMultipleOrders fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchOrdersPlaceMultipleOrders.class); + } + + /** + * Convert an instance of BatchOrdersPlaceMultipleOrders to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java new file mode 100644 index 000000000..ac9dc794d --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/BatchOrdersPlaceMultipleOrdersInner.java @@ -0,0 +1,1385 @@ +/* + * Binance Derivatives Trading COIN Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures REST 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_coin_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_coin_futures.rest.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.JsonAdapter; +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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** BatchOrdersPlaceMultipleOrdersInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class BatchOrdersPlaceMultipleOrdersInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + /** Gets or Sets side */ + @JsonAdapter(SideEnum.Adapter.class) + public enum SideEnum { + BUY("BUY"), + + SELL("SELL"); + + private String value; + + SideEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SideEnum fromValue(String value) { + for (SideEnum b : SideEnum.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 SideEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SideEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SideEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SideEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SIDE = "side"; + + @SerializedName(SERIALIZED_NAME_SIDE) + @jakarta.annotation.Nullable + private SideEnum side; + + /** Gets or Sets positionSide */ + @JsonAdapter(PositionSideEnum.Adapter.class) + public enum PositionSideEnum { + BOTH("BOTH"), + + LONG("LONG"), + + SHORT("SHORT"); + + private String value; + + PositionSideEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PositionSideEnum fromValue(String value) { + for (PositionSideEnum b : PositionSideEnum.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 PositionSideEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PositionSideEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PositionSideEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PositionSideEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; + + @SerializedName(SERIALIZED_NAME_POSITION_SIDE) + @jakarta.annotation.Nullable + private PositionSideEnum positionSide; + + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + LIMIT("LIMIT"), + + MARKET("MARKET"), + + STOP("STOP"), + + STOP_MARKET("STOP_MARKET"), + + TAKE_PROFIT("TAKE_PROFIT"), + + TAKE_PROFIT_MARKET("TAKE_PROFIT_MARKET"), + + TRAILING_STOP_MARKET("TRAILING_STOP_MARKET"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.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 TypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private TypeEnum type; + + /** Gets or Sets timeInForce */ + @JsonAdapter(TimeInForceEnum.Adapter.class) + public enum TimeInForceEnum { + GTC("GTC"), + + IOC("IOC"), + + FOK("FOK"), + + GTX("GTX"); + + private String value; + + TimeInForceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TimeInForceEnum fromValue(String value) { + for (TimeInForceEnum b : TimeInForceEnum.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 TimeInForceEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TimeInForceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TimeInForceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TimeInForceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; + + @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) + @jakarta.annotation.Nullable + private TimeInForceEnum 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_REDUCE_ONLY = "reduceOnly"; + + @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) + @jakarta.annotation.Nullable + private String reduceOnly; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_NEW_CLIENT_ORDER_ID = "newClientOrderId"; + + @SerializedName(SERIALIZED_NAME_NEW_CLIENT_ORDER_ID) + @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 { + ACK("ACK"), + + RESULT("RESULT"); + + private String value; + + NewOrderRespTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NewOrderRespTypeEnum fromValue(String value) { + for (NewOrderRespTypeEnum b : NewOrderRespTypeEnum.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 NewOrderRespTypeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NewOrderRespTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NewOrderRespTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NewOrderRespTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; + + @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) + @jakarta.annotation.Nullable + private NewOrderRespTypeEnum newOrderRespType; + + /** Gets or Sets priceMatch */ + @JsonAdapter(PriceMatchEnum.Adapter.class) + public enum PriceMatchEnum { + NONE("NONE"), + + OPPONENT("OPPONENT"), + + OPPONENT_5("OPPONENT_5"), + + OPPONENT_10("OPPONENT_10"), + + OPPONENT_20("OPPONENT_20"), + + QUEUE("QUEUE"), + + QUEUE_5("QUEUE_5"), + + QUEUE_10("QUEUE_10"), + + QUEUE_20("QUEUE_20"); + + private String value; + + PriceMatchEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PriceMatchEnum fromValue(String value) { + for (PriceMatchEnum b : PriceMatchEnum.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 PriceMatchEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PriceMatchEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PriceMatchEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PriceMatchEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PRICE_MATCH = "priceMatch"; + + @SerializedName(SERIALIZED_NAME_PRICE_MATCH) + @jakarta.annotation.Nullable + private PriceMatchEnum priceMatch; + + /** Gets or Sets selfTradePreventionMode */ + @JsonAdapter(SelfTradePreventionModeEnum.Adapter.class) + public enum SelfTradePreventionModeEnum { + NONE("NONE"), + + EXPIRE_TAKER("EXPIRE_TAKER"), + + EXPIRE_BOTH("EXPIRE_BOTH"), + + EXPIRE_MAKER("EXPIRE_MAKER"); + + private String value; + + SelfTradePreventionModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SelfTradePreventionModeEnum fromValue(String value) { + for (SelfTradePreventionModeEnum b : SelfTradePreventionModeEnum.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 SelfTradePreventionModeEnum enumeration) + throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SelfTradePreventionModeEnum read(final JsonReader jsonReader) + throws IOException { + String value = jsonReader.nextString(); + return SelfTradePreventionModeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SelfTradePreventionModeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private SelfTradePreventionModeEnum selfTradePreventionMode; + + public BatchOrdersPlaceMultipleOrdersInner() {} + + public BatchOrdersPlaceMultipleOrdersInner 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 BatchOrdersPlaceMultipleOrdersInner side(@jakarta.annotation.Nullable SideEnum side) { + this.side = side; + return this; + } + + /** + * Get side + * + * @return side + */ + @jakarta.annotation.Nullable + public SideEnum getSide() { + return side; + } + + public void setSide(@jakarta.annotation.Nullable SideEnum side) { + this.side = side; + } + + public BatchOrdersPlaceMultipleOrdersInner positionSide( + @jakarta.annotation.Nullable PositionSideEnum positionSide) { + this.positionSide = positionSide; + return this; + } + + /** + * Get positionSide + * + * @return positionSide + */ + @jakarta.annotation.Nullable + public PositionSideEnum getPositionSide() { + return positionSide; + } + + public void setPositionSide(@jakarta.annotation.Nullable PositionSideEnum positionSide) { + this.positionSide = positionSide; + } + + public BatchOrdersPlaceMultipleOrdersInner type(@jakarta.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public TypeEnum getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable TypeEnum type) { + this.type = type; + } + + public BatchOrdersPlaceMultipleOrdersInner timeInForce( + @jakarta.annotation.Nullable TimeInForceEnum timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + /** + * Get timeInForce + * + * @return timeInForce + */ + @jakarta.annotation.Nullable + public TimeInForceEnum getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(@jakarta.annotation.Nullable TimeInForceEnum timeInForce) { + this.timeInForce = timeInForce; + } + + public BatchOrdersPlaceMultipleOrdersInner 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 BatchOrdersPlaceMultipleOrdersInner reduceOnly( + @jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + return this; + } + + /** + * Get reduceOnly + * + * @return reduceOnly + */ + @jakarta.annotation.Nullable + public String getReduceOnly() { + return reduceOnly; + } + + public void setReduceOnly(@jakarta.annotation.Nullable String reduceOnly) { + this.reduceOnly = reduceOnly; + } + + public BatchOrdersPlaceMultipleOrdersInner 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 BatchOrdersPlaceMultipleOrdersInner newClientOrderId( + @jakarta.annotation.Nullable String newClientOrderId) { + this.newClientOrderId = newClientOrderId; + return this; + } + + /** + * Get newClientOrderId + * + * @return newClientOrderId + */ + @jakarta.annotation.Nullable + public String getNewClientOrderId() { + return newClientOrderId; + } + + public void setNewClientOrderId(@jakarta.annotation.Nullable String newClientOrderId) { + 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; + return this; + } + + /** + * Get newOrderRespType + * + * @return newOrderRespType + */ + @jakarta.annotation.Nullable + public NewOrderRespTypeEnum getNewOrderRespType() { + return newOrderRespType; + } + + public void setNewOrderRespType( + @jakarta.annotation.Nullable NewOrderRespTypeEnum newOrderRespType) { + this.newOrderRespType = newOrderRespType; + } + + public BatchOrdersPlaceMultipleOrdersInner priceMatch( + @jakarta.annotation.Nullable PriceMatchEnum priceMatch) { + this.priceMatch = priceMatch; + return this; + } + + /** + * Get priceMatch + * + * @return priceMatch + */ + @jakarta.annotation.Nullable + public PriceMatchEnum getPriceMatch() { + return priceMatch; + } + + public void setPriceMatch(@jakarta.annotation.Nullable PriceMatchEnum priceMatch) { + this.priceMatch = priceMatch; + } + + public BatchOrdersPlaceMultipleOrdersInner selfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionModeEnum selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + return this; + } + + /** + * Get selfTradePreventionMode + * + * @return selfTradePreventionMode + */ + @jakarta.annotation.Nullable + public SelfTradePreventionModeEnum getSelfTradePreventionMode() { + return selfTradePreventionMode; + } + + public void setSelfTradePreventionMode( + @jakarta.annotation.Nullable SelfTradePreventionModeEnum selfTradePreventionMode) { + this.selfTradePreventionMode = selfTradePreventionMode; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchOrdersPlaceMultipleOrdersInner batchOrdersPlaceMultipleOrdersInner = + (BatchOrdersPlaceMultipleOrdersInner) o; + return Objects.equals(this.symbol, batchOrdersPlaceMultipleOrdersInner.symbol) + && Objects.equals(this.side, batchOrdersPlaceMultipleOrdersInner.side) + && Objects.equals( + this.positionSide, batchOrdersPlaceMultipleOrdersInner.positionSide) + && Objects.equals(this.type, batchOrdersPlaceMultipleOrdersInner.type) + && Objects.equals(this.timeInForce, batchOrdersPlaceMultipleOrdersInner.timeInForce) + && Objects.equals(this.quantity, batchOrdersPlaceMultipleOrdersInner.quantity) + && Objects.equals(this.reduceOnly, batchOrdersPlaceMultipleOrdersInner.reduceOnly) + && 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) + && Objects.equals( + this.selfTradePreventionMode, + batchOrdersPlaceMultipleOrdersInner.selfTradePreventionMode); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + side, + positionSide, + type, + timeInForce, + quantity, + reduceOnly, + price, + newClientOrderId, + stopPrice, + activationPrice, + callbackRate, + workingType, + priceProtect, + newOrderRespType, + priceMatch, + selfTradePreventionMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchOrdersPlaceMultipleOrdersInner {\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(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + 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: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object quantityValue = getQuantity(); + String quantityValueAsString = ""; + quantityValueAsString = quantityValue.toString(); + sb.append("quantity=").append(urlEncode(quantityValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object newClientOrderIdValue = getNewClientOrderId(); + 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(); + sb.append("newOrderRespType=").append(urlEncode(newOrderRespTypeValueAsString)).append(""); + Object priceMatchValue = getPriceMatch(); + String priceMatchValueAsString = ""; + priceMatchValueAsString = priceMatchValue.toString(); + sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("symbol"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("type"); + openapiFields.add("timeInForce"); + openapiFields.add("quantity"); + 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"); + + // 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 + * BatchOrdersPlaceMultipleOrdersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchOrdersPlaceMultipleOrdersInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in BatchOrdersPlaceMultipleOrdersInner is" + + " not found in the empty JSON string", + BatchOrdersPlaceMultipleOrdersInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + 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" + + " 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())); + } + // validate the optional field `side` + if (jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) { + SideEnum.validateJsonElement(jsonObj.get("side")); + } + 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())); + } + // validate the optional field `positionSide` + if (jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) { + PositionSideEnum.validateJsonElement(jsonObj.get("positionSide")); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").toString())); + } + // validate the optional field `type` + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) { + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + 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())); + } + // validate the optional field `timeInForce` + if (jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) { + TimeInForceEnum.validateJsonElement(jsonObj.get("timeInForce")); + } + if ((jsonObj.get("quantity") != null && !jsonObj.get("quantity").isJsonNull()) + && !jsonObj.get("quantity").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("reduceOnly") != null && !jsonObj.get("reduceOnly").isJsonNull()) + && !jsonObj.get("reduceOnly").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `reduceOnly` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("reduceOnly").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("newClientOrderId") != null + && !jsonObj.get("newClientOrderId").isJsonNull()) + && !jsonObj.get("newClientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newClientOrderId` to be a primitive type in the" + + " 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()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `newOrderRespType` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("newOrderRespType").toString())); + } + // validate the optional field `newOrderRespType` + if (jsonObj.get("newOrderRespType") != null + && !jsonObj.get("newOrderRespType").isJsonNull()) { + NewOrderRespTypeEnum.validateJsonElement(jsonObj.get("newOrderRespType")); + } + 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())); + } + // validate the optional field `priceMatch` + if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { + PriceMatchEnum.validateJsonElement(jsonObj.get("priceMatch")); + } + 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())); + } + // validate the optional field `selfTradePreventionMode` + if (jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { + SelfTradePreventionModeEnum.validateJsonElement(jsonObj.get("selfTradePreventionMode")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BatchOrdersPlaceMultipleOrdersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchOrdersPlaceMultipleOrdersInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(BatchOrdersPlaceMultipleOrdersInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, BatchOrdersPlaceMultipleOrdersInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BatchOrdersPlaceMultipleOrdersInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of BatchOrdersPlaceMultipleOrdersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchOrdersPlaceMultipleOrdersInner + * @throws IOException if the JSON string is invalid with respect to + * BatchOrdersPlaceMultipleOrdersInner + */ + public static BatchOrdersPlaceMultipleOrdersInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, BatchOrdersPlaceMultipleOrdersInner.class); + } + + /** + * Convert an instance of BatchOrdersPlaceMultipleOrdersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponseInner.java index b0b1ddf28..025c1ecd0 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CancelMultipleOrdersResponseInner.java @@ -132,6 +132,12 @@ public class CancelMultipleOrdersResponseInner { @jakarta.annotation.Nullable private String symbol; + public static final String SERIALIZED_NAME_PAIR = "pair"; + + @SerializedName(SERIALIZED_NAME_PAIR) + @jakarta.annotation.Nullable + private String pair; + public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) @@ -513,6 +519,25 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } + public CancelMultipleOrdersResponseInner pair(@jakarta.annotation.Nullable String pair) { + this.pair = pair; + return this; + } + + /** + * Get pair + * + * @return pair + */ + @jakarta.annotation.Nullable + public String getPair() { + return pair; + } + + public void setPair(@jakarta.annotation.Nullable String pair) { + this.pair = pair; + } + public CancelMultipleOrdersResponseInner timeInForce( @jakarta.annotation.Nullable String timeInForce) { this.timeInForce = timeInForce; @@ -759,6 +784,7 @@ public boolean equals(Object o) { && Objects.equals( this.closePosition, cancelMultipleOrdersResponseInner.closePosition) && Objects.equals(this.symbol, cancelMultipleOrdersResponseInner.symbol) + && Objects.equals(this.pair, cancelMultipleOrdersResponseInner.pair) && Objects.equals(this.timeInForce, cancelMultipleOrdersResponseInner.timeInForce) && Objects.equals(this.type, cancelMultipleOrdersResponseInner.type) && Objects.equals( @@ -794,6 +820,7 @@ public int hashCode() { stopPrice, closePosition, symbol, + pair, timeInForce, type, activatePrice, @@ -827,6 +854,7 @@ public String toString() { sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" pair: ").append(toIndentedString(pair)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); @@ -911,6 +939,10 @@ public String toUrlQueryString() { String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object pairValue = getPair(); + String pairValueAsString = ""; + pairValueAsString = pairValue.toString(); + sb.append("pair=").append(urlEncode(pairValueAsString)).append(""); Object timeInForceValue = getTimeInForce(); String timeInForceValueAsString = ""; timeInForceValueAsString = timeInForceValue.toString(); @@ -1001,6 +1033,7 @@ private String toIndentedString(Object o) { openapiFields.add("stopPrice"); openapiFields.add("closePosition"); openapiFields.add("symbol"); + openapiFields.add("pair"); openapiFields.add("timeInForce"); openapiFields.add("type"); openapiFields.add("activatePrice"); @@ -1141,6 +1174,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) + && !jsonObj.get("pair").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pair` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("pair").toString())); + } if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) && !jsonObj.get("timeInForce").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponse.java index c6255c216..d72194ebf 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponse.java @@ -35,7 +35,7 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class CurrentAllOpenOrdersResponse extends ArrayList { +public class CurrentAllOpenOrdersResponse extends ArrayList { public CurrentAllOpenOrdersResponse() {} @Override @@ -117,7 +117,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti JsonArray array = jsonElement.getAsJsonArray(); // validate array items for (JsonElement element : array) { - CurrentAllOpenOrdersResponseInner.validateJsonElement(element); + AllOrdersResponseInner.validateJsonElement(element); } if (jsonElement == null) { if (!CurrentAllOpenOrdersResponse.openapiRequiredFields diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartMarginUserDataStreamResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KeepaliveUserDataStreamResponse.java similarity index 72% rename from clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartMarginUserDataStreamResponse.java rename to clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KeepaliveUserDataStreamResponse.java index 35796aa39..80f099d16 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartMarginUserDataStreamResponse.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/KeepaliveUserDataStreamResponse.java @@ -1,6 +1,6 @@ /* - * Binance Margin Trading REST API - * OpenAPI Specification for the Binance Margin Trading REST API + * Binance Derivatives Trading COIN Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures REST API * * The version of the OpenAPI document: 1.0.0 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.margin_trading.rest.model; +package com.binance.connector.client.derivatives_trading_coin_futures.rest.model; -import com.binance.connector.client.margin_trading.rest.JSON; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -31,20 +31,20 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** StartMarginUserDataStreamResponse */ +/** KeepaliveUserDataStreamResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class StartMarginUserDataStreamResponse { +public class KeepaliveUserDataStreamResponse { public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; @SerializedName(SERIALIZED_NAME_LISTEN_KEY) @jakarta.annotation.Nullable private String listenKey; - public StartMarginUserDataStreamResponse() {} + public KeepaliveUserDataStreamResponse() {} - public StartMarginUserDataStreamResponse listenKey( + public KeepaliveUserDataStreamResponse listenKey( @jakarta.annotation.Nullable String listenKey) { this.listenKey = listenKey; return this; @@ -72,9 +72,9 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - StartMarginUserDataStreamResponse startMarginUserDataStreamResponse = - (StartMarginUserDataStreamResponse) o; - return Objects.equals(this.listenKey, startMarginUserDataStreamResponse.listenKey); + KeepaliveUserDataStreamResponse keepaliveUserDataStreamResponse = + (KeepaliveUserDataStreamResponse) o; + return Objects.equals(this.listenKey, keepaliveUserDataStreamResponse.listenKey); } @Override @@ -85,7 +85,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class StartMarginUserDataStreamResponse {\n"); + sb.append("class KeepaliveUserDataStreamResponse {\n"); sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); sb.append("}"); return sb.toString(); @@ -137,18 +137,17 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * StartMarginUserDataStreamResponse + * KeepaliveUserDataStreamResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!StartMarginUserDataStreamResponse.openapiRequiredFields + if (!KeepaliveUserDataStreamResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in StartMarginUserDataStreamResponse is" - + " not found in the empty JSON string", - StartMarginUserDataStreamResponse.openapiRequiredFields - .toString())); + "The required field(s) %s in KeepaliveUserDataStreamResponse is not" + + " found in the empty JSON string", + KeepaliveUserDataStreamResponse.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -166,26 +165,26 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!StartMarginUserDataStreamResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'StartMarginUserDataStreamResponse' and - // its subtypes + if (!KeepaliveUserDataStreamResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'KeepaliveUserDataStreamResponse' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(StartMarginUserDataStreamResponse.class)); + this, TypeToken.get(KeepaliveUserDataStreamResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, StartMarginUserDataStreamResponse value) + public void write(JsonWriter out, KeepaliveUserDataStreamResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public StartMarginUserDataStreamResponse read(JsonReader in) + public KeepaliveUserDataStreamResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -196,19 +195,19 @@ public StartMarginUserDataStreamResponse read(JsonReader in) } /** - * Create an instance of StartMarginUserDataStreamResponse given an JSON string + * Create an instance of KeepaliveUserDataStreamResponse given an JSON string * * @param jsonString JSON string - * @return An instance of StartMarginUserDataStreamResponse + * @return An instance of KeepaliveUserDataStreamResponse * @throws IOException if the JSON string is invalid with respect to - * StartMarginUserDataStreamResponse + * KeepaliveUserDataStreamResponse */ - public static StartMarginUserDataStreamResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StartMarginUserDataStreamResponse.class); + public static KeepaliveUserDataStreamResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, KeepaliveUserDataStreamResponse.class); } /** - * Convert an instance of StartMarginUserDataStreamResponse to an JSON string + * Convert an instance of KeepaliveUserDataStreamResponse to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersRequest.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersRequest.java new file mode 100644 index 000000000..0832bc93a --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersRequest.java @@ -0,0 +1,251 @@ +/* + * Binance Derivatives Trading COIN Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures REST 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_coin_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_coin_futures.rest.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.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** PlaceMultipleOrdersRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PlaceMultipleOrdersRequest { + public static final String SERIALIZED_NAME_BATCH_ORDERS = "batchOrders"; + + @SerializedName(SERIALIZED_NAME_BATCH_ORDERS) + @jakarta.annotation.Nonnull + private BatchOrdersPlaceMultipleOrders batchOrders; + + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public PlaceMultipleOrdersRequest() {} + + public PlaceMultipleOrdersRequest batchOrders( + @jakarta.annotation.Nonnull BatchOrdersPlaceMultipleOrders batchOrders) { + this.batchOrders = batchOrders; + return this; + } + + /** + * Get batchOrders + * + * @return batchOrders + */ + @jakarta.annotation.Nonnull + @NotNull + @Valid + public BatchOrdersPlaceMultipleOrders getBatchOrders() { + return batchOrders; + } + + public void setBatchOrders( + @jakarta.annotation.Nonnull BatchOrdersPlaceMultipleOrders batchOrders) { + this.batchOrders = batchOrders; + } + + public PlaceMultipleOrdersRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PlaceMultipleOrdersRequest placeMultipleOrdersRequest = (PlaceMultipleOrdersRequest) o; + return Objects.equals(this.batchOrders, placeMultipleOrdersRequest.batchOrders) + && Objects.equals(this.recvWindow, placeMultipleOrdersRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(batchOrders, recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaceMultipleOrdersRequest {\n"); + sb.append(" batchOrders: ").append(toIndentedString(batchOrders)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object batchOrdersValue = getBatchOrders(); + String batchOrdersValueAsString = ""; + batchOrdersValueAsString = batchOrdersValue.toString(); + sb.append("batchOrders=").append(urlEncode(batchOrdersValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("batchOrders"); + openapiFields.add("recvWindow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("batchOrders"); + } + + /** + * 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 PlaceMultipleOrdersRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PlaceMultipleOrdersRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PlaceMultipleOrdersRequest is not" + + " found in the empty JSON string", + PlaceMultipleOrdersRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PlaceMultipleOrdersRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PlaceMultipleOrdersRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PlaceMultipleOrdersRequest' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PlaceMultipleOrdersRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PlaceMultipleOrdersRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PlaceMultipleOrdersRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PlaceMultipleOrdersRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PlaceMultipleOrdersRequest + * @throws IOException if the JSON string is invalid with respect to PlaceMultipleOrdersRequest + */ + public static PlaceMultipleOrdersRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PlaceMultipleOrdersRequest.class); + } + + /** + * Convert an instance of PlaceMultipleOrdersRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersResponse.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersResponse.java new file mode 100644 index 000000000..8e0b2857a --- /dev/null +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersResponse.java @@ -0,0 +1,184 @@ +/* + * Binance Derivatives Trading COIN Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading COIN Futures REST 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_coin_futures.rest.model; + +import com.binance.connector.client.derivatives_trading_coin_futures.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** PlaceMultipleOrdersResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class PlaceMultipleOrdersResponse extends ArrayList { + public PlaceMultipleOrdersResponse() {} + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PlaceMultipleOrdersResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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(); + + // 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 + * PlaceMultipleOrdersResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + PlaceMultipleOrdersResponseInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!PlaceMultipleOrdersResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in PlaceMultipleOrdersResponse is not" + + " found in the empty JSON string", + PlaceMultipleOrdersResponse.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PlaceMultipleOrdersResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PlaceMultipleOrdersResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(PlaceMultipleOrdersResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, PlaceMultipleOrdersResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public PlaceMultipleOrdersResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of PlaceMultipleOrdersResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PlaceMultipleOrdersResponse + * @throws IOException if the JSON string is invalid with respect to PlaceMultipleOrdersResponse + */ + public static PlaceMultipleOrdersResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PlaceMultipleOrdersResponse.class); + } + + /** + * Convert an instance of PlaceMultipleOrdersResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponseInner.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersResponseInner.java similarity index 77% rename from clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponseInner.java rename to clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersResponseInner.java index 3c3ac1243..00f1cfd50 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/CurrentAllOpenOrdersResponseInner.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/model/PlaceMultipleOrdersResponseInner.java @@ -31,23 +31,23 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** CurrentAllOpenOrdersResponseInner */ +/** PlaceMultipleOrdersResponseInner */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class CurrentAllOpenOrdersResponseInner { - public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE) - @jakarta.annotation.Nullable - private String avgPrice; - +public class PlaceMultipleOrdersResponseInner { public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) @jakarta.annotation.Nullable private String clientOrderId; + public static final String SERIALIZED_NAME_CUM_QTY = "cumQty"; + + @SerializedName(SERIALIZED_NAME_CUM_QTY) + @jakarta.annotation.Nullable + private String cumQty; + public static final String SERIALIZED_NAME_CUM_BASE = "cumBase"; @SerializedName(SERIALIZED_NAME_CUM_BASE) @@ -66,17 +66,17 @@ public class CurrentAllOpenOrdersResponseInner { @jakarta.annotation.Nullable private Long orderId; - public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; - @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @SerializedName(SERIALIZED_NAME_AVG_PRICE) @jakarta.annotation.Nullable - private String origQty; + private String avgPrice; - public static final String SERIALIZED_NAME_ORIG_TYPE = "origType"; + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; - @SerializedName(SERIALIZED_NAME_ORIG_TYPE) + @SerializedName(SERIALIZED_NAME_ORIG_QTY) @jakarta.annotation.Nullable - private String origType; + private String origQty; public static final String SERIALIZED_NAME_PRICE = "price"; @@ -114,23 +114,17 @@ public class CurrentAllOpenOrdersResponseInner { @jakarta.annotation.Nullable private String stopPrice; - 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_SYMBOL = "symbol"; @SerializedName(SERIALIZED_NAME_SYMBOL) @jakarta.annotation.Nullable private String symbol; - public static final String SERIALIZED_NAME_TIME = "time"; + public static final String SERIALIZED_NAME_PAIR = "pair"; - @SerializedName(SERIALIZED_NAME_TIME) + @SerializedName(SERIALIZED_NAME_PAIR) @jakarta.annotation.Nullable - private Long time; + private String pair; public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; @@ -144,6 +138,12 @@ public class CurrentAllOpenOrdersResponseInner { @jakarta.annotation.Nullable private String type; + public static final String SERIALIZED_NAME_ORIG_TYPE = "origType"; + + @SerializedName(SERIALIZED_NAME_ORIG_TYPE) + @jakarta.annotation.Nullable + private String origType; + public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) @@ -187,29 +187,21 @@ public class CurrentAllOpenOrdersResponseInner { @jakarta.annotation.Nullable private String selfTradePreventionMode; - public CurrentAllOpenOrdersResponseInner() {} + public static final String SERIALIZED_NAME_CODE = "code"; - public CurrentAllOpenOrdersResponseInner avgPrice( - @jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - return this; - } + @SerializedName(SERIALIZED_NAME_CODE) + @jakarta.annotation.Nullable + private Long code; - /** - * Get avgPrice - * - * @return avgPrice - */ + public static final String SERIALIZED_NAME_MSG = "msg"; + + @SerializedName(SERIALIZED_NAME_MSG) @jakarta.annotation.Nullable - public String getAvgPrice() { - return avgPrice; - } + private String msg; - public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - } + public PlaceMultipleOrdersResponseInner() {} - public CurrentAllOpenOrdersResponseInner clientOrderId( + public PlaceMultipleOrdersResponseInner clientOrderId( @jakarta.annotation.Nullable String clientOrderId) { this.clientOrderId = clientOrderId; return this; @@ -229,7 +221,26 @@ public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) this.clientOrderId = clientOrderId; } - public CurrentAllOpenOrdersResponseInner cumBase(@jakarta.annotation.Nullable String cumBase) { + public PlaceMultipleOrdersResponseInner cumQty(@jakarta.annotation.Nullable String cumQty) { + this.cumQty = cumQty; + return this; + } + + /** + * Get cumQty + * + * @return cumQty + */ + @jakarta.annotation.Nullable + public String getCumQty() { + return cumQty; + } + + public void setCumQty(@jakarta.annotation.Nullable String cumQty) { + this.cumQty = cumQty; + } + + public PlaceMultipleOrdersResponseInner cumBase(@jakarta.annotation.Nullable String cumBase) { this.cumBase = cumBase; return this; } @@ -248,7 +259,7 @@ public void setCumBase(@jakarta.annotation.Nullable String cumBase) { this.cumBase = cumBase; } - public CurrentAllOpenOrdersResponseInner executedQty( + public PlaceMultipleOrdersResponseInner executedQty( @jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; return this; @@ -268,7 +279,7 @@ public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { this.executedQty = executedQty; } - public CurrentAllOpenOrdersResponseInner orderId(@jakarta.annotation.Nullable Long orderId) { + public PlaceMultipleOrdersResponseInner orderId(@jakarta.annotation.Nullable Long orderId) { this.orderId = orderId; return this; } @@ -287,46 +298,45 @@ public void setOrderId(@jakarta.annotation.Nullable Long orderId) { this.orderId = orderId; } - public CurrentAllOpenOrdersResponseInner origQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; + public PlaceMultipleOrdersResponseInner avgPrice(@jakarta.annotation.Nullable String avgPrice) { + this.avgPrice = avgPrice; return this; } /** - * Get origQty + * Get avgPrice * - * @return origQty + * @return avgPrice */ @jakarta.annotation.Nullable - public String getOrigQty() { - return origQty; + public String getAvgPrice() { + return avgPrice; } - public void setOrigQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; + public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { + this.avgPrice = avgPrice; } - public CurrentAllOpenOrdersResponseInner origType( - @jakarta.annotation.Nullable String origType) { - this.origType = origType; + public PlaceMultipleOrdersResponseInner origQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; return this; } /** - * Get origType + * Get origQty * - * @return origType + * @return origQty */ @jakarta.annotation.Nullable - public String getOrigType() { - return origType; + public String getOrigQty() { + return origQty; } - public void setOrigType(@jakarta.annotation.Nullable String origType) { - this.origType = origType; + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; } - public CurrentAllOpenOrdersResponseInner price(@jakarta.annotation.Nullable String price) { + public PlaceMultipleOrdersResponseInner price(@jakarta.annotation.Nullable String price) { this.price = price; return this; } @@ -345,7 +355,7 @@ public void setPrice(@jakarta.annotation.Nullable String price) { this.price = price; } - public CurrentAllOpenOrdersResponseInner reduceOnly( + public PlaceMultipleOrdersResponseInner reduceOnly( @jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; return this; @@ -365,7 +375,7 @@ public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { this.reduceOnly = reduceOnly; } - public CurrentAllOpenOrdersResponseInner side(@jakarta.annotation.Nullable String side) { + public PlaceMultipleOrdersResponseInner side(@jakarta.annotation.Nullable String side) { this.side = side; return this; } @@ -384,7 +394,7 @@ public void setSide(@jakarta.annotation.Nullable String side) { this.side = side; } - public CurrentAllOpenOrdersResponseInner positionSide( + public PlaceMultipleOrdersResponseInner positionSide( @jakarta.annotation.Nullable String positionSide) { this.positionSide = positionSide; return this; @@ -404,7 +414,7 @@ public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { this.positionSide = positionSide; } - public CurrentAllOpenOrdersResponseInner status(@jakarta.annotation.Nullable String status) { + public PlaceMultipleOrdersResponseInner status(@jakarta.annotation.Nullable String status) { this.status = status; return this; } @@ -423,7 +433,7 @@ public void setStatus(@jakarta.annotation.Nullable String status) { this.status = status; } - public CurrentAllOpenOrdersResponseInner stopPrice( + public PlaceMultipleOrdersResponseInner stopPrice( @jakarta.annotation.Nullable String stopPrice) { this.stopPrice = stopPrice; return this; @@ -443,27 +453,7 @@ public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { this.stopPrice = stopPrice; } - public CurrentAllOpenOrdersResponseInner 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 CurrentAllOpenOrdersResponseInner symbol(@jakarta.annotation.Nullable String symbol) { + public PlaceMultipleOrdersResponseInner symbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; return this; } @@ -482,26 +472,26 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; } - public CurrentAllOpenOrdersResponseInner time(@jakarta.annotation.Nullable Long time) { - this.time = time; + public PlaceMultipleOrdersResponseInner pair(@jakarta.annotation.Nullable String pair) { + this.pair = pair; return this; } /** - * Get time + * Get pair * - * @return time + * @return pair */ @jakarta.annotation.Nullable - public Long getTime() { - return time; + public String getPair() { + return pair; } - public void setTime(@jakarta.annotation.Nullable Long time) { - this.time = time; + public void setPair(@jakarta.annotation.Nullable String pair) { + this.pair = pair; } - public CurrentAllOpenOrdersResponseInner timeInForce( + public PlaceMultipleOrdersResponseInner timeInForce( @jakarta.annotation.Nullable String timeInForce) { this.timeInForce = timeInForce; return this; @@ -521,7 +511,7 @@ public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { this.timeInForce = timeInForce; } - public CurrentAllOpenOrdersResponseInner type(@jakarta.annotation.Nullable String type) { + public PlaceMultipleOrdersResponseInner type(@jakarta.annotation.Nullable String type) { this.type = type; return this; } @@ -540,7 +530,26 @@ public void setType(@jakarta.annotation.Nullable String type) { this.type = type; } - public CurrentAllOpenOrdersResponseInner activatePrice( + public PlaceMultipleOrdersResponseInner origType(@jakarta.annotation.Nullable String origType) { + this.origType = origType; + return this; + } + + /** + * Get origType + * + * @return origType + */ + @jakarta.annotation.Nullable + public String getOrigType() { + return origType; + } + + public void setOrigType(@jakarta.annotation.Nullable String origType) { + this.origType = origType; + } + + public PlaceMultipleOrdersResponseInner activatePrice( @jakarta.annotation.Nullable String activatePrice) { this.activatePrice = activatePrice; return this; @@ -560,7 +569,7 @@ public void setActivatePrice(@jakarta.annotation.Nullable String activatePrice) this.activatePrice = activatePrice; } - public CurrentAllOpenOrdersResponseInner priceRate( + public PlaceMultipleOrdersResponseInner priceRate( @jakarta.annotation.Nullable String priceRate) { this.priceRate = priceRate; return this; @@ -580,7 +589,7 @@ public void setPriceRate(@jakarta.annotation.Nullable String priceRate) { this.priceRate = priceRate; } - public CurrentAllOpenOrdersResponseInner updateTime( + public PlaceMultipleOrdersResponseInner updateTime( @jakarta.annotation.Nullable Long updateTime) { this.updateTime = updateTime; return this; @@ -600,7 +609,7 @@ public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { this.updateTime = updateTime; } - public CurrentAllOpenOrdersResponseInner workingType( + public PlaceMultipleOrdersResponseInner workingType( @jakarta.annotation.Nullable String workingType) { this.workingType = workingType; return this; @@ -620,7 +629,7 @@ public void setWorkingType(@jakarta.annotation.Nullable String workingType) { this.workingType = workingType; } - public CurrentAllOpenOrdersResponseInner priceProtect( + public PlaceMultipleOrdersResponseInner priceProtect( @jakarta.annotation.Nullable Boolean priceProtect) { this.priceProtect = priceProtect; return this; @@ -640,7 +649,7 @@ public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { this.priceProtect = priceProtect; } - public CurrentAllOpenOrdersResponseInner priceMatch( + public PlaceMultipleOrdersResponseInner priceMatch( @jakarta.annotation.Nullable String priceMatch) { this.priceMatch = priceMatch; return this; @@ -660,7 +669,7 @@ public void setPriceMatch(@jakarta.annotation.Nullable String priceMatch) { this.priceMatch = priceMatch; } - public CurrentAllOpenOrdersResponseInner selfTradePreventionMode( + public PlaceMultipleOrdersResponseInner selfTradePreventionMode( @jakarta.annotation.Nullable String selfTradePreventionMode) { this.selfTradePreventionMode = selfTradePreventionMode; return this; @@ -681,6 +690,44 @@ public void setSelfTradePreventionMode( this.selfTradePreventionMode = selfTradePreventionMode; } + public PlaceMultipleOrdersResponseInner code(@jakarta.annotation.Nullable Long code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code + */ + @jakarta.annotation.Nullable + public Long getCode() { + return code; + } + + public void setCode(@jakarta.annotation.Nullable Long code) { + this.code = code; + } + + public PlaceMultipleOrdersResponseInner msg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + return this; + } + + /** + * Get msg + * + * @return msg + */ + @jakarta.annotation.Nullable + public String getMsg() { + return msg; + } + + public void setMsg(@jakarta.annotation.Nullable String msg) { + this.msg = msg; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -689,92 +736,94 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CurrentAllOpenOrdersResponseInner currentAllOpenOrdersResponseInner = - (CurrentAllOpenOrdersResponseInner) o; - return Objects.equals(this.avgPrice, currentAllOpenOrdersResponseInner.avgPrice) - && Objects.equals( - this.clientOrderId, currentAllOpenOrdersResponseInner.clientOrderId) - && Objects.equals(this.cumBase, currentAllOpenOrdersResponseInner.cumBase) - && Objects.equals(this.executedQty, currentAllOpenOrdersResponseInner.executedQty) - && Objects.equals(this.orderId, currentAllOpenOrdersResponseInner.orderId) - && Objects.equals(this.origQty, currentAllOpenOrdersResponseInner.origQty) - && Objects.equals(this.origType, currentAllOpenOrdersResponseInner.origType) - && Objects.equals(this.price, currentAllOpenOrdersResponseInner.price) - && Objects.equals(this.reduceOnly, currentAllOpenOrdersResponseInner.reduceOnly) - && Objects.equals(this.side, currentAllOpenOrdersResponseInner.side) - && Objects.equals(this.positionSide, currentAllOpenOrdersResponseInner.positionSide) - && Objects.equals(this.status, currentAllOpenOrdersResponseInner.status) - && Objects.equals(this.stopPrice, currentAllOpenOrdersResponseInner.stopPrice) - && Objects.equals( - this.closePosition, currentAllOpenOrdersResponseInner.closePosition) - && Objects.equals(this.symbol, currentAllOpenOrdersResponseInner.symbol) - && Objects.equals(this.time, currentAllOpenOrdersResponseInner.time) - && Objects.equals(this.timeInForce, currentAllOpenOrdersResponseInner.timeInForce) - && Objects.equals(this.type, currentAllOpenOrdersResponseInner.type) + PlaceMultipleOrdersResponseInner placeMultipleOrdersResponseInner = + (PlaceMultipleOrdersResponseInner) o; + return Objects.equals(this.clientOrderId, placeMultipleOrdersResponseInner.clientOrderId) + && Objects.equals(this.cumQty, placeMultipleOrdersResponseInner.cumQty) + && Objects.equals(this.cumBase, placeMultipleOrdersResponseInner.cumBase) + && Objects.equals(this.executedQty, placeMultipleOrdersResponseInner.executedQty) + && Objects.equals(this.orderId, placeMultipleOrdersResponseInner.orderId) + && Objects.equals(this.avgPrice, placeMultipleOrdersResponseInner.avgPrice) + && Objects.equals(this.origQty, placeMultipleOrdersResponseInner.origQty) + && Objects.equals(this.price, placeMultipleOrdersResponseInner.price) + && Objects.equals(this.reduceOnly, placeMultipleOrdersResponseInner.reduceOnly) + && Objects.equals(this.side, placeMultipleOrdersResponseInner.side) + && Objects.equals(this.positionSide, placeMultipleOrdersResponseInner.positionSide) + && Objects.equals(this.status, placeMultipleOrdersResponseInner.status) + && Objects.equals(this.stopPrice, placeMultipleOrdersResponseInner.stopPrice) + && Objects.equals(this.symbol, placeMultipleOrdersResponseInner.symbol) + && Objects.equals(this.pair, placeMultipleOrdersResponseInner.pair) + && Objects.equals(this.timeInForce, placeMultipleOrdersResponseInner.timeInForce) + && Objects.equals(this.type, placeMultipleOrdersResponseInner.type) + && Objects.equals(this.origType, placeMultipleOrdersResponseInner.origType) && Objects.equals( - this.activatePrice, currentAllOpenOrdersResponseInner.activatePrice) - && Objects.equals(this.priceRate, currentAllOpenOrdersResponseInner.priceRate) - && Objects.equals(this.updateTime, currentAllOpenOrdersResponseInner.updateTime) - && Objects.equals(this.workingType, currentAllOpenOrdersResponseInner.workingType) - && Objects.equals(this.priceProtect, currentAllOpenOrdersResponseInner.priceProtect) - && Objects.equals(this.priceMatch, currentAllOpenOrdersResponseInner.priceMatch) + 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) + && Objects.equals(this.priceMatch, placeMultipleOrdersResponseInner.priceMatch) && Objects.equals( this.selfTradePreventionMode, - currentAllOpenOrdersResponseInner.selfTradePreventionMode); + placeMultipleOrdersResponseInner.selfTradePreventionMode) + && Objects.equals(this.code, placeMultipleOrdersResponseInner.code) + && Objects.equals(this.msg, placeMultipleOrdersResponseInner.msg); } @Override public int hashCode() { return Objects.hash( - avgPrice, clientOrderId, + cumQty, cumBase, executedQty, orderId, + avgPrice, origQty, - origType, price, reduceOnly, side, positionSide, status, stopPrice, - closePosition, symbol, - time, + pair, timeInForce, type, + origType, activatePrice, priceRate, updateTime, workingType, priceProtect, priceMatch, - selfTradePreventionMode); + selfTradePreventionMode, + code, + msg); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CurrentAllOpenOrdersResponseInner {\n"); - sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); + sb.append("class PlaceMultipleOrdersResponseInner {\n"); sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" cumQty: ").append(toIndentedString(cumQty)).append("\n"); sb.append(" cumBase: ").append(toIndentedString(cumBase)).append("\n"); sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); - sb.append(" origType: ").append(toIndentedString(origType)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); sb.append(" side: ").append(toIndentedString(side)).append("\n"); sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); - sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" pair: ").append(toIndentedString(pair)).append("\n"); 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"); @@ -784,6 +833,8 @@ public String toString() { sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) .append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); sb.append("}"); return sb.toString(); } @@ -791,14 +842,14 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object avgPriceValue = getAvgPrice(); - String avgPriceValueAsString = ""; - avgPriceValueAsString = avgPriceValue.toString(); - sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); Object clientOrderIdValue = getClientOrderId(); String clientOrderIdValueAsString = ""; clientOrderIdValueAsString = clientOrderIdValue.toString(); sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object cumQtyValue = getCumQty(); + String cumQtyValueAsString = ""; + cumQtyValueAsString = cumQtyValue.toString(); + sb.append("cumQty=").append(urlEncode(cumQtyValueAsString)).append(""); Object cumBaseValue = getCumBase(); String cumBaseValueAsString = ""; cumBaseValueAsString = cumBaseValue.toString(); @@ -811,14 +862,14 @@ public String toUrlQueryString() { String orderIdValueAsString = ""; orderIdValueAsString = orderIdValue.toString(); sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object avgPriceValue = getAvgPrice(); + String avgPriceValueAsString = ""; + avgPriceValueAsString = avgPriceValue.toString(); + sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); Object origQtyValue = getOrigQty(); String origQtyValueAsString = ""; origQtyValueAsString = origQtyValue.toString(); sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); - Object origTypeValue = getOrigType(); - String origTypeValueAsString = ""; - origTypeValueAsString = origTypeValue.toString(); - sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); Object priceValue = getPrice(); String priceValueAsString = ""; priceValueAsString = priceValue.toString(); @@ -843,18 +894,14 @@ public String toUrlQueryString() { 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 symbolValue = getSymbol(); String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); - Object timeValue = getTime(); - String timeValueAsString = ""; - timeValueAsString = timeValue.toString(); - sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object pairValue = getPair(); + String pairValueAsString = ""; + pairValueAsString = pairValue.toString(); + sb.append("pair=").append(urlEncode(pairValueAsString)).append(""); Object timeInForceValue = getTimeInForce(); String timeInForceValueAsString = ""; timeInForceValueAsString = timeInForceValue.toString(); @@ -863,6 +910,10 @@ public String toUrlQueryString() { String typeValueAsString = ""; typeValueAsString = typeValue.toString(); sb.append("type=").append(urlEncode(typeValueAsString)).append(""); + Object origTypeValue = getOrigType(); + String origTypeValueAsString = ""; + origTypeValueAsString = origTypeValue.toString(); + sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); Object activatePriceValue = getActivatePrice(); String activatePriceValueAsString = ""; activatePriceValueAsString = activatePriceValue.toString(); @@ -893,6 +944,14 @@ public String toUrlQueryString() { sb.append("selfTradePreventionMode=") .append(urlEncode(selfTradePreventionModeValueAsString)) .append(""); + Object codeValue = getCode(); + String codeValueAsString = ""; + codeValueAsString = codeValue.toString(); + sb.append("code=").append(urlEncode(codeValueAsString)).append(""); + Object msgValue = getMsg(); + String msgValueAsString = ""; + msgValueAsString = msgValue.toString(); + sb.append("msg=").append(urlEncode(msgValueAsString)).append(""); return sb.toString(); } @@ -921,24 +980,24 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("avgPrice"); openapiFields.add("clientOrderId"); + openapiFields.add("cumQty"); openapiFields.add("cumBase"); openapiFields.add("executedQty"); openapiFields.add("orderId"); + openapiFields.add("avgPrice"); openapiFields.add("origQty"); - openapiFields.add("origType"); openapiFields.add("price"); openapiFields.add("reduceOnly"); openapiFields.add("side"); openapiFields.add("positionSide"); openapiFields.add("status"); openapiFields.add("stopPrice"); - openapiFields.add("closePosition"); openapiFields.add("symbol"); - openapiFields.add("time"); + openapiFields.add("pair"); openapiFields.add("timeInForce"); openapiFields.add("type"); + openapiFields.add("origType"); openapiFields.add("activatePrice"); openapiFields.add("priceRate"); openapiFields.add("updateTime"); @@ -946,6 +1005,8 @@ private String toIndentedString(Object o) { openapiFields.add("priceProtect"); openapiFields.add("priceMatch"); openapiFields.add("selfTradePreventionMode"); + openapiFields.add("code"); + openapiFields.add("msg"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -956,29 +1017,20 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * CurrentAllOpenOrdersResponseInner + * PlaceMultipleOrdersResponseInner */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!CurrentAllOpenOrdersResponseInner.openapiRequiredFields + if (!PlaceMultipleOrdersResponseInner.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in CurrentAllOpenOrdersResponseInner is" + "The required field(s) %s in PlaceMultipleOrdersResponseInner is" + " not found in the empty JSON string", - CurrentAllOpenOrdersResponseInner.openapiRequiredFields - .toString())); + PlaceMultipleOrdersResponseInner.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) - && !jsonObj.get("avgPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `avgPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("avgPrice").toString())); - } if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) && !jsonObj.get("clientOrderId").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -987,6 +1039,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientOrderId").toString())); } + if ((jsonObj.get("cumQty") != null && !jsonObj.get("cumQty").isJsonNull()) + && !jsonObj.get("cumQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cumQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("cumQty").toString())); + } if ((jsonObj.get("cumBase") != null && !jsonObj.get("cumBase").isJsonNull()) && !jsonObj.get("cumBase").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1003,6 +1063,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("executedQty").toString())); } + if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) + && !jsonObj.get("avgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avgPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("avgPrice").toString())); + } if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) && !jsonObj.get("origQty").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1011,14 +1079,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("origQty").toString())); } - if ((jsonObj.get("origType") != null && !jsonObj.get("origType").isJsonNull()) - && !jsonObj.get("origType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("origType").toString())); - } if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) && !jsonObj.get("price").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1067,6 +1127,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("symbol").toString())); } + if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) + && !jsonObj.get("pair").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `pair` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("pair").toString())); + } if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) && !jsonObj.get("timeInForce").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1083,6 +1151,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("type").toString())); } + if ((jsonObj.get("origType") != null && !jsonObj.get("origType").isJsonNull()) + && !jsonObj.get("origType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("origType").toString())); + } if ((jsonObj.get("activatePrice") != null && !jsonObj.get("activatePrice").isJsonNull()) && !jsonObj.get("activatePrice").isJsonPrimitive()) { throw new IllegalArgumentException( @@ -1124,32 +1200,40 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " the JSON string but got `%s`", jsonObj.get("selfTradePreventionMode").toString())); } + if ((jsonObj.get("msg") != null && !jsonObj.get("msg").isJsonNull()) + && !jsonObj.get("msg").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `msg` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("msg").toString())); + } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!CurrentAllOpenOrdersResponseInner.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'CurrentAllOpenOrdersResponseInner' and + if (!PlaceMultipleOrdersResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PlaceMultipleOrdersResponseInner' and // its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(CurrentAllOpenOrdersResponseInner.class)); + this, TypeToken.get(PlaceMultipleOrdersResponseInner.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, CurrentAllOpenOrdersResponseInner value) + public void write(JsonWriter out, PlaceMultipleOrdersResponseInner value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public CurrentAllOpenOrdersResponseInner read(JsonReader in) + public PlaceMultipleOrdersResponseInner read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -1160,19 +1244,19 @@ public CurrentAllOpenOrdersResponseInner read(JsonReader in) } /** - * Create an instance of CurrentAllOpenOrdersResponseInner given an JSON string + * Create an instance of PlaceMultipleOrdersResponseInner given an JSON string * * @param jsonString JSON string - * @return An instance of CurrentAllOpenOrdersResponseInner + * @return An instance of PlaceMultipleOrdersResponseInner * @throws IOException if the JSON string is invalid with respect to - * CurrentAllOpenOrdersResponseInner + * PlaceMultipleOrdersResponseInner */ - public static CurrentAllOpenOrdersResponseInner fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, CurrentAllOpenOrdersResponseInner.class); + public static PlaceMultipleOrdersResponseInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PlaceMultipleOrdersResponseInner.class); } /** - * Convert an instance of CurrentAllOpenOrdersResponseInner to an JSON string + * Convert an instance of PlaceMultipleOrdersResponseInner to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java index da12e0422..bab9e717f 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/DerivativesTradingCoinFuturesWebSocketApi.java @@ -34,7 +34,7 @@ public class DerivativesTradingCoinFuturesWebSocketApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/DerivativesTradingCoinFuturesWebSocketStreamsUtil.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/DerivativesTradingCoinFuturesWebSocketStreamsUtil.java index 0932694d2..0d249cc7d 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/DerivativesTradingCoinFuturesWebSocketStreamsUtil.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/DerivativesTradingCoinFuturesWebSocketStreamsUtil.java @@ -7,11 +7,15 @@ public class DerivativesTradingCoinFuturesWebSocketStreamsUtil { private static final boolean HAS_TIME_UNIT = false; public static WebSocketClientConfiguration getClientConfiguration() { + return getClientConfiguration(""); + } + + public static WebSocketClientConfiguration getClientConfiguration(String path) { WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); if (!HAS_TIME_UNIT) { clientConfiguration.setTimeUnit(null); } - clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setUrl(BASE_URL + path + "/stream"); clientConfiguration.setAutoLogon(false); return clientConfiguration; } diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java index 0305b36e7..f21114cc5 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/DerivativesTradingCoinFuturesWebSocketStreams.java @@ -58,7 +58,7 @@ public class DerivativesTradingCoinFuturesWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-coin-futures/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java index 377e1f31a..f9f2714d7 100644 --- a/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java +++ b/clients/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApi.java @@ -13,11 +13,16 @@ package com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.api; import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionInterface; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionPoolWrapper; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.JSON; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.AggregateTradeStreamsRequest; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.AggregateTradeStreamsResponse; import com.binance.connector.client.derivatives_trading_coin_futures.websocket.stream.model.AllBookTickersStreamRequest; @@ -68,11 +73,27 @@ import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; public class WebsocketMarketStreamsApi { + private static final String USER_AGENT = + String.format( + "binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private StreamConnectionInterface connection; public WebsocketMarketStreamsApi() {} + public WebsocketMarketStreamsApi(WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + public WebsocketMarketStreamsApi(StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } this.connection = connection; } diff --git a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApiTest.java b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApiTest.java index af68694cd..9a82f0914 100644 --- a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApiTest.java +++ b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/TradeApiTest.java @@ -228,7 +228,7 @@ public void autoCancelAllOpenOrdersTest() throws ApiException, CryptoException { api.autoCancelAllOpenOrders(autoCancelAllOpenOrdersRequest); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); + Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); ArgumentCaptor signInputCaptor = ArgumentCaptor.forClass(String.class); Mockito.verify(signatureGeneratorSpy).signAsString(signInputCaptor.capture()); diff --git a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApiTest.java b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApiTest.java index a15400dae..b0121d89b 100644 --- a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApiTest.java +++ b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/api/UserDataStreamsApiTest.java @@ -23,6 +23,7 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.common.sign.HmacSignatureGenerator; import com.binance.connector.client.common.sign.SignatureGenerator; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.KeepaliveUserDataStreamResponse; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.StartUserDataStreamResponse; import jakarta.validation.constraints.*; import okhttp3.Call; @@ -106,10 +107,10 @@ public void closeUserDataStreamTest() throws ApiException, CryptoException { */ @Test public void keepaliveUserDataStreamTest() throws ApiException, CryptoException { - api.keepaliveUserDataStream(); + ApiResponse keepaliveUserDataStreamResponseApiResponse = api.keepaliveUserDataStream(); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); + Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); diff --git a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApiTest.java b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApiTest.java index b9441f5a5..584308bbc 100644 --- a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApiTest.java +++ b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/AccountApiTest.java @@ -73,6 +73,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); AccountApi accountApi = new AccountApi(connectionSpy); diff --git a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApiTest.java b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApiTest.java index d1ab94e2f..001327725 100644 --- a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApiTest.java +++ b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/TradeApiTest.java @@ -81,6 +81,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); TradeApi accountApi = new TradeApi(connectionSpy); diff --git a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApiTest.java b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApiTest.java index ead0d5bf5..5300a290c 100644 --- a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApiTest.java +++ b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/api/api/UserDataStreamsApiTest.java @@ -75,6 +75,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); UserDataStreamsApi accountApi = new UserDataStreamsApi(connectionSpy); diff --git a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java index 39191b683..3f001c0ed 100644 --- a/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java +++ b/clients/derivatives-trading-coin-futures/src/test/java/com/binance/connector/client/derivatives_trading_coin_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java @@ -109,6 +109,7 @@ public void initApiClient() throws Exception { StreamConnectionWrapper connectionWrapper = new StreamConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); WebsocketMarketStreamsApi accountApi = new WebsocketMarketStreamsApi(connectionSpy); diff --git a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md index 70fc32960..02fb16163 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 6.0.0 - 2026-02-12 + +### Added (2) + +#### REST API + +- `getDeltaModeStatus()` (`GET /sapi/v1/portfolio/delta-mode`) +- `switchDeltaMode()` (`POST /sapi/v1/portfolio/delta-mode`) + ## 5.0.0 - 2025-12-16 ### Removed (2) diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md b/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md index f0115e651..bcfd1841a 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/AccountApi.md @@ -9,6 +9,7 @@ All URIs are relative to *https://api.binance.com* | [**fundAutoCollection**](AccountApi.md#fundAutoCollection) | **POST** /sapi/v1/portfolio/auto-collection | Fund Auto-collection(USER_DATA) | | [**fundCollectionByAsset**](AccountApi.md#fundCollectionByAsset) | **POST** /sapi/v1/portfolio/asset-collection | Fund Collection by Asset(USER_DATA) | | [**getAutoRepayFuturesStatus**](AccountApi.md#getAutoRepayFuturesStatus) | **GET** /sapi/v1/portfolio/repay-futures-switch | Get Auto-repay-futures Status(USER_DATA) | +| [**getDeltaModeStatus**](AccountApi.md#getDeltaModeStatus) | **GET** /sapi/v1/portfolio/delta-mode | Get Delta Mode Status(USER_DATA) | | [**getPortfolioMarginProAccountBalance**](AccountApi.md#getPortfolioMarginProAccountBalance) | **GET** /sapi/v1/portfolio/balance | Get Portfolio Margin Pro Account Balance(USER_DATA) | | [**getPortfolioMarginProAccountInfo**](AccountApi.md#getPortfolioMarginProAccountInfo) | **GET** /sapi/v1/portfolio/account | Get Portfolio Margin Pro Account Info(USER_DATA) | | [**getPortfolioMarginProSpanAccountInfo**](AccountApi.md#getPortfolioMarginProSpanAccountInfo) | **GET** /sapi/v2/portfolio/account | Get Portfolio Margin Pro SPAN Account Info(USER_DATA) | @@ -18,6 +19,7 @@ All URIs are relative to *https://api.binance.com* | [**queryPortfolioMarginProBankruptcyLoanRepayHistory**](AccountApi.md#queryPortfolioMarginProBankruptcyLoanRepayHistory) | **GET** /sapi/v1/portfolio/pmloan-history | Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER_DATA) | | [**queryPortfolioMarginProNegativeBalanceInterestHistory**](AccountApi.md#queryPortfolioMarginProNegativeBalanceInterestHistory) | **GET** /sapi/v1/portfolio/interest-history | Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA) | | [**repayFuturesNegativeBalance**](AccountApi.md#repayFuturesNegativeBalance) | **POST** /sapi/v1/portfolio/repay-futures-negative-balance | Repay futures Negative Balance(USER_DATA) | +| [**switchDeltaMode**](AccountApi.md#switchDeltaMode) | **POST** /sapi/v1/portfolio/delta-mode | Switch Delta Mode(TRADE) | | [**transferLdusdtRwusdForPortfolioMargin**](AccountApi.md#transferLdusdtRwusdForPortfolioMargin) | **POST** /sapi/v1/portfolio/earn-asset-transfer | Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) | @@ -331,6 +333,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Auto-repay-futures Status | - | + +# **getDeltaModeStatus** +> GetDeltaModeStatusResponse getDeltaModeStatus(recvWindow) + +Get Delta Mode Status(USER_DATA) + +Query the Delta mode status of current account. Weight: 1500 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + AccountApi apiInstance = new AccountApi(defaultClient); + Long recvWindow = 56L; // Long | + try { + GetDeltaModeStatusResponse result = apiInstance.getDeltaModeStatus(recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#getDeltaModeStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetDeltaModeStatusResponse**](GetDeltaModeStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Delta Mode Status | - | + # **getPortfolioMarginProAccountBalance** > GetPortfolioMarginProAccountBalanceResponse getPortfolioMarginProAccountBalance(asset, recvWindow) @@ -591,7 +655,7 @@ No authorization required Portfolio Margin Pro Bankruptcy Loan Repay -Repay Portfolio Margin Pro Bankruptcy Loan Weight: 3000 +Repay Portfolio Margin Pro Bankruptcy Loan * Please note that the API Key has enabled Spot & Margin Trading permissions to access this endpoint. Weight: 3000 ### Example ```java @@ -911,6 +975,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Repay futures Negative Balance | - | + +# **switchDeltaMode** +> SwitchDeltaModeResponse switchDeltaMode(switchDeltaModeRequest) + +Switch Delta Mode(TRADE) + +Switch the Delta mode for existing PM PRO / PM RETAIL accounts. Weight: 1500 + +### Example +```java +// Import classes: +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiClient; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.ApiException; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.Configuration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.models.*; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.AccountApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + AccountApi apiInstance = new AccountApi(defaultClient); + SwitchDeltaModeRequest switchDeltaModeRequest = new SwitchDeltaModeRequest(); // SwitchDeltaModeRequest | + try { + SwitchDeltaModeResponse result = apiInstance.switchDeltaMode(switchDeltaModeRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccountApi#switchDeltaMode"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **switchDeltaModeRequest** | [**SwitchDeltaModeRequest**](SwitchDeltaModeRequest.md)| | | + +### Return type + +[**SwitchDeltaModeResponse**](SwitchDeltaModeResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Switch Delta Mode | - | + # **transferLdusdtRwusdForPortfolioMargin** > TransferLdusdtRwusdForPortfolioMarginResponse transferLdusdtRwusdForPortfolioMargin(transferLdusdtRwusdForPortfolioMarginRequest) diff --git a/clients/margin-trading/docs/StartMarginUserDataStreamResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/GetDeltaModeStatusResponse.md similarity index 59% rename from clients/margin-trading/docs/StartMarginUserDataStreamResponse.md rename to clients/derivatives-trading-portfolio-margin-pro/docs/GetDeltaModeStatusResponse.md index 0a6385689..17fcc4d2f 100644 --- a/clients/margin-trading/docs/StartMarginUserDataStreamResponse.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/GetDeltaModeStatusResponse.md @@ -1,13 +1,13 @@ -# StartMarginUserDataStreamResponse +# GetDeltaModeStatusResponse ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | [optional] | +|**deltaEnabled** | **Boolean** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginResponse.md deleted file mode 100644 index 5f7fa89e6..000000000 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/MintBfusdForPortfolioMarginResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# MintBfusdForPortfolioMarginResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**fromAsset** | **String** | | [optional] | -|**targetAsset** | **String** | | [optional] | -|**fromAssetQty** | **Long** | | [optional] | -|**targetAssetQty** | **Double** | | [optional] | -|**mintRate** | **Double** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginResponse.md deleted file mode 100644 index 637aa495f..000000000 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginResponse.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# RedeemBfusdForPortfolioMarginResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**fromAsset** | **String** | | [optional] | -|**targetAsset** | **String** | | [optional] | -|**fromAssetQty** | **Double** | | [optional] | -|**targetAssetQty** | **Double** | | [optional] | -|**redeemRate** | **Double** | | [optional] | - - - diff --git a/clients/convert/docs/QueryLimitOpenOrdersRequest.md b/clients/derivatives-trading-portfolio-margin-pro/docs/SwitchDeltaModeRequest.md similarity index 72% rename from clients/convert/docs/QueryLimitOpenOrdersRequest.md rename to clients/derivatives-trading-portfolio-margin-pro/docs/SwitchDeltaModeRequest.md index 14c24c80a..e74fe5e3d 100644 --- a/clients/convert/docs/QueryLimitOpenOrdersRequest.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/SwitchDeltaModeRequest.md @@ -1,12 +1,13 @@ -# QueryLimitOpenOrdersRequest +# SwitchDeltaModeRequest ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| +|**deltaEnabled** | **String** | | | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtForPortfolioMarginResponse.md b/clients/derivatives-trading-portfolio-margin-pro/docs/SwitchDeltaModeResponse.md similarity index 79% rename from clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtForPortfolioMarginResponse.md rename to clients/derivatives-trading-portfolio-margin-pro/docs/SwitchDeltaModeResponse.md index 5bb7ef939..4ef7285f9 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtForPortfolioMarginResponse.md +++ b/clients/derivatives-trading-portfolio-margin-pro/docs/SwitchDeltaModeResponse.md @@ -1,6 +1,6 @@ -# TransferLdusdtForPortfolioMarginResponse +# SwitchDeltaModeResponse ## Properties diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtForPortfolioMarginRequest.md b/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtForPortfolioMarginRequest.md deleted file mode 100644 index b25ed9219..000000000 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/TransferLdusdtForPortfolioMarginRequest.md +++ /dev/null @@ -1,16 +0,0 @@ - - -# TransferLdusdtForPortfolioMarginRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**asset** | **String** | | | -|**transferType** | **String** | | | -|**amount** | **Double** | | | -|**recvWindow** | **Long** | | [optional] | - - - diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md index c2f3c0454..863683980 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin-pro/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-portfolio-margin-pro - 5.0.0 + 6.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin-pro - 5.0.0 + 6.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin-pro/example_rest.md b/clients/derivatives-trading-portfolio-margin-pro/example_rest.md index 9e7f6067f..a102016e7 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/example_rest.md +++ b/clients/derivatives-trading-portfolio-margin-pro/example_rest.md @@ -10,6 +10,8 @@ [GET /sapi/v1/portfolio/repay-futures-switch](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status) - getAutoRepayFuturesStatus - [GetAutoRepayFuturesStatusExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetAutoRepayFuturesStatusExample.java#L47) +[GET /sapi/v1/portfolio/delta-mode](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Delta-Mode-Status) - getDeltaModeStatus - [GetDeltaModeStatusExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetDeltaModeStatusExample.java#L47) + [GET /sapi/v1/portfolio/balance](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info) - getPortfolioMarginProAccountBalance - [GetPortfolioMarginProAccountBalanceExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetPortfolioMarginProAccountBalanceExample.java#L47) [GET /sapi/v1/portfolio/account](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info) - getPortfolioMarginProAccountInfo - [GetPortfolioMarginProAccountInfoExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetPortfolioMarginProAccountInfoExample.java#L47) @@ -18,7 +20,7 @@ [GET /sapi/v1/portfolio/earn-asset-balance](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Transferable-Earn-Asset-Balance-for-Portfolio-Margin) - getTransferableEarnAssetBalanceForPortfolioMargin - [GetTransferableEarnAssetBalanceForPortfolioMarginExample.java:47](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetTransferableEarnAssetBalanceForPortfolioMarginExample.java#L47) -[POST /sapi/v1/portfolio/repay](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) - portfolioMarginProBankruptcyLoanRepay - [PortfolioMarginProBankruptcyLoanRepayExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/PortfolioMarginProBankruptcyLoanRepayExample.java#L48) +[POST /sapi/v1/portfolio/repay](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay) - portfolioMarginProBankruptcyLoanRepay - [PortfolioMarginProBankruptcyLoanRepayExample.java:49](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/PortfolioMarginProBankruptcyLoanRepayExample.java#L49) [GET /sapi/v1/portfolio/pmLoan](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount) - queryPortfolioMarginProBankruptcyLoanAmount - [QueryPortfolioMarginProBankruptcyLoanAmountExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/QueryPortfolioMarginProBankruptcyLoanAmountExample.java#L48) @@ -28,6 +30,8 @@ [POST /sapi/v1/portfolio/repay-futures-negative-balance](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance) - repayFuturesNegativeBalance - [RepayFuturesNegativeBalanceExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/RepayFuturesNegativeBalanceExample.java#L48) +[POST /sapi/v1/portfolio/delta-mode](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Switch-Delta-Mode) - switchDeltaMode - [SwitchDeltaModeExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SwitchDeltaModeExample.java#L48) + [POST /sapi/v1/portfolio/earn-asset-transfer](https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Transfer-LDUSDT-Portfolio-Margin) - transferLdusdtRwusdForPortfolioMargin - [TransferLdusdtRwusdForPortfolioMarginExample.java:48](/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/TransferLdusdtRwusdForPortfolioMarginExample.java#L48) ## MarketData diff --git a/clients/derivatives-trading-portfolio-margin-pro/pom.xml b/clients/derivatives-trading-portfolio-margin-pro/pom.xml index a470cdb05..e3f039772 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/clients/derivatives-trading-portfolio-margin-pro/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin-pro derivatives-trading-portfolio-margin-pro - 5.0.0 + 6.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java index 874b974e7..a8e0ff920 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/JSON.java @@ -135,6 +135,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .GetAutoRepayFuturesStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model + .GetDeltaModeStatusResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .GetPortfolioMarginAssetLeverageResponse.CustomTypeAdapterFactory()); @@ -218,6 +221,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .RepayFuturesNegativeBalanceResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model + .SwitchDeltaModeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model + .SwitchDeltaModeResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model .TransferLdusdtRwusdForPortfolioMarginRequest.CustomTypeAdapterFactory()); diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java index 6d70f92fc..8e5ea78b9 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApi.java @@ -29,6 +29,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetAutoRepayFuturesStatusResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetDeltaModeStatusResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountBalanceResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountInfoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProSpanAccountInfoResponse; @@ -40,6 +41,8 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginResponse; import com.google.gson.reflect.TypeToken; @@ -65,7 +68,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -809,6 +812,138 @@ public ApiResponse getAutoRepayFuturesStatus( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for getDeltaModeStatus + * + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Delta Mode Status -
+ * + * @see Get + * Delta Mode Status(USER_DATA) Documentation + */ + private okhttp3.Call getDeltaModeStatusCall(Long recvWindow) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/portfolio/delta-mode"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getDeltaModeStatusValidateBeforeCall(Long recvWindow) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {recvWindow}; + Method method = this.getClass().getMethod("getDeltaModeStatus", Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getDeltaModeStatusCall(recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Delta Mode Status(USER_DATA) Query the Delta mode status of current account. Weight: 1500 + * + * @param recvWindow (optional) + * @return ApiResponse<GetDeltaModeStatusResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Delta Mode Status -
+ * + * @see Get + * Delta Mode Status(USER_DATA) Documentation + */ + public ApiResponse getDeltaModeStatus(Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = getDeltaModeStatusValidateBeforeCall(recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getPortfolioMarginProAccountBalance * @@ -1511,8 +1646,9 @@ private okhttp3.Call portfolioMarginProBankruptcyLoanRepayValidateBeforeCall( } /** - * Portfolio Margin Pro Bankruptcy Loan Repay Repay Portfolio Margin Pro Bankruptcy Loan Weight: - * 3000 + * Portfolio Margin Pro Bankruptcy Loan Repay Repay Portfolio Margin Pro Bankruptcy Loan * + * Please note that the API Key has enabled Spot & Margin Trading permissions to access this + * endpoint. Weight: 3000 * * @param portfolioMarginProBankruptcyLoanRepayRequest (required) * @return ApiResponse<PortfolioMarginProBankruptcyLoanRepayResponse> @@ -2184,6 +2320,146 @@ public ApiResponse repayFuturesNegativeBala return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for switchDeltaMode + * + * @param switchDeltaModeRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Switch Delta Mode -
+ * + * @see Switch + * Delta Mode(TRADE) Documentation + */ + private okhttp3.Call switchDeltaModeCall(SwitchDeltaModeRequest switchDeltaModeRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/portfolio/delta-mode"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (switchDeltaModeRequest.getDeltaEnabled() != null) { + localVarFormParams.put("deltaEnabled", switchDeltaModeRequest.getDeltaEnabled()); + } + + if (switchDeltaModeRequest.getRecvWindow() != null) { + localVarFormParams.put("recvWindow", switchDeltaModeRequest.getRecvWindow()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call switchDeltaModeValidateBeforeCall( + SwitchDeltaModeRequest switchDeltaModeRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {switchDeltaModeRequest}; + Method method = + this.getClass().getMethod("switchDeltaMode", SwitchDeltaModeRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return switchDeltaModeCall(switchDeltaModeRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Switch Delta Mode(TRADE) Switch the Delta mode for existing PM PRO / PM RETAIL accounts. + * Weight: 1500 + * + * @param switchDeltaModeRequest (required) + * @return ApiResponse<SwitchDeltaModeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Switch Delta Mode -
+ * + * @see Switch + * Delta Mode(TRADE) Documentation + */ + public ApiResponse switchDeltaMode( + @Valid @NotNull SwitchDeltaModeRequest switchDeltaModeRequest) throws ApiException { + okhttp3.Call localVarCall = switchDeltaModeValidateBeforeCall(switchDeltaModeRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for transferLdusdtRwusdForPortfolioMargin * diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java index e3314533a..9c5f197e5 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/DerivativesTradingPortfolioMarginProRestApi.java @@ -14,6 +14,7 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.FundCollectionByAssetResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetAutoRepayFuturesStatusResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetDeltaModeStatusResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginAssetLeverageResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountBalanceResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountInfoResponse; @@ -29,6 +30,8 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceResponse; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.TransferLdusdtRwusdForPortfolioMarginResponse; @@ -166,6 +169,29 @@ public ApiResponse getAutoRepayFuturesStatus( return accountApi.getAutoRepayFuturesStatus(recvWindow); } + /** + * Get Delta Mode Status(USER_DATA) Query the Delta mode status of current account. Weight: 1500 + * + * @param recvWindow (optional) + * @return ApiResponse<GetDeltaModeStatusResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Delta Mode Status -
+ * + * @see Get + * Delta Mode Status(USER_DATA) Documentation + */ + public ApiResponse getDeltaModeStatus(Long recvWindow) + throws ApiException { + return accountApi.getDeltaModeStatus(recvWindow); + } + /** * Get Portfolio Margin Pro Account Balance(USER_DATA) Query Portfolio Margin Pro account * balance Weight: 20 @@ -268,8 +294,9 @@ public ApiResponse getPortfolioMarginP } /** - * Portfolio Margin Pro Bankruptcy Loan Repay Repay Portfolio Margin Pro Bankruptcy Loan Weight: - * 3000 + * Portfolio Margin Pro Bankruptcy Loan Repay Repay Portfolio Margin Pro Bankruptcy Loan * + * Please note that the API Key has enabled Spot & Margin Trading permissions to access this + * endpoint. Weight: 3000 * * @param portfolioMarginProBankruptcyLoanRepayRequest (required) * @return ApiResponse<PortfolioMarginProBankruptcyLoanRepayResponse> @@ -411,6 +438,30 @@ public ApiResponse repayFuturesNegativeBala return accountApi.repayFuturesNegativeBalance(repayFuturesNegativeBalanceRequest); } + /** + * Switch Delta Mode(TRADE) Switch the Delta mode for existing PM PRO / PM RETAIL accounts. + * Weight: 1500 + * + * @param switchDeltaModeRequest (required) + * @return ApiResponse<SwitchDeltaModeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Switch Delta Mode -
+ * + * @see Switch + * Delta Mode(TRADE) Documentation + */ + public ApiResponse switchDeltaMode( + SwitchDeltaModeRequest switchDeltaModeRequest) throws ApiException { + return accountApi.switchDeltaMode(switchDeltaModeRequest); + } + /** * Transfer LDUSDT/RWUSD for Portfolio Margin(TRADE) Transfer LDUSDT/RWUSD as collateral for all * types of Portfolio Margin account Weight: 1500 diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java index 61e799ad0..5f1bbeb32 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/MarketDataApi.java @@ -45,7 +45,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersRequest.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/GetDeltaModeStatusResponse.java similarity index 60% rename from clients/convert/src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersRequest.java rename to clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/GetDeltaModeStatusResponse.java index 482c796c4..a6ebd6815 100644 --- a/clients/convert/src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersRequest.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/GetDeltaModeStatusResponse.java @@ -1,6 +1,6 @@ /* - * Binance Convert REST API - * OpenAPI Specification for the Binance Convert REST API + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API * * The version of the OpenAPI document: 1.0.0 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.convert.rest.model; +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; -import com.binance.connector.client.convert.rest.JSON; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -31,36 +31,37 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** QueryLimitOpenOrdersRequest */ +/** GetDeltaModeStatusResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class QueryLimitOpenOrdersRequest { - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; +public class GetDeltaModeStatusResponse { + public static final String SERIALIZED_NAME_DELTA_ENABLED = "deltaEnabled"; - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @SerializedName(SERIALIZED_NAME_DELTA_ENABLED) @jakarta.annotation.Nullable - private Long recvWindow; + private Boolean deltaEnabled; - public QueryLimitOpenOrdersRequest() {} + public GetDeltaModeStatusResponse() {} - public QueryLimitOpenOrdersRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; + public GetDeltaModeStatusResponse deltaEnabled( + @jakarta.annotation.Nullable Boolean deltaEnabled) { + this.deltaEnabled = deltaEnabled; return this; } /** - * Get recvWindow + * Get deltaEnabled * - * @return recvWindow + * @return deltaEnabled */ @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; + public Boolean getDeltaEnabled() { + return deltaEnabled; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; + public void setDeltaEnabled(@jakarta.annotation.Nullable Boolean deltaEnabled) { + this.deltaEnabled = deltaEnabled; } @Override @@ -71,20 +72,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest = (QueryLimitOpenOrdersRequest) o; - return Objects.equals(this.recvWindow, queryLimitOpenOrdersRequest.recvWindow); + GetDeltaModeStatusResponse getDeltaModeStatusResponse = (GetDeltaModeStatusResponse) o; + return Objects.equals(this.deltaEnabled, getDeltaModeStatusResponse.deltaEnabled); } @Override public int hashCode() { - return Objects.hash(recvWindow); + return Objects.hash(deltaEnabled); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class QueryLimitOpenOrdersRequest {\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("class GetDeltaModeStatusResponse {\n"); + sb.append(" deltaEnabled: ").append(toIndentedString(deltaEnabled)).append("\n"); sb.append("}"); return sb.toString(); } @@ -92,10 +93,10 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + Object deltaEnabledValue = getDeltaEnabled(); + String deltaEnabledValueAsString = ""; + deltaEnabledValueAsString = deltaEnabledValue.toString(); + sb.append("deltaEnabled=").append(urlEncode(deltaEnabledValueAsString)).append(""); return sb.toString(); } @@ -124,7 +125,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("recvWindow"); + openapiFields.add("deltaEnabled"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -134,18 +135,17 @@ private String toIndentedString(Object o) { * 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 - * QueryLimitOpenOrdersRequest + * @throws IOException if the JSON Element is invalid with respect to GetDeltaModeStatusResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!QueryLimitOpenOrdersRequest.openapiRequiredFields + if (!GetDeltaModeStatusResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in QueryLimitOpenOrdersRequest is not" + "The required field(s) %s in GetDeltaModeStatusResponse is not" + " found in the empty JSON string", - QueryLimitOpenOrdersRequest.openapiRequiredFields.toString())); + GetDeltaModeStatusResponse.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -155,25 +155,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryLimitOpenOrdersRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QueryLimitOpenOrdersRequest' and its + if (!GetDeltaModeStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetDeltaModeStatusResponse' and its // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(QueryLimitOpenOrdersRequest.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(GetDeltaModeStatusResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, QueryLimitOpenOrdersRequest value) + public void write(JsonWriter out, GetDeltaModeStatusResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public QueryLimitOpenOrdersRequest read(JsonReader in) throws IOException { + public GetDeltaModeStatusResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -183,18 +183,18 @@ public QueryLimitOpenOrdersRequest read(JsonReader in) throws IOException { } /** - * Create an instance of QueryLimitOpenOrdersRequest given an JSON string + * Create an instance of GetDeltaModeStatusResponse given an JSON string * * @param jsonString JSON string - * @return An instance of QueryLimitOpenOrdersRequest - * @throws IOException if the JSON string is invalid with respect to QueryLimitOpenOrdersRequest + * @return An instance of GetDeltaModeStatusResponse + * @throws IOException if the JSON string is invalid with respect to GetDeltaModeStatusResponse */ - public static QueryLimitOpenOrdersRequest fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, QueryLimitOpenOrdersRequest.class); + public static GetDeltaModeStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetDeltaModeStatusResponse.class); } /** - * Convert an instance of QueryLimitOpenOrdersRequest to an JSON string + * Convert an instance of GetDeltaModeStatusResponse to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginResponse.java deleted file mode 100644 index 4f09947c4..000000000 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginResponse.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Binance Derivatives Trading Portfolio Margin Pro REST API - * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST 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_portfolio_margin_pro.rest.model; - -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.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.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** MintBfusdForPortfolioMarginResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class MintBfusdForPortfolioMarginResponse { - public static final String SERIALIZED_NAME_FROM_ASSET = "fromAsset"; - - @SerializedName(SERIALIZED_NAME_FROM_ASSET) - @jakarta.annotation.Nullable - private String fromAsset; - - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_FROM_ASSET_QTY = "fromAssetQty"; - - @SerializedName(SERIALIZED_NAME_FROM_ASSET_QTY) - @jakarta.annotation.Nullable - private Long fromAssetQty; - - public static final String SERIALIZED_NAME_TARGET_ASSET_QTY = "targetAssetQty"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET_QTY) - @jakarta.annotation.Nullable - private Double targetAssetQty; - - public static final String SERIALIZED_NAME_MINT_RATE = "mintRate"; - - @SerializedName(SERIALIZED_NAME_MINT_RATE) - @jakarta.annotation.Nullable - private Double mintRate; - - public MintBfusdForPortfolioMarginResponse() {} - - public MintBfusdForPortfolioMarginResponse fromAsset( - @jakarta.annotation.Nullable String fromAsset) { - this.fromAsset = fromAsset; - return this; - } - - /** - * Get fromAsset - * - * @return fromAsset - */ - @jakarta.annotation.Nullable - public String getFromAsset() { - return fromAsset; - } - - public void setFromAsset(@jakarta.annotation.Nullable String fromAsset) { - this.fromAsset = fromAsset; - } - - public MintBfusdForPortfolioMarginResponse targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public MintBfusdForPortfolioMarginResponse fromAssetQty( - @jakarta.annotation.Nullable Long fromAssetQty) { - this.fromAssetQty = fromAssetQty; - return this; - } - - /** - * Get fromAssetQty - * - * @return fromAssetQty - */ - @jakarta.annotation.Nullable - public Long getFromAssetQty() { - return fromAssetQty; - } - - public void setFromAssetQty(@jakarta.annotation.Nullable Long fromAssetQty) { - this.fromAssetQty = fromAssetQty; - } - - public MintBfusdForPortfolioMarginResponse targetAssetQty( - @jakarta.annotation.Nullable Double targetAssetQty) { - this.targetAssetQty = targetAssetQty; - return this; - } - - /** - * Get targetAssetQty - * - * @return targetAssetQty - */ - @jakarta.annotation.Nullable - @Valid - public Double getTargetAssetQty() { - return targetAssetQty; - } - - public void setTargetAssetQty(@jakarta.annotation.Nullable Double targetAssetQty) { - this.targetAssetQty = targetAssetQty; - } - - public MintBfusdForPortfolioMarginResponse mintRate( - @jakarta.annotation.Nullable Double mintRate) { - this.mintRate = mintRate; - return this; - } - - /** - * Get mintRate - * - * @return mintRate - */ - @jakarta.annotation.Nullable - @Valid - public Double getMintRate() { - return mintRate; - } - - public void setMintRate(@jakarta.annotation.Nullable Double mintRate) { - this.mintRate = mintRate; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MintBfusdForPortfolioMarginResponse mintBfusdForPortfolioMarginResponse = - (MintBfusdForPortfolioMarginResponse) o; - return Objects.equals(this.fromAsset, mintBfusdForPortfolioMarginResponse.fromAsset) - && Objects.equals(this.targetAsset, mintBfusdForPortfolioMarginResponse.targetAsset) - && Objects.equals( - this.fromAssetQty, mintBfusdForPortfolioMarginResponse.fromAssetQty) - && Objects.equals( - this.targetAssetQty, mintBfusdForPortfolioMarginResponse.targetAssetQty) - && Objects.equals(this.mintRate, mintBfusdForPortfolioMarginResponse.mintRate); - } - - @Override - public int hashCode() { - return Objects.hash(fromAsset, targetAsset, fromAssetQty, targetAssetQty, mintRate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MintBfusdForPortfolioMarginResponse {\n"); - sb.append(" fromAsset: ").append(toIndentedString(fromAsset)).append("\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" fromAssetQty: ").append(toIndentedString(fromAssetQty)).append("\n"); - sb.append(" targetAssetQty: ").append(toIndentedString(targetAssetQty)).append("\n"); - sb.append(" mintRate: ").append(toIndentedString(mintRate)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object fromAssetValue = getFromAsset(); - String fromAssetValueAsString = ""; - fromAssetValueAsString = fromAssetValue.toString(); - sb.append("fromAsset=").append(urlEncode(fromAssetValueAsString)).append(""); - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object fromAssetQtyValue = getFromAssetQty(); - String fromAssetQtyValueAsString = ""; - fromAssetQtyValueAsString = fromAssetQtyValue.toString(); - sb.append("fromAssetQty=").append(urlEncode(fromAssetQtyValueAsString)).append(""); - Object targetAssetQtyValue = getTargetAssetQty(); - String targetAssetQtyValueAsString = ""; - targetAssetQtyValueAsString = targetAssetQtyValue.toString(); - sb.append("targetAssetQty=").append(urlEncode(targetAssetQtyValueAsString)).append(""); - Object mintRateValue = getMintRate(); - String mintRateValueAsString = ""; - mintRateValueAsString = mintRateValue.toString(); - sb.append("mintRate=").append(urlEncode(mintRateValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * 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("fromAsset"); - openapiFields.add("targetAsset"); - openapiFields.add("fromAssetQty"); - openapiFields.add("targetAssetQty"); - openapiFields.add("mintRate"); - - // 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 - * MintBfusdForPortfolioMarginResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!MintBfusdForPortfolioMarginResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in MintBfusdForPortfolioMarginResponse is" - + " not found in the empty JSON string", - MintBfusdForPortfolioMarginResponse.openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("fromAsset") != null && !jsonObj.get("fromAsset").isJsonNull()) - && !jsonObj.get("fromAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fromAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("fromAsset").toString())); - } - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!MintBfusdForPortfolioMarginResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MintBfusdForPortfolioMarginResponse' and - // its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(MintBfusdForPortfolioMarginResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, MintBfusdForPortfolioMarginResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public MintBfusdForPortfolioMarginResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of MintBfusdForPortfolioMarginResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of MintBfusdForPortfolioMarginResponse - * @throws IOException if the JSON string is invalid with respect to - * MintBfusdForPortfolioMarginResponse - */ - public static MintBfusdForPortfolioMarginResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, MintBfusdForPortfolioMarginResponse.class); - } - - /** - * Convert an instance of MintBfusdForPortfolioMarginResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginRequest.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginRequest.java deleted file mode 100644 index 25ed1f6c0..000000000 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginRequest.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Binance Derivatives Trading Portfolio Margin Pro REST API - * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST 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_portfolio_margin_pro.rest.model; - -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.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.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** RedeemBfusdForPortfolioMarginRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class RedeemBfusdForPortfolioMarginRequest { - public static final String SERIALIZED_NAME_FROM_ASSET = "fromAsset"; - - @SerializedName(SERIALIZED_NAME_FROM_ASSET) - @jakarta.annotation.Nonnull - private String fromAsset; - - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nonnull - private String targetAsset; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - - @SerializedName(SERIALIZED_NAME_AMOUNT) - @jakarta.annotation.Nonnull - private Double amount; - - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) - @jakarta.annotation.Nullable - private Long recvWindow; - - public RedeemBfusdForPortfolioMarginRequest() {} - - public RedeemBfusdForPortfolioMarginRequest fromAsset( - @jakarta.annotation.Nonnull String fromAsset) { - this.fromAsset = fromAsset; - return this; - } - - /** - * Get fromAsset - * - * @return fromAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getFromAsset() { - return fromAsset; - } - - public void setFromAsset(@jakarta.annotation.Nonnull String fromAsset) { - this.fromAsset = fromAsset; - } - - public RedeemBfusdForPortfolioMarginRequest targetAsset( - @jakarta.annotation.Nonnull String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nonnull String targetAsset) { - this.targetAsset = targetAsset; - } - - public RedeemBfusdForPortfolioMarginRequest amount(@jakarta.annotation.Nonnull Double amount) { - this.amount = amount; - return this; - } - - /** - * Get amount - * - * @return amount - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getAmount() { - return amount; - } - - public void setAmount(@jakarta.annotation.Nonnull Double amount) { - this.amount = amount; - } - - public RedeemBfusdForPortfolioMarginRequest recvWindow( - @jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Get recvWindow - * - * @return recvWindow - */ - @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; - } - - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RedeemBfusdForPortfolioMarginRequest redeemBfusdForPortfolioMarginRequest = - (RedeemBfusdForPortfolioMarginRequest) o; - return Objects.equals(this.fromAsset, redeemBfusdForPortfolioMarginRequest.fromAsset) - && Objects.equals( - this.targetAsset, redeemBfusdForPortfolioMarginRequest.targetAsset) - && Objects.equals(this.amount, redeemBfusdForPortfolioMarginRequest.amount) - && Objects.equals(this.recvWindow, redeemBfusdForPortfolioMarginRequest.recvWindow); - } - - @Override - public int hashCode() { - return Objects.hash(fromAsset, targetAsset, amount, recvWindow); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RedeemBfusdForPortfolioMarginRequest {\n"); - sb.append(" fromAsset: ").append(toIndentedString(fromAsset)).append("\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object fromAssetValue = getFromAsset(); - String fromAssetValueAsString = ""; - fromAssetValueAsString = fromAssetValue.toString(); - sb.append("fromAsset=").append(urlEncode(fromAssetValueAsString)).append(""); - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object amountValue = getAmount(); - String amountValueAsString = ""; - amountValueAsString = amountValue.toString(); - sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * 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("fromAsset"); - openapiFields.add("targetAsset"); - openapiFields.add("amount"); - openapiFields.add("recvWindow"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("fromAsset"); - openapiRequiredFields.add("targetAsset"); - openapiRequiredFields.add("amount"); - } - - /** - * 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 - * RedeemBfusdForPortfolioMarginRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RedeemBfusdForPortfolioMarginRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RedeemBfusdForPortfolioMarginRequest" - + " is not found in the empty JSON string", - RedeemBfusdForPortfolioMarginRequest.openapiRequiredFields - .toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : RedeemBfusdForPortfolioMarginRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("fromAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fromAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("fromAsset").toString())); - } - if (!jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RedeemBfusdForPortfolioMarginRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RedeemBfusdForPortfolioMarginRequest' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RedeemBfusdForPortfolioMarginRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, RedeemBfusdForPortfolioMarginRequest value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RedeemBfusdForPortfolioMarginRequest read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RedeemBfusdForPortfolioMarginRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of RedeemBfusdForPortfolioMarginRequest - * @throws IOException if the JSON string is invalid with respect to - * RedeemBfusdForPortfolioMarginRequest - */ - public static RedeemBfusdForPortfolioMarginRequest fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, RedeemBfusdForPortfolioMarginRequest.class); - } - - /** - * Convert an instance of RedeemBfusdForPortfolioMarginRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginResponse.java deleted file mode 100644 index 63d2ec23f..000000000 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/RedeemBfusdForPortfolioMarginResponse.java +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Binance Derivatives Trading Portfolio Margin Pro REST API - * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST 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_portfolio_margin_pro.rest.model; - -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.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.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** RedeemBfusdForPortfolioMarginResponse */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class RedeemBfusdForPortfolioMarginResponse { - public static final String SERIALIZED_NAME_FROM_ASSET = "fromAsset"; - - @SerializedName(SERIALIZED_NAME_FROM_ASSET) - @jakarta.annotation.Nullable - private String fromAsset; - - public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET) - @jakarta.annotation.Nullable - private String targetAsset; - - public static final String SERIALIZED_NAME_FROM_ASSET_QTY = "fromAssetQty"; - - @SerializedName(SERIALIZED_NAME_FROM_ASSET_QTY) - @jakarta.annotation.Nullable - private Double fromAssetQty; - - public static final String SERIALIZED_NAME_TARGET_ASSET_QTY = "targetAssetQty"; - - @SerializedName(SERIALIZED_NAME_TARGET_ASSET_QTY) - @jakarta.annotation.Nullable - private Double targetAssetQty; - - public static final String SERIALIZED_NAME_REDEEM_RATE = "redeemRate"; - - @SerializedName(SERIALIZED_NAME_REDEEM_RATE) - @jakarta.annotation.Nullable - private Double redeemRate; - - public RedeemBfusdForPortfolioMarginResponse() {} - - public RedeemBfusdForPortfolioMarginResponse fromAsset( - @jakarta.annotation.Nullable String fromAsset) { - this.fromAsset = fromAsset; - return this; - } - - /** - * Get fromAsset - * - * @return fromAsset - */ - @jakarta.annotation.Nullable - public String getFromAsset() { - return fromAsset; - } - - public void setFromAsset(@jakarta.annotation.Nullable String fromAsset) { - this.fromAsset = fromAsset; - } - - public RedeemBfusdForPortfolioMarginResponse targetAsset( - @jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - return this; - } - - /** - * Get targetAsset - * - * @return targetAsset - */ - @jakarta.annotation.Nullable - public String getTargetAsset() { - return targetAsset; - } - - public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { - this.targetAsset = targetAsset; - } - - public RedeemBfusdForPortfolioMarginResponse fromAssetQty( - @jakarta.annotation.Nullable Double fromAssetQty) { - this.fromAssetQty = fromAssetQty; - return this; - } - - /** - * Get fromAssetQty - * - * @return fromAssetQty - */ - @jakarta.annotation.Nullable - @Valid - public Double getFromAssetQty() { - return fromAssetQty; - } - - public void setFromAssetQty(@jakarta.annotation.Nullable Double fromAssetQty) { - this.fromAssetQty = fromAssetQty; - } - - public RedeemBfusdForPortfolioMarginResponse targetAssetQty( - @jakarta.annotation.Nullable Double targetAssetQty) { - this.targetAssetQty = targetAssetQty; - return this; - } - - /** - * Get targetAssetQty - * - * @return targetAssetQty - */ - @jakarta.annotation.Nullable - @Valid - public Double getTargetAssetQty() { - return targetAssetQty; - } - - public void setTargetAssetQty(@jakarta.annotation.Nullable Double targetAssetQty) { - this.targetAssetQty = targetAssetQty; - } - - public RedeemBfusdForPortfolioMarginResponse redeemRate( - @jakarta.annotation.Nullable Double redeemRate) { - this.redeemRate = redeemRate; - return this; - } - - /** - * Get redeemRate - * - * @return redeemRate - */ - @jakarta.annotation.Nullable - @Valid - public Double getRedeemRate() { - return redeemRate; - } - - public void setRedeemRate(@jakarta.annotation.Nullable Double redeemRate) { - this.redeemRate = redeemRate; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RedeemBfusdForPortfolioMarginResponse redeemBfusdForPortfolioMarginResponse = - (RedeemBfusdForPortfolioMarginResponse) o; - return Objects.equals(this.fromAsset, redeemBfusdForPortfolioMarginResponse.fromAsset) - && Objects.equals( - this.targetAsset, redeemBfusdForPortfolioMarginResponse.targetAsset) - && Objects.equals( - this.fromAssetQty, redeemBfusdForPortfolioMarginResponse.fromAssetQty) - && Objects.equals( - this.targetAssetQty, redeemBfusdForPortfolioMarginResponse.targetAssetQty) - && Objects.equals( - this.redeemRate, redeemBfusdForPortfolioMarginResponse.redeemRate); - } - - @Override - public int hashCode() { - return Objects.hash(fromAsset, targetAsset, fromAssetQty, targetAssetQty, redeemRate); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RedeemBfusdForPortfolioMarginResponse {\n"); - sb.append(" fromAsset: ").append(toIndentedString(fromAsset)).append("\n"); - sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" fromAssetQty: ").append(toIndentedString(fromAssetQty)).append("\n"); - sb.append(" targetAssetQty: ").append(toIndentedString(targetAssetQty)).append("\n"); - sb.append(" redeemRate: ").append(toIndentedString(redeemRate)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object fromAssetValue = getFromAsset(); - String fromAssetValueAsString = ""; - fromAssetValueAsString = fromAssetValue.toString(); - sb.append("fromAsset=").append(urlEncode(fromAssetValueAsString)).append(""); - Object targetAssetValue = getTargetAsset(); - String targetAssetValueAsString = ""; - targetAssetValueAsString = targetAssetValue.toString(); - sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object fromAssetQtyValue = getFromAssetQty(); - String fromAssetQtyValueAsString = ""; - fromAssetQtyValueAsString = fromAssetQtyValue.toString(); - sb.append("fromAssetQty=").append(urlEncode(fromAssetQtyValueAsString)).append(""); - Object targetAssetQtyValue = getTargetAssetQty(); - String targetAssetQtyValueAsString = ""; - targetAssetQtyValueAsString = targetAssetQtyValue.toString(); - sb.append("targetAssetQty=").append(urlEncode(targetAssetQtyValueAsString)).append(""); - Object redeemRateValue = getRedeemRate(); - String redeemRateValueAsString = ""; - redeemRateValueAsString = redeemRateValue.toString(); - sb.append("redeemRate=").append(urlEncode(redeemRateValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * 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("fromAsset"); - openapiFields.add("targetAsset"); - openapiFields.add("fromAssetQty"); - openapiFields.add("targetAssetQty"); - openapiFields.add("redeemRate"); - - // 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 - * RedeemBfusdForPortfolioMarginResponse - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!RedeemBfusdForPortfolioMarginResponse.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in RedeemBfusdForPortfolioMarginResponse" - + " is not found in the empty JSON string", - RedeemBfusdForPortfolioMarginResponse.openapiRequiredFields - .toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("fromAsset") != null && !jsonObj.get("fromAsset").isJsonNull()) - && !jsonObj.get("fromAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fromAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("fromAsset").toString())); - } - if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) - && !jsonObj.get("targetAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `targetAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("targetAsset").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!RedeemBfusdForPortfolioMarginResponse.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'RedeemBfusdForPortfolioMarginResponse' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(RedeemBfusdForPortfolioMarginResponse.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, RedeemBfusdForPortfolioMarginResponse value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public RedeemBfusdForPortfolioMarginResponse read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of RedeemBfusdForPortfolioMarginResponse given an JSON string - * - * @param jsonString JSON string - * @return An instance of RedeemBfusdForPortfolioMarginResponse - * @throws IOException if the JSON string is invalid with respect to - * RedeemBfusdForPortfolioMarginResponse - */ - public static RedeemBfusdForPortfolioMarginResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, RedeemBfusdForPortfolioMarginResponse.class); - } - - /** - * Convert an instance of RedeemBfusdForPortfolioMarginResponse to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/KeepaliveMarginUserDataStreamRequest.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SwitchDeltaModeRequest.java similarity index 53% rename from clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/KeepaliveMarginUserDataStreamRequest.java rename to clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SwitchDeltaModeRequest.java index bacbb532f..6a9013d8a 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/KeepaliveMarginUserDataStreamRequest.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SwitchDeltaModeRequest.java @@ -1,6 +1,6 @@ /* - * Binance Margin Trading REST API - * OpenAPI Specification for the Binance Margin Trading REST API + * Binance Derivatives Trading Portfolio Margin Pro REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API * * The version of the OpenAPI document: 1.0.0 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.margin_trading.rest.model; +package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; -import com.binance.connector.client.margin_trading.rest.JSON; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -31,38 +31,62 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** KeepaliveMarginUserDataStreamRequest */ +/** SwitchDeltaModeRequest */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class KeepaliveMarginUserDataStreamRequest { - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; +public class SwitchDeltaModeRequest { + public static final String SERIALIZED_NAME_DELTA_ENABLED = "deltaEnabled"; - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) + @SerializedName(SERIALIZED_NAME_DELTA_ENABLED) @jakarta.annotation.Nonnull - private String listenKey; + private String deltaEnabled; - public KeepaliveMarginUserDataStreamRequest() {} + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - public KeepaliveMarginUserDataStreamRequest listenKey( - @jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Long recvWindow; + + public SwitchDeltaModeRequest() {} + + public SwitchDeltaModeRequest deltaEnabled(@jakarta.annotation.Nonnull String deltaEnabled) { + this.deltaEnabled = deltaEnabled; return this; } /** - * Get listenKey + * Get deltaEnabled * - * @return listenKey + * @return deltaEnabled */ @jakarta.annotation.Nonnull @NotNull - public String getListenKey() { - return listenKey; + public String getDeltaEnabled() { + return deltaEnabled; } - public void setListenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; + public void setDeltaEnabled(@jakarta.annotation.Nonnull String deltaEnabled) { + this.deltaEnabled = deltaEnabled; + } + + public SwitchDeltaModeRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + public Long getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { + this.recvWindow = recvWindow; } @Override @@ -73,21 +97,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest = - (KeepaliveMarginUserDataStreamRequest) o; - return Objects.equals(this.listenKey, keepaliveMarginUserDataStreamRequest.listenKey); + SwitchDeltaModeRequest switchDeltaModeRequest = (SwitchDeltaModeRequest) o; + return Objects.equals(this.deltaEnabled, switchDeltaModeRequest.deltaEnabled) + && Objects.equals(this.recvWindow, switchDeltaModeRequest.recvWindow); } @Override public int hashCode() { - return Objects.hash(listenKey); + return Objects.hash(deltaEnabled, recvWindow); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class KeepaliveMarginUserDataStreamRequest {\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); + sb.append("class SwitchDeltaModeRequest {\n"); + sb.append(" deltaEnabled: ").append(toIndentedString(deltaEnabled)).append("\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); } @@ -95,10 +120,14 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object listenKeyValue = getListenKey(); - String listenKeyValueAsString = ""; - listenKeyValueAsString = listenKeyValue.toString(); - sb.append("listenKey=").append(urlEncode(listenKeyValueAsString)).append(""); + Object deltaEnabledValue = getDeltaEnabled(); + String deltaEnabledValueAsString = ""; + deltaEnabledValueAsString = deltaEnabledValue.toString(); + sb.append("deltaEnabled=").append(urlEncode(deltaEnabledValueAsString)).append(""); + Object recvWindowValue = getRecvWindow(); + String recvWindowValueAsString = ""; + recvWindowValueAsString = recvWindowValue.toString(); + sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); return sb.toString(); } @@ -127,35 +156,34 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("listenKey"); + openapiFields.add("deltaEnabled"); + openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("listenKey"); + openapiRequiredFields.add("deltaEnabled"); } /** * 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 - * KeepaliveMarginUserDataStreamRequest + * @throws IOException if the JSON Element is invalid with respect to SwitchDeltaModeRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!KeepaliveMarginUserDataStreamRequest.openapiRequiredFields + if (!SwitchDeltaModeRequest.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in KeepaliveMarginUserDataStreamRequest" - + " is not found in the empty JSON string", - KeepaliveMarginUserDataStreamRequest.openapiRequiredFields - .toString())); + "The required field(s) %s in SwitchDeltaModeRequest is not found in" + + " the empty JSON string", + SwitchDeltaModeRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : KeepaliveMarginUserDataStreamRequest.openapiRequiredFields) { + for (String requiredField : SwitchDeltaModeRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -164,12 +192,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("listenKey").isJsonPrimitive()) { + if (!jsonObj.get("deltaEnabled").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" + "Expected the field `deltaEnabled` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("listenKey").toString())); + jsonObj.get("deltaEnabled").toString())); } } @@ -177,28 +205,24 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!KeepaliveMarginUserDataStreamRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'KeepaliveMarginUserDataStreamRequest' - // and its subtypes + if (!SwitchDeltaModeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SwitchDeltaModeRequest' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(KeepaliveMarginUserDataStreamRequest.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SwitchDeltaModeRequest.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, KeepaliveMarginUserDataStreamRequest value) + public void write(JsonWriter out, SwitchDeltaModeRequest value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public KeepaliveMarginUserDataStreamRequest read(JsonReader in) - throws IOException { + public SwitchDeltaModeRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -208,20 +232,18 @@ public KeepaliveMarginUserDataStreamRequest read(JsonReader in) } /** - * Create an instance of KeepaliveMarginUserDataStreamRequest given an JSON string + * Create an instance of SwitchDeltaModeRequest given an JSON string * * @param jsonString JSON string - * @return An instance of KeepaliveMarginUserDataStreamRequest - * @throws IOException if the JSON string is invalid with respect to - * KeepaliveMarginUserDataStreamRequest + * @return An instance of SwitchDeltaModeRequest + * @throws IOException if the JSON string is invalid with respect to SwitchDeltaModeRequest */ - public static KeepaliveMarginUserDataStreamRequest fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, KeepaliveMarginUserDataStreamRequest.class); + public static SwitchDeltaModeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SwitchDeltaModeRequest.class); } /** - * Convert an instance of KeepaliveMarginUserDataStreamRequest to an JSON string + * Convert an instance of SwitchDeltaModeRequest to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtForPortfolioMarginResponse.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SwitchDeltaModeResponse.java similarity index 70% rename from clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtForPortfolioMarginResponse.java rename to clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SwitchDeltaModeResponse.java index 070d6dea2..d70d13e99 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtForPortfolioMarginResponse.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/SwitchDeltaModeResponse.java @@ -31,20 +31,20 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** TransferLdusdtForPortfolioMarginResponse */ +/** SwitchDeltaModeResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class TransferLdusdtForPortfolioMarginResponse { +public class SwitchDeltaModeResponse { public static final String SERIALIZED_NAME_MSG = "msg"; @SerializedName(SERIALIZED_NAME_MSG) @jakarta.annotation.Nullable private String msg; - public TransferLdusdtForPortfolioMarginResponse() {} + public SwitchDeltaModeResponse() {} - public TransferLdusdtForPortfolioMarginResponse msg(@jakarta.annotation.Nullable String msg) { + public SwitchDeltaModeResponse msg(@jakarta.annotation.Nullable String msg) { this.msg = msg; return this; } @@ -71,9 +71,8 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TransferLdusdtForPortfolioMarginResponse transferLdusdtForPortfolioMarginResponse = - (TransferLdusdtForPortfolioMarginResponse) o; - return Objects.equals(this.msg, transferLdusdtForPortfolioMarginResponse.msg); + SwitchDeltaModeResponse switchDeltaModeResponse = (SwitchDeltaModeResponse) o; + return Objects.equals(this.msg, switchDeltaModeResponse.msg); } @Override @@ -84,7 +83,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TransferLdusdtForPortfolioMarginResponse {\n"); + sb.append("class SwitchDeltaModeResponse {\n"); sb.append(" msg: ").append(toIndentedString(msg)).append("\n"); sb.append("}"); return sb.toString(); @@ -135,20 +134,17 @@ private String toIndentedString(Object o) { * 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 - * TransferLdusdtForPortfolioMarginResponse + * @throws IOException if the JSON Element is invalid with respect to SwitchDeltaModeResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!TransferLdusdtForPortfolioMarginResponse.openapiRequiredFields + if (!SwitchDeltaModeResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in" - + " TransferLdusdtForPortfolioMarginResponse is not found in" - + " the empty JSON string", - TransferLdusdtForPortfolioMarginResponse.openapiRequiredFields - .toString())); + "The required field(s) %s in SwitchDeltaModeResponse is not found" + + " in the empty JSON string", + SwitchDeltaModeResponse.openapiRequiredFields.toString())); } } JsonObject jsonObj = jsonElement.getAsJsonObject(); @@ -166,29 +162,25 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!TransferLdusdtForPortfolioMarginResponse.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'TransferLdusdtForPortfolioMarginResponse' and its subtypes + if (!SwitchDeltaModeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SwitchDeltaModeResponse' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(TransferLdusdtForPortfolioMarginResponse.class)); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(SwitchDeltaModeResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, TransferLdusdtForPortfolioMarginResponse value) + public void write(JsonWriter out, SwitchDeltaModeResponse value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public TransferLdusdtForPortfolioMarginResponse read(JsonReader in) - throws IOException { + public SwitchDeltaModeResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -198,20 +190,18 @@ public TransferLdusdtForPortfolioMarginResponse read(JsonReader in) } /** - * Create an instance of TransferLdusdtForPortfolioMarginResponse given an JSON string + * Create an instance of SwitchDeltaModeResponse given an JSON string * * @param jsonString JSON string - * @return An instance of TransferLdusdtForPortfolioMarginResponse - * @throws IOException if the JSON string is invalid with respect to - * TransferLdusdtForPortfolioMarginResponse + * @return An instance of SwitchDeltaModeResponse + * @throws IOException if the JSON string is invalid with respect to SwitchDeltaModeResponse */ - public static TransferLdusdtForPortfolioMarginResponse fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, TransferLdusdtForPortfolioMarginResponse.class); + public static SwitchDeltaModeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SwitchDeltaModeResponse.class); } /** - * Convert an instance of TransferLdusdtForPortfolioMarginResponse to an JSON string + * Convert an instance of SwitchDeltaModeResponse to an JSON string * * @return JSON string */ diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtForPortfolioMarginRequest.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtForPortfolioMarginRequest.java deleted file mode 100644 index 3eed55b04..000000000 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/TransferLdusdtForPortfolioMarginRequest.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Binance Derivatives Trading Portfolio Margin Pro REST API - * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST 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_portfolio_margin_pro.rest.model; - -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.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.Valid; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** TransferLdusdtForPortfolioMarginRequest */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class TransferLdusdtForPortfolioMarginRequest { - public static final String SERIALIZED_NAME_ASSET = "asset"; - - @SerializedName(SERIALIZED_NAME_ASSET) - @jakarta.annotation.Nonnull - private String asset; - - public static final String SERIALIZED_NAME_TRANSFER_TYPE = "transferType"; - - @SerializedName(SERIALIZED_NAME_TRANSFER_TYPE) - @jakarta.annotation.Nonnull - private String transferType; - - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - - @SerializedName(SERIALIZED_NAME_AMOUNT) - @jakarta.annotation.Nonnull - private Double amount; - - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; - - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) - @jakarta.annotation.Nullable - private Long recvWindow; - - public TransferLdusdtForPortfolioMarginRequest() {} - - public TransferLdusdtForPortfolioMarginRequest asset(@jakarta.annotation.Nonnull String asset) { - this.asset = asset; - return this; - } - - /** - * Get asset - * - * @return asset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getAsset() { - return asset; - } - - public void setAsset(@jakarta.annotation.Nonnull String asset) { - this.asset = asset; - } - - public TransferLdusdtForPortfolioMarginRequest transferType( - @jakarta.annotation.Nonnull String transferType) { - this.transferType = transferType; - return this; - } - - /** - * Get transferType - * - * @return transferType - */ - @jakarta.annotation.Nonnull - @NotNull - public String getTransferType() { - return transferType; - } - - public void setTransferType(@jakarta.annotation.Nonnull String transferType) { - this.transferType = transferType; - } - - public TransferLdusdtForPortfolioMarginRequest amount( - @jakarta.annotation.Nonnull Double amount) { - this.amount = amount; - return this; - } - - /** - * Get amount - * - * @return amount - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getAmount() { - return amount; - } - - public void setAmount(@jakarta.annotation.Nonnull Double amount) { - this.amount = amount; - } - - public TransferLdusdtForPortfolioMarginRequest recvWindow( - @jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Get recvWindow - * - * @return recvWindow - */ - @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; - } - - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TransferLdusdtForPortfolioMarginRequest transferLdusdtForPortfolioMarginRequest = - (TransferLdusdtForPortfolioMarginRequest) o; - return Objects.equals(this.asset, transferLdusdtForPortfolioMarginRequest.asset) - && Objects.equals( - this.transferType, transferLdusdtForPortfolioMarginRequest.transferType) - && Objects.equals(this.amount, transferLdusdtForPortfolioMarginRequest.amount) - && Objects.equals( - this.recvWindow, transferLdusdtForPortfolioMarginRequest.recvWindow); - } - - @Override - public int hashCode() { - return Objects.hash(asset, transferType, amount, recvWindow); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TransferLdusdtForPortfolioMarginRequest {\n"); - sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); - sb.append(" transferType: ").append(toIndentedString(transferType)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object assetValue = getAsset(); - String assetValueAsString = ""; - assetValueAsString = assetValue.toString(); - sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); - Object transferTypeValue = getTransferType(); - String transferTypeValueAsString = ""; - transferTypeValueAsString = transferTypeValue.toString(); - sb.append("transferType=").append(urlEncode(transferTypeValueAsString)).append(""); - Object amountValue = getAmount(); - String amountValueAsString = ""; - amountValueAsString = amountValue.toString(); - sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * 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("asset"); - openapiFields.add("transferType"); - openapiFields.add("amount"); - openapiFields.add("recvWindow"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("asset"); - openapiRequiredFields.add("transferType"); - openapiRequiredFields.add("amount"); - } - - /** - * 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 - * TransferLdusdtForPortfolioMarginRequest - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!TransferLdusdtForPortfolioMarginRequest.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in" - + " TransferLdusdtForPortfolioMarginRequest is not found in the" - + " empty JSON string", - TransferLdusdtForPortfolioMarginRequest.openapiRequiredFields - .toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TransferLdusdtForPortfolioMarginRequest.openapiRequiredFields) { - if (jsonElement.getAsJsonObject().get(requiredField) == null) { - throw new IllegalArgumentException( - String.format( - "The required field `%s` is not found in the JSON string: %s", - requiredField, jsonElement.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("asset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `asset` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("asset").toString())); - } - if (!jsonObj.get("transferType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `transferType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("transferType").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!TransferLdusdtForPortfolioMarginRequest.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes 'TransferLdusdtForPortfolioMarginRequest' - // and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter( - this, TypeToken.get(TransferLdusdtForPortfolioMarginRequest.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write( - JsonWriter out, TransferLdusdtForPortfolioMarginRequest value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public TransferLdusdtForPortfolioMarginRequest read(JsonReader in) - throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of TransferLdusdtForPortfolioMarginRequest given an JSON string - * - * @param jsonString JSON string - * @return An instance of TransferLdusdtForPortfolioMarginRequest - * @throws IOException if the JSON string is invalid with respect to - * TransferLdusdtForPortfolioMarginRequest - */ - public static TransferLdusdtForPortfolioMarginRequest fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, TransferLdusdtForPortfolioMarginRequest.class); - } - - /** - * Convert an instance of TransferLdusdtForPortfolioMarginRequest to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java index 806f5b397..a56dfd3e4 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/DerivativesTradingPortfolioMarginProWebSocketStreamsUtil.java @@ -7,11 +7,15 @@ public class DerivativesTradingPortfolioMarginProWebSocketStreamsUtil { private static final boolean HAS_TIME_UNIT = false; public static WebSocketClientConfiguration getClientConfiguration() { + return getClientConfiguration(""); + } + + public static WebSocketClientConfiguration getClientConfiguration(String path) { WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); if (!HAS_TIME_UNIT) { clientConfiguration.setTimeUnit(null); } - clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setUrl(BASE_URL + path + "/stream"); clientConfiguration.setAutoLogon(false); return clientConfiguration; } diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java index 8731ff312..ede9037fb 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/websocket/stream/api/DerivativesTradingPortfolioMarginProWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginProWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin-pro/5.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin-pro/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java b/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java index 30e44cab2..52da0eab9 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java +++ b/clients/derivatives-trading-portfolio-margin-pro/src/test/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/api/AccountApiTest.java @@ -12,8 +12,6 @@ package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api; -import static org.junit.Assert.assertEquals; - import com.binance.connector.client.common.ApiClient; import com.binance.connector.client.common.ApiException; import com.binance.connector.client.common.ApiResponse; @@ -35,18 +33,13 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountBalanceResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProAccountInfoResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetPortfolioMarginProSpanAccountInfoResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.MintBfusdForPortfolioMarginResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.PortfolioMarginProBankruptcyLoanRepayRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.PortfolioMarginProBankruptcyLoanRepayResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProBankruptcyLoanAmountResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginRequest; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RedeemBfusdForPortfolioMarginResponse; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceRequest; import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.RepayFuturesNegativeBalanceResponse; -import jakarta.validation.constraints.*; import okhttp3.Call; import okhttp3.Request; import org.bouncycastle.crypto.CryptoException; @@ -55,6 +48,8 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mockito; +import static org.junit.Assert.assertEquals; + /** API tests for AccountApi */ public class AccountApiTest { diff --git a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md index 2c0deca8f..553ef9814 100644 --- a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## 5.0.0 - 2026-02-12 + +### Changed (2) + +#### REST API + +- Modified parameter `strategyType`: + - enum added: `LIMIT_MAKER` + - affected methods: + - `newCmConditionalOrder()` (`POST /papi/v1/cm/conditional/order`) + - `newUmConditionalOrder()` (`POST /papi/v1/um/conditional/order`) +- Modified response for `queryCurrentCmOpenOrder()` (`GET /papi/v1/cm/openOrder`): + - type `object` → `array` + - property `price` deleted + - property `positionSide` deleted + - property `avgPrice` deleted + - property `timeInForce` deleted + - property `executedQty` deleted + - property `updateTime` deleted + - property `status` deleted + - property `side` deleted + - property `clientOrderId` deleted + - property `origType` deleted + - property `symbol` deleted + - property `cumBase` deleted + - property `orderId` deleted + - property `origQty` deleted + - property `type` deleted + - property `reduceOnly` deleted + - property `time` deleted + - property `pair` deleted + ## 4.0.0 - 2025-12-16 ### Changed (1) @@ -57,4 +89,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/derivatives-trading-portfolio-margin/docs/QueryCurrentCmOpenOrderResponse.md b/clients/derivatives-trading-portfolio-margin/docs/QueryCurrentCmOpenOrderResponse.md index 7d2b3dc6b..7ce2586bc 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/QueryCurrentCmOpenOrderResponse.md +++ b/clients/derivatives-trading-portfolio-margin/docs/QueryCurrentCmOpenOrderResponse.md @@ -7,24 +7,6 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**avgPrice** | **String** | | [optional] | -|**clientOrderId** | **String** | | [optional] | -|**cumBase** | **String** | | [optional] | -|**executedQty** | **String** | | [optional] | -|**orderId** | **Long** | | [optional] | -|**origQty** | **String** | | [optional] | -|**origType** | **String** | | [optional] | -|**price** | **String** | | [optional] | -|**reduceOnly** | **Boolean** | | [optional] | -|**side** | **String** | | [optional] | -|**positionSide** | **String** | | [optional] | -|**status** | **String** | | [optional] | -|**symbol** | **String** | | [optional] | -|**pair** | **String** | | [optional] | -|**time** | **Long** | | [optional] | -|**timeInForce** | **String** | | [optional] | -|**type** | **String** | | [optional] | -|**updateTime** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/StrategyType.md b/clients/derivatives-trading-portfolio-margin/docs/StrategyType.md index a178eedda..9e8dd8182 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/StrategyType.md +++ b/clients/derivatives-trading-portfolio-margin/docs/StrategyType.md @@ -9,6 +9,8 @@ * `STOP_MARKET` (value: `"STOP_MARKET"`) +* `LIMIT_MAKER` (value: `"LIMIT_MAKER"`) + * `TAKE_PROFIT` (value: `"TAKE_PROFIT"`) * `TAKE_PROFIT_MARKET` (value: `"TAKE_PROFIT_MARKET"`) diff --git a/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md b/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md index 093cf2434..4163aa9ce 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md +++ b/clients/derivatives-trading-portfolio-margin/docs/TradeApi.md @@ -2786,7 +2786,7 @@ No authorization required Query Current UM Open Conditional Order(USER_DATA) -Query Current UM Open Conditional Order * Either `strategyId` or `newClientStrategyId` must be sent. * If the queried order has been `CANCELED`, `TRIGGERED`或`EXPIRED`, the error message \"Order does not exist\" will be returned. Weight: 1 +Query Current UM Open Conditional Order * Either `strategyId` or `newClientStrategyId` must be sent. * If the queried order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, the error message \"Order does not exist\" will be returned. Weight: 1 ### Example ```java diff --git a/clients/derivatives-trading-portfolio-margin/docs/UmPositionAdlQuantileEstimationResponseInner.md b/clients/derivatives-trading-portfolio-margin/docs/UmPositionAdlQuantileEstimationResponseInner.md index e10086903..429f524be 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/UmPositionAdlQuantileEstimationResponseInner.md +++ b/clients/derivatives-trading-portfolio-margin/docs/UmPositionAdlQuantileEstimationResponseInner.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | -|**adlQuantile** | [**CmPositionAdlQuantileEstimationResponseInnerAdlQuantile**](CmPositionAdlQuantileEstimationResponseInnerAdlQuantile.md) | | [optional] | +|**adlQuantile** | [**UmPositionAdlQuantileEstimationResponseInnerAdlQuantile**](UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.md) | | [optional] | diff --git a/clients/derivatives-trading-portfolio-margin/docs/UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.md b/clients/derivatives-trading-portfolio-margin/docs/UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.md new file mode 100644 index 000000000..2abf0974c --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/docs/UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.md @@ -0,0 +1,15 @@ + + +# UmPositionAdlQuantileEstimationResponseInnerAdlQuantile + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**LONG** | **Long** | | [optional] | +|**SHORT** | **Long** | | [optional] | +|**BOTH** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md b/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md index 38b71dd37..6f2ae7547 100644 --- a/clients/derivatives-trading-portfolio-margin/docs/rest-api/migration-guide.md +++ b/clients/derivatives-trading-portfolio-margin/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-portfolio-margin - 4.0.0 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-portfolio-margin - 4.0.0 + 5.0.0 ``` diff --git a/clients/derivatives-trading-portfolio-margin/pom.xml b/clients/derivatives-trading-portfolio-margin/pom.xml index 41415ecd2..b7bf783db 100644 --- a/clients/derivatives-trading-portfolio-margin/pom.xml +++ b/clients/derivatives-trading-portfolio-margin/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-derivatives-trading-portfolio-margin derivatives-trading-portfolio-margin - 4.0.0 + 5.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java index 9d8b0200a..5164dd27b 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/JSON.java @@ -682,6 +682,10 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model .UmPositionAdlQuantileEstimationResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_portfolio_margin.rest.model + .UmPositionAdlQuantileEstimationResponseInnerAdlQuantile + .CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java index e0bf9ff3a..7027c10bb 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/AccountApi.java @@ -94,7 +94,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/5.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-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java index 820e2edac..ce267f705 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/DerivativesTradingPortfolioMarginRestApi.java @@ -2610,8 +2610,8 @@ public ApiResponse queryCurrentMarginOpenOr /** * Query Current UM Open Conditional Order(USER_DATA) Query Current UM Open Conditional Order * * Either `strategyId` or `newClientStrategyId` must be sent. * If the - * queried order has been `CANCELED`, `TRIGGERED`或`EXPIRED`, the - * error message \"Order does not exist\" will be returned. Weight: 1 + * queried order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, + * the error message \"Order does not exist\" will be returned. Weight: 1 * * @param symbol (required) * @param strategyId (optional) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java index 3c257647c..11117ab70 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/MarketDataApi.java @@ -40,7 +40,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/5.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-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java index bbfa13ac5..9600decf6 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/TradeApi.java @@ -112,7 +112,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -7470,8 +7470,8 @@ private okhttp3.Call queryCurrentUmOpenConditionalOrderValidateBeforeCall( /** * Query Current UM Open Conditional Order(USER_DATA) Query Current UM Open Conditional Order * * Either `strategyId` or `newClientStrategyId` must be sent. * If the - * queried order has been `CANCELED`, `TRIGGERED`或`EXPIRED`, the - * error message \"Order does not exist\" will be returned. Weight: 1 + * queried order has been `CANCELED`, `TRIGGERED` or `EXPIRED`, + * the error message \"Order does not exist\" will be returned. Weight: 1 * * @param symbol (required) * @param strategyId (optional) diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java index 809dcdc8f..aad4de960 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/api/UserDataStreamsApi.java @@ -42,7 +42,7 @@ public class UserDataStreamsApi { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/5.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-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java index fd5c9ae40..e258a8020 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/QueryCurrentCmOpenOrderResponse.java @@ -14,11 +14,10 @@ import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.JSON; import com.google.gson.Gson; +import com.google.gson.JsonArray; 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; @@ -27,6 +26,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.HashSet; import java.util.Objects; import org.hibernate.validator.constraints.*; @@ -35,465 +35,9 @@ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class QueryCurrentCmOpenOrderResponse { - public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE) - @jakarta.annotation.Nullable - private String avgPrice; - - public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; - - @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) - @jakarta.annotation.Nullable - private String clientOrderId; - - public static final String SERIALIZED_NAME_CUM_BASE = "cumBase"; - - @SerializedName(SERIALIZED_NAME_CUM_BASE) - @jakarta.annotation.Nullable - private String cumBase; - - public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; - - @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) - @jakarta.annotation.Nullable - private String executedQty; - - public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; - - @SerializedName(SERIALIZED_NAME_ORDER_ID) - @jakarta.annotation.Nullable - private Long orderId; - - public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; - - @SerializedName(SERIALIZED_NAME_ORIG_QTY) - @jakarta.annotation.Nullable - private String origQty; - - public static final String SERIALIZED_NAME_ORIG_TYPE = "origType"; - - @SerializedName(SERIALIZED_NAME_ORIG_TYPE) - @jakarta.annotation.Nullable - private String origType; - - public static final String SERIALIZED_NAME_PRICE = "price"; - - @SerializedName(SERIALIZED_NAME_PRICE) - @jakarta.annotation.Nullable - private String price; - - 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_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_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - - @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nullable - private String symbol; - - public static final String SERIALIZED_NAME_PAIR = "pair"; - - @SerializedName(SERIALIZED_NAME_PAIR) - @jakarta.annotation.Nullable - private String pair; - - public static final String SERIALIZED_NAME_TIME = "time"; - - @SerializedName(SERIALIZED_NAME_TIME) - @jakarta.annotation.Nullable - private Long time; - - 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_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @jakarta.annotation.Nullable - private String type; - - public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; - - @SerializedName(SERIALIZED_NAME_UPDATE_TIME) - @jakarta.annotation.Nullable - private Long updateTime; - +public class QueryCurrentCmOpenOrderResponse extends ArrayList { public QueryCurrentCmOpenOrderResponse() {} - public QueryCurrentCmOpenOrderResponse avgPrice(@jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - return this; - } - - /** - * Get avgPrice - * - * @return avgPrice - */ - @jakarta.annotation.Nullable - public String getAvgPrice() { - return avgPrice; - } - - public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - } - - public QueryCurrentCmOpenOrderResponse clientOrderId( - @jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - return this; - } - - /** - * Get clientOrderId - * - * @return clientOrderId - */ - @jakarta.annotation.Nullable - public String getClientOrderId() { - return clientOrderId; - } - - public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - } - - public QueryCurrentCmOpenOrderResponse cumBase(@jakarta.annotation.Nullable String cumBase) { - this.cumBase = cumBase; - return this; - } - - /** - * Get cumBase - * - * @return cumBase - */ - @jakarta.annotation.Nullable - public String getCumBase() { - return cumBase; - } - - public void setCumBase(@jakarta.annotation.Nullable String cumBase) { - this.cumBase = cumBase; - } - - public QueryCurrentCmOpenOrderResponse executedQty( - @jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - return this; - } - - /** - * Get executedQty - * - * @return executedQty - */ - @jakarta.annotation.Nullable - public String getExecutedQty() { - return executedQty; - } - - public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - } - - public QueryCurrentCmOpenOrderResponse orderId(@jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - return this; - } - - /** - * Get orderId - * - * @return orderId - */ - @jakarta.annotation.Nullable - public Long getOrderId() { - return orderId; - } - - public void setOrderId(@jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - } - - public QueryCurrentCmOpenOrderResponse origQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - return this; - } - - /** - * Get origQty - * - * @return origQty - */ - @jakarta.annotation.Nullable - public String getOrigQty() { - return origQty; - } - - public void setOrigQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - } - - public QueryCurrentCmOpenOrderResponse origType(@jakarta.annotation.Nullable String origType) { - this.origType = origType; - return this; - } - - /** - * Get origType - * - * @return origType - */ - @jakarta.annotation.Nullable - public String getOrigType() { - return origType; - } - - public void setOrigType(@jakarta.annotation.Nullable String origType) { - this.origType = origType; - } - - public QueryCurrentCmOpenOrderResponse 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 QueryCurrentCmOpenOrderResponse 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 QueryCurrentCmOpenOrderResponse 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 QueryCurrentCmOpenOrderResponse 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 QueryCurrentCmOpenOrderResponse status(@jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public QueryCurrentCmOpenOrderResponse 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 QueryCurrentCmOpenOrderResponse pair(@jakarta.annotation.Nullable String pair) { - this.pair = pair; - return this; - } - - /** - * Get pair - * - * @return pair - */ - @jakarta.annotation.Nullable - public String getPair() { - return pair; - } - - public void setPair(@jakarta.annotation.Nullable String pair) { - this.pair = pair; - } - - public QueryCurrentCmOpenOrderResponse time(@jakarta.annotation.Nullable Long time) { - this.time = time; - return this; - } - - /** - * Get time - * - * @return time - */ - @jakarta.annotation.Nullable - public Long getTime() { - return time; - } - - public void setTime(@jakarta.annotation.Nullable Long time) { - this.time = time; - } - - public QueryCurrentCmOpenOrderResponse 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 QueryCurrentCmOpenOrderResponse type(@jakarta.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - public void setType(@jakarta.annotation.Nullable String type) { - this.type = type; - } - - public QueryCurrentCmOpenOrderResponse 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; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -502,73 +46,19 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - QueryCurrentCmOpenOrderResponse queryCurrentCmOpenOrderResponse = - (QueryCurrentCmOpenOrderResponse) o; - return Objects.equals(this.avgPrice, queryCurrentCmOpenOrderResponse.avgPrice) - && Objects.equals(this.clientOrderId, queryCurrentCmOpenOrderResponse.clientOrderId) - && Objects.equals(this.cumBase, queryCurrentCmOpenOrderResponse.cumBase) - && Objects.equals(this.executedQty, queryCurrentCmOpenOrderResponse.executedQty) - && Objects.equals(this.orderId, queryCurrentCmOpenOrderResponse.orderId) - && Objects.equals(this.origQty, queryCurrentCmOpenOrderResponse.origQty) - && Objects.equals(this.origType, queryCurrentCmOpenOrderResponse.origType) - && Objects.equals(this.price, queryCurrentCmOpenOrderResponse.price) - && Objects.equals(this.reduceOnly, queryCurrentCmOpenOrderResponse.reduceOnly) - && Objects.equals(this.side, queryCurrentCmOpenOrderResponse.side) - && Objects.equals(this.positionSide, queryCurrentCmOpenOrderResponse.positionSide) - && Objects.equals(this.status, queryCurrentCmOpenOrderResponse.status) - && Objects.equals(this.symbol, queryCurrentCmOpenOrderResponse.symbol) - && Objects.equals(this.pair, queryCurrentCmOpenOrderResponse.pair) - && Objects.equals(this.time, queryCurrentCmOpenOrderResponse.time) - && Objects.equals(this.timeInForce, queryCurrentCmOpenOrderResponse.timeInForce) - && Objects.equals(this.type, queryCurrentCmOpenOrderResponse.type) - && Objects.equals(this.updateTime, queryCurrentCmOpenOrderResponse.updateTime); + return super.equals(o); } @Override public int hashCode() { - return Objects.hash( - avgPrice, - clientOrderId, - cumBase, - executedQty, - orderId, - origQty, - origType, - price, - reduceOnly, - side, - positionSide, - status, - symbol, - pair, - time, - timeInForce, - type, - updateTime); + return Objects.hash(super.hashCode()); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QueryCurrentCmOpenOrderResponse {\n"); - sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); - sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); - sb.append(" cumBase: ").append(toIndentedString(cumBase)).append("\n"); - sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); - sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); - sb.append(" origType: ").append(toIndentedString(origType)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" pair: ").append(toIndentedString(pair)).append("\n"); - sb.append(" time: ").append(toIndentedString(time)).append("\n"); - sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append("}"); return sb.toString(); } @@ -576,78 +66,6 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object avgPriceValue = getAvgPrice(); - String avgPriceValueAsString = ""; - avgPriceValueAsString = avgPriceValue.toString(); - sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); - Object clientOrderIdValue = getClientOrderId(); - String clientOrderIdValueAsString = ""; - clientOrderIdValueAsString = clientOrderIdValue.toString(); - sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); - Object cumBaseValue = getCumBase(); - String cumBaseValueAsString = ""; - cumBaseValueAsString = cumBaseValue.toString(); - sb.append("cumBase=").append(urlEncode(cumBaseValueAsString)).append(""); - Object executedQtyValue = getExecutedQty(); - String executedQtyValueAsString = ""; - executedQtyValueAsString = executedQtyValue.toString(); - sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object orderIdValue = getOrderId(); - String orderIdValueAsString = ""; - orderIdValueAsString = orderIdValue.toString(); - sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); - Object origQtyValue = getOrigQty(); - String origQtyValueAsString = ""; - origQtyValueAsString = origQtyValue.toString(); - sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); - Object origTypeValue = getOrigType(); - String origTypeValueAsString = ""; - origTypeValueAsString = origTypeValue.toString(); - sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); - Object priceValue = getPrice(); - String priceValueAsString = ""; - priceValueAsString = priceValue.toString(); - sb.append("price=").append(urlEncode(priceValueAsString)).append(""); - Object reduceOnlyValue = getReduceOnly(); - String reduceOnlyValueAsString = ""; - reduceOnlyValueAsString = reduceOnlyValue.toString(); - sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object sideValue = getSide(); - String sideValueAsString = ""; - sideValueAsString = sideValue.toString(); - sb.append("side=").append(urlEncode(sideValueAsString)).append(""); - Object positionSideValue = getPositionSide(); - String positionSideValueAsString = ""; - positionSideValueAsString = positionSideValue.toString(); - sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object symbolValue = getSymbol(); - String symbolValueAsString = ""; - symbolValueAsString = symbolValue.toString(); - sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); - Object pairValue = getPair(); - String pairValueAsString = ""; - pairValueAsString = pairValue.toString(); - sb.append("pair=").append(urlEncode(pairValueAsString)).append(""); - Object timeValue = getTime(); - String timeValueAsString = ""; - timeValueAsString = timeValue.toString(); - sb.append("time=").append(urlEncode(timeValueAsString)).append(""); - Object timeInForceValue = getTimeInForce(); - String timeInForceValueAsString = ""; - timeInForceValueAsString = timeInForceValue.toString(); - sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); - Object typeValue = getType(); - String typeValueAsString = ""; - typeValueAsString = typeValue.toString(); - sb.append("type=").append(urlEncode(typeValueAsString)).append(""); - Object updateTimeValue = getUpdateTime(); - String updateTimeValueAsString = ""; - updateTimeValueAsString = updateTimeValue.toString(); - sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); return sb.toString(); } @@ -676,24 +94,6 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("avgPrice"); - openapiFields.add("clientOrderId"); - openapiFields.add("cumBase"); - openapiFields.add("executedQty"); - openapiFields.add("orderId"); - openapiFields.add("origQty"); - openapiFields.add("origType"); - openapiFields.add("price"); - openapiFields.add("reduceOnly"); - openapiFields.add("side"); - openapiFields.add("positionSide"); - openapiFields.add("status"); - openapiFields.add("symbol"); - openapiFields.add("pair"); - openapiFields.add("time"); - openapiFields.add("timeInForce"); - openapiFields.add("type"); - openapiFields.add("updateTime"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -707,6 +107,18 @@ private String toIndentedString(Object o) { * QueryCurrentCmOpenOrderResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + QueryAllCmOrdersResponseInner.validateJsonElement(element); + } if (jsonElement == null) { if (!QueryCurrentCmOpenOrderResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null @@ -717,119 +129,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti QueryCurrentCmOpenOrderResponse.openapiRequiredFields.toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) - && !jsonObj.get("avgPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `avgPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("avgPrice").toString())); - } - if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) - && !jsonObj.get("clientOrderId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `clientOrderId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("clientOrderId").toString())); - } - if ((jsonObj.get("cumBase") != null && !jsonObj.get("cumBase").isJsonNull()) - && !jsonObj.get("cumBase").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cumBase` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("cumBase").toString())); - } - if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) - && !jsonObj.get("executedQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `executedQty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("executedQty").toString())); - } - if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) - && !jsonObj.get("origQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("origQty").toString())); - } - if ((jsonObj.get("origType") != null && !jsonObj.get("origType").isJsonNull()) - && !jsonObj.get("origType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("origType").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("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("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").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" - + " but got `%s`", - jsonObj.get("symbol").toString())); - } - if ((jsonObj.get("pair") != null && !jsonObj.get("pair").isJsonNull()) - && !jsonObj.get("pair").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `pair` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("pair").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())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) - && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @@ -850,7 +149,7 @@ public TypeAdapter create(Gson gson, TypeToken type) { @Override public void write(JsonWriter out, QueryCurrentCmOpenOrderResponse value) throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); elementAdapter.write(out, obj); } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StrategyType.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StrategyType.java index c417d5447..d5865b054 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StrategyType.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/StrategyType.java @@ -28,6 +28,8 @@ public enum StrategyType { STOP_MARKET("STOP_MARKET"), + LIMIT_MAKER("LIMIT_MAKER"), + TAKE_PROFIT("TAKE_PROFIT"), TAKE_PROFIT_MARKET("TAKE_PROFIT_MARKET"), diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java index 7b4ecafdb..988e0a5f9 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInner.java @@ -47,7 +47,7 @@ public class UmPositionAdlQuantileEstimationResponseInner { @SerializedName(SERIALIZED_NAME_ADL_QUANTILE) @jakarta.annotation.Nullable - private CmPositionAdlQuantileEstimationResponseInnerAdlQuantile adlQuantile; + private UmPositionAdlQuantileEstimationResponseInnerAdlQuantile adlQuantile; public UmPositionAdlQuantileEstimationResponseInner() {} @@ -73,7 +73,7 @@ public void setSymbol(@jakarta.annotation.Nullable String symbol) { public UmPositionAdlQuantileEstimationResponseInner adlQuantile( @jakarta.annotation.Nullable - CmPositionAdlQuantileEstimationResponseInnerAdlQuantile adlQuantile) { + UmPositionAdlQuantileEstimationResponseInnerAdlQuantile adlQuantile) { this.adlQuantile = adlQuantile; return this; } @@ -85,13 +85,13 @@ public UmPositionAdlQuantileEstimationResponseInner adlQuantile( */ @jakarta.annotation.Nullable @Valid - public CmPositionAdlQuantileEstimationResponseInnerAdlQuantile getAdlQuantile() { + public UmPositionAdlQuantileEstimationResponseInnerAdlQuantile getAdlQuantile() { return adlQuantile; } public void setAdlQuantile( @jakarta.annotation.Nullable - CmPositionAdlQuantileEstimationResponseInnerAdlQuantile adlQuantile) { + UmPositionAdlQuantileEstimationResponseInnerAdlQuantile adlQuantile) { this.adlQuantile = adlQuantile; } @@ -202,7 +202,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } // validate the optional field `adlQuantile` if (jsonObj.get("adlQuantile") != null && !jsonObj.get("adlQuantile").isJsonNull()) { - CmPositionAdlQuantileEstimationResponseInnerAdlQuantile.validateJsonElement( + UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.validateJsonElement( jsonObj.get("adlQuantile")); } } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.java new file mode 100644 index 000000000..7d1783bc2 --- /dev/null +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/model/UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.java @@ -0,0 +1,293 @@ +/* + * Binance Derivatives Trading Portfolio Margin REST API + * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin REST 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_portfolio_margin.rest.model; + +import com.binance.connector.client.derivatives_trading_portfolio_margin.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** UmPositionAdlQuantileEstimationResponseInnerAdlQuantile */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UmPositionAdlQuantileEstimationResponseInnerAdlQuantile { + public static final String SERIALIZED_NAME_L_O_N_G = "LONG"; + + @SerializedName(SERIALIZED_NAME_L_O_N_G) + @jakarta.annotation.Nullable + private Long LONG; + + public static final String SERIALIZED_NAME_S_H_O_R_T = "SHORT"; + + @SerializedName(SERIALIZED_NAME_S_H_O_R_T) + @jakarta.annotation.Nullable + private Long SHORT; + + public static final String SERIALIZED_NAME_B_O_T_H = "BOTH"; + + @SerializedName(SERIALIZED_NAME_B_O_T_H) + @jakarta.annotation.Nullable + private Long BOTH; + + public UmPositionAdlQuantileEstimationResponseInnerAdlQuantile() {} + + public UmPositionAdlQuantileEstimationResponseInnerAdlQuantile LONG( + @jakarta.annotation.Nullable Long LONG) { + this.LONG = LONG; + return this; + } + + /** + * Get LONG + * + * @return LONG + */ + @jakarta.annotation.Nullable + public Long getLONG() { + return LONG; + } + + public void setLONG(@jakarta.annotation.Nullable Long LONG) { + this.LONG = LONG; + } + + public UmPositionAdlQuantileEstimationResponseInnerAdlQuantile SHORT( + @jakarta.annotation.Nullable Long SHORT) { + this.SHORT = SHORT; + return this; + } + + /** + * Get SHORT + * + * @return SHORT + */ + @jakarta.annotation.Nullable + public Long getSHORT() { + return SHORT; + } + + public void setSHORT(@jakarta.annotation.Nullable Long SHORT) { + this.SHORT = SHORT; + } + + public UmPositionAdlQuantileEstimationResponseInnerAdlQuantile BOTH( + @jakarta.annotation.Nullable Long BOTH) { + this.BOTH = BOTH; + return this; + } + + /** + * Get BOTH + * + * @return BOTH + */ + @jakarta.annotation.Nullable + public Long getBOTH() { + return BOTH; + } + + public void setBOTH(@jakarta.annotation.Nullable Long BOTH) { + this.BOTH = BOTH; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UmPositionAdlQuantileEstimationResponseInnerAdlQuantile + umPositionAdlQuantileEstimationResponseInnerAdlQuantile = + (UmPositionAdlQuantileEstimationResponseInnerAdlQuantile) o; + return Objects.equals( + this.LONG, umPositionAdlQuantileEstimationResponseInnerAdlQuantile.LONG) + && Objects.equals( + this.SHORT, umPositionAdlQuantileEstimationResponseInnerAdlQuantile.SHORT) + && Objects.equals( + this.BOTH, umPositionAdlQuantileEstimationResponseInnerAdlQuantile.BOTH); + } + + @Override + public int hashCode() { + return Objects.hash(LONG, SHORT, BOTH); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UmPositionAdlQuantileEstimationResponseInnerAdlQuantile {\n"); + sb.append(" LONG: ").append(toIndentedString(LONG)).append("\n"); + sb.append(" SHORT: ").append(toIndentedString(SHORT)).append("\n"); + sb.append(" BOTH: ").append(toIndentedString(BOTH)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object LONGValue = getLONG(); + String LONGValueAsString = ""; + LONGValueAsString = LONGValue.toString(); + sb.append("LONG=").append(urlEncode(LONGValueAsString)).append(""); + Object SHORTValue = getSHORT(); + String SHORTValueAsString = ""; + SHORTValueAsString = SHORTValue.toString(); + sb.append("SHORT=").append(urlEncode(SHORTValueAsString)).append(""); + Object BOTHValue = getBOTH(); + String BOTHValueAsString = ""; + BOTHValueAsString = BOTHValue.toString(); + sb.append("BOTH=").append(urlEncode(BOTHValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("LONG"); + openapiFields.add("SHORT"); + openapiFields.add("BOTH"); + + // 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 + * UmPositionAdlQuantileEstimationResponseInnerAdlQuantile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UmPositionAdlQuantileEstimationResponseInnerAdlQuantile is" + + " not found in the empty JSON string", + UmPositionAdlQuantileEstimationResponseInnerAdlQuantile + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'UmPositionAdlQuantileEstimationResponseInnerAdlQuantile' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + UmPositionAdlQuantileEstimationResponseInnerAdlQuantile value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UmPositionAdlQuantileEstimationResponseInnerAdlQuantile read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UmPositionAdlQuantileEstimationResponseInnerAdlQuantile given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of UmPositionAdlQuantileEstimationResponseInnerAdlQuantile + * @throws IOException if the JSON string is invalid with respect to + * UmPositionAdlQuantileEstimationResponseInnerAdlQuantile + */ + public static UmPositionAdlQuantileEstimationResponseInnerAdlQuantile fromJson( + String jsonString) throws IOException { + return JSON.getGson() + .fromJson( + jsonString, UmPositionAdlQuantileEstimationResponseInnerAdlQuantile.class); + } + + /** + * Convert an instance of UmPositionAdlQuantileEstimationResponseInnerAdlQuantile to an JSON + * string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java index 651c35914..ce3b8e398 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/DerivativesTradingPortfolioMarginWebSocketStreamsUtil.java @@ -7,11 +7,15 @@ public class DerivativesTradingPortfolioMarginWebSocketStreamsUtil { private static final boolean HAS_TIME_UNIT = false; public static WebSocketClientConfiguration getClientConfiguration() { + return getClientConfiguration(""); + } + + public static WebSocketClientConfiguration getClientConfiguration(String path) { WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); if (!HAS_TIME_UNIT) { clientConfiguration.setTimeUnit(null); } - clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setUrl(BASE_URL + path + "/stream"); clientConfiguration.setAutoLogon(false); return clientConfiguration; } diff --git a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java index a50f7586d..68fd8b025 100644 --- a/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java +++ b/clients/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/websocket/stream/api/DerivativesTradingPortfolioMarginWebSocketStreams.java @@ -19,7 +19,7 @@ public class DerivativesTradingPortfolioMarginWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-derivatives-trading-portfolio-margin/4.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-portfolio-margin/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index 8f8ec8642..521c633e2 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,109 @@ # Changelog +## 9.0.0 - 2026-02-12 + +### Changed (20) + +#### REST API + +- Added parameter `activatePrice` + - affected methods: + - `newAlgoOrder()` (`POST /fapi/v1/algoOrder`) +- Added parameter `algoId` + - affected methods: + - `cancelAlgoOrder()` (`DELETE /fapi/v1/algoOrder`) +- Added parameter `clientAlgoId` + - affected methods: + - `cancelAlgoOrder()` (`DELETE /fapi/v1/algoOrder`) +- Added parameter `newOrderRespType` + - affected methods: + - `newAlgoOrder()` (`POST /fapi/v1/algoOrder`) +- Deleted parameter `activationPrice` + - affected methods: + - `newAlgoOrder()` (`POST /fapi/v1/algoOrder`) +- Deleted parameter `algoid` + - affected methods: + - `cancelAlgoOrder()` (`DELETE /fapi/v1/algoOrder`) +- Deleted parameter `clientalgoid` + - affected methods: + - `cancelAlgoOrder()` (`DELETE /fapi/v1/algoOrder`) +- Modified parameter `batchOrders`: + - items: property `stopPrice` added + - items: item property `stopPrice` added + - affected methods: + - `modifyMultipleOrders()` (`PUT /fapi/v1/batchOrders`) +- Modified response for `placeMultipleOrders()` (`POST /fapi/v1/batchOrders`): + - items: property `closePosition` added + - items: item property `closePosition` added + +- Modified response for `queryOrder()` (`GET /fapi/v1/order`): + - property `id` added + - property `result` added + - property `updateTime` deleted + - property `priceRate` deleted + - property `orderId` deleted + - property `type` deleted + - property `goodTillDate` deleted + - property `origQty` deleted + - property `origType` deleted + - property `closePosition` deleted + - property `time` deleted + - property `timeInForce` deleted + - property `priceMatch` deleted + - property `workingType` deleted + - property `activatePrice` deleted + - property `executedQty` deleted + - property `selfTradePreventionMode` deleted + - property `reduceOnly` deleted + - property `side` deleted + - property `price` deleted + - property `clientOrderId` deleted + - property `stopPrice` deleted + - property `symbol` deleted + - property `cumQuote` deleted + - property `priceProtect` deleted + - property `avgPrice` deleted + - property `positionSide` deleted + - `status`: type `string` → `integer` + +- Modified response for `symbolConfiguration()` (`GET /fapi/v1/symbolConfig`): + - items.`isAutoAddMargin`: type `string` → `boolean` + - items.`isAutoAddMargin`: type `string` → `boolean` + +#### WebSocket API + +- Added parameter `activatePrice` + - affected methods: + - `newAlgoOrder()` (`algoOrder.place` method) +- Added parameter `algoId` + - affected methods: + - `cancelAlgoOrder()` (`algoOrder.cancel` method) +- Added parameter `clientAlgoId` + - affected methods: + - `cancelAlgoOrder()` (`algoOrder.cancel` method) +- Added parameter `newOrderRespType` + - affected methods: + - `newAlgoOrder()` (`algoOrder.place` method) +- Deleted parameter `activationPrice` + - affected methods: + - `newAlgoOrder()` (`algoOrder.place` method) +- Deleted parameter `algoid` + - affected methods: + - `cancelAlgoOrder()` (`algoOrder.cancel` method) +- Deleted parameter `clientalgoid` + - affected methods: + - `cancelAlgoOrder()` (`algoOrder.cancel` method) +- Modified response for `positionInformationV2()` (`v2/account.position` method): + - `result`.items: property `unRealizedProfit` added + - `result`.items: property `unrealizedProfit` deleted + - `result`.items: item property `unRealizedProfit` added + - `result`.items: item property `unrealizedProfit` deleted + +#### WebSocket Streams + +- Modified response for `aggregateTradeStreams()` (`@aggTrade` stream): + - property `nq` added + ## 8.0.0 - 2026-01-06 ### Changed (3) diff --git a/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md b/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md index 0e3d188f6..224db3852 100644 --- a/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md +++ b/clients/derivatives-trading-usds-futures/docs/BatchOrdersInner.md @@ -14,6 +14,7 @@ |**quantity** | **String** | | [optional] | |**price** | **String** | | [optional] | |**priceMatch** | [**PriceMatchEnum**](#PriceMatchEnum) | | [optional] | +|**stopPrice** | **String** | | [optional] | |**recvWindow** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderRequest.md b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderRequest.md index cd665e995..2a806749d 100644 --- a/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderRequest.md +++ b/clients/derivatives-trading-usds-futures/docs/CancelAlgoOrderRequest.md @@ -8,8 +8,8 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **String** | | [optional] | -|**algoid** | **Long** | | [optional] | -|**clientalgoid** | **String** | | [optional] | +|**algoId** | **Long** | | [optional] | +|**clientAlgoId** | **String** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md index 4dc8a0658..1107ac006 100644 --- a/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md +++ b/clients/derivatives-trading-usds-futures/docs/NewAlgoOrderRequest.md @@ -25,6 +25,7 @@ |**activatePrice** | **Double** | | [optional] | |**callbackRate** | **Double** | | [optional] | |**clientAlgoId** | **String** | | [optional] | +|**newOrderRespType** | **NewOrderRespType** | | [optional] | |**selfTradePreventionMode** | **SelfTradePreventionMode** | | [optional] | |**goodTillDate** | **Long** | | [optional] | |**recvWindow** | **Long** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md b/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md index 3182f48f7..be07fb6ca 100644 --- a/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md +++ b/clients/derivatives-trading-usds-futures/docs/PlaceMultipleOrdersResponseInner.md @@ -20,6 +20,7 @@ |**positionSide** | **String** | | [optional] | |**status** | **String** | | [optional] | |**stopPrice** | **String** | | [optional] | +|**closePosition** | **Boolean** | | [optional] | |**symbol** | **String** | | [optional] | |**timeInForce** | **String** | | [optional] | |**type** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2ResponseResultInner.md b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2ResponseResultInner.md index 929311dfd..b0e97127a 100644 --- a/clients/derivatives-trading-usds-futures/docs/PositionInformationV2ResponseResultInner.md +++ b/clients/derivatives-trading-usds-futures/docs/PositionInformationV2ResponseResultInner.md @@ -13,7 +13,7 @@ |**entryPrice** | **String** | | [optional] | |**breakEvenPrice** | **String** | | [optional] | |**markPrice** | **String** | | [optional] | -|**unrealizedProfit** | **String** | | [optional] | +|**unRealizedProfit** | **String** | | [optional] | |**liquidationPrice** | **String** | | [optional] | |**isolatedMargin** | **String** | | [optional] | |**notional** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/SymbolConfigurationResponseInner.md b/clients/derivatives-trading-usds-futures/docs/SymbolConfigurationResponseInner.md index 21fad5f03..69a652a51 100644 --- a/clients/derivatives-trading-usds-futures/docs/SymbolConfigurationResponseInner.md +++ b/clients/derivatives-trading-usds-futures/docs/SymbolConfigurationResponseInner.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | [optional] | |**marginType** | **String** | | [optional] | -|**isAutoAddMargin** | **String** | | [optional] | +|**isAutoAddMargin** | **Boolean** | | [optional] | |**leverage** | **Long** | | [optional] | |**maxNotionalValue** | **String** | | [optional] | diff --git a/clients/derivatives-trading-usds-futures/docs/TradeApi.md b/clients/derivatives-trading-usds-futures/docs/TradeApi.md index ef4b8f23f..60b04215e 100644 --- a/clients/derivatives-trading-usds-futures/docs/TradeApi.md +++ b/clients/derivatives-trading-usds-futures/docs/TradeApi.md @@ -20,7 +20,7 @@ All URIs are relative to *http://localhost* Cancel Algo Order (TRADE) -Cancel an active algo order. * Either `algoid` or `clientalgoid` must be sent. Weight: 1 +Cancel an active algo order. * Either `algoId` or `clientAlgoId` must be sent. Weight: 1 ### 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 09d8d417b..96a626b8b 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 - 8.0.0 + 9.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-derivatives-trading-usds-futures - 8.0.0 + 9.0.0 ``` diff --git a/clients/derivatives-trading-usds-futures/example_websocket_api.md b/clients/derivatives-trading-usds-futures/example_websocket_api.md index 60b0ac092..4b5c520b1 100644 --- a/clients/derivatives-trading-usds-futures/example_websocket_api.md +++ b/clients/derivatives-trading-usds-futures/example_websocket_api.md @@ -2,11 +2,11 @@ [account.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information) - accountInformation - [AccountInformationExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationExample.java#L49) -[v2/account.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) - accountInformationV2 - [AccountInformationV2ExampleAsync.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java#L49) +[v2/account.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Account-Information-V2) - accountInformationV2 - [AccountInformationV2Example.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2Example.java#L49) [account.balance](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance) - futuresAccountBalance - [FuturesAccountBalanceExample.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceExample.java#L48) -[v2/account.balance](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance-V2) - futuresAccountBalanceV2 - [FuturesAccountBalanceV2ExampleAsync.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java#L48) +[v2/account.balance](https://developers.binance.com/docs/derivatives/usds-margined-futures/account/websocket-api/Futures-Account-Balance-V2) - futuresAccountBalanceV2 - [FuturesAccountBalanceV2Example.java:48](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2Example.java#L48) ## MarketData @@ -30,7 +30,7 @@ [account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information) - positionInformation - [PositionInformationExample.java:49](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationExample.java#L49) -[v2/account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) - positionInformationV2 - [PositionInformationV2ExampleAsync.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java#L50) +[v2/account.position](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Info-V2) - positionInformationV2 - [PositionInformationV2Example.java:50](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2Example.java#L50) [order.status](https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Query-Order) - queryOrder - [QueryOrderExample.java:52](/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/QueryOrderExample.java#L52) diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index 5b72db74b..17d835c56 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 - 8.0.0 + 9.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java index 3cf467ca2..7e91da3ab 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/JSON.java @@ -627,6 +627,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .QueryOrderResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.derivatives_trading_usds_futures.rest.model + .QueryOrderResponseResult.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.derivatives_trading_usds_futures.rest.model .QueryUserRateLimitResponse.CustomTypeAdapterFactory()); 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 3ead98776..967c5dddc 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.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 2bb2dc404..1132f782b 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.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 ada11b0a0..08635fcff 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 @@ -1036,7 +1036,7 @@ public ApiResponse getFundingRateHistory( /** * Get Funding Rate Info Query funding rate info for symbols that had FundingRateCap/ * FundingRateFloor / fundingIntervalHours adjustment Weight: 0 share 500/5min/IP rate limit - * with GET /fapi/v1/fundingInfo + * with GET /fapi/v1/fundingRate * * @return ApiResponse<GetFundingRateInfoResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1887,11 +1887,11 @@ public ApiResponse autoCancelAllOpenOrders( } /** - * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoid` or - * `clientalgoid` must be sent. Weight: 1 + * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoId` or + * `clientAlgoId` must be sent. Weight: 1 * - * @param algoid (optional) - * @param clientalgoid (optional) + * @param algoId (optional) + * @param clientAlgoId (optional) * @param recvWindow (optional) * @return ApiResponse<CancelAlgoOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1908,8 +1908,8 @@ public ApiResponse autoCancelAllOpenOrders( * Algo Order (TRADE) Documentation */ public ApiResponse cancelAlgoOrder( - Long algoid, String clientalgoid, Long recvWindow) throws ApiException { - return tradeApi.cancelAlgoOrder(algoid, clientalgoid, recvWindow); + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { + return tradeApi.cancelAlgoOrder(algoId, clientAlgoId, recvWindow); } /** 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 1fb52c6af..043bfea0c 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1473,7 +1473,7 @@ private okhttp3.Call getFundingRateInfoValidateBeforeCall() throws ApiException /** * Get Funding Rate Info Query funding rate info for symbols that had FundingRateCap/ * FundingRateFloor / fundingIntervalHours adjustment Weight: 0 share 500/5min/IP rate limit - * with GET /fapi/v1/fundingInfo + * with GET /fapi/v1/fundingRate * * @return ApiResponse<GetFundingRateInfoResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the 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 6a893ba85..4216f89fd 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.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 229f2f79c..3790e7854 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -686,8 +686,8 @@ public ApiResponse autoCancelAllOpenOrders( /** * Build call for cancelAlgoOrder * - * @param algoid (optional) - * @param clientalgoid (optional) + * @param algoId (optional) + * @param clientAlgoId (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -702,7 +702,7 @@ public ApiResponse autoCancelAllOpenOrders( * href="https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order">Cancel * Algo Order (TRADE) Documentation */ - private okhttp3.Call cancelAlgoOrderCall(Long algoid, String clientalgoid, Long recvWindow) + private okhttp3.Call cancelAlgoOrderCall(Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers @@ -728,13 +728,13 @@ private okhttp3.Call cancelAlgoOrderCall(Long algoid, String clientalgoid, Long Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - if (algoid != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoid", algoid)); + if (algoId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("algoId", algoId)); } - if (clientalgoid != null) { + if (clientAlgoId != null) { localVarQueryParams.addAll( - localVarApiClient.parameterToPair("clientalgoid", clientalgoid)); + localVarApiClient.parameterToPair("clientAlgoId", clientAlgoId)); } if (recvWindow != null) { @@ -773,7 +773,7 @@ private okhttp3.Call cancelAlgoOrderCall(Long algoid, String clientalgoid, Long @SuppressWarnings("rawtypes") private okhttp3.Call cancelAlgoOrderValidateBeforeCall( - Long algoid, String clientalgoid, Long recvWindow) throws ApiException { + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -783,7 +783,7 @@ private okhttp3.Call cancelAlgoOrderValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {algoid, clientalgoid, recvWindow}; + Object[] parameterValues = {algoId, clientAlgoId, recvWindow}; Method method = this.getClass() .getMethod("cancelAlgoOrder", Long.class, String.class, Long.class); @@ -791,7 +791,7 @@ private okhttp3.Call cancelAlgoOrderValidateBeforeCall( executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return cancelAlgoOrderCall(algoid, clientalgoid, recvWindow); + return cancelAlgoOrderCall(algoId, clientAlgoId, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -805,11 +805,11 @@ private okhttp3.Call cancelAlgoOrderValidateBeforeCall( } /** - * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoid` or - * `clientalgoid` must be sent. Weight: 1 + * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoId` or + * `clientAlgoId` must be sent. Weight: 1 * - * @param algoid (optional) - * @param clientalgoid (optional) + * @param algoId (optional) + * @param clientAlgoId (optional) * @param recvWindow (optional) * @return ApiResponse<CancelAlgoOrderResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -826,9 +826,9 @@ private okhttp3.Call cancelAlgoOrderValidateBeforeCall( * Algo Order (TRADE) Documentation */ public ApiResponse cancelAlgoOrder( - Long algoid, String clientalgoid, Long recvWindow) throws ApiException { + Long algoId, String clientAlgoId, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - cancelAlgoOrderValidateBeforeCall(algoid, clientalgoid, recvWindow); + cancelAlgoOrderValidateBeforeCall(algoId, clientAlgoId, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -3494,6 +3494,10 @@ private okhttp3.Call newAlgoOrderCall(NewAlgoOrderRequest newAlgoOrderRequest) localVarFormParams.put("clientAlgoId", newAlgoOrderRequest.getClientAlgoId()); } + if (newAlgoOrderRequest.getNewOrderRespType() != null) { + localVarFormParams.put("newOrderRespType", newAlgoOrderRequest.getNewOrderRespType()); + } + if (newAlgoOrderRequest.getSelfTradePreventionMode() != null) { localVarFormParams.put( "selfTradePreventionMode", newAlgoOrderRequest.getSelfTradePreventionMode()); 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 e454ca062..efd794060 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.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/BatchOrdersInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java index 90bb13c8f..1cc0447bf 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/BatchOrdersInner.java @@ -195,6 +195,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti @jakarta.annotation.Nullable private PriceMatchEnum priceMatch; + 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_RECV_WINDOW = "recvWindow"; @SerializedName(SERIALIZED_NAME_RECV_WINDOW) @@ -337,6 +343,25 @@ public void setPriceMatch(@jakarta.annotation.Nullable PriceMatchEnum priceMatch this.priceMatch = priceMatch; } + public BatchOrdersInner 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 BatchOrdersInner recvWindow(@jakarta.annotation.Nullable String recvWindow) { this.recvWindow = recvWindow; return this; @@ -372,13 +397,22 @@ public boolean equals(Object o) { && Objects.equals(this.quantity, batchOrdersInner.quantity) && Objects.equals(this.price, batchOrdersInner.price) && Objects.equals(this.priceMatch, batchOrdersInner.priceMatch) + && Objects.equals(this.stopPrice, batchOrdersInner.stopPrice) && Objects.equals(this.recvWindow, batchOrdersInner.recvWindow); } @Override public int hashCode() { return Objects.hash( - orderId, origClientOrderId, symbol, side, quantity, price, priceMatch, recvWindow); + orderId, + origClientOrderId, + symbol, + side, + quantity, + price, + priceMatch, + stopPrice, + recvWindow); } @Override @@ -392,6 +426,7 @@ public String toString() { sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); sb.append(" price: ").append(toIndentedString(price)).append("\n"); sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); + sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -430,6 +465,10 @@ public String toUrlQueryString() { String priceMatchValueAsString = ""; priceMatchValueAsString = priceMatchValue.toString(); sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); + Object stopPriceValue = getStopPrice(); + String stopPriceValueAsString = ""; + stopPriceValueAsString = stopPriceValue.toString(); + sb.append("stopPrice=").append(urlEncode(stopPriceValueAsString)).append(""); Object recvWindowValue = getRecvWindow(); String recvWindowValueAsString = ""; recvWindowValueAsString = recvWindowValue.toString(); @@ -469,6 +508,7 @@ private String toIndentedString(Object o) { openapiFields.add("quantity"); openapiFields.add("price"); openapiFields.add("priceMatch"); + openapiFields.add("stopPrice"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -558,6 +598,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti if (jsonObj.get("priceMatch") != null && !jsonObj.get("priceMatch").isJsonNull()) { PriceMatchEnum.validateJsonElement(jsonObj.get("priceMatch")); } + 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("recvWindow") != null && !jsonObj.get("recvWindow").isJsonNull()) && !jsonObj.get("recvWindow").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/NewAlgoOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/NewAlgoOrderRequest.java index d0a7a62f3..00d1534ca 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 @@ -139,6 +139,12 @@ public class NewAlgoOrderRequest { @jakarta.annotation.Nullable private String clientAlgoId; + public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; + + @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) + @jakarta.annotation.Nullable + private NewOrderRespType newOrderRespType; + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = "selfTradePreventionMode"; @@ -498,6 +504,28 @@ public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { this.clientAlgoId = clientAlgoId; } + public NewAlgoOrderRequest newOrderRespType( + @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { + this.newOrderRespType = newOrderRespType; + return this; + } + + /** + * Get newOrderRespType + * + * @return newOrderRespType + */ + @jakarta.annotation.Nullable + @Valid + public NewOrderRespType getNewOrderRespType() { + return newOrderRespType; + } + + public void setNewOrderRespType( + @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { + this.newOrderRespType = newOrderRespType; + } + public NewAlgoOrderRequest selfTradePreventionMode( @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { this.selfTradePreventionMode = selfTradePreventionMode; @@ -584,6 +612,7 @@ public boolean equals(Object o) { && Objects.equals(this.activatePrice, newAlgoOrderRequest.activatePrice) && Objects.equals(this.callbackRate, newAlgoOrderRequest.callbackRate) && Objects.equals(this.clientAlgoId, newAlgoOrderRequest.clientAlgoId) + && Objects.equals(this.newOrderRespType, newAlgoOrderRequest.newOrderRespType) && Objects.equals( this.selfTradePreventionMode, newAlgoOrderRequest.selfTradePreventionMode) && Objects.equals(this.goodTillDate, newAlgoOrderRequest.goodTillDate) @@ -610,6 +639,7 @@ public int hashCode() { activatePrice, callbackRate, clientAlgoId, + newOrderRespType, selfTradePreventionMode, goodTillDate, recvWindow); @@ -636,6 +666,7 @@ public String toString() { 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(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) .append("\n"); @@ -716,6 +747,10 @@ public String toUrlQueryString() { String clientAlgoIdValueAsString = ""; clientAlgoIdValueAsString = clientAlgoIdValue.toString(); sb.append("clientAlgoId=").append(urlEncode(clientAlgoIdValueAsString)).append(""); + Object newOrderRespTypeValue = getNewOrderRespType(); + String newOrderRespTypeValueAsString = ""; + newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); + sb.append("newOrderRespType=").append(urlEncode(newOrderRespTypeValueAsString)).append(""); Object selfTradePreventionModeValue = getSelfTradePreventionMode(); String selfTradePreventionModeValueAsString = ""; selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); @@ -775,6 +810,7 @@ private String toIndentedString(Object o) { openapiFields.add("activatePrice"); openapiFields.add("callbackRate"); openapiFields.add("clientAlgoId"); + openapiFields.add("newOrderRespType"); openapiFields.add("selfTradePreventionMode"); openapiFields.add("goodTillDate"); openapiFields.add("recvWindow"); @@ -886,6 +922,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientAlgoId").toString())); } + // validate the optional field `newOrderRespType` + if (jsonObj.get("newOrderRespType") != null + && !jsonObj.get("newOrderRespType").isJsonNull()) { + NewOrderRespType.validateJsonElement(jsonObj.get("newOrderRespType")); + } // validate the optional field `selfTradePreventionMode` if (jsonObj.get("selfTradePreventionMode") != null && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { 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 5b8396ebb..e72c2fe42 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 @@ -114,6 +114,12 @@ public class PlaceMultipleOrdersResponseInner { @jakarta.annotation.Nullable private String stopPrice; + 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_SYMBOL = "symbol"; @SerializedName(SERIALIZED_NAME_SYMBOL) @@ -441,6 +447,26 @@ public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { this.stopPrice = stopPrice; } + public PlaceMultipleOrdersResponseInner 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 PlaceMultipleOrdersResponseInner symbol(@jakarta.annotation.Nullable String symbol) { this.symbol = symbol; return this; @@ -700,6 +726,8 @@ public boolean equals(Object o) { && Objects.equals(this.positionSide, placeMultipleOrdersResponseInner.positionSide) && Objects.equals(this.status, placeMultipleOrdersResponseInner.status) && Objects.equals(this.stopPrice, placeMultipleOrdersResponseInner.stopPrice) + && Objects.equals( + this.closePosition, placeMultipleOrdersResponseInner.closePosition) && Objects.equals(this.symbol, placeMultipleOrdersResponseInner.symbol) && Objects.equals(this.timeInForce, placeMultipleOrdersResponseInner.timeInForce) && Objects.equals(this.type, placeMultipleOrdersResponseInner.type) @@ -732,6 +760,7 @@ public int hashCode() { positionSide, status, stopPrice, + closePosition, symbol, timeInForce, type, @@ -763,6 +792,7 @@ public String toString() { sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); @@ -836,6 +866,10 @@ public String toUrlQueryString() { 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 symbolValue = getSymbol(); String symbolValueAsString = ""; symbolValueAsString = symbolValue.toString(); @@ -927,6 +961,7 @@ private String toIndentedString(Object o) { openapiFields.add("positionSide"); openapiFields.add("status"); openapiFields.add("stopPrice"); + openapiFields.add("closePosition"); openapiFields.add("symbol"); openapiFields.add("timeInForce"); openapiFields.add("type"); diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java index fa8983e8a..590ba48cc 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponse.java @@ -22,6 +22,7 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import jakarta.validation.Valid; import jakarta.validation.constraints.*; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -36,375 +37,46 @@ value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") public class QueryOrderResponse { - public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; + public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_AVG_PRICE) + @SerializedName(SERIALIZED_NAME_ID) @jakarta.annotation.Nullable - private String avgPrice; - - public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; - - @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) - @jakarta.annotation.Nullable - private String clientOrderId; - - public static final String SERIALIZED_NAME_CUM_QUOTE = "cumQuote"; - - @SerializedName(SERIALIZED_NAME_CUM_QUOTE) - @jakarta.annotation.Nullable - private String cumQuote; - - public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; - - @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) - @jakarta.annotation.Nullable - private String executedQty; - - public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; - - @SerializedName(SERIALIZED_NAME_ORDER_ID) - @jakarta.annotation.Nullable - private Long orderId; - - public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; - - @SerializedName(SERIALIZED_NAME_ORIG_QTY) - @jakarta.annotation.Nullable - private String origQty; - - public static final String SERIALIZED_NAME_ORIG_TYPE = "origType"; - - @SerializedName(SERIALIZED_NAME_ORIG_TYPE) - @jakarta.annotation.Nullable - private String origType; - - public static final String SERIALIZED_NAME_PRICE = "price"; - - @SerializedName(SERIALIZED_NAME_PRICE) - @jakarta.annotation.Nullable - private String price; - - 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_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; + private String id; public static final String SERIALIZED_NAME_STATUS = "status"; @SerializedName(SERIALIZED_NAME_STATUS) @jakarta.annotation.Nullable - private String status; - - 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_CLOSE_POSITION = "closePosition"; - - @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) - @jakarta.annotation.Nullable - private Boolean closePosition; - - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - - @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nullable - private String symbol; - - public static final String SERIALIZED_NAME_TIME = "time"; - - @SerializedName(SERIALIZED_NAME_TIME) - @jakarta.annotation.Nullable - private Long time; - - 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_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @jakarta.annotation.Nullable - private String type; - - 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) - @jakarta.annotation.Nullable - private Long updateTime; - - 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_PROTECT = "priceProtect"; - - @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) - @jakarta.annotation.Nullable - private Boolean priceProtect; - - 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_SELF_TRADE_PREVENTION_MODE = - "selfTradePreventionMode"; - - @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) - @jakarta.annotation.Nullable - private String selfTradePreventionMode; + private Long status; - public static final String SERIALIZED_NAME_GOOD_TILL_DATE = "goodTillDate"; + public static final String SERIALIZED_NAME_RESULT = "result"; - @SerializedName(SERIALIZED_NAME_GOOD_TILL_DATE) + @SerializedName(SERIALIZED_NAME_RESULT) @jakarta.annotation.Nullable - private Long goodTillDate; + private QueryOrderResponseResult result; public QueryOrderResponse() {} - public QueryOrderResponse avgPrice(@jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - return this; - } - - /** - * Get avgPrice - * - * @return avgPrice - */ - @jakarta.annotation.Nullable - public String getAvgPrice() { - return avgPrice; - } - - public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - } - - public QueryOrderResponse clientOrderId(@jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - return this; - } - - /** - * Get clientOrderId - * - * @return clientOrderId - */ - @jakarta.annotation.Nullable - public String getClientOrderId() { - return clientOrderId; - } - - public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - } - - public QueryOrderResponse cumQuote(@jakarta.annotation.Nullable String cumQuote) { - this.cumQuote = cumQuote; - return this; - } - - /** - * Get cumQuote - * - * @return cumQuote - */ - @jakarta.annotation.Nullable - public String getCumQuote() { - return cumQuote; - } - - public void setCumQuote(@jakarta.annotation.Nullable String cumQuote) { - this.cumQuote = cumQuote; - } - - public QueryOrderResponse executedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - return this; - } - - /** - * Get executedQty - * - * @return executedQty - */ - @jakarta.annotation.Nullable - public String getExecutedQty() { - return executedQty; - } - - public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - } - - public QueryOrderResponse orderId(@jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - return this; - } - - /** - * Get orderId - * - * @return orderId - */ - @jakarta.annotation.Nullable - public Long getOrderId() { - return orderId; - } - - public void setOrderId(@jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - } - - public QueryOrderResponse origQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - return this; - } - - /** - * Get origQty - * - * @return origQty - */ - @jakarta.annotation.Nullable - public String getOrigQty() { - return origQty; - } - - public void setOrigQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - } - - public QueryOrderResponse origType(@jakarta.annotation.Nullable String origType) { - this.origType = origType; - return this; - } - - /** - * Get origType - * - * @return origType - */ - @jakarta.annotation.Nullable - public String getOrigType() { - return origType; - } - - public void setOrigType(@jakarta.annotation.Nullable String origType) { - this.origType = origType; - } - - public QueryOrderResponse 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 QueryOrderResponse reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; + public QueryOrderResponse id(@jakarta.annotation.Nullable String id) { + this.id = id; return this; } /** - * Get reduceOnly + * Get id * - * @return reduceOnly + * @return id */ @jakarta.annotation.Nullable - public Boolean getReduceOnly() { - return reduceOnly; - } - - public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; + public String getId() { + return id; } - public QueryOrderResponse side(@jakarta.annotation.Nullable String side) { - this.side = side; - return this; + public void setId(@jakarta.annotation.Nullable String id) { + this.id = id; } - /** - * Get side - * - * @return side - */ - @jakarta.annotation.Nullable - public String getSide() { - return side; - } - - public void setSide(@jakarta.annotation.Nullable String side) { - this.side = side; - } - - public QueryOrderResponse 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 QueryOrderResponse status(@jakarta.annotation.Nullable String status) { + public QueryOrderResponse status(@jakarta.annotation.Nullable Long status) { this.status = status; return this; } @@ -415,280 +87,32 @@ public QueryOrderResponse status(@jakarta.annotation.Nullable String status) { * @return status */ @jakarta.annotation.Nullable - public String getStatus() { + public Long getStatus() { return status; } - public void setStatus(@jakarta.annotation.Nullable String status) { + public void setStatus(@jakarta.annotation.Nullable Long status) { this.status = status; } - public QueryOrderResponse stopPrice(@jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; + public QueryOrderResponse result(@jakarta.annotation.Nullable QueryOrderResponseResult result) { + this.result = result; return this; } /** - * Get stopPrice + * Get result * - * @return stopPrice + * @return result */ @jakarta.annotation.Nullable - public String getStopPrice() { - return stopPrice; - } - - public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; + @Valid + public QueryOrderResponseResult getResult() { + return result; } - public QueryOrderResponse 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 QueryOrderResponse 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 QueryOrderResponse time(@jakarta.annotation.Nullable Long time) { - this.time = time; - return this; - } - - /** - * Get time - * - * @return time - */ - @jakarta.annotation.Nullable - public Long getTime() { - return time; - } - - public void setTime(@jakarta.annotation.Nullable Long time) { - this.time = time; - } - - public QueryOrderResponse 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 QueryOrderResponse type(@jakarta.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - public void setType(@jakarta.annotation.Nullable String type) { - this.type = type; - } - - public QueryOrderResponse 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 QueryOrderResponse 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 QueryOrderResponse 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 QueryOrderResponse 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 QueryOrderResponse 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 QueryOrderResponse 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 QueryOrderResponse selfTradePreventionMode( - @jakarta.annotation.Nullable String selfTradePreventionMode) { - this.selfTradePreventionMode = selfTradePreventionMode; - return this; - } - - /** - * Get selfTradePreventionMode - * - * @return selfTradePreventionMode - */ - @jakarta.annotation.Nullable - public String getSelfTradePreventionMode() { - return selfTradePreventionMode; - } - - public void setSelfTradePreventionMode( - @jakarta.annotation.Nullable String selfTradePreventionMode) { - this.selfTradePreventionMode = selfTradePreventionMode; - } - - public QueryOrderResponse 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 setResult(@jakarta.annotation.Nullable QueryOrderResponseResult result) { + this.result = result; } @Override @@ -700,98 +124,23 @@ public boolean equals(Object o) { return false; } QueryOrderResponse queryOrderResponse = (QueryOrderResponse) o; - return Objects.equals(this.avgPrice, queryOrderResponse.avgPrice) - && Objects.equals(this.clientOrderId, queryOrderResponse.clientOrderId) - && Objects.equals(this.cumQuote, queryOrderResponse.cumQuote) - && Objects.equals(this.executedQty, queryOrderResponse.executedQty) - && Objects.equals(this.orderId, queryOrderResponse.orderId) - && Objects.equals(this.origQty, queryOrderResponse.origQty) - && Objects.equals(this.origType, queryOrderResponse.origType) - && Objects.equals(this.price, queryOrderResponse.price) - && Objects.equals(this.reduceOnly, queryOrderResponse.reduceOnly) - && Objects.equals(this.side, queryOrderResponse.side) - && Objects.equals(this.positionSide, queryOrderResponse.positionSide) + return Objects.equals(this.id, queryOrderResponse.id) && Objects.equals(this.status, queryOrderResponse.status) - && Objects.equals(this.stopPrice, queryOrderResponse.stopPrice) - && Objects.equals(this.closePosition, queryOrderResponse.closePosition) - && Objects.equals(this.symbol, queryOrderResponse.symbol) - && Objects.equals(this.time, queryOrderResponse.time) - && Objects.equals(this.timeInForce, queryOrderResponse.timeInForce) - && Objects.equals(this.type, queryOrderResponse.type) - && Objects.equals(this.activatePrice, queryOrderResponse.activatePrice) - && Objects.equals(this.priceRate, queryOrderResponse.priceRate) - && Objects.equals(this.updateTime, queryOrderResponse.updateTime) - && Objects.equals(this.workingType, queryOrderResponse.workingType) - && Objects.equals(this.priceProtect, queryOrderResponse.priceProtect) - && Objects.equals(this.priceMatch, queryOrderResponse.priceMatch) - && Objects.equals( - this.selfTradePreventionMode, queryOrderResponse.selfTradePreventionMode) - && Objects.equals(this.goodTillDate, queryOrderResponse.goodTillDate); + && Objects.equals(this.result, queryOrderResponse.result); } @Override public int hashCode() { - return Objects.hash( - avgPrice, - clientOrderId, - cumQuote, - executedQty, - orderId, - origQty, - origType, - price, - reduceOnly, - side, - positionSide, - status, - stopPrice, - closePosition, - symbol, - time, - timeInForce, - type, - activatePrice, - priceRate, - updateTime, - workingType, - priceProtect, - priceMatch, - selfTradePreventionMode, - goodTillDate); + return Objects.hash(id, status, result); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QueryOrderResponse {\n"); - sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); - sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); - sb.append(" cumQuote: ").append(toIndentedString(cumQuote)).append("\n"); - sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); - sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); - sb.append(" origType: ").append(toIndentedString(origType)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); - sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" time: ").append(toIndentedString(time)).append("\n"); - sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).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"); - sb.append(" priceMatch: ").append(toIndentedString(priceMatch)).append("\n"); - sb.append(" selfTradePreventionMode: ") - .append(toIndentedString(selfTradePreventionMode)) - .append("\n"); - sb.append(" goodTillDate: ").append(toIndentedString(goodTillDate)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); sb.append("}"); return sb.toString(); } @@ -799,112 +148,18 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object avgPriceValue = getAvgPrice(); - String avgPriceValueAsString = ""; - avgPriceValueAsString = avgPriceValue.toString(); - sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); - Object clientOrderIdValue = getClientOrderId(); - String clientOrderIdValueAsString = ""; - clientOrderIdValueAsString = clientOrderIdValue.toString(); - sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); - Object cumQuoteValue = getCumQuote(); - String cumQuoteValueAsString = ""; - cumQuoteValueAsString = cumQuoteValue.toString(); - sb.append("cumQuote=").append(urlEncode(cumQuoteValueAsString)).append(""); - Object executedQtyValue = getExecutedQty(); - String executedQtyValueAsString = ""; - executedQtyValueAsString = executedQtyValue.toString(); - sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object orderIdValue = getOrderId(); - String orderIdValueAsString = ""; - orderIdValueAsString = orderIdValue.toString(); - sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); - Object origQtyValue = getOrigQty(); - String origQtyValueAsString = ""; - origQtyValueAsString = origQtyValue.toString(); - sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); - Object origTypeValue = getOrigType(); - String origTypeValueAsString = ""; - origTypeValueAsString = origTypeValue.toString(); - sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); - Object priceValue = getPrice(); - String priceValueAsString = ""; - priceValueAsString = priceValue.toString(); - sb.append("price=").append(urlEncode(priceValueAsString)).append(""); - Object reduceOnlyValue = getReduceOnly(); - String reduceOnlyValueAsString = ""; - reduceOnlyValueAsString = reduceOnlyValue.toString(); - sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object sideValue = getSide(); - String sideValueAsString = ""; - sideValueAsString = sideValue.toString(); - sb.append("side=").append(urlEncode(sideValueAsString)).append(""); - Object positionSideValue = getPositionSide(); - String positionSideValueAsString = ""; - positionSideValueAsString = positionSideValue.toString(); - sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object idValue = getId(); + String idValueAsString = ""; + idValueAsString = idValue.toString(); + sb.append("id=").append(urlEncode(idValueAsString)).append(""); Object statusValue = getStatus(); String statusValueAsString = ""; statusValueAsString = statusValue.toString(); sb.append("status=").append(urlEncode(statusValueAsString)).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 symbolValue = getSymbol(); - String symbolValueAsString = ""; - symbolValueAsString = symbolValue.toString(); - sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); - Object timeValue = getTime(); - String timeValueAsString = ""; - timeValueAsString = timeValue.toString(); - sb.append("time=").append(urlEncode(timeValueAsString)).append(""); - Object timeInForceValue = getTimeInForce(); - String timeInForceValueAsString = ""; - timeInForceValueAsString = timeInForceValue.toString(); - sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); - Object typeValue = getType(); - String typeValueAsString = ""; - typeValueAsString = typeValue.toString(); - sb.append("type=").append(urlEncode(typeValueAsString)).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(); - sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).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 priceMatchValue = getPriceMatch(); - String priceMatchValueAsString = ""; - priceMatchValueAsString = priceMatchValue.toString(); - sb.append("priceMatch=").append(urlEncode(priceMatchValueAsString)).append(""); - Object selfTradePreventionModeValue = getSelfTradePreventionMode(); - String selfTradePreventionModeValueAsString = ""; - selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); - sb.append("selfTradePreventionMode=") - .append(urlEncode(selfTradePreventionModeValueAsString)) - .append(""); - Object goodTillDateValue = getGoodTillDate(); - String goodTillDateValueAsString = ""; - goodTillDateValueAsString = goodTillDateValue.toString(); - sb.append("goodTillDate=").append(urlEncode(goodTillDateValueAsString)).append(""); + Object resultValue = getResult(); + String resultValueAsString = ""; + resultValueAsString = resultValue.toString(); + sb.append("result=").append(urlEncode(resultValueAsString)).append(""); return sb.toString(); } @@ -933,32 +188,9 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("avgPrice"); - openapiFields.add("clientOrderId"); - openapiFields.add("cumQuote"); - openapiFields.add("executedQty"); - openapiFields.add("orderId"); - openapiFields.add("origQty"); - openapiFields.add("origType"); - openapiFields.add("price"); - openapiFields.add("reduceOnly"); - openapiFields.add("side"); - openapiFields.add("positionSide"); + openapiFields.add("id"); openapiFields.add("status"); - openapiFields.add("stopPrice"); - openapiFields.add("closePosition"); - openapiFields.add("symbol"); - openapiFields.add("time"); - openapiFields.add("timeInForce"); - openapiFields.add("type"); - openapiFields.add("activatePrice"); - openapiFields.add("priceRate"); - openapiFields.add("updateTime"); - openapiFields.add("workingType"); - openapiFields.add("priceProtect"); - openapiFields.add("priceMatch"); - openapiFields.add("selfTradePreventionMode"); - openapiFields.add("goodTillDate"); + openapiFields.add("result"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -982,158 +214,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) - && !jsonObj.get("avgPrice").isJsonPrimitive()) { + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) + && !jsonObj.get("id").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `avgPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("avgPrice").toString())); + "Expected the field `id` to be a primitive type in the JSON string but" + + " got `%s`", + jsonObj.get("id").toString())); } - if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) - && !jsonObj.get("clientOrderId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `clientOrderId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("clientOrderId").toString())); - } - if ((jsonObj.get("cumQuote") != null && !jsonObj.get("cumQuote").isJsonNull()) - && !jsonObj.get("cumQuote").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cumQuote` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("cumQuote").toString())); - } - if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) - && !jsonObj.get("executedQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `executedQty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("executedQty").toString())); - } - if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) - && !jsonObj.get("origQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("origQty").toString())); - } - if ((jsonObj.get("origType") != null && !jsonObj.get("origType").isJsonNull()) - && !jsonObj.get("origType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("origType").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("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("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").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("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" - + " but got `%s`", - jsonObj.get("symbol").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())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) - && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").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( - 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())); - } - 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())); + // validate the optional field `result` + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) { + QueryOrderResponseResult.validateJsonElement(jsonObj.get("result")); } } diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponseResult.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponseResult.java new file mode 100644 index 000000000..fb1226bbb --- /dev/null +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponseResult.java @@ -0,0 +1,1070 @@ +/* + * Binance Derivatives Trading USDS Futures REST API + * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST 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.rest.model; + +import com.binance.connector.client.derivatives_trading_usds_futures.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** QueryOrderResponseResult */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryOrderResponseResult { + public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; + + @SerializedName(SERIALIZED_NAME_AVG_PRICE) + @jakarta.annotation.Nullable + private String avgPrice; + + public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) + @jakarta.annotation.Nullable + private String clientOrderId; + + public static final String SERIALIZED_NAME_CUM_QUOTE = "cumQuote"; + + @SerializedName(SERIALIZED_NAME_CUM_QUOTE) + @jakarta.annotation.Nullable + private String cumQuote; + + public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; + + @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) + @jakarta.annotation.Nullable + private String executedQty; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; + + @SerializedName(SERIALIZED_NAME_ORIG_QTY) + @jakarta.annotation.Nullable + private String origQty; + + public static final String SERIALIZED_NAME_ORIG_TYPE = "origType"; + + @SerializedName(SERIALIZED_NAME_ORIG_TYPE) + @jakarta.annotation.Nullable + private String origType; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + 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_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_STATUS = "status"; + + @SerializedName(SERIALIZED_NAME_STATUS) + @jakarta.annotation.Nullable + private String status; + + 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_CLOSE_POSITION = "closePosition"; + + @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) + @jakarta.annotation.Nullable + private Boolean closePosition; + + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + 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_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private String type; + + 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) + @jakarta.annotation.Nullable + private Long updateTime; + + 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_PROTECT = "priceProtect"; + + @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) + @jakarta.annotation.Nullable + private Boolean priceProtect; + + public QueryOrderResponseResult() {} + + public QueryOrderResponseResult avgPrice(@jakarta.annotation.Nullable String avgPrice) { + this.avgPrice = avgPrice; + return this; + } + + /** + * Get avgPrice + * + * @return avgPrice + */ + @jakarta.annotation.Nullable + public String getAvgPrice() { + return avgPrice; + } + + public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { + this.avgPrice = avgPrice; + } + + public QueryOrderResponseResult clientOrderId( + @jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + return this; + } + + /** + * Get clientOrderId + * + * @return clientOrderId + */ + @jakarta.annotation.Nullable + public String getClientOrderId() { + return clientOrderId; + } + + public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { + this.clientOrderId = clientOrderId; + } + + public QueryOrderResponseResult cumQuote(@jakarta.annotation.Nullable String cumQuote) { + this.cumQuote = cumQuote; + return this; + } + + /** + * Get cumQuote + * + * @return cumQuote + */ + @jakarta.annotation.Nullable + public String getCumQuote() { + return cumQuote; + } + + public void setCumQuote(@jakarta.annotation.Nullable String cumQuote) { + this.cumQuote = cumQuote; + } + + public QueryOrderResponseResult executedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + return this; + } + + /** + * Get executedQty + * + * @return executedQty + */ + @jakarta.annotation.Nullable + public String getExecutedQty() { + return executedQty; + } + + public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { + this.executedQty = executedQty; + } + + public QueryOrderResponseResult orderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + public QueryOrderResponseResult origQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + return this; + } + + /** + * Get origQty + * + * @return origQty + */ + @jakarta.annotation.Nullable + public String getOrigQty() { + return origQty; + } + + public void setOrigQty(@jakarta.annotation.Nullable String origQty) { + this.origQty = origQty; + } + + public QueryOrderResponseResult origType(@jakarta.annotation.Nullable String origType) { + this.origType = origType; + return this; + } + + /** + * Get origType + * + * @return origType + */ + @jakarta.annotation.Nullable + public String getOrigType() { + return origType; + } + + public void setOrigType(@jakarta.annotation.Nullable String origType) { + this.origType = origType; + } + + public QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult status(@jakarta.annotation.Nullable String status) { + this.status = status; + return this; + } + + /** + * Get status + * + * @return status + */ + @jakarta.annotation.Nullable + public String getStatus() { + return status; + } + + public void setStatus(@jakarta.annotation.Nullable String status) { + this.status = status; + } + + public QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult time(@jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + public QueryOrderResponseResult 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 QueryOrderResponseResult type(@jakarta.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable String type) { + this.type = type; + } + + public QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult 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 QueryOrderResponseResult 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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryOrderResponseResult queryOrderResponseResult = (QueryOrderResponseResult) o; + return Objects.equals(this.avgPrice, queryOrderResponseResult.avgPrice) + && Objects.equals(this.clientOrderId, queryOrderResponseResult.clientOrderId) + && Objects.equals(this.cumQuote, queryOrderResponseResult.cumQuote) + && Objects.equals(this.executedQty, queryOrderResponseResult.executedQty) + && Objects.equals(this.orderId, queryOrderResponseResult.orderId) + && Objects.equals(this.origQty, queryOrderResponseResult.origQty) + && Objects.equals(this.origType, queryOrderResponseResult.origType) + && Objects.equals(this.price, queryOrderResponseResult.price) + && Objects.equals(this.reduceOnly, queryOrderResponseResult.reduceOnly) + && Objects.equals(this.side, queryOrderResponseResult.side) + && Objects.equals(this.positionSide, queryOrderResponseResult.positionSide) + && Objects.equals(this.status, queryOrderResponseResult.status) + && Objects.equals(this.stopPrice, queryOrderResponseResult.stopPrice) + && Objects.equals(this.closePosition, queryOrderResponseResult.closePosition) + && Objects.equals(this.symbol, queryOrderResponseResult.symbol) + && Objects.equals(this.time, queryOrderResponseResult.time) + && Objects.equals(this.timeInForce, queryOrderResponseResult.timeInForce) + && Objects.equals(this.type, queryOrderResponseResult.type) + && Objects.equals(this.activatePrice, queryOrderResponseResult.activatePrice) + && Objects.equals(this.priceRate, queryOrderResponseResult.priceRate) + && Objects.equals(this.updateTime, queryOrderResponseResult.updateTime) + && Objects.equals(this.workingType, queryOrderResponseResult.workingType) + && Objects.equals(this.priceProtect, queryOrderResponseResult.priceProtect); + } + + @Override + public int hashCode() { + return Objects.hash( + avgPrice, + clientOrderId, + cumQuote, + executedQty, + orderId, + origQty, + origType, + price, + reduceOnly, + side, + positionSide, + status, + stopPrice, + closePosition, + symbol, + time, + timeInForce, + type, + activatePrice, + priceRate, + updateTime, + workingType, + priceProtect); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryOrderResponseResult {\n"); + sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); + sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); + sb.append(" cumQuote: ").append(toIndentedString(cumQuote)).append("\n"); + sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); + sb.append(" origType: ").append(toIndentedString(origType)).append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); + sb.append(" side: ").append(toIndentedString(side)).append("\n"); + sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); + sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object avgPriceValue = getAvgPrice(); + String avgPriceValueAsString = ""; + avgPriceValueAsString = avgPriceValue.toString(); + sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); + Object clientOrderIdValue = getClientOrderId(); + String clientOrderIdValueAsString = ""; + clientOrderIdValueAsString = clientOrderIdValue.toString(); + sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); + Object cumQuoteValue = getCumQuote(); + String cumQuoteValueAsString = ""; + cumQuoteValueAsString = cumQuoteValue.toString(); + sb.append("cumQuote=").append(urlEncode(cumQuoteValueAsString)).append(""); + Object executedQtyValue = getExecutedQty(); + String executedQtyValueAsString = ""; + executedQtyValueAsString = executedQtyValue.toString(); + sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + Object origQtyValue = getOrigQty(); + String origQtyValueAsString = ""; + origQtyValueAsString = origQtyValue.toString(); + sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); + Object origTypeValue = getOrigType(); + String origTypeValueAsString = ""; + origTypeValueAsString = origTypeValue.toString(); + sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object reduceOnlyValue = getReduceOnly(); + String reduceOnlyValueAsString = ""; + reduceOnlyValueAsString = reduceOnlyValue.toString(); + sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); + Object sideValue = getSide(); + String sideValueAsString = ""; + sideValueAsString = sideValue.toString(); + sb.append("side=").append(urlEncode(sideValueAsString)).append(""); + Object positionSideValue = getPositionSide(); + String positionSideValueAsString = ""; + positionSideValueAsString = positionSideValue.toString(); + sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); + Object statusValue = getStatus(); + String statusValueAsString = ""; + statusValueAsString = statusValue.toString(); + sb.append("status=").append(urlEncode(statusValueAsString)).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 symbolValue = getSymbol(); + String symbolValueAsString = ""; + symbolValueAsString = symbolValue.toString(); + sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + Object timeInForceValue = getTimeInForce(); + String timeInForceValueAsString = ""; + timeInForceValueAsString = timeInForceValue.toString(); + sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).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(); + sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).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(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("avgPrice"); + openapiFields.add("clientOrderId"); + openapiFields.add("cumQuote"); + openapiFields.add("executedQty"); + openapiFields.add("orderId"); + openapiFields.add("origQty"); + openapiFields.add("origType"); + openapiFields.add("price"); + openapiFields.add("reduceOnly"); + openapiFields.add("side"); + openapiFields.add("positionSide"); + openapiFields.add("status"); + openapiFields.add("stopPrice"); + openapiFields.add("closePosition"); + openapiFields.add("symbol"); + openapiFields.add("time"); + openapiFields.add("timeInForce"); + openapiFields.add("type"); + openapiFields.add("activatePrice"); + openapiFields.add("priceRate"); + openapiFields.add("updateTime"); + openapiFields.add("workingType"); + openapiFields.add("priceProtect"); + + // 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 QueryOrderResponseResult + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryOrderResponseResult.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryOrderResponseResult is not found" + + " in the empty JSON string", + QueryOrderResponseResult.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) + && !jsonObj.get("avgPrice").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `avgPrice` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("avgPrice").toString())); + } + if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) + && !jsonObj.get("clientOrderId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientOrderId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientOrderId").toString())); + } + if ((jsonObj.get("cumQuote") != null && !jsonObj.get("cumQuote").isJsonNull()) + && !jsonObj.get("cumQuote").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `cumQuote` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("cumQuote").toString())); + } + if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) + && !jsonObj.get("executedQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `executedQty` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("executedQty").toString())); + } + if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) + && !jsonObj.get("origQty").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origQty` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("origQty").toString())); + } + if ((jsonObj.get("origType") != null && !jsonObj.get("origType").isJsonNull()) + && !jsonObj.get("origType").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `origType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("origType").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("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("status") != null && !jsonObj.get("status").isJsonNull()) + && !jsonObj.get("status").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `status` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("status").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("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" + + " but got `%s`", + jsonObj.get("symbol").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())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) + && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `type` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("type").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( + String.format( + "Expected the field `workingType` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("workingType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryOrderResponseResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryOrderResponseResult' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(QueryOrderResponseResult.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryOrderResponseResult value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryOrderResponseResult read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryOrderResponseResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryOrderResponseResult + * @throws IOException if the JSON string is invalid with respect to QueryOrderResponseResult + */ + public static QueryOrderResponseResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryOrderResponseResult.class); + } + + /** + * Convert an instance of QueryOrderResponseResult 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/rest/model/SymbolConfigurationResponseInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponseInner.java index fafdbb351..6b924686d 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponseInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/SymbolConfigurationResponseInner.java @@ -52,7 +52,7 @@ public class SymbolConfigurationResponseInner { @SerializedName(SERIALIZED_NAME_IS_AUTO_ADD_MARGIN) @jakarta.annotation.Nullable - private String isAutoAddMargin; + private Boolean isAutoAddMargin; public static final String SERIALIZED_NAME_LEVERAGE = "leverage"; @@ -108,7 +108,7 @@ public void setMarginType(@jakarta.annotation.Nullable String marginType) { } public SymbolConfigurationResponseInner isAutoAddMargin( - @jakarta.annotation.Nullable String isAutoAddMargin) { + @jakarta.annotation.Nullable Boolean isAutoAddMargin) { this.isAutoAddMargin = isAutoAddMargin; return this; } @@ -119,11 +119,11 @@ public SymbolConfigurationResponseInner isAutoAddMargin( * @return isAutoAddMargin */ @jakarta.annotation.Nullable - public String getIsAutoAddMargin() { + public Boolean getIsAutoAddMargin() { return isAutoAddMargin; } - public void setIsAutoAddMargin(@jakarta.annotation.Nullable String isAutoAddMargin) { + public void setIsAutoAddMargin(@jakarta.annotation.Nullable Boolean isAutoAddMargin) { this.isAutoAddMargin = isAutoAddMargin; } @@ -299,14 +299,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("marginType").toString())); } - if ((jsonObj.get("isAutoAddMargin") != null && !jsonObj.get("isAutoAddMargin").isJsonNull()) - && !jsonObj.get("isAutoAddMargin").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `isAutoAddMargin` to be a primitive type in the" - + " JSON string but got `%s`", - jsonObj.get("isAutoAddMargin").toString())); - } if ((jsonObj.get("maxNotionalValue") != null && !jsonObj.get("maxNotionalValue").isJsonNull()) && !jsonObj.get("maxNotionalValue").isJsonPrimitive()) { 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 39a63f3f7..105df89be 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.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 321bc7bcf..8b39d256c 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 @@ -51,8 +51,8 @@ public TradeApi(ConnectionInterface connection) { } /** - * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoid` or - * `clientalgoid` must be sent. Weight: 1 + * Cancel Algo Order (TRADE) Cancel an active algo order. * Either `algoId` or + * `clientAlgoId` must be sent. Weight: 1 * * @param cancelAlgoOrderRequest (required) * @return CancelAlgoOrderResponse diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderRequest.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderRequest.java index a9352e6a7..cdbdb658b 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderRequest.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/CancelAlgoOrderRequest.java @@ -45,17 +45,17 @@ public class CancelAlgoOrderRequest extends BaseDTO { @jakarta.annotation.Nullable private String id; - public static final String SERIALIZED_NAME_ALGOID = "algoid"; + public static final String SERIALIZED_NAME_ALGO_ID = "algoId"; - @SerializedName(SERIALIZED_NAME_ALGOID) + @SerializedName(SERIALIZED_NAME_ALGO_ID) @jakarta.annotation.Nullable - private Long algoid; + private Long algoId; - public static final String SERIALIZED_NAME_CLIENTALGOID = "clientalgoid"; + public static final String SERIALIZED_NAME_CLIENT_ALGO_ID = "clientAlgoId"; - @SerializedName(SERIALIZED_NAME_CLIENTALGOID) + @SerializedName(SERIALIZED_NAME_CLIENT_ALGO_ID) @jakarta.annotation.Nullable - private String clientalgoid; + private String clientAlgoId; public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @@ -84,42 +84,42 @@ public void setId(@jakarta.annotation.Nullable String id) { this.id = id; } - public CancelAlgoOrderRequest algoid(@jakarta.annotation.Nullable Long algoid) { - this.algoid = algoid; + public CancelAlgoOrderRequest algoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; return this; } /** - * Get algoid + * Get algoId * - * @return algoid + * @return algoId */ @jakarta.annotation.Nullable - public Long getAlgoid() { - return algoid; + public Long getAlgoId() { + return algoId; } - public void setAlgoid(@jakarta.annotation.Nullable Long algoid) { - this.algoid = algoid; + public void setAlgoId(@jakarta.annotation.Nullable Long algoId) { + this.algoId = algoId; } - public CancelAlgoOrderRequest clientalgoid(@jakarta.annotation.Nullable String clientalgoid) { - this.clientalgoid = clientalgoid; + public CancelAlgoOrderRequest clientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; return this; } /** - * Get clientalgoid + * Get clientAlgoId * - * @return clientalgoid + * @return clientAlgoId */ @jakarta.annotation.Nullable - public String getClientalgoid() { - return clientalgoid; + public String getClientAlgoId() { + return clientAlgoId; } - public void setClientalgoid(@jakarta.annotation.Nullable String clientalgoid) { - this.clientalgoid = clientalgoid; + public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { + this.clientAlgoId = clientAlgoId; } public CancelAlgoOrderRequest recvWindow(@jakarta.annotation.Nullable Long recvWindow) { @@ -151,14 +151,14 @@ public boolean equals(Object o) { } CancelAlgoOrderRequest cancelAlgoOrderRequest = (CancelAlgoOrderRequest) o; return Objects.equals(this.id, cancelAlgoOrderRequest.id) - && Objects.equals(this.algoid, cancelAlgoOrderRequest.algoid) - && Objects.equals(this.clientalgoid, cancelAlgoOrderRequest.clientalgoid) + && Objects.equals(this.algoId, cancelAlgoOrderRequest.algoId) + && Objects.equals(this.clientAlgoId, cancelAlgoOrderRequest.clientAlgoId) && Objects.equals(this.recvWindow, cancelAlgoOrderRequest.recvWindow); } @Override public int hashCode() { - return Objects.hash(id, algoid, clientalgoid, recvWindow); + return Objects.hash(id, algoId, clientAlgoId, recvWindow); } @Override @@ -166,8 +166,8 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CancelAlgoOrderRequest {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" algoid: ").append(toIndentedString(algoid)).append("\n"); - sb.append(" clientalgoid: ").append(toIndentedString(clientalgoid)).append("\n"); + sb.append(" algoId: ").append(toIndentedString(algoId)).append("\n"); + sb.append(" clientAlgoId: ").append(toIndentedString(clientAlgoId)).append("\n"); sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); sb.append("}"); return sb.toString(); @@ -182,15 +182,15 @@ public String toUrlQueryString() { String idValueAsString = idValue.toString(); valMap.put("id", idValueAsString); } - Long algoidValue = getAlgoid(); - if (algoidValue != null) { - String algoidValueAsString = algoidValue.toString(); - valMap.put("algoid", algoidValueAsString); + Long algoIdValue = getAlgoId(); + if (algoIdValue != null) { + String algoIdValueAsString = algoIdValue.toString(); + valMap.put("algoId", algoIdValueAsString); } - String clientalgoidValue = getClientalgoid(); - if (clientalgoidValue != null) { - String clientalgoidValueAsString = clientalgoidValue.toString(); - valMap.put("clientalgoid", clientalgoidValueAsString); + String clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + String clientAlgoIdValueAsString = clientAlgoIdValue.toString(); + valMap.put("clientAlgoId", clientAlgoIdValueAsString); } Long recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { @@ -212,13 +212,13 @@ public Map toMap() { if (idValue != null) { valMap.put("id", idValue); } - Object algoidValue = getAlgoid(); - if (algoidValue != null) { - valMap.put("algoid", algoidValue); + Object algoIdValue = getAlgoId(); + if (algoIdValue != null) { + valMap.put("algoId", algoIdValue); } - Object clientalgoidValue = getClientalgoid(); - if (clientalgoidValue != null) { - valMap.put("clientalgoid", clientalgoidValue); + Object clientAlgoIdValue = getClientAlgoId(); + if (clientAlgoIdValue != null) { + valMap.put("clientAlgoId", clientAlgoIdValue); } Object recvWindowValue = getRecvWindow(); if (recvWindowValue != null) { @@ -251,8 +251,8 @@ private String toIndentedString(Object o) { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); openapiFields.add("id"); - openapiFields.add("algoid"); - openapiFields.add("clientalgoid"); + openapiFields.add("algoId"); + openapiFields.add("clientAlgoId"); openapiFields.add("recvWindow"); // a set of required properties/fields (JSON key names) @@ -297,13 +297,13 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " got `%s`", jsonObj.get("id").toString())); } - if ((jsonObj.get("clientalgoid") != null && !jsonObj.get("clientalgoid").isJsonNull()) - && !jsonObj.get("clientalgoid").isJsonPrimitive()) { + if ((jsonObj.get("clientAlgoId") != null && !jsonObj.get("clientAlgoId").isJsonNull()) + && !jsonObj.get("clientAlgoId").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `clientalgoid` to be a primitive type in the JSON" + "Expected the field `clientAlgoId` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("clientalgoid").toString())); + jsonObj.get("clientAlgoId").toString())); } } 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 a4971badf..f4cdf1ef2 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 @@ -149,6 +149,12 @@ public class NewAlgoOrderRequest extends BaseDTO { @jakarta.annotation.Nullable private String clientAlgoId; + public static final String SERIALIZED_NAME_NEW_ORDER_RESP_TYPE = "newOrderRespType"; + + @SerializedName(SERIALIZED_NAME_NEW_ORDER_RESP_TYPE) + @jakarta.annotation.Nullable + private NewOrderRespType newOrderRespType; + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = "selfTradePreventionMode"; @@ -527,6 +533,28 @@ public void setClientAlgoId(@jakarta.annotation.Nullable String clientAlgoId) { this.clientAlgoId = clientAlgoId; } + public NewAlgoOrderRequest newOrderRespType( + @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { + this.newOrderRespType = newOrderRespType; + return this; + } + + /** + * Get newOrderRespType + * + * @return newOrderRespType + */ + @jakarta.annotation.Nullable + @Valid + public NewOrderRespType getNewOrderRespType() { + return newOrderRespType; + } + + public void setNewOrderRespType( + @jakarta.annotation.Nullable NewOrderRespType newOrderRespType) { + this.newOrderRespType = newOrderRespType; + } + public NewAlgoOrderRequest selfTradePreventionMode( @jakarta.annotation.Nullable SelfTradePreventionMode selfTradePreventionMode) { this.selfTradePreventionMode = selfTradePreventionMode; @@ -614,6 +642,7 @@ public boolean equals(Object o) { && Objects.equals(this.activatePrice, newAlgoOrderRequest.activatePrice) && Objects.equals(this.callbackRate, newAlgoOrderRequest.callbackRate) && Objects.equals(this.clientAlgoId, newAlgoOrderRequest.clientAlgoId) + && Objects.equals(this.newOrderRespType, newAlgoOrderRequest.newOrderRespType) && Objects.equals( this.selfTradePreventionMode, newAlgoOrderRequest.selfTradePreventionMode) && Objects.equals(this.goodTillDate, newAlgoOrderRequest.goodTillDate) @@ -641,6 +670,7 @@ public int hashCode() { activatePrice, callbackRate, clientAlgoId, + newOrderRespType, selfTradePreventionMode, goodTillDate, recvWindow); @@ -668,6 +698,7 @@ public String toString() { 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(" newOrderRespType: ").append(toIndentedString(newOrderRespType)).append("\n"); sb.append(" selfTradePreventionMode: ") .append(toIndentedString(selfTradePreventionMode)) .append("\n"); @@ -774,6 +805,11 @@ public String toUrlQueryString() { String clientAlgoIdValueAsString = clientAlgoIdValue.toString(); valMap.put("clientAlgoId", clientAlgoIdValueAsString); } + NewOrderRespType newOrderRespTypeValue = getNewOrderRespType(); + if (newOrderRespTypeValue != null) { + String newOrderRespTypeValueAsString = newOrderRespTypeValue.toString(); + valMap.put("newOrderRespType", newOrderRespTypeValueAsString); + } SelfTradePreventionMode selfTradePreventionModeValue = getSelfTradePreventionMode(); if (selfTradePreventionModeValue != null) { String selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); @@ -872,6 +908,10 @@ public Map toMap() { if (clientAlgoIdValue != null) { valMap.put("clientAlgoId", clientAlgoIdValue); } + Object newOrderRespTypeValue = getNewOrderRespType(); + if (newOrderRespTypeValue != null) { + valMap.put("newOrderRespType", newOrderRespTypeValue); + } Object selfTradePreventionModeValue = getSelfTradePreventionMode(); if (selfTradePreventionModeValue != null) { valMap.put("selfTradePreventionMode", selfTradePreventionModeValue); @@ -928,6 +968,7 @@ private String toIndentedString(Object o) { openapiFields.add("activatePrice"); openapiFields.add("callbackRate"); openapiFields.add("clientAlgoId"); + openapiFields.add("newOrderRespType"); openapiFields.add("selfTradePreventionMode"); openapiFields.add("goodTillDate"); openapiFields.add("recvWindow"); @@ -1059,6 +1100,11 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("clientAlgoId").toString())); } + // validate the optional field `newOrderRespType` + if (jsonObj.get("newOrderRespType") != null + && !jsonObj.get("newOrderRespType").isJsonNull()) { + NewOrderRespType.validateJsonElement(jsonObj.get("newOrderRespType")); + } // validate the optional field `selfTradePreventionMode` if (jsonObj.get("selfTradePreventionMode") != null && !jsonObj.get("selfTradePreventionMode").isJsonNull()) { diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/PositionInformationV2ResponseResultInner.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/PositionInformationV2ResponseResultInner.java index 9edcdb3b2..9e69f3008 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/PositionInformationV2ResponseResultInner.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/model/PositionInformationV2ResponseResultInner.java @@ -75,11 +75,11 @@ public class PositionInformationV2ResponseResultInner extends BaseDTO { @jakarta.annotation.Nullable private String markPrice; - public static final String SERIALIZED_NAME_UNREALIZED_PROFIT = "unrealizedProfit"; + public static final String SERIALIZED_NAME_UN_REALIZED_PROFIT = "unRealizedProfit"; - @SerializedName(SERIALIZED_NAME_UNREALIZED_PROFIT) + @SerializedName(SERIALIZED_NAME_UN_REALIZED_PROFIT) @jakarta.annotation.Nullable - private String unrealizedProfit; + private String unRealizedProfit; public static final String SERIALIZED_NAME_LIQUIDATION_PRICE = "liquidationPrice"; @@ -281,24 +281,24 @@ public void setMarkPrice(@jakarta.annotation.Nullable String markPrice) { this.markPrice = markPrice; } - public PositionInformationV2ResponseResultInner unrealizedProfit( - @jakarta.annotation.Nullable String unrealizedProfit) { - this.unrealizedProfit = unrealizedProfit; + public PositionInformationV2ResponseResultInner unRealizedProfit( + @jakarta.annotation.Nullable String unRealizedProfit) { + this.unRealizedProfit = unRealizedProfit; return this; } /** - * Get unrealizedProfit + * Get unRealizedProfit * - * @return unrealizedProfit + * @return unRealizedProfit */ @jakarta.annotation.Nullable - public String getUnrealizedProfit() { - return unrealizedProfit; + public String getUnRealizedProfit() { + return unRealizedProfit; } - public void setUnrealizedProfit(@jakarta.annotation.Nullable String unrealizedProfit) { - this.unrealizedProfit = unrealizedProfit; + public void setUnRealizedProfit(@jakarta.annotation.Nullable String unRealizedProfit) { + this.unRealizedProfit = unRealizedProfit; } public PositionInformationV2ResponseResultInner liquidationPrice( @@ -585,8 +585,8 @@ public boolean equals(Object o) { && Objects.equals( this.markPrice, positionInformationV2ResponseResultInner.markPrice) && Objects.equals( - this.unrealizedProfit, - positionInformationV2ResponseResultInner.unrealizedProfit) + this.unRealizedProfit, + positionInformationV2ResponseResultInner.unRealizedProfit) && Objects.equals( this.liquidationPrice, positionInformationV2ResponseResultInner.liquidationPrice) @@ -627,7 +627,7 @@ public int hashCode() { entryPrice, breakEvenPrice, markPrice, - unrealizedProfit, + unRealizedProfit, liquidationPrice, isolatedMargin, notional, @@ -653,7 +653,7 @@ public String toString() { sb.append(" entryPrice: ").append(toIndentedString(entryPrice)).append("\n"); sb.append(" breakEvenPrice: ").append(toIndentedString(breakEvenPrice)).append("\n"); sb.append(" markPrice: ").append(toIndentedString(markPrice)).append("\n"); - sb.append(" unrealizedProfit: ").append(toIndentedString(unrealizedProfit)).append("\n"); + sb.append(" unRealizedProfit: ").append(toIndentedString(unRealizedProfit)).append("\n"); sb.append(" liquidationPrice: ").append(toIndentedString(liquidationPrice)).append("\n"); sb.append(" isolatedMargin: ").append(toIndentedString(isolatedMargin)).append("\n"); sb.append(" notional: ").append(toIndentedString(notional)).append("\n"); @@ -709,10 +709,10 @@ public String toUrlQueryString() { String markPriceValueAsString = markPriceValue.toString(); valMap.put("markPrice", markPriceValueAsString); } - String unrealizedProfitValue = getUnrealizedProfit(); - if (unrealizedProfitValue != null) { - String unrealizedProfitValueAsString = unrealizedProfitValue.toString(); - valMap.put("unrealizedProfit", unrealizedProfitValueAsString); + String unRealizedProfitValue = getUnRealizedProfit(); + if (unRealizedProfitValue != null) { + String unRealizedProfitValueAsString = unRealizedProfitValue.toString(); + valMap.put("unRealizedProfit", unRealizedProfitValueAsString); } String liquidationPriceValue = getLiquidationPrice(); if (liquidationPriceValue != null) { @@ -814,9 +814,9 @@ public Map toMap() { if (markPriceValue != null) { valMap.put("markPrice", markPriceValue); } - Object unrealizedProfitValue = getUnrealizedProfit(); - if (unrealizedProfitValue != null) { - valMap.put("unrealizedProfit", unrealizedProfitValue); + Object unRealizedProfitValue = getUnRealizedProfit(); + if (unRealizedProfitValue != null) { + valMap.put("unRealizedProfit", unRealizedProfitValue); } Object liquidationPriceValue = getLiquidationPrice(); if (liquidationPriceValue != null) { @@ -902,7 +902,7 @@ private String toIndentedString(Object o) { openapiFields.add("entryPrice"); openapiFields.add("breakEvenPrice"); openapiFields.add("markPrice"); - openapiFields.add("unrealizedProfit"); + openapiFields.add("unRealizedProfit"); openapiFields.add("liquidationPrice"); openapiFields.add("isolatedMargin"); openapiFields.add("notional"); @@ -1003,14 +1003,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("markPrice").toString())); } - if ((jsonObj.get("unrealizedProfit") != null - && !jsonObj.get("unrealizedProfit").isJsonNull()) - && !jsonObj.get("unrealizedProfit").isJsonPrimitive()) { + if ((jsonObj.get("unRealizedProfit") != null + && !jsonObj.get("unRealizedProfit").isJsonNull()) + && !jsonObj.get("unRealizedProfit").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `unrealizedProfit` to be a primitive type in the" + "Expected the field `unRealizedProfit` to be a primitive type in the" + " JSON string but got `%s`", - jsonObj.get("unrealizedProfit").toString())); + jsonObj.get("unRealizedProfit").toString())); } if ((jsonObj.get("liquidationPrice") != null && !jsonObj.get("liquidationPrice").isJsonNull()) diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/DerivativesTradingUsdsFuturesWebSocketStreamsUtil.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/DerivativesTradingUsdsFuturesWebSocketStreamsUtil.java index 0f2185f5d..031d3bd50 100644 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/DerivativesTradingUsdsFuturesWebSocketStreamsUtil.java +++ b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/DerivativesTradingUsdsFuturesWebSocketStreamsUtil.java @@ -7,11 +7,15 @@ public class DerivativesTradingUsdsFuturesWebSocketStreamsUtil { private static final boolean HAS_TIME_UNIT = false; public static WebSocketClientConfiguration getClientConfiguration() { + return getClientConfiguration(""); + } + + public static WebSocketClientConfiguration getClientConfiguration(String path) { WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); if (!HAS_TIME_UNIT) { clientConfiguration.setTimeUnit(null); } - clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setUrl(BASE_URL + path + "/stream"); clientConfiguration.setAutoLogon(false); return clientConfiguration; } 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 0f57e5418..d277946db 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/8.0.0 (Java/%s; %s; %s)", + "binance-derivatives-trading-usds-futures/9.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 5080538cc..60e2e879f 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 @@ -13,11 +13,16 @@ package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api; import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionInterface; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionPoolWrapper; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsRequest; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsResponse; import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllBookTickersStreamRequest; @@ -70,11 +75,27 @@ import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; public class WebsocketMarketStreamsApi { + private static final String USER_AGENT = + String.format( + "binance-derivatives-trading-usds-futures/9.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private StreamConnectionInterface connection; public WebsocketMarketStreamsApi() {} + public WebsocketMarketStreamsApi(WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + public WebsocketMarketStreamsApi(StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } this.connection = connection; } diff --git a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApiTest.java b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApiTest.java index c22b1d397..31a869ef0 100644 --- a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApiTest.java +++ b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/AccountApiTest.java @@ -77,6 +77,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); AccountApi accountApi = new AccountApi(connectionSpy); diff --git a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApiTest.java b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApiTest.java index 44f101d62..b30c8a61b 100644 --- a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApiTest.java +++ b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/MarketDataApiTest.java @@ -75,6 +75,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); MarketDataApi accountApi = new MarketDataApi(connectionSpy); diff --git a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApiTest.java b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApiTest.java index b3a6af5ac..ad06a81d2 100644 --- a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApiTest.java +++ b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/TradeApiTest.java @@ -82,6 +82,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); TradeApi accountApi = new TradeApi(connectionSpy); diff --git a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApiTest.java b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApiTest.java index e701fa935..108f7e215 100644 --- a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApiTest.java +++ b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/api/UserDataStreamsApiTest.java @@ -75,6 +75,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); UserDataStreamsApi accountApi = new UserDataStreamsApi(connectionSpy); diff --git a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java index c6ff457e9..5ead8389e 100644 --- a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java +++ b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java @@ -107,6 +107,7 @@ public void initApiClient() throws Exception { StreamConnectionWrapper connectionWrapper = new StreamConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); WebsocketMarketStreamsApi accountApi = new WebsocketMarketStreamsApi(connectionSpy); diff --git a/clients/margin-trading/CHANGELOG.md b/clients/margin-trading/CHANGELOG.md index a5890e104..8ac213b7e 100644 --- a/clients/margin-trading/CHANGELOG.md +++ b/clients/margin-trading/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 6.0.0 - 2026-02-12 + +### Added (1) + +#### REST API + +- `getMarginAssetRiskBasedLiquidationRatio()` (`GET /sapi/v1/margin/risk-based-liquidation-ratio`) + ## 5.0.0 - 2025-12-16 ### Removed (6) diff --git a/clients/margin-trading/docs/AccountApi.md b/clients/margin-trading/docs/AccountApi.md index 82252529f..adcdfca5a 100644 --- a/clients/margin-trading/docs/AccountApi.md +++ b/clients/margin-trading/docs/AccountApi.md @@ -355,10 +355,10 @@ public class Example { String asset = "asset_example"; // String | String symbol = "symbol_example"; // String | isolated margin pair String type = "type_example"; // String | Transfer Type: ROLL_IN, ROLL_OUT - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | - Long fromId = 56L; // Long | 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 - Long limit = 56L; // Long | Default Value: 500; Max Value: 1000 + Long fromId = 56L; // Long | If `fromId` is set, data with `id` greater than `fromId` will be returned. Otherwise, the latest data will be returned. + Long limit = 56L; // Long | Limit on the number of data records returned per request. Default: 500; Maximum: 1000. Long recvWindow = 56L; // Long | No more than 60000 try { QueryCrossIsolatedMarginCapitalFlowResponse result = apiInstance.queryCrossIsolatedMarginCapitalFlow(asset, symbol, type, startTime, endTime, fromId, limit, recvWindow); @@ -381,10 +381,10 @@ public class Example { | **asset** | **String**| | [optional] | | **symbol** | **String**| isolated margin pair | [optional] | | **type** | **String**| Transfer Type: ROLL_IN, ROLL_OUT | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | -| **fromId** | **Long**| 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 | [optional] | -| **limit** | **Long**| Default Value: 500; Max Value: 1000 | [optional] | +| **fromId** | **Long**| If `fromId` is set, data with `id` greater than `fromId` will be returned. Otherwise, the latest data will be returned. | [optional] | +| **limit** | **Long**| Limit on the number of data records returned per request. Default: 500; Maximum: 1000. | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | ### Return type diff --git a/clients/margin-trading/docs/BorrowRepayApi.md b/clients/margin-trading/docs/BorrowRepayApi.md index 7ec4f1146..2e300bb16 100644 --- a/clients/margin-trading/docs/BorrowRepayApi.md +++ b/clients/margin-trading/docs/BorrowRepayApi.md @@ -101,7 +101,7 @@ public class Example { BorrowRepayApi apiInstance = new BorrowRepayApi(defaultClient); String asset = "asset_example"; // String | String isolatedSymbol = "isolatedSymbol_example"; // String | isolated symbol - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10 Max:100 @@ -126,7 +126,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **asset** | **String**| | [optional] | | **isolatedSymbol** | **String**| isolated symbol | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | | **size** | **Long**| Default:10 Max:100 | [optional] | @@ -239,7 +239,7 @@ public class Example { String asset = "asset_example"; // String | String isolatedSymbol = "isolatedSymbol_example"; // String | isolated symbol Long txId = 56L; // Long | `tranId` in `POST /sapi/v1/margin/loan` - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10 Max:100 @@ -266,7 +266,7 @@ public class Example { | **asset** | **String**| | [optional] | | **isolatedSymbol** | **String**| isolated symbol | [optional] | | **txId** | **Long**| `tranId` in `POST /sapi/v1/margin/loan` | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | | **size** | **Long**| Default:10 Max:100 | [optional] | @@ -315,7 +315,7 @@ public class Example { BorrowRepayApi apiInstance = new BorrowRepayApi(defaultClient); String asset = "asset_example"; // String | Long vipLevel = 56L; // Long | User's current specific margin data will be returned if vipLevel is omitted - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | Long recvWindow = 56L; // Long | No more than 60000 try { @@ -338,7 +338,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **asset** | **String**| | | | **vipLevel** | **Long**| User's current specific margin data will be returned if vipLevel is omitted | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | diff --git a/clients/margin-trading/docs/GetMarginAssetRiskBasedLiquidationRatioResponse.md b/clients/margin-trading/docs/GetMarginAssetRiskBasedLiquidationRatioResponse.md new file mode 100644 index 000000000..f24f7f833 --- /dev/null +++ b/clients/margin-trading/docs/GetMarginAssetRiskBasedLiquidationRatioResponse.md @@ -0,0 +1,12 @@ + + +# GetMarginAssetRiskBasedLiquidationRatioResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/margin-trading/docs/GetMarginAssetRiskBasedLiquidationRatioResponseInner.md b/clients/margin-trading/docs/GetMarginAssetRiskBasedLiquidationRatioResponseInner.md new file mode 100644 index 000000000..43ebd448d --- /dev/null +++ b/clients/margin-trading/docs/GetMarginAssetRiskBasedLiquidationRatioResponseInner.md @@ -0,0 +1,14 @@ + + +# GetMarginAssetRiskBasedLiquidationRatioResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**asset** | **String** | | [optional] | +|**riskBasedLiquidationRatio** | **String** | | [optional] | + + + diff --git a/clients/margin-trading/docs/KeepaliveIsolatedMarginUserDataStreamRequest.md b/clients/margin-trading/docs/KeepaliveIsolatedMarginUserDataStreamRequest.md deleted file mode 100644 index 8a9d3c6f4..000000000 --- a/clients/margin-trading/docs/KeepaliveIsolatedMarginUserDataStreamRequest.md +++ /dev/null @@ -1,14 +0,0 @@ - - -# KeepaliveIsolatedMarginUserDataStreamRequest - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**symbol** | **String** | | | -|**listenKey** | **String** | | | - - - diff --git a/clients/margin-trading/docs/MarketDataApi.md b/clients/margin-trading/docs/MarketDataApi.md index 9ccf3acbf..682811c53 100644 --- a/clients/margin-trading/docs/MarketDataApi.md +++ b/clients/margin-trading/docs/MarketDataApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.binance.com* | [**getDelistSchedule**](MarketDataApi.md#getDelistSchedule) | **GET** /sapi/v1/margin/delist-schedule | Get Delist Schedule (MARKET_DATA) | | [**getLimitPricePairs**](MarketDataApi.md#getLimitPricePairs) | **GET** /sapi/v1/margin/limit-price-pairs | Get Limit Price Pairs(MARKET_DATA) | | [**getListSchedule**](MarketDataApi.md#getListSchedule) | **GET** /sapi/v1/margin/list-schedule | Get list Schedule (MARKET_DATA) | +| [**getMarginAssetRiskBasedLiquidationRatio**](MarketDataApi.md#getMarginAssetRiskBasedLiquidationRatio) | **GET** /sapi/v1/margin/risk-based-liquidation-ratio | Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) | | [**queryIsolatedMarginTierData**](MarketDataApi.md#queryIsolatedMarginTierData) | **GET** /sapi/v1/margin/isolatedMarginTier | Query Isolated Margin Tier Data (USER_DATA) | | [**queryLiabilityCoinLeverageBracketInCrossMarginProMode**](MarketDataApi.md#queryLiabilityCoinLeverageBracketInCrossMarginProMode) | **GET** /sapi/v1/margin/leverageBracket | Query Liability Coin Leverage Bracket in Cross Margin Pro Mode(MARKET_DATA) | | [**queryMarginAvailableInventory**](MarketDataApi.md#queryMarginAvailableInventory) | **GET** /sapi/v1/margin/available-inventory | Query Margin Available Inventory(USER_DATA) | @@ -445,6 +446,64 @@ No authorization required |-------------|-------------|------------------| | **200** | Get list Schedule | - | + +# **getMarginAssetRiskBasedLiquidationRatio** +> GetMarginAssetRiskBasedLiquidationRatioResponse getMarginAssetRiskBasedLiquidationRatio() + +Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) + +Get Margin Asset Risk-Based Liquidation Ratio Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.margin_trading.ApiClient; +import com.binance.connector.client.margin_trading.ApiException; +import com.binance.connector.client.margin_trading.Configuration; +import com.binance.connector.client.margin_trading.models.*; +import com.binance.connector.client.margin_trading.rest.api.MarketDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + MarketDataApi apiInstance = new MarketDataApi(defaultClient); + try { + GetMarginAssetRiskBasedLiquidationRatioResponse result = apiInstance.getMarginAssetRiskBasedLiquidationRatio(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketDataApi#getMarginAssetRiskBasedLiquidationRatio"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**GetMarginAssetRiskBasedLiquidationRatioResponse**](GetMarginAssetRiskBasedLiquidationRatioResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get Margin Asset Risk-Based Liquidation Ratio | - | + # **queryIsolatedMarginTierData** > QueryIsolatedMarginTierDataResponse queryIsolatedMarginTierData(symbol, tier, recvWindow) diff --git a/clients/margin-trading/docs/StartIsolatedMarginUserDataStreamResponse.md b/clients/margin-trading/docs/StartIsolatedMarginUserDataStreamResponse.md deleted file mode 100644 index 3dbc39b65..000000000 --- a/clients/margin-trading/docs/StartIsolatedMarginUserDataStreamResponse.md +++ /dev/null @@ -1,13 +0,0 @@ - - -# StartIsolatedMarginUserDataStreamResponse - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**listenKey** | **String** | | [optional] | - - - diff --git a/clients/margin-trading/docs/TradeApi.md b/clients/margin-trading/docs/TradeApi.md index b7daad5ef..c36b04f4c 100644 --- a/clients/margin-trading/docs/TradeApi.md +++ b/clients/margin-trading/docs/TradeApi.md @@ -242,7 +242,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TradeApi apiInstance = new TradeApi(defaultClient); - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | String isolatedSymbol = "isolatedSymbol_example"; // String | isolated symbol Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 @@ -266,7 +266,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | | **isolatedSymbol** | **String**| isolated symbol | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | @@ -378,7 +378,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10, Max:100 - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | Long recvWindow = 56L; // Long | No more than 60000 try { @@ -401,7 +401,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **current** | **Long**| Currently querying page. Start from 1. Default:1 | | | **size** | **Long**| Default:10, Max:100 | | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | @@ -1034,10 +1034,10 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" String symbol = "symbol_example"; // String | isolated margin pair - Long fromId = 56L; // Long | 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long fromId = 56L; // Long | If `fromId` is set, data with `id` greater than `fromId` will be returned. Otherwise, the latest data will be returned. + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | - Long limit = 56L; // Long | Default Value: 500; Max Value: 1000 + Long limit = 56L; // Long | Limit on the number of data records returned per request. Default: 500; Maximum: 1000. Long recvWindow = 56L; // Long | No more than 60000 try { QueryMarginAccountsAllOcoResponse result = apiInstance.queryMarginAccountsAllOco(isIsolated, symbol, fromId, startTime, endTime, limit, recvWindow); @@ -1059,10 +1059,10 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | | **symbol** | **String**| isolated margin pair | [optional] | -| **fromId** | **Long**| 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **fromId** | **Long**| If `fromId` is set, data with `id` greater than `fromId` will be returned. Otherwise, the latest data will be returned. | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | -| **limit** | **Long**| Default Value: 500; Max Value: 1000 | [optional] | +| **limit** | **Long**| Limit on the number of data records returned per request. Default: 500; Maximum: 1000. | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | ### Return type @@ -1109,9 +1109,9 @@ public class Example { String symbol = "symbol_example"; // String | String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" Long orderId = 56L; // Long | - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | - Long limit = 56L; // Long | Default Value: 500; Max Value: 1000 + Long limit = 56L; // Long | Limit on the number of data records returned per request. Default: 500; Maximum: 1000. Long recvWindow = 56L; // Long | No more than 60000 try { QueryMarginAccountsAllOrdersResponse result = apiInstance.queryMarginAccountsAllOrders(symbol, isIsolated, orderId, startTime, endTime, limit, recvWindow); @@ -1134,9 +1134,9 @@ public class Example { | **symbol** | **String**| | | | **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | | **orderId** | **Long**| | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | -| **limit** | **Long**| Default Value: 500; Max Value: 1000 | [optional] | +| **limit** | **Long**| Limit on the number of data records returned per request. Default: 500; Maximum: 1000. | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | ### Return type @@ -1455,10 +1455,10 @@ public class Example { String symbol = "symbol_example"; // String | String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" Long orderId = 56L; // Long | - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | - Long fromId = 56L; // Long | 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 - Long limit = 56L; // Long | Default Value: 500; Max Value: 1000 + Long fromId = 56L; // Long | If `fromId` is set, data with `id` greater than `fromId` will be returned. Otherwise, the latest data will be returned. + Long limit = 56L; // Long | Limit on the number of data records returned per request. Default: 500; Maximum: 1000. Long recvWindow = 56L; // Long | No more than 60000 try { QueryMarginAccountsTradeListResponse result = apiInstance.queryMarginAccountsTradeList(symbol, isIsolated, orderId, startTime, endTime, fromId, limit, recvWindow); @@ -1481,10 +1481,10 @@ public class Example { | **symbol** | **String**| | | | **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | | **orderId** | **Long**| | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | -| **fromId** | **Long**| 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 | [optional] | -| **limit** | **Long**| Default Value: 500; Max Value: 1000 | [optional] | +| **fromId** | **Long**| If `fromId` is set, data with `id` greater than `fromId` will be returned. Otherwise, the latest data will be returned. | [optional] | +| **limit** | **Long**| Limit on the number of data records returned per request. Default: 500; Maximum: 1000. | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | ### Return type diff --git a/clients/margin-trading/docs/TradeDataStreamApi.md b/clients/margin-trading/docs/TradeDataStreamApi.md deleted file mode 100644 index 24f3e3f6b..000000000 --- a/clients/margin-trading/docs/TradeDataStreamApi.md +++ /dev/null @@ -1,380 +0,0 @@ -# TradeDataStreamApi - -All URIs are relative to *https://api.binance.com* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**closeIsolatedMarginUserDataStream**](TradeDataStreamApi.md#closeIsolatedMarginUserDataStream) | **DELETE** /sapi/v1/userDataStream/isolated | Close Isolated Margin User Data Stream (USER_STREAM) | -| [**closeMarginUserDataStream**](TradeDataStreamApi.md#closeMarginUserDataStream) | **DELETE** /sapi/v1/userDataStream | Close Margin User Data Stream (USER_STREAM) | -| [**keepaliveIsolatedMarginUserDataStream**](TradeDataStreamApi.md#keepaliveIsolatedMarginUserDataStream) | **PUT** /sapi/v1/userDataStream/isolated | Keepalive Isolated Margin User Data Stream (USER_STREAM) | -| [**keepaliveMarginUserDataStream**](TradeDataStreamApi.md#keepaliveMarginUserDataStream) | **PUT** /sapi/v1/userDataStream | Keepalive Margin User Data Stream (USER_STREAM) | -| [**startIsolatedMarginUserDataStream**](TradeDataStreamApi.md#startIsolatedMarginUserDataStream) | **POST** /sapi/v1/userDataStream/isolated | Start Isolated Margin User Data Stream (USER_STREAM) | -| [**startMarginUserDataStream**](TradeDataStreamApi.md#startMarginUserDataStream) | **POST** /sapi/v1/userDataStream | Start Margin User Data Stream (USER_STREAM) | - - - -# **closeIsolatedMarginUserDataStream** -> closeIsolatedMarginUserDataStream(symbol, listenkey) - -Close Isolated Margin User Data Stream (USER_STREAM) - -Close out a isolated margin user data stream. Weight: 3000 - -### Example -```java -// Import classes: -import com.binance.connector.client.margin_trading.ApiClient; -import com.binance.connector.client.margin_trading.ApiException; -import com.binance.connector.client.margin_trading.Configuration; -import com.binance.connector.client.margin_trading.models.*; -import com.binance.connector.client.margin_trading.rest.api.TradeDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeDataStreamApi apiInstance = new TradeDataStreamApi(defaultClient); - String symbol = "symbol_example"; // String | - String listenkey = "listenkey_example"; // String | - try { - apiInstance.closeIsolatedMarginUserDataStream(symbol, listenkey); - } catch (ApiException e) { - System.err.println("Exception when calling TradeDataStreamApi#closeIsolatedMarginUserDataStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **symbol** | **String**| | | -| **listenkey** | **String**| | | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | - - -# **closeMarginUserDataStream** -> closeMarginUserDataStream(listenkey) - -Close Margin User Data Stream (USER_STREAM) - -Close out a Margin user data stream. Weight: 3000 - -### Example -```java -// Import classes: -import com.binance.connector.client.margin_trading.ApiClient; -import com.binance.connector.client.margin_trading.ApiException; -import com.binance.connector.client.margin_trading.Configuration; -import com.binance.connector.client.margin_trading.models.*; -import com.binance.connector.client.margin_trading.rest.api.TradeDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeDataStreamApi apiInstance = new TradeDataStreamApi(defaultClient); - String listenkey = "listenkey_example"; // String | - try { - apiInstance.closeMarginUserDataStream(listenkey); - } catch (ApiException e) { - System.err.println("Exception when calling TradeDataStreamApi#closeMarginUserDataStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **listenkey** | **String**| | | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | - - -# **keepaliveIsolatedMarginUserDataStream** -> keepaliveIsolatedMarginUserDataStream(keepaliveIsolatedMarginUserDataStreamRequest) - -Keepalive Isolated Margin User Data Stream (USER_STREAM) - -Keepalive an isolated margin user data stream to prevent a time out. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.margin_trading.ApiClient; -import com.binance.connector.client.margin_trading.ApiException; -import com.binance.connector.client.margin_trading.Configuration; -import com.binance.connector.client.margin_trading.models.*; -import com.binance.connector.client.margin_trading.rest.api.TradeDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeDataStreamApi apiInstance = new TradeDataStreamApi(defaultClient); - KeepaliveIsolatedMarginUserDataStreamRequest keepaliveIsolatedMarginUserDataStreamRequest = new KeepaliveIsolatedMarginUserDataStreamRequest(); // KeepaliveIsolatedMarginUserDataStreamRequest | - try { - apiInstance.keepaliveIsolatedMarginUserDataStream(keepaliveIsolatedMarginUserDataStreamRequest); - } catch (ApiException e) { - System.err.println("Exception when calling TradeDataStreamApi#keepaliveIsolatedMarginUserDataStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **keepaliveIsolatedMarginUserDataStreamRequest** | [**KeepaliveIsolatedMarginUserDataStreamRequest**](KeepaliveIsolatedMarginUserDataStreamRequest.md)| | | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | - - -# **keepaliveMarginUserDataStream** -> keepaliveMarginUserDataStream(keepaliveMarginUserDataStreamRequest) - -Keepalive Margin User Data Stream (USER_STREAM) - -Keepalive a margin user data stream to prevent a time out. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.margin_trading.ApiClient; -import com.binance.connector.client.margin_trading.ApiException; -import com.binance.connector.client.margin_trading.Configuration; -import com.binance.connector.client.margin_trading.models.*; -import com.binance.connector.client.margin_trading.rest.api.TradeDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeDataStreamApi apiInstance = new TradeDataStreamApi(defaultClient); - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest = new KeepaliveMarginUserDataStreamRequest(); // KeepaliveMarginUserDataStreamRequest | - try { - apiInstance.keepaliveMarginUserDataStream(keepaliveMarginUserDataStreamRequest); - } catch (ApiException e) { - System.err.println("Exception when calling TradeDataStreamApi#keepaliveMarginUserDataStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **keepaliveMarginUserDataStreamRequest** | [**KeepaliveMarginUserDataStreamRequest**](KeepaliveMarginUserDataStreamRequest.md)| | | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | OK | - | - - -# **startIsolatedMarginUserDataStream** -> StartIsolatedMarginUserDataStreamResponse startIsolatedMarginUserDataStream(startIsolatedMarginUserDataStreamRequest) - -Start Isolated Margin User Data Stream (USER_STREAM) - -Start a new isolated margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.margin_trading.ApiClient; -import com.binance.connector.client.margin_trading.ApiException; -import com.binance.connector.client.margin_trading.Configuration; -import com.binance.connector.client.margin_trading.models.*; -import com.binance.connector.client.margin_trading.rest.api.TradeDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeDataStreamApi apiInstance = new TradeDataStreamApi(defaultClient); - StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest = new StartIsolatedMarginUserDataStreamRequest(); // StartIsolatedMarginUserDataStreamRequest | - try { - StartIsolatedMarginUserDataStreamResponse result = apiInstance.startIsolatedMarginUserDataStream(startIsolatedMarginUserDataStreamRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeDataStreamApi#startIsolatedMarginUserDataStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **startIsolatedMarginUserDataStreamRequest** | [**StartIsolatedMarginUserDataStreamRequest**](StartIsolatedMarginUserDataStreamRequest.md)| | | - -### Return type - -[**StartIsolatedMarginUserDataStreamResponse**](StartIsolatedMarginUserDataStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Start Isolated Margin User Data Stream | - | - - -# **startMarginUserDataStream** -> StartMarginUserDataStreamResponse startMarginUserDataStream() - -Start Margin User Data Stream (USER_STREAM) - -Start a new margin user data stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has an active listenKey, that listenKey will be returned and its validity will be extended for 60 minutes. Weight: 1 - -### Example -```java -// Import classes: -import com.binance.connector.client.margin_trading.ApiClient; -import com.binance.connector.client.margin_trading.ApiException; -import com.binance.connector.client.margin_trading.Configuration; -import com.binance.connector.client.margin_trading.models.*; -import com.binance.connector.client.margin_trading.rest.api.TradeDataStreamApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.binance.com"); - - TradeDataStreamApi apiInstance = new TradeDataStreamApi(defaultClient); - try { - StartMarginUserDataStreamResponse result = apiInstance.startMarginUserDataStream(); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling TradeDataStreamApi#startMarginUserDataStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**StartMarginUserDataStreamResponse**](StartMarginUserDataStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Start Margin User Data Stream | - | - diff --git a/clients/margin-trading/docs/TransferApi.md b/clients/margin-trading/docs/TransferApi.md index 458bad48d..e96f755bd 100644 --- a/clients/margin-trading/docs/TransferApi.md +++ b/clients/margin-trading/docs/TransferApi.md @@ -33,7 +33,7 @@ public class Example { TransferApi apiInstance = new TransferApi(defaultClient); String asset = "asset_example"; // String | String type = "type_example"; // String | Transfer Type: ROLL_IN, ROLL_OUT - Long startTime = 56L; // Long | 只支持查询最近90天的数据 + Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | Long current = 56L; // Long | Currently querying page. Start from 1. Default:1 Long size = 56L; // Long | Default:10 Max:100 @@ -59,7 +59,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **asset** | **String**| | [optional] | | **type** | **String**| Transfer Type: ROLL_IN, ROLL_OUT | [optional] | -| **startTime** | **Long**| 只支持查询最近90天的数据 | [optional] | +| **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | | **current** | **Long**| Currently querying page. Start from 1. Default:1 | [optional] | | **size** | **Long**| Default:10 Max:100 | [optional] | diff --git a/clients/margin-trading/docs/rest-api/migration-guide.md b/clients/margin-trading/docs/rest-api/migration-guide.md index 71283e8e5..c2b5524d4 100644 --- a/clients/margin-trading/docs/rest-api/migration-guide.md +++ b/clients/margin-trading/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-margin-trading - 5.0.0 + 6.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-margin-trading - 5.0.0 + 6.0.0 ``` diff --git a/clients/margin-trading/example_rest.md b/clients/margin-trading/example_rest.md index 2d7d80213..03ed15412 100644 --- a/clients/margin-trading/example_rest.md +++ b/clients/margin-trading/example_rest.md @@ -52,6 +52,8 @@ [GET /sapi/v1/margin/list-schedule](https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule) - getListSchedule - [GetListScheduleExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetListScheduleExample.java#L48) +[GET /sapi/v1/margin/risk-based-liquidation-ratio](https://developers.binance.com/docs/margin_trading/market-data/Get-Margin-Asset-Risk-Based-Liquidation-Ratio) - getMarginAssetRiskBasedLiquidationRatio - [GetMarginAssetRiskBasedLiquidationRatioExample.java:47](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginAssetRiskBasedLiquidationRatioExample.java#L47) + [GET /sapi/v1/margin/isolatedMarginTier](https://developers.binance.com/docs/margin_trading/market-data/Query-Isolated-Margin-Tier-Data) - queryIsolatedMarginTierData - [QueryIsolatedMarginTierDataExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/QueryIsolatedMarginTierDataExample.java#L48) [GET /sapi/v1/margin/leverageBracket](https://developers.binance.com/docs/margin_trading/market-data/Query-Liability-Coin-Leverage-Bracket-in-Cross-Margin-Pro-Mode) - queryLiabilityCoinLeverageBracketInCrossMarginProMode - [QueryLiabilityCoinLeverageBracketInCrossMarginProModeExample.java:47](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/QueryLiabilityCoinLeverageBracketInCrossMarginProModeExample.java#L47) diff --git a/clients/margin-trading/pom.xml b/clients/margin-trading/pom.xml index cc927b976..5af48e30d 100644 --- a/clients/margin-trading/pom.xml +++ b/clients/margin-trading/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-margin-trading margin-trading - 5.0.0 + 6.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java index 28d6dd287..5c62444b3 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/JSON.java @@ -205,6 +205,14 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .GetListScheduleResponseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.rest.model + .GetMarginAssetRiskBasedLiquidationRatioResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.rest.model + .GetMarginAssetRiskBasedLiquidationRatioResponseInner + .CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .GetSmallLiabilityExchangeCoinListResponse.CustomTypeAdapterFactory()); diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java index a525b1645..e4eb5a509 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/AccountApi.java @@ -55,7 +55,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -804,10 +804,13 @@ public ApiResponse getSummaryOfMarginAccount( * @param asset (optional) * @param symbol isolated margin pair (optional) * @param type Transfer Type: ROLL_IN, ROLL_OUT (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -978,10 +981,13 @@ private okhttp3.Call queryCrossIsolatedMarginCapitalFlowValidateBeforeCall( * @param asset (optional) * @param symbol isolated margin pair (optional) * @param type Transfer Type: ROLL_IN, ROLL_OUT (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryCrossIsolatedMarginCapitalFlowResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java index 0342ff0db..705b925bc 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java @@ -49,7 +49,7 @@ public class BorrowRepayApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -236,7 +236,7 @@ public ApiResponse getFutureHourlyInterestR * * @param asset (optional) * @param isolatedSymbol isolated symbol (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) @@ -414,7 +414,7 @@ private okhttp3.Call getInterestHistoryValidateBeforeCall( * * @param asset (optional) * @param isolatedSymbol isolated symbol (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) @@ -617,7 +617,7 @@ public ApiResponse marginAccountBorrowRepay( * @param asset (optional) * @param isolatedSymbol isolated symbol (optional) * @param txId `tranId` in `POST /sapi/v1/margin/loan` (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) @@ -813,7 +813,7 @@ private okhttp3.Call queryBorrowRepayRecordsInMarginAccountValidateBeforeCall( * @param asset (optional) * @param isolatedSymbol isolated symbol (optional) * @param txId `tranId` in `POST /sapi/v1/margin/loan` (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) @@ -866,7 +866,7 @@ private okhttp3.Call queryBorrowRepayRecordsInMarginAccountValidateBeforeCall( * @param asset (required) * @param vipLevel User's current specific margin data will be returned if vipLevel is * omitted (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute @@ -1007,7 +1007,7 @@ private okhttp3.Call queryMarginInterestRateHistoryValidateBeforeCall( * @param asset (required) * @param vipLevel User's current specific margin data will be returned if vipLevel is * omitted (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginInterestRateHistoryResponse> diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java index e0204bdab..41d2b73d5 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java @@ -25,6 +25,7 @@ import com.binance.connector.client.margin_trading.rest.model.GetInterestHistoryResponse; import com.binance.connector.client.margin_trading.rest.model.GetLimitPricePairsResponse; import com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse; +import com.binance.connector.client.margin_trading.rest.model.GetMarginAssetRiskBasedLiquidationRatioResponse; import com.binance.connector.client.margin_trading.rest.model.GetSmallLiabilityExchangeCoinListResponse; import com.binance.connector.client.margin_trading.rest.model.GetSmallLiabilityExchangeHistoryResponse; import com.binance.connector.client.margin_trading.rest.model.GetSummaryOfMarginAccountResponse; @@ -226,10 +227,13 @@ public ApiResponse getSummaryOfMarginAccount( * @param asset (optional) * @param symbol isolated margin pair (optional) * @param type Transfer Type: ROLL_IN, ROLL_OUT (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryCrossIsolatedMarginCapitalFlowResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -434,7 +438,7 @@ public ApiResponse getFutureHourlyInterestR * * @param asset (optional) * @param isolatedSymbol isolated symbol (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) @@ -502,7 +506,7 @@ public ApiResponse marginAccountBorrowRepay( * @param asset (optional) * @param isolatedSymbol isolated symbol (optional) * @param txId `tranId` in `POST /sapi/v1/margin/loan` (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) @@ -544,7 +548,7 @@ public ApiResponse marginAccountBorrowRepay( * @param asset (required) * @param vipLevel User's current specific margin data will be returned if vipLevel is * omitted (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginInterestRateHistoryResponse> @@ -765,6 +769,29 @@ public ApiResponse getListSchedule(Long recvWindow) return marketDataApi.getListSchedule(recvWindow); } + /** + * Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) Get Margin Asset Risk-Based + * Liquidation Ratio Weight: 1 + * + * @return ApiResponse<GetMarginAssetRiskBasedLiquidationRatioResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Margin Asset Risk-Based Liquidation Ratio -
+ * + * @see Get + * Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) Documentation + */ + public ApiResponse + getMarginAssetRiskBasedLiquidationRatio() throws ApiException { + return marketDataApi.getMarginAssetRiskBasedLiquidationRatio(); + } + /** * Query Isolated Margin Tier Data (USER_DATA) Get isolated margin tier data collection with any * tier as https://www.binance.com/en/margin-data Weight: 1(IP) @@ -1019,7 +1046,7 @@ public void editIpForSpecialKey(EditIpForSpecialKeyRequest editIpForSpecialKeyRe * Get Force Liquidation Record (USER_DATA) Get Force Liquidation Record * Response in * descending order Weight: 1(IP) * - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param isolatedSymbol isolated symbol (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -1081,7 +1108,7 @@ public ApiResponse getSmallLiabilityE * * @param current Currently querying page. Start from 1. Default:1 (required) * @param size Default:10, Max:100 (required) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<GetSmallLiabilityExchangeHistoryResponse> @@ -1394,10 +1421,13 @@ public ApiResponse queryCurrentMargin * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param symbol isolated margin pair (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsAllOcoResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1437,9 +1467,10 @@ public ApiResponse queryMarginAccountsAllOco( * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param orderId (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsAllOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1606,10 +1637,13 @@ public ApiResponse queryMarginAccountsOrder( * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param orderId (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsTradeListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1721,7 +1755,7 @@ public void smallLiabilityExchange(SmallLiabilityExchangeRequest smallLiabilityE * * @param asset (optional) * @param type Transfer Type: ROLL_IN, ROLL_OUT (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java index 27f6e009b..56d68e8d2 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarketDataApi.java @@ -26,6 +26,7 @@ import com.binance.connector.client.margin_trading.rest.model.GetDelistScheduleResponse; import com.binance.connector.client.margin_trading.rest.model.GetLimitPricePairsResponse; import com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse; +import com.binance.connector.client.margin_trading.rest.model.GetMarginAssetRiskBasedLiquidationRatioResponse; import com.binance.connector.client.margin_trading.rest.model.QueryIsolatedMarginTierDataResponse; import com.binance.connector.client.margin_trading.rest.model.QueryLiabilityCoinLeverageBracketInCrossMarginProModeResponse; import com.binance.connector.client.margin_trading.rest.model.QueryMarginAvailableInventoryResponse; @@ -52,7 +53,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1016,6 +1017,133 @@ public ApiResponse getListSchedule(Long recvWindow) return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for getMarginAssetRiskBasedLiquidationRatio + * + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Margin Asset Risk-Based Liquidation Ratio -
+ * + * @see Get + * Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) Documentation + */ + private okhttp3.Call getMarginAssetRiskBasedLiquidationRatioCall() throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/margin/risk-based-liquidation-ratio"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMarginAssetRiskBasedLiquidationRatioValidateBeforeCall() + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {}; + Method method = this.getClass().getMethod("getMarginAssetRiskBasedLiquidationRatio"); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getMarginAssetRiskBasedLiquidationRatioCall(); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) Get Margin Asset Risk-Based + * Liquidation Ratio Weight: 1 + * + * @return ApiResponse<GetMarginAssetRiskBasedLiquidationRatioResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get Margin Asset Risk-Based Liquidation Ratio -
+ * + * @see Get + * Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) Documentation + */ + public ApiResponse + getMarginAssetRiskBasedLiquidationRatio() throws ApiException { + okhttp3.Call localVarCall = getMarginAssetRiskBasedLiquidationRatioValidateBeforeCall(); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for queryIsolatedMarginTierData * diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java index d952edf1b..efbab0c4d 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/RiskDataStreamApi.java @@ -44,7 +44,7 @@ public class RiskDataStreamApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java index 5706291ec..fe373fb3d 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeApi.java @@ -74,7 +74,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -577,7 +577,7 @@ public ApiResponse editIpForSpecialKey( /** * Build call for getForceLiquidationRecord * - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param isolatedSymbol isolated symbol (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -736,7 +736,7 @@ private okhttp3.Call getForceLiquidationRecordValidateBeforeCall( * Get Force Liquidation Record (USER_DATA) Get Force Liquidation Record * Response in * descending order Weight: 1(IP) * - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param isolatedSymbol isolated symbol (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) @@ -913,7 +913,7 @@ public ApiResponse getSmallLiabilityE * * @param current Currently querying page. Start from 1. Default:1 (required) * @param size Default:10, Max:100 (required) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute @@ -1053,7 +1053,7 @@ private okhttp3.Call getSmallLiabilityExchangeHistoryValidateBeforeCall( * * @param current Currently querying page. Start from 1. Default:1 (required) * @param size Default:10, Max:100 (required) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<GetSmallLiabilityExchangeHistoryResponse> @@ -3039,10 +3039,13 @@ public ApiResponse queryCurrentMargin * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param symbol isolated margin pair (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3206,10 +3209,13 @@ private okhttp3.Call queryMarginAccountsAllOcoValidateBeforeCall( * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param symbol isolated margin pair (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsAllOcoResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -3249,9 +3255,10 @@ public ApiResponse queryMarginAccountsAllOco( * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param orderId (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3419,9 +3426,10 @@ private okhttp3.Call queryMarginAccountsAllOrdersValidateBeforeCall( * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param orderId (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsAllOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -4158,10 +4166,13 @@ public ApiResponse queryMarginAccountsOrder( * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param orderId (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -4334,10 +4345,13 @@ private okhttp3.Call queryMarginAccountsTradeListValidateBeforeCall( * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default * \"FALSE\" (optional) * @param orderId (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) - * @param fromId 如设置fromId, 将返回id > fromId的数据。否则将返回最新数据 (optional) - * @param limit Default Value: 500; Max Value: 1000 (optional) + * @param fromId If `fromId` is set, data with `id` greater than + * `fromId` will be returned. Otherwise, the latest data will be returned. + * (optional) + * @param limit Limit on the number of data records returned per request. Default: 500; Maximum: + * 1000. (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsTradeListResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java deleted file mode 100644 index d61ad1351..000000000 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApi.java +++ /dev/null @@ -1,961 +0,0 @@ -/* - * Binance Margin Trading REST API - * OpenAPI Specification for the Binance Margin Trading REST 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.margin_trading.rest.api; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.Pair; -import com.binance.connector.client.common.SystemUtil; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveIsolatedMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamResponse; -import com.binance.connector.client.margin_trading.rest.model.StartMarginUserDataStreamResponse; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Valid; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import jakarta.validation.executable.ExecutableValidator; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class TradeDataStreamApi { - private ApiClient localVarApiClient; - private int localHostIndex; - private String localCustomBaseUrl; - - private static final String USER_AGENT = - String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", - SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - private static final boolean HAS_TIME_UNIT = false; - - public TradeDataStreamApi(ClientConfiguration clientConfiguration) { - this(new ApiClient(clientConfiguration)); - } - - public TradeDataStreamApi(ApiClient apiClient) { - apiClient.setUserAgent(USER_AGENT); - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public int getHostIndex() { - return localHostIndex; - } - - public void setHostIndex(int hostIndex) { - this.localHostIndex = hostIndex; - } - - public String getCustomBaseUrl() { - return localCustomBaseUrl; - } - - public void setCustomBaseUrl(String customBaseUrl) { - this.localCustomBaseUrl = customBaseUrl; - } - - /** - * Build call for closeIsolatedMarginUserDataStream - * - * @param symbol (required) - * @param listenkey (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Close - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - private okhttp3.Call closeIsolatedMarginUserDataStreamCall(String symbol, String listenkey) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/userDataStream/isolated"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (symbol != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("symbol", symbol)); - } - - if (listenkey != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("listenkey", listenkey)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call closeIsolatedMarginUserDataStreamValidateBeforeCall( - String symbol, String listenkey) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {symbol, listenkey}; - Method method = - this.getClass() - .getMethod( - "closeIsolatedMarginUserDataStream", - String.class, - String.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return closeIsolatedMarginUserDataStreamCall(symbol, listenkey); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Close Isolated Margin User Data Stream (USER_STREAM) Close out a isolated margin user data - * stream. Weight: 3000 - * - * @param symbol (required) - * @param listenkey (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Close - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - public ApiResponse closeIsolatedMarginUserDataStream( - @NotNull String symbol, @NotNull String listenkey) throws ApiException { - okhttp3.Call localVarCall = - closeIsolatedMarginUserDataStreamValidateBeforeCall(symbol, listenkey); - return localVarApiClient.execute(localVarCall); - } - - /** - * Build call for closeMarginUserDataStream - * - * @param listenkey (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Close - * Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - private okhttp3.Call closeMarginUserDataStreamCall(String listenkey) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/userDataStream"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (listenkey != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("listenkey", listenkey)); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call closeMarginUserDataStreamValidateBeforeCall(String listenkey) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {listenkey}; - Method method = this.getClass().getMethod("closeMarginUserDataStream", String.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return closeMarginUserDataStreamCall(listenkey); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Close Margin User Data Stream (USER_STREAM) Close out a Margin user data stream. Weight: 3000 - * - * @param listenkey (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Close - * Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - public ApiResponse closeMarginUserDataStream(@NotNull String listenkey) - throws ApiException { - okhttp3.Call localVarCall = closeMarginUserDataStreamValidateBeforeCall(listenkey); - return localVarApiClient.execute(localVarCall); - } - - /** - * Build call for keepaliveIsolatedMarginUserDataStream - * - * @param keepaliveIsolatedMarginUserDataStreamRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Keepalive - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - private okhttp3.Call keepaliveIsolatedMarginUserDataStreamCall( - KeepaliveIsolatedMarginUserDataStreamRequest - keepaliveIsolatedMarginUserDataStreamRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/userDataStream/isolated"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (keepaliveIsolatedMarginUserDataStreamRequest.getSymbol() != null) { - localVarFormParams.put( - "symbol", keepaliveIsolatedMarginUserDataStreamRequest.getSymbol()); - } - - if (keepaliveIsolatedMarginUserDataStreamRequest.getListenKey() != null) { - localVarFormParams.put( - "listenKey", keepaliveIsolatedMarginUserDataStreamRequest.getListenKey()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PUT", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call keepaliveIsolatedMarginUserDataStreamValidateBeforeCall( - KeepaliveIsolatedMarginUserDataStreamRequest - keepaliveIsolatedMarginUserDataStreamRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {keepaliveIsolatedMarginUserDataStreamRequest}; - Method method = - this.getClass() - .getMethod( - "keepaliveIsolatedMarginUserDataStream", - KeepaliveIsolatedMarginUserDataStreamRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return keepaliveIsolatedMarginUserDataStreamCall( - keepaliveIsolatedMarginUserDataStreamRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Keepalive Isolated Margin User Data Stream (USER_STREAM) Keepalive an isolated margin user - * data stream to prevent a time out. Weight: 1 - * - * @param keepaliveIsolatedMarginUserDataStreamRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Keepalive - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - public ApiResponse keepaliveIsolatedMarginUserDataStream( - @Valid @NotNull - KeepaliveIsolatedMarginUserDataStreamRequest - keepaliveIsolatedMarginUserDataStreamRequest) - throws ApiException { - okhttp3.Call localVarCall = - keepaliveIsolatedMarginUserDataStreamValidateBeforeCall( - keepaliveIsolatedMarginUserDataStreamRequest); - return localVarApiClient.execute(localVarCall); - } - - /** - * Build call for keepaliveMarginUserDataStream - * - * @param keepaliveMarginUserDataStreamRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Keepalive - * Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - private okhttp3.Call keepaliveMarginUserDataStreamCall( - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/userDataStream"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (keepaliveMarginUserDataStreamRequest.getListenKey() != null) { - localVarFormParams.put( - "listenKey", keepaliveMarginUserDataStreamRequest.getListenKey()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "PUT", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call keepaliveMarginUserDataStreamValidateBeforeCall( - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {keepaliveMarginUserDataStreamRequest}; - Method method = - this.getClass() - .getMethod( - "keepaliveMarginUserDataStream", - KeepaliveMarginUserDataStreamRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return keepaliveMarginUserDataStreamCall(keepaliveMarginUserDataStreamRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Keepalive Margin User Data Stream (USER_STREAM) Keepalive a margin user data stream to - * prevent a time out. Weight: 1 - * - * @param keepaliveMarginUserDataStreamRequest (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 OK -
- * - * @deprecated - * @see Keepalive - * Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - public ApiResponse keepaliveMarginUserDataStream( - @Valid @NotNull - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest) - throws ApiException { - okhttp3.Call localVarCall = - keepaliveMarginUserDataStreamValidateBeforeCall( - keepaliveMarginUserDataStreamRequest); - return localVarApiClient.execute(localVarCall); - } - - /** - * Build call for startIsolatedMarginUserDataStream - * - * @param startIsolatedMarginUserDataStreamRequest (required) - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Start Isolated Margin User Data Stream -
- * - * @deprecated - * @see Start - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - private okhttp3.Call startIsolatedMarginUserDataStreamCall( - StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest) - throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/userDataStream/isolated"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (startIsolatedMarginUserDataStreamRequest.getSymbol() != null) { - localVarFormParams.put("symbol", startIsolatedMarginUserDataStreamRequest.getSymbol()); - } - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call startIsolatedMarginUserDataStreamValidateBeforeCall( - StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {startIsolatedMarginUserDataStreamRequest}; - Method method = - this.getClass() - .getMethod( - "startIsolatedMarginUserDataStream", - StartIsolatedMarginUserDataStreamRequest.class); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return startIsolatedMarginUserDataStreamCall( - startIsolatedMarginUserDataStreamRequest); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Start Isolated Margin User Data Stream (USER_STREAM) Start a new isolated margin user data - * stream. The stream will close after 60 minutes unless a keepalive is sent. If the account has - * an active listenKey, that listenKey will be returned and its validity will be extended for 60 - * minutes. Weight: 1 - * - * @param startIsolatedMarginUserDataStreamRequest (required) - * @return ApiResponse<StartIsolatedMarginUserDataStreamResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Start Isolated Margin User Data Stream -
- * - * @deprecated - * @see Start - * Isolated Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - public ApiResponse startIsolatedMarginUserDataStream( - @Valid @NotNull - StartIsolatedMarginUserDataStreamRequest - startIsolatedMarginUserDataStreamRequest) - throws ApiException { - okhttp3.Call localVarCall = - startIsolatedMarginUserDataStreamValidateBeforeCall( - startIsolatedMarginUserDataStreamRequest); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Build call for startMarginUserDataStream - * - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Start Margin User Data Stream -
- * - * @deprecated - * @see Start - * Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - private okhttp3.Call startMarginUserDataStreamCall() throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] {}; - - // Determine Base Path to Use - if (localCustomBaseUrl != null) { - basePath = localCustomBaseUrl; - } else if (localBasePaths.length > 0) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/sapi/v1/userDataStream"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; - final String localVarContentType = - localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (!localVarFormParams.isEmpty() && localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - Set localVarAuthNames = new HashSet<>(); - if (HAS_TIME_UNIT) { - localVarAuthNames.add("timeUnit"); - } - return localVarApiClient.buildCall( - basePath, - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarPostBody, - localVarHeaderParams, - localVarCookieParams, - localVarFormParams, - localVarAuthNames); - } - - @Deprecated - @SuppressWarnings("rawtypes") - private okhttp3.Call startMarginUserDataStreamValidateBeforeCall() throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - ExecutableValidator executableValidator = validator.forExecutables(); - - Object[] parameterValues = {}; - Method method = this.getClass().getMethod("startMarginUserDataStream"); - Set> violations = - executableValidator.validateParameters(this, method, parameterValues); - - if (violations.size() == 0) { - return startMarginUserDataStreamCall(); - } else { - throw new ConstraintViolationException((Set) violations); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Start Margin User Data Stream (USER_STREAM) Start a new margin user data stream. The stream - * will close after 60 minutes unless a keepalive is sent. If the account has an active - * listenKey, that listenKey will be returned and its validity will be extended for 60 minutes. - * Weight: 1 - * - * @return ApiResponse<StartMarginUserDataStreamResponse> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Start Margin User Data Stream -
- * - * @deprecated - * @see Start - * Margin User Data Stream (USER_STREAM) Documentation - */ - @Deprecated - public ApiResponse startMarginUserDataStream() - throws ApiException { - okhttp3.Call localVarCall = startMarginUserDataStreamValidateBeforeCall(); - java.lang.reflect.Type localVarReturnType = - new TypeToken() {}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } -} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java index 57a224230..907f26d02 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/TransferApi.java @@ -43,7 +43,7 @@ public class TransferApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -85,7 +85,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * * @param asset (optional) * @param type Transfer Type: ROLL_IN, ROLL_OUT (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) @@ -261,7 +261,7 @@ private okhttp3.Call getCrossMarginTransferHistoryValidateBeforeCall( * * @param asset (optional) * @param type Transfer Type: ROLL_IN, ROLL_OUT (optional) - * @param startTime 只支持查询最近90天的数据 (optional) + * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) * @param current Currently querying page. Start from 1. Default:1 (optional) * @param size Default:10 Max:100 (optional) diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartIsolatedMarginUserDataStreamResponse.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginAssetRiskBasedLiquidationRatioResponse.java similarity index 57% rename from clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartIsolatedMarginUserDataStreamResponse.java rename to clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginAssetRiskBasedLiquidationRatioResponse.java index df8ed7922..73ff42abb 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/StartIsolatedMarginUserDataStreamResponse.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginAssetRiskBasedLiquidationRatioResponse.java @@ -14,11 +14,10 @@ import com.binance.connector.client.margin_trading.rest.JSON; import com.google.gson.Gson; +import com.google.gson.JsonArray; 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; @@ -27,42 +26,18 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.HashSet; import java.util.Objects; import org.hibernate.validator.constraints.*; -/** StartIsolatedMarginUserDataStreamResponse */ +/** GetMarginAssetRiskBasedLiquidationRatioResponse */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class StartIsolatedMarginUserDataStreamResponse { - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; - - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) - @jakarta.annotation.Nullable - private String listenKey; - - public StartIsolatedMarginUserDataStreamResponse() {} - - public StartIsolatedMarginUserDataStreamResponse listenKey( - @jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - return this; - } - - /** - * Get listenKey - * - * @return listenKey - */ - @jakarta.annotation.Nullable - public String getListenKey() { - return listenKey; - } - - public void setListenKey(@jakarta.annotation.Nullable String listenKey) { - this.listenKey = listenKey; - } +public class GetMarginAssetRiskBasedLiquidationRatioResponse + extends ArrayList { + public GetMarginAssetRiskBasedLiquidationRatioResponse() {} @Override public boolean equals(Object o) { @@ -72,21 +47,19 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - StartIsolatedMarginUserDataStreamResponse startIsolatedMarginUserDataStreamResponse = - (StartIsolatedMarginUserDataStreamResponse) o; - return Objects.equals(this.listenKey, startIsolatedMarginUserDataStreamResponse.listenKey); + return super.equals(o); } @Override public int hashCode() { - return Objects.hash(listenKey); + return Objects.hash(super.hashCode()); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class StartIsolatedMarginUserDataStreamResponse {\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); + sb.append("class GetMarginAssetRiskBasedLiquidationRatioResponse {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append("}"); return sb.toString(); } @@ -94,10 +67,6 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object listenKeyValue = getListenKey(); - String listenKeyValueAsString = ""; - listenKeyValueAsString = listenKeyValue.toString(); - sb.append("listenKey=").append(urlEncode(listenKeyValueAsString)).append(""); return sb.toString(); } @@ -126,7 +95,6 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("listenKey"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -137,58 +105,64 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * StartIsolatedMarginUserDataStreamResponse + * GetMarginAssetRiskBasedLiquidationRatioResponse */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected json element to be a array type in the JSON string but got" + + " `%s`", + jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for (JsonElement element : array) { + GetMarginAssetRiskBasedLiquidationRatioResponseInner.validateJsonElement(element); + } if (jsonElement == null) { - if (!StartIsolatedMarginUserDataStreamResponse.openapiRequiredFields + if (!GetMarginAssetRiskBasedLiquidationRatioResponse.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( "The required field(s) %s in" - + " StartIsolatedMarginUserDataStreamResponse is not found in" - + " the empty JSON string", - StartIsolatedMarginUserDataStreamResponse.openapiRequiredFields + + " GetMarginAssetRiskBasedLiquidationRatioResponse is not" + + " found in the empty JSON string", + GetMarginAssetRiskBasedLiquidationRatioResponse + .openapiRequiredFields .toString())); } } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("listenKey") != null && !jsonObj.get("listenKey").isJsonNull()) - && !jsonObj.get("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("listenKey").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!StartIsolatedMarginUserDataStreamResponse.class.isAssignableFrom( + if (!GetMarginAssetRiskBasedLiquidationRatioResponse.class.isAssignableFrom( type.getRawType())) { return null; // this class only serializes - // 'StartIsolatedMarginUserDataStreamResponse' and its subtypes + // 'GetMarginAssetRiskBasedLiquidationRatioResponse' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(StartIsolatedMarginUserDataStreamResponse.class)); + this, + TypeToken.get(GetMarginAssetRiskBasedLiquidationRatioResponse.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override public void write( - JsonWriter out, StartIsolatedMarginUserDataStreamResponse value) + JsonWriter out, + GetMarginAssetRiskBasedLiquidationRatioResponse value) throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); elementAdapter.write(out, obj); } @Override - public StartIsolatedMarginUserDataStreamResponse read(JsonReader in) + public GetMarginAssetRiskBasedLiquidationRatioResponse read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -199,20 +173,21 @@ public StartIsolatedMarginUserDataStreamResponse read(JsonReader in) } /** - * Create an instance of StartIsolatedMarginUserDataStreamResponse given an JSON string + * Create an instance of GetMarginAssetRiskBasedLiquidationRatioResponse given an JSON string * * @param jsonString JSON string - * @return An instance of StartIsolatedMarginUserDataStreamResponse + * @return An instance of GetMarginAssetRiskBasedLiquidationRatioResponse * @throws IOException if the JSON string is invalid with respect to - * StartIsolatedMarginUserDataStreamResponse + * GetMarginAssetRiskBasedLiquidationRatioResponse */ - public static StartIsolatedMarginUserDataStreamResponse fromJson(String jsonString) + public static GetMarginAssetRiskBasedLiquidationRatioResponse fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, StartIsolatedMarginUserDataStreamResponse.class); + return JSON.getGson() + .fromJson(jsonString, GetMarginAssetRiskBasedLiquidationRatioResponse.class); } /** - * Convert an instance of StartIsolatedMarginUserDataStreamResponse to an JSON string + * Convert an instance of GetMarginAssetRiskBasedLiquidationRatioResponse to an JSON string * * @return JSON string */ diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginAssetRiskBasedLiquidationRatioResponseInner.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginAssetRiskBasedLiquidationRatioResponseInner.java new file mode 100644 index 000000000..ce3802eaf --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginAssetRiskBasedLiquidationRatioResponseInner.java @@ -0,0 +1,282 @@ +/* + * Binance Margin Trading REST API + * OpenAPI Specification for the Binance Margin Trading REST 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.margin_trading.rest.model; + +import com.binance.connector.client.margin_trading.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetMarginAssetRiskBasedLiquidationRatioResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetMarginAssetRiskBasedLiquidationRatioResponseInner { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_RISK_BASED_LIQUIDATION_RATIO = + "riskBasedLiquidationRatio"; + + @SerializedName(SERIALIZED_NAME_RISK_BASED_LIQUIDATION_RATIO) + @jakarta.annotation.Nullable + private String riskBasedLiquidationRatio; + + public GetMarginAssetRiskBasedLiquidationRatioResponseInner() {} + + public GetMarginAssetRiskBasedLiquidationRatioResponseInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public GetMarginAssetRiskBasedLiquidationRatioResponseInner riskBasedLiquidationRatio( + @jakarta.annotation.Nullable String riskBasedLiquidationRatio) { + this.riskBasedLiquidationRatio = riskBasedLiquidationRatio; + return this; + } + + /** + * Get riskBasedLiquidationRatio + * + * @return riskBasedLiquidationRatio + */ + @jakarta.annotation.Nullable + public String getRiskBasedLiquidationRatio() { + return riskBasedLiquidationRatio; + } + + public void setRiskBasedLiquidationRatio( + @jakarta.annotation.Nullable String riskBasedLiquidationRatio) { + this.riskBasedLiquidationRatio = riskBasedLiquidationRatio; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMarginAssetRiskBasedLiquidationRatioResponseInner + getMarginAssetRiskBasedLiquidationRatioResponseInner = + (GetMarginAssetRiskBasedLiquidationRatioResponseInner) o; + return Objects.equals( + this.asset, getMarginAssetRiskBasedLiquidationRatioResponseInner.asset) + && Objects.equals( + this.riskBasedLiquidationRatio, + getMarginAssetRiskBasedLiquidationRatioResponseInner + .riskBasedLiquidationRatio); + } + + @Override + public int hashCode() { + return Objects.hash(asset, riskBasedLiquidationRatio); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMarginAssetRiskBasedLiquidationRatioResponseInner {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" riskBasedLiquidationRatio: ") + .append(toIndentedString(riskBasedLiquidationRatio)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object riskBasedLiquidationRatioValue = getRiskBasedLiquidationRatio(); + String riskBasedLiquidationRatioValueAsString = ""; + riskBasedLiquidationRatioValueAsString = riskBasedLiquidationRatioValue.toString(); + sb.append("riskBasedLiquidationRatio=") + .append(urlEncode(riskBasedLiquidationRatioValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("asset"); + openapiFields.add("riskBasedLiquidationRatio"); + + // 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 + * GetMarginAssetRiskBasedLiquidationRatioResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetMarginAssetRiskBasedLiquidationRatioResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetMarginAssetRiskBasedLiquidationRatioResponseInner is not" + + " found in the empty JSON string", + GetMarginAssetRiskBasedLiquidationRatioResponseInner + .openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("riskBasedLiquidationRatio") != null + && !jsonObj.get("riskBasedLiquidationRatio").isJsonNull()) + && !jsonObj.get("riskBasedLiquidationRatio").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `riskBasedLiquidationRatio` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("riskBasedLiquidationRatio").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMarginAssetRiskBasedLiquidationRatioResponseInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetMarginAssetRiskBasedLiquidationRatioResponseInner' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get( + GetMarginAssetRiskBasedLiquidationRatioResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetMarginAssetRiskBasedLiquidationRatioResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMarginAssetRiskBasedLiquidationRatioResponseInner read( + JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetMarginAssetRiskBasedLiquidationRatioResponseInner given an JSON + * string + * + * @param jsonString JSON string + * @return An instance of GetMarginAssetRiskBasedLiquidationRatioResponseInner + * @throws IOException if the JSON string is invalid with respect to + * GetMarginAssetRiskBasedLiquidationRatioResponseInner + */ + public static GetMarginAssetRiskBasedLiquidationRatioResponseInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetMarginAssetRiskBasedLiquidationRatioResponseInner.class); + } + + /** + * Convert an instance of GetMarginAssetRiskBasedLiquidationRatioResponseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java index cd0f9cace..b58ee6760 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/MarginTradingWebSocketStreamsUtil.java @@ -7,11 +7,15 @@ public class MarginTradingWebSocketStreamsUtil { private static final boolean HAS_TIME_UNIT = false; public static WebSocketClientConfiguration getClientConfiguration() { + return getClientConfiguration(""); + } + + public static WebSocketClientConfiguration getClientConfiguration(String path) { WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); if (!HAS_TIME_UNIT) { clientConfiguration.setTimeUnit(null); } - clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setUrl(BASE_URL + path + "/stream"); clientConfiguration.setAutoLogon(false); return clientConfiguration; } diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java index d1b66a94c..de0a5b429 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java @@ -20,7 +20,7 @@ public class MarginTradingWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-margin-trading/5.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/margin-trading/src/test/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApiTest.java b/clients/margin-trading/src/test/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApiTest.java deleted file mode 100644 index 5ada4119a..000000000 --- a/clients/margin-trading/src/test/java/com/binance/connector/client/margin_trading/rest/api/TradeDataStreamApiTest.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Binance Margin Trading REST API - * OpenAPI Specification for the Binance Margin Trading REST 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.margin_trading.rest.api; - -import static org.junit.Assert.assertEquals; - -import com.binance.connector.client.common.ApiClient; -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.ApiResponse; -import com.binance.connector.client.common.auth.BinanceAuthenticationFactory; -import com.binance.connector.client.common.auth.SignatureAuthentication; -import com.binance.connector.client.common.configuration.ClientConfiguration; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.sign.HmacSignatureGenerator; -import com.binance.connector.client.common.sign.SignatureGenerator; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveIsolatedMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.KeepaliveMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamRequest; -import com.binance.connector.client.margin_trading.rest.model.StartIsolatedMarginUserDataStreamResponse; -import com.binance.connector.client.margin_trading.rest.model.StartMarginUserDataStreamResponse; -import jakarta.validation.constraints.*; -import okhttp3.Call; -import okhttp3.Request; -import org.bouncycastle.crypto.CryptoException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -/** API tests for TradeDataStreamApi */ -public class TradeDataStreamApiTest { - - private TradeDataStreamApi api; - private ApiClient apiClientSpy; - private SignatureGenerator signatureGeneratorSpy; - - @BeforeEach - public void initApiClient() throws ApiException { - ClientConfiguration clientConfiguration = new ClientConfiguration(); - clientConfiguration.setUrl("http://localhost:8080"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setSecretKey("secretKey"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - - HmacSignatureGenerator signatureGenerator = - new HmacSignatureGenerator(signatureConfiguration.getSecretKey()); - signatureGeneratorSpy = Mockito.spy(signatureGenerator); - SignatureAuthentication signatureAuthentication = - new SignatureAuthentication( - signatureConfiguration.getApiKey(), signatureGeneratorSpy); - SignatureAuthentication authenticationSpy = Mockito.spy(signatureAuthentication); - Mockito.doReturn("1736393892000").when(authenticationSpy).buildTimestamp(); - - BinanceAuthenticationFactory factoryMock = Mockito.mock(BinanceAuthenticationFactory.class); - Mockito.doReturn(authenticationSpy) - .when(factoryMock) - .getAuthentication(signatureConfiguration); - - ApiClient apiClient = new ApiClient(clientConfiguration, factoryMock); - - apiClientSpy = Mockito.spy(apiClient); - Mockito.doReturn(new ApiResponse<>(200, null)) - .when(apiClientSpy) - .execute(Mockito.any(), Mockito.any(java.lang.reflect.Type.class)); - Mockito.doReturn(new ApiResponse<>(200, null)).when(apiClientSpy).execute(Mockito.any()); - Mockito.doReturn("1736393892000").when(apiClientSpy).buildTimestamp(); - - api = new TradeDataStreamApi(apiClientSpy); - } - - /** - * Close Isolated Margin User Data Stream (USER_STREAM) - * - *

Close out a isolated margin user data stream. Weight: 3000 - * - * @throws ApiException if the Api call fails - */ - @Test - public void closeIsolatedMarginUserDataStreamTest() throws ApiException, CryptoException { - String symbol = ""; - String listenkey = ""; - api.closeIsolatedMarginUserDataStream(symbol, listenkey); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/userDataStream/isolated", actualRequest.url().encodedPath()); - } - - /** - * Close Margin User Data Stream (USER_STREAM) - * - *

Close out a Margin user data stream. Weight: 3000 - * - * @throws ApiException if the Api call fails - */ - @Test - public void closeMarginUserDataStreamTest() throws ApiException, CryptoException { - String listenkey = ""; - api.closeMarginUserDataStream(listenkey); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/userDataStream", actualRequest.url().encodedPath()); - } - - /** - * Keepalive Isolated Margin User Data Stream (USER_STREAM) - * - *

Keepalive an isolated margin user data stream to prevent a time out. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void keepaliveIsolatedMarginUserDataStreamTest() throws ApiException, CryptoException { - KeepaliveIsolatedMarginUserDataStreamRequest keepaliveIsolatedMarginUserDataStreamRequest = - new KeepaliveIsolatedMarginUserDataStreamRequest(); - - keepaliveIsolatedMarginUserDataStreamRequest.symbol(""); - keepaliveIsolatedMarginUserDataStreamRequest.listenKey(""); - - api.keepaliveIsolatedMarginUserDataStream(keepaliveIsolatedMarginUserDataStreamRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/userDataStream/isolated", actualRequest.url().encodedPath()); - } - - /** - * Keepalive Margin User Data Stream (USER_STREAM) - * - *

Keepalive a margin user data stream to prevent a time out. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void keepaliveMarginUserDataStreamTest() throws ApiException, CryptoException { - KeepaliveMarginUserDataStreamRequest keepaliveMarginUserDataStreamRequest = - new KeepaliveMarginUserDataStreamRequest(); - - keepaliveMarginUserDataStreamRequest.listenKey(""); - - api.keepaliveMarginUserDataStream(keepaliveMarginUserDataStreamRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy).execute(callArgumentCaptor.capture()); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/userDataStream", actualRequest.url().encodedPath()); - } - - /** - * Start Isolated Margin User Data Stream (USER_STREAM) - * - *

Start a new isolated margin user data stream. The stream will close after 60 minutes - * unless a keepalive is sent. If the account has an active listenKey, that listenKey will be - * returned and its validity will be extended for 60 minutes. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void startIsolatedMarginUserDataStreamTest() throws ApiException, CryptoException { - StartIsolatedMarginUserDataStreamRequest startIsolatedMarginUserDataStreamRequest = - new StartIsolatedMarginUserDataStreamRequest(); - - startIsolatedMarginUserDataStreamRequest.symbol(""); - - ApiResponse response = - api.startIsolatedMarginUserDataStream(startIsolatedMarginUserDataStreamRequest); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/userDataStream/isolated", actualRequest.url().encodedPath()); - } - - /** - * Start Margin User Data Stream (USER_STREAM) - * - *

Start a new margin user data stream. The stream will close after 60 minutes unless a - * keepalive is sent. If the account has an active listenKey, that listenKey will be returned - * and its validity will be extended for 60 minutes. Weight: 1 - * - * @throws ApiException if the Api call fails - */ - @Test - public void startMarginUserDataStreamTest() throws ApiException, CryptoException { - ApiResponse response = api.startMarginUserDataStream(); - - ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); - Mockito.verify(apiClientSpy) - .execute(callArgumentCaptor.capture(), Mockito.any(java.lang.reflect.Type.class)); - - Call captorValue = callArgumentCaptor.getValue(); - Request actualRequest = captorValue.request(); - - assertEquals(null, actualRequest.url().queryParameter("signature")); - assertEquals("/sapi/v1/userDataStream", actualRequest.url().encodedPath()); - } -} diff --git a/clients/mining/CHANGELOG.md b/clients/mining/CHANGELOG.md index 28d9d543b..b7d6b3285 100644 --- a/clients/mining/CHANGELOG.md +++ b/clients/mining/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog +## 3.0.0 - 2026-02-12 + +### Changed (2) + +- Deleted parameter `userName` + - affected methods: + - `hashrateResaleDetail()` (`GET /sapi/v1/mining/hash-transfer/profit/details`) +- Modified response for `hashrateResaleList()` (`GET /sapi/v1/mining/hash-transfer/config/details/list`): + - `data`.`configDetails`.items: property `type` added + - `data`.`configDetails`.items: item property `type` added + ## 2.1.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/mining/docs/HashrateResaleListResponseDataConfigDetailsInner.md b/clients/mining/docs/HashrateResaleListResponseDataConfigDetailsInner.md index e9d59c049..e24933a63 100644 --- a/clients/mining/docs/HashrateResaleListResponseDataConfigDetailsInner.md +++ b/clients/mining/docs/HashrateResaleListResponseDataConfigDetailsInner.md @@ -15,6 +15,7 @@ |**startDay** | **Long** | | [optional] | |**endDay** | **Long** | | [optional] | |**status** | **Long** | | [optional] | +|**type** | **Long** | | [optional] | diff --git a/clients/mining/docs/MiningApi.md b/clients/mining/docs/MiningApi.md index 989c4815f..00f72e5ad 100644 --- a/clients/mining/docs/MiningApi.md +++ b/clients/mining/docs/MiningApi.md @@ -417,7 +417,7 @@ No authorization required # **hashrateResaleDetail** -> HashrateResaleDetailResponse hashrateResaleDetail(configId, userName, pageIndex, pageSize, recvWindow) +> HashrateResaleDetailResponse hashrateResaleDetail(configId, pageIndex, pageSize, recvWindow) Hashrate Resale Detail(USER_DATA) @@ -439,12 +439,11 @@ public class Example { MiningApi apiInstance = new MiningApi(defaultClient); Long configId = 56L; // Long | Mining ID 168 - String userName = "userName_example"; // String | Mining account test Long pageIndex = 56L; // Long | Page number, empty default first page, starting from 1 Long pageSize = 56L; // Long | Min 10,Max 200 Long recvWindow = 56L; // Long | try { - HashrateResaleDetailResponse result = apiInstance.hashrateResaleDetail(configId, userName, pageIndex, pageSize, recvWindow); + HashrateResaleDetailResponse result = apiInstance.hashrateResaleDetail(configId, pageIndex, pageSize, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MiningApi#hashrateResaleDetail"); @@ -462,7 +461,6 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **configId** | **Long**| Mining ID 168 | | -| **userName** | **String**| Mining account test | | | **pageIndex** | **Long**| Page number, empty default first page, starting from 1 | [optional] | | **pageSize** | **Long**| Min 10,Max 200 | [optional] | | **recvWindow** | **Long**| | [optional] | diff --git a/clients/mining/docs/rest-api/migration-guide.md b/clients/mining/docs/rest-api/migration-guide.md index 8a4bf5aa5..56bd96e78 100644 --- a/clients/mining/docs/rest-api/migration-guide.md +++ b/clients/mining/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-mining - 2.1.1 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-mining - 2.1.1 + 3.0.0 ``` diff --git a/clients/mining/pom.xml b/clients/mining/pom.xml index 87772e0d3..ce7b01648 100644 --- a/clients/mining/pom.xml +++ b/clients/mining/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-mining mining - 2.1.1 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.3.1 \ No newline at end of file diff --git a/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningApi.java b/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningApi.java index 42229f4d0..48110aed0 100644 --- a/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningApi.java +++ b/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningApi.java @@ -57,7 +57,7 @@ public class MiningApi { private static final String USER_AGENT = String.format( - "binance-mining/2.1.1 (Java/%s; %s; %s)", + "binance-mining/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1077,7 +1077,6 @@ public ApiResponse extraBonusList( * Build call for hashrateResaleDetail * * @param configId Mining ID 168 (required) - * @param userName Mining account test (required) * @param pageIndex Page number, empty default first page, starting from 1 (optional) * @param pageSize Min 10,Max 200 (optional) * @param recvWindow (optional) @@ -1095,8 +1094,7 @@ public ApiResponse extraBonusList( * Resale Detail(USER_DATA) Documentation */ private okhttp3.Call hashrateResaleDetailCall( - Long configId, String userName, Long pageIndex, Long pageSize, Long recvWindow) - throws ApiException { + Long configId, Long pageIndex, Long pageSize, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1125,10 +1123,6 @@ private okhttp3.Call hashrateResaleDetailCall( localVarQueryParams.addAll(localVarApiClient.parameterToPair("configId", configId)); } - if (userName != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("userName", userName)); - } - if (pageIndex != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageIndex", pageIndex)); } @@ -1173,8 +1167,7 @@ private okhttp3.Call hashrateResaleDetailCall( @SuppressWarnings("rawtypes") private okhttp3.Call hashrateResaleDetailValidateBeforeCall( - Long configId, String userName, Long pageIndex, Long pageSize, Long recvWindow) - throws ApiException { + Long configId, Long pageIndex, Long pageSize, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1184,13 +1177,12 @@ private okhttp3.Call hashrateResaleDetailValidateBeforeCall( .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {configId, userName, pageIndex, pageSize, recvWindow}; + Object[] parameterValues = {configId, pageIndex, pageSize, recvWindow}; Method method = this.getClass() .getMethod( "hashrateResaleDetail", Long.class, - String.class, Long.class, Long.class, Long.class); @@ -1198,8 +1190,7 @@ private okhttp3.Call hashrateResaleDetailValidateBeforeCall( executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return hashrateResaleDetailCall( - configId, userName, pageIndex, pageSize, recvWindow); + return hashrateResaleDetailCall(configId, pageIndex, pageSize, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -1216,7 +1207,6 @@ private okhttp3.Call hashrateResaleDetailValidateBeforeCall( * Hashrate Resale Detail(USER_DATA) Hashrate Resale Detail(USER_DATA) Weight: 5 * * @param configId Mining ID 168 (required) - * @param userName Mining account test (required) * @param pageIndex Page number, empty default first page, starting from 1 (optional) * @param pageSize Min 10,Max 200 (optional) * @param recvWindow (optional) @@ -1235,15 +1225,10 @@ private okhttp3.Call hashrateResaleDetailValidateBeforeCall( * Resale Detail(USER_DATA) Documentation */ public ApiResponse hashrateResaleDetail( - @NotNull Long configId, - @NotNull String userName, - Long pageIndex, - Long pageSize, - Long recvWindow) + @NotNull Long configId, Long pageIndex, Long pageSize, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - hashrateResaleDetailValidateBeforeCall( - configId, userName, pageIndex, pageSize, recvWindow); + hashrateResaleDetailValidateBeforeCall(configId, pageIndex, pageSize, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); diff --git a/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningRestApi.java b/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningRestApi.java index 20123a1a8..205b60617 100644 --- a/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningRestApi.java +++ b/clients/mining/src/main/java/com/binance/connector/client/mining/rest/api/MiningRestApi.java @@ -204,7 +204,6 @@ public ApiResponse extraBonusList( * Hashrate Resale Detail(USER_DATA) Hashrate Resale Detail(USER_DATA) Weight: 5 * * @param configId Mining ID 168 (required) - * @param userName Mining account test (required) * @param pageIndex Page number, empty default first page, starting from 1 (optional) * @param pageSize Min 10,Max 200 (optional) * @param recvWindow (optional) @@ -223,9 +222,8 @@ public ApiResponse extraBonusList( * Resale Detail(USER_DATA) Documentation */ public ApiResponse hashrateResaleDetail( - Long configId, String userName, Long pageIndex, Long pageSize, Long recvWindow) - throws ApiException { - return miningApi.hashrateResaleDetail(configId, userName, pageIndex, pageSize, recvWindow); + Long configId, Long pageIndex, Long pageSize, Long recvWindow) throws ApiException { + return miningApi.hashrateResaleDetail(configId, pageIndex, pageSize, recvWindow); } /** diff --git a/clients/mining/src/main/java/com/binance/connector/client/mining/rest/model/HashrateResaleListResponseDataConfigDetailsInner.java b/clients/mining/src/main/java/com/binance/connector/client/mining/rest/model/HashrateResaleListResponseDataConfigDetailsInner.java index 9470c4a72..968053402 100644 --- a/clients/mining/src/main/java/com/binance/connector/client/mining/rest/model/HashrateResaleListResponseDataConfigDetailsInner.java +++ b/clients/mining/src/main/java/com/binance/connector/client/mining/rest/model/HashrateResaleListResponseDataConfigDetailsInner.java @@ -84,6 +84,12 @@ public class HashrateResaleListResponseDataConfigDetailsInner { @jakarta.annotation.Nullable private Long status; + public static final String SERIALIZED_NAME_TYPE = "type"; + + @SerializedName(SERIALIZED_NAME_TYPE) + @jakarta.annotation.Nullable + private Long type; + public HashrateResaleListResponseDataConfigDetailsInner() {} public HashrateResaleListResponseDataConfigDetailsInner configId( @@ -246,6 +252,26 @@ public void setStatus(@jakarta.annotation.Nullable Long status) { this.status = status; } + public HashrateResaleListResponseDataConfigDetailsInner type( + @jakarta.annotation.Nullable Long type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @jakarta.annotation.Nullable + public Long getType() { + return type; + } + + public void setType(@jakarta.annotation.Nullable Long type) { + this.type = type; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -274,7 +300,8 @@ public boolean equals(Object o) { && Objects.equals( this.endDay, hashrateResaleListResponseDataConfigDetailsInner.endDay) && Objects.equals( - this.status, hashrateResaleListResponseDataConfigDetailsInner.status); + this.status, hashrateResaleListResponseDataConfigDetailsInner.status) + && Objects.equals(this.type, hashrateResaleListResponseDataConfigDetailsInner.type); } @Override @@ -287,7 +314,8 @@ public int hashCode() { hashRate, startDay, endDay, - status); + status, + type); } @Override @@ -302,6 +330,7 @@ public String toString() { sb.append(" startDay: ").append(toIndentedString(startDay)).append("\n"); sb.append(" endDay: ").append(toIndentedString(endDay)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -341,6 +370,10 @@ public String toUrlQueryString() { String statusValueAsString = ""; statusValueAsString = statusValue.toString(); sb.append("status=").append(urlEncode(statusValueAsString)).append(""); + Object typeValue = getType(); + String typeValueAsString = ""; + typeValueAsString = typeValue.toString(); + sb.append("type=").append(urlEncode(typeValueAsString)).append(""); return sb.toString(); } @@ -377,6 +410,7 @@ private String toIndentedString(Object o) { openapiFields.add("startDay"); openapiFields.add("endDay"); openapiFields.add("status"); + openapiFields.add("type"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/mining/src/test/java/com/binance/connector/client/mining/rest/api/MiningApiTest.java b/clients/mining/src/test/java/com/binance/connector/client/mining/rest/api/MiningApiTest.java index 777c79faa..2c774af80 100644 --- a/clients/mining/src/test/java/com/binance/connector/client/mining/rest/api/MiningApiTest.java +++ b/clients/mining/src/test/java/com/binance/connector/client/mining/rest/api/MiningApiTest.java @@ -292,12 +292,11 @@ public void extraBonusListTest() throws ApiException, CryptoException { @Test public void hashrateResaleDetailTest() throws ApiException, CryptoException { Long configId = 1L; - String userName = ""; Long pageIndex = 1L; Long pageSize = 0L; Long recvWindow = 5000L; ApiResponse response = - api.hashrateResaleDetail(configId, userName, pageIndex, pageSize, recvWindow); + api.hashrateResaleDetail(configId, pageIndex, pageSize, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -310,10 +309,10 @@ public void hashrateResaleDetailTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "configId=1&userName=&pageIndex=1&pageSize=0&recvWindow=5000×tamp=1736393892000", + "configId=1&pageIndex=1&pageSize=0&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "b103a00035916bdb8dda3e3a55f6af838e11a6a38aab27a2dd32367be83b547b", + "9c805c6c53b91db70e29b00b8a524eefa85aa8a2df6112589da273da49ebb200", actualRequest.url().queryParameter("signature")); assertEquals( "/sapi/v1/mining/hash-transfer/profit/details", actualRequest.url().encodedPath()); diff --git a/clients/simple-earn/CHANGELOG.md b/clients/simple-earn/CHANGELOG.md index a73fde371..eec2cb95b 100644 --- a/clients/simple-earn/CHANGELOG.md +++ b/clients/simple-earn/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 5.0.0 - 2026-02-12 + +### Changed (1) + +- Modified response for `getBfusdQuotaDetails()` (`GET /sapi/v1/bfusd/quota`): + - property `redeemEnable` deleted + - property `subscribeEnable` deleted + ## 4.0.0 - 2025-12-16 ### Added (8) diff --git a/clients/simple-earn/docs/GetBfusdQuotaDetailsResponse.md b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponse.md index 79cdd0b0a..3eb684ac9 100644 --- a/clients/simple-earn/docs/GetBfusdQuotaDetailsResponse.md +++ b/clients/simple-earn/docs/GetBfusdQuotaDetailsResponse.md @@ -9,8 +9,6 @@ |------------ | ------------- | ------------- | -------------| |**fastRedemptionQuota** | [**GetBfusdQuotaDetailsResponseFastRedemptionQuota**](GetBfusdQuotaDetailsResponseFastRedemptionQuota.md) | | [optional] | |**standardRedemptionQuota** | [**GetBfusdQuotaDetailsResponseStandardRedemptionQuota**](GetBfusdQuotaDetailsResponseStandardRedemptionQuota.md) | | [optional] | -|**subscribeEnable** | **Boolean** | | [optional] | -|**redeemEnable** | **Boolean** | | [optional] | diff --git a/clients/simple-earn/docs/rest-api/migration-guide.md b/clients/simple-earn/docs/rest-api/migration-guide.md index df9630768..e2bd5dcf1 100644 --- a/clients/simple-earn/docs/rest-api/migration-guide.md +++ b/clients/simple-earn/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-simple-earn - 4.0.0 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-simple-earn - 4.0.0 + 5.0.0 ``` diff --git a/clients/simple-earn/pom.xml b/clients/simple-earn/pom.xml index 155b4c9db..76e72c81d 100644 --- a/clients/simple-earn/pom.xml +++ b/clients/simple-earn/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-simple-earn simple-earn - 4.0.0 + 5.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/BfusdApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/BfusdApi.java index d6ca30ca6..d62f75cd3 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/BfusdApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/BfusdApi.java @@ -53,7 +53,7 @@ public class BfusdApi { private static final String USER_AGENT = String.format( - "binance-simple-earn/4.0.0 (Java/%s; %s; %s)", + "binance-simple-earn/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java index de236c507..501608bd9 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/FlexibleLockedApi.java @@ -74,7 +74,7 @@ public class FlexibleLockedApi { private static final String USER_AGENT = String.format( - "binance-simple-earn/4.0.0 (Java/%s; %s; %s)", + "binance-simple-earn/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java index d250a1ef3..84db97889 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/api/RwusdApi.java @@ -53,7 +53,7 @@ public class RwusdApi { private static final String USER_AGENT = String.format( - "binance-simple-earn/4.0.0 (Java/%s; %s; %s)", + "binance-simple-earn/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponse.java b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponse.java index aa33250f1..f8d60f3ac 100644 --- a/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponse.java +++ b/clients/simple-earn/src/main/java/com/binance/connector/client/simple_earn/rest/model/GetBfusdQuotaDetailsResponse.java @@ -50,18 +50,6 @@ public class GetBfusdQuotaDetailsResponse { @jakarta.annotation.Nullable private GetBfusdQuotaDetailsResponseStandardRedemptionQuota standardRedemptionQuota; - public static final String SERIALIZED_NAME_SUBSCRIBE_ENABLE = "subscribeEnable"; - - @SerializedName(SERIALIZED_NAME_SUBSCRIBE_ENABLE) - @jakarta.annotation.Nullable - private Boolean subscribeEnable; - - public static final String SERIALIZED_NAME_REDEEM_ENABLE = "redeemEnable"; - - @SerializedName(SERIALIZED_NAME_REDEEM_ENABLE) - @jakarta.annotation.Nullable - private Boolean redeemEnable; - public GetBfusdQuotaDetailsResponse() {} public GetBfusdQuotaDetailsResponse fastRedemptionQuota( @@ -112,46 +100,6 @@ public void setStandardRedemptionQuota( this.standardRedemptionQuota = standardRedemptionQuota; } - public GetBfusdQuotaDetailsResponse subscribeEnable( - @jakarta.annotation.Nullable Boolean subscribeEnable) { - this.subscribeEnable = subscribeEnable; - return this; - } - - /** - * Get subscribeEnable - * - * @return subscribeEnable - */ - @jakarta.annotation.Nullable - public Boolean getSubscribeEnable() { - return subscribeEnable; - } - - public void setSubscribeEnable(@jakarta.annotation.Nullable Boolean subscribeEnable) { - this.subscribeEnable = subscribeEnable; - } - - public GetBfusdQuotaDetailsResponse redeemEnable( - @jakarta.annotation.Nullable Boolean redeemEnable) { - this.redeemEnable = redeemEnable; - return this; - } - - /** - * Get redeemEnable - * - * @return redeemEnable - */ - @jakarta.annotation.Nullable - public Boolean getRedeemEnable() { - return redeemEnable; - } - - public void setRedeemEnable(@jakarta.annotation.Nullable Boolean redeemEnable) { - this.redeemEnable = redeemEnable; - } - @Override public boolean equals(Object o) { if (this == o) { @@ -166,16 +114,12 @@ public boolean equals(Object o) { this.fastRedemptionQuota, getBfusdQuotaDetailsResponse.fastRedemptionQuota) && Objects.equals( this.standardRedemptionQuota, - getBfusdQuotaDetailsResponse.standardRedemptionQuota) - && Objects.equals( - this.subscribeEnable, getBfusdQuotaDetailsResponse.subscribeEnable) - && Objects.equals(this.redeemEnable, getBfusdQuotaDetailsResponse.redeemEnable); + getBfusdQuotaDetailsResponse.standardRedemptionQuota); } @Override public int hashCode() { - return Objects.hash( - fastRedemptionQuota, standardRedemptionQuota, subscribeEnable, redeemEnable); + return Objects.hash(fastRedemptionQuota, standardRedemptionQuota); } @Override @@ -188,8 +132,6 @@ public String toString() { sb.append(" standardRedemptionQuota: ") .append(toIndentedString(standardRedemptionQuota)) .append("\n"); - sb.append(" subscribeEnable: ").append(toIndentedString(subscribeEnable)).append("\n"); - sb.append(" redeemEnable: ").append(toIndentedString(redeemEnable)).append("\n"); sb.append("}"); return sb.toString(); } @@ -209,14 +151,6 @@ public String toUrlQueryString() { sb.append("standardRedemptionQuota=") .append(urlEncode(standardRedemptionQuotaValueAsString)) .append(""); - Object subscribeEnableValue = getSubscribeEnable(); - String subscribeEnableValueAsString = ""; - subscribeEnableValueAsString = subscribeEnableValue.toString(); - sb.append("subscribeEnable=").append(urlEncode(subscribeEnableValueAsString)).append(""); - Object redeemEnableValue = getRedeemEnable(); - String redeemEnableValueAsString = ""; - redeemEnableValueAsString = redeemEnableValue.toString(); - sb.append("redeemEnable=").append(urlEncode(redeemEnableValueAsString)).append(""); return sb.toString(); } @@ -247,8 +181,6 @@ private String toIndentedString(Object o) { openapiFields = new HashSet(); openapiFields.add("fastRedemptionQuota"); openapiFields.add("standardRedemptionQuota"); - openapiFields.add("subscribeEnable"); - openapiFields.add("redeemEnable"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index c75fbc7f3..4b58dfba3 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 9.0.0 - 2026-02-12 + +### Added (1) + +#### WebSocket API + +- `orderAmendKeepPriority()` (`order.amend.keepPriority` method) + +### Changed (1) + +#### WebSocket API + +- Added parameter `recvWindow` + - affected methods: + - `userDataStreamSubscribeSignature()` (`userDataStream.subscribe.signature` method) + ## 8.0.0 - 2025-12-31 ### Added (4) diff --git a/clients/spot/docs/OrderAmendmentsRequest.md b/clients/spot/docs/OrderAmendmentsRequest.md index 79f6c8700..2e311b11a 100644 --- a/clients/spot/docs/OrderAmendmentsRequest.md +++ b/clients/spot/docs/OrderAmendmentsRequest.md @@ -10,7 +10,7 @@ |**symbol** | **String** | | | |**orderId** | **Long** | | | |**fromExecutionId** | **Long** | | [optional] | -|**limit** | **Integer** | | [optional] | +|**limit** | **Long** | | [optional] | |**recvWindow** | **Double** | | [optional] | diff --git a/clients/spot/docs/TradesAggregateRequest.md b/clients/spot/docs/TradesAggregateRequest.md index f4b7c515b..b85f5fdcd 100644 --- a/clients/spot/docs/TradesAggregateRequest.md +++ b/clients/spot/docs/TradesAggregateRequest.md @@ -8,10 +8,10 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**symbol** | **String** | | | -|**fromId** | **Integer** | | [optional] | +|**fromId** | **Long** | | [optional] | |**startTime** | **Long** | | [optional] | |**endTime** | **Long** | | [optional] | -|**limit** | **Integer** | | [optional] | +|**limit** | **Long** | | [optional] | diff --git a/clients/spot/docs/UserDataStreamApi.md b/clients/spot/docs/UserDataStreamApi.md index c761102b0..3d1caa4d1 100644 --- a/clients/spot/docs/UserDataStreamApi.md +++ b/clients/spot/docs/UserDataStreamApi.md @@ -128,7 +128,7 @@ No authorization required # **userDataStreamSubscribeSignature** -> UserDataStreamSubscribeSignatureResponse userDataStreamSubscribeSignature() +> UserDataStreamSubscribeSignatureResponse userDataStreamSubscribeSignature(userDataStreamSubscribeSignatureRequest) WebSocket Subscribe to User Data Stream through signature subscription @@ -149,8 +149,9 @@ public class Example { defaultClient.setBasePath("http://localhost"); UserDataStreamApi apiInstance = new UserDataStreamApi(defaultClient); + UserDataStreamSubscribeSignatureRequest userDataStreamSubscribeSignatureRequest = new UserDataStreamSubscribeSignatureRequest(); // UserDataStreamSubscribeSignatureRequest | try { - UserDataStreamSubscribeSignatureResponse result = apiInstance.userDataStreamSubscribeSignature(); + UserDataStreamSubscribeSignatureResponse result = apiInstance.userDataStreamSubscribeSignature(userDataStreamSubscribeSignatureRequest); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserDataStreamApi#userDataStreamSubscribeSignature"); @@ -164,7 +165,10 @@ public class Example { ``` ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userDataStreamSubscribeSignatureRequest** | [**UserDataStreamSubscribeSignatureRequest**](UserDataStreamSubscribeSignatureRequest.md)| | [optional] | ### Return type @@ -176,7 +180,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -190,7 +194,7 @@ No authorization required WebSocket Unsubscribe from User Data Stream -Stop listening to the User Data Stream in the current WebSocket connection. Note that `session.logout` will only close the subscription created with `userdataStream.subscribe` but not subscriptions opened with `userDataStream.subscribe.signature`. Weight: 2 +Stop listening to the User Data Stream in the current WebSocket connection. Note that `session.logout` will only close the subscription created with `userDataStream.subscribe` but not subscriptions opened with `userDataStream.subscribe.signature`. Weight: 2 ### Example ```java diff --git a/clients/spot/docs/UserDataStreamSubscribeSignatureRequest.md b/clients/spot/docs/UserDataStreamSubscribeSignatureRequest.md new file mode 100644 index 000000000..6b40648ed --- /dev/null +++ b/clients/spot/docs/UserDataStreamSubscribeSignatureRequest.md @@ -0,0 +1,13 @@ + + +# UserDataStreamSubscribeSignatureRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**recvWindow** | **Double** | | [optional] | + + + diff --git a/clients/spot/docs/rest-api/migration-guide.md b/clients/spot/docs/rest-api/migration-guide.md index 551cd0af1..0396f3ac6 100644 --- a/clients/spot/docs/rest-api/migration-guide.md +++ b/clients/spot/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-spot - 8.0.0 + 9.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-spot - 8.0.0 + 9.0.0 ``` diff --git a/clients/spot/example_websocket_api.md b/clients/spot/example_websocket_api.md index e541aa276..98a5f27a2 100644 --- a/clients/spot/example_websocket_api.md +++ b/clients/spot/example_websocket_api.md @@ -54,7 +54,7 @@ [ticker](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#rolling-window-price-change-statistics) - ticker - [TickerExample.java:51](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerExample.java#L51) -[ticker.24hr](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#24hr-ticker-price-change-statistics) - ticker24hr - [HrExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java#L54) +[ticker.24hr](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#24hr-ticker-price-change-statistics) - ticker24hr - [Ticker24hrExample.java:54](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/Ticker24hrExample.java#L54) [ticker.book](https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#symbol-order-book-ticker) - tickerBook - [TickerBookExample.java:52](/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/TickerBookExample.java#L52) diff --git a/clients/spot/pom.xml b/clients/spot/pom.xml index 37a0d6264..3a6b1b035 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-spot spot - 8.0.0 + 9.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.3.1 \ No newline at end of file diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java index 3b6201e16..fe6da5d1e 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/AccountApi.java @@ -56,7 +56,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-spot/8.0.0 (Java/%s; %s; %s)", + "binance-spot/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java index 7f9995836..fc5e3a489 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/GeneralApi.java @@ -47,7 +47,7 @@ public class GeneralApi { private static final String USER_AGENT = String.format( - "binance-spot/8.0.0 (Java/%s; %s; %s)", + "binance-spot/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java index 6b3fd7929..8802f3904 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/MarketApi.java @@ -59,7 +59,7 @@ public class MarketApi { private static final String USER_AGENT = String.format( - "binance-spot/8.0.0 (Java/%s; %s; %s)", + "binance-spot/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java index b0cb51944..d66a55291 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/rest/api/TradeApi.java @@ -71,7 +71,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-spot/8.0.0 (Java/%s; %s; %s)", + "binance-spot/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = true; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java index 77ef42fca..3cfc8b00d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/JSON.java @@ -1080,6 +1080,9 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .UserDataStreamSubscribeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.spot.websocket.api.model + .UserDataStreamSubscribeSignatureRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.spot.websocket.api.model .UserDataStreamSubscribeSignatureResponse.CustomTypeAdapterFactory()); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java index 81307c46a..cf2b55f4d 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/SpotWebSocketApi.java @@ -101,6 +101,7 @@ import com.binance.connector.client.spot.websocket.api.model.UiKlinesResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; @@ -111,7 +112,7 @@ public class SpotWebSocketApi { private static final String USER_AGENT = String.format( - "binance-spot/8.0.0 (Java/%s; %s; %s)", + "binance-spot/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private AccountApi accountApi; @@ -392,8 +393,11 @@ public CompletableFuture sessionSubscriptions() } public StreamResponse - userDataStreamSubscribeSignature() throws ApiException { - return userDataStreamApi.userDataStreamSubscribeSignature(); + userDataStreamSubscribeSignature( + UserDataStreamSubscribeSignatureRequest userDataStreamSubscribeSignatureRequest) + throws ApiException { + return userDataStreamApi.userDataStreamSubscribeSignature( + userDataStreamSubscribeSignatureRequest); } public CompletableFuture userDataStreamUnsubscribe( diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java index b2dd9c3d8..0bbac4fd8 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApi.java @@ -24,6 +24,7 @@ import com.binance.connector.client.spot.websocket.api.model.SessionSubscriptionsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeResponse; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureResponse; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamUnsubscribeResponse; @@ -138,6 +139,7 @@ private void userDataStreamSubscribeValidateBeforeCall() throws ApiException {} /** * WebSocket Subscribe to User Data Stream through signature subscription Weight: 2 * + * @param userDataStreamSubscribeSignatureRequest (optional) * @return UserDataStreamSubscribeSignatureResponse * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the * response body @@ -153,17 +155,23 @@ private void userDataStreamSubscribeValidateBeforeCall() throws ApiException {} * Subscribe to User Data Stream through signature subscription Documentation */ public StreamResponse - userDataStreamSubscribeSignature() throws ApiException { - userDataStreamSubscribeSignatureValidateBeforeCall(); + userDataStreamSubscribeSignature( + UserDataStreamSubscribeSignatureRequest userDataStreamSubscribeSignatureRequest) + throws ApiException { + userDataStreamSubscribeSignatureValidateBeforeCall(userDataStreamSubscribeSignatureRequest); String methodName = "/userDataStream.subscribe.signature".substring(1); - ApiRequestWrapperDTO build = - new ApiRequestWrapperDTO.Builder< - BaseRequestDTO, UserDataStreamSubscribeSignatureResponse>() - .id(getRequestID()) - .method(methodName) - .params(new BaseRequestDTO()) - .responseType(UserDataStreamSubscribeSignatureResponse.class) - .build(); + ApiRequestWrapperDTO< + UserDataStreamSubscribeSignatureRequest, + UserDataStreamSubscribeSignatureResponse> + build = + new ApiRequestWrapperDTO.Builder< + UserDataStreamSubscribeSignatureRequest, + UserDataStreamSubscribeSignatureResponse>() + .id(getRequestID()) + .method(methodName) + .params(userDataStreamSubscribeSignatureRequest) + .responseType(UserDataStreamSubscribeSignatureResponse.class) + .build(); try { BlockingQueue queue = connection.sendForStream(build); @@ -179,12 +187,33 @@ private void userDataStreamSubscribeValidateBeforeCall() throws ApiException {} } @SuppressWarnings("rawtypes") - private void userDataStreamSubscribeSignatureValidateBeforeCall() throws ApiException {} + private void userDataStreamSubscribeSignatureValidateBeforeCall( + UserDataStreamSubscribeSignatureRequest userDataStreamSubscribeSignatureRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + + Set> violations = + validator.validate(userDataStreamSubscribeSignatureRequest); + + if (!violations.isEmpty()) { + throw new ConstraintViolationException(violations); + } + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } /** * WebSocket Unsubscribe from User Data Stream Stop listening to the User Data Stream in the * current WebSocket connection. Note that `session.logout` will only close the - * subscription created with `userdataStream.subscribe` but not subscriptions opened + * subscription created with `userDataStream.subscribe` but not subscriptions opened * with `userDataStream.subscribe.signature`. Weight: 2 * * @param userDataStreamUnsubscribeRequest (optional) diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java index 45e0426ed..6b81a1bd2 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/OrderAmendmentsRequest.java @@ -63,7 +63,7 @@ public class OrderAmendmentsRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_LIMIT) @jakarta.annotation.Nullable - private Integer limit; + private Long limit; public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; @@ -133,7 +133,7 @@ public void setFromExecutionId(@jakarta.annotation.Nullable Long fromExecutionId this.fromExecutionId = fromExecutionId; } - public OrderAmendmentsRequest limit(@jakarta.annotation.Nullable Integer limit) { + public OrderAmendmentsRequest limit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; return this; } @@ -144,11 +144,11 @@ public OrderAmendmentsRequest limit(@jakarta.annotation.Nullable Integer limit) * @return limit */ @jakarta.annotation.Nullable - public Integer getLimit() { + public Long getLimit() { return limit; } - public void setLimit(@jakarta.annotation.Nullable Integer limit) { + public void setLimit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; } @@ -225,7 +225,7 @@ public String toUrlQueryString() { String fromExecutionIdValueAsString = fromExecutionIdValue.toString(); valMap.put("fromExecutionId", fromExecutionIdValueAsString); } - Integer limitValue = getLimit(); + Long limitValue = getLimit(); if (limitValue != null) { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateRequest.java index e9070da12..5159ef533 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateRequest.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/TradesAggregateRequest.java @@ -49,7 +49,7 @@ public class TradesAggregateRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_FROM_ID) @jakarta.annotation.Nullable - private Integer fromId; + private Long fromId; public static final String SERIALIZED_NAME_START_TIME = "startTime"; @@ -67,7 +67,7 @@ public class TradesAggregateRequest extends BaseDTO { @SerializedName(SERIALIZED_NAME_LIMIT) @jakarta.annotation.Nullable - private Integer limit; + private Long limit; public TradesAggregateRequest() {} @@ -91,7 +91,7 @@ public void setSymbol(@jakarta.annotation.Nonnull String symbol) { this.symbol = symbol; } - public TradesAggregateRequest fromId(@jakarta.annotation.Nullable Integer fromId) { + public TradesAggregateRequest fromId(@jakarta.annotation.Nullable Long fromId) { this.fromId = fromId; return this; } @@ -102,11 +102,11 @@ public TradesAggregateRequest fromId(@jakarta.annotation.Nullable Integer fromId * @return fromId */ @jakarta.annotation.Nullable - public Integer getFromId() { + public Long getFromId() { return fromId; } - public void setFromId(@jakarta.annotation.Nullable Integer fromId) { + public void setFromId(@jakarta.annotation.Nullable Long fromId) { this.fromId = fromId; } @@ -148,7 +148,7 @@ public void setEndTime(@jakarta.annotation.Nullable Long endTime) { this.endTime = endTime; } - public TradesAggregateRequest limit(@jakarta.annotation.Nullable Integer limit) { + public TradesAggregateRequest limit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; return this; } @@ -159,11 +159,11 @@ public TradesAggregateRequest limit(@jakarta.annotation.Nullable Integer limit) * @return limit */ @jakarta.annotation.Nullable - public Integer getLimit() { + public Long getLimit() { return limit; } - public void setLimit(@jakarta.annotation.Nullable Integer limit) { + public void setLimit(@jakarta.annotation.Nullable Long limit) { this.limit = limit; } @@ -210,7 +210,7 @@ public String toUrlQueryString() { String symbolValueAsString = symbolValue.toString(); valMap.put("symbol", symbolValueAsString); } - Integer fromIdValue = getFromId(); + Long fromIdValue = getFromId(); if (fromIdValue != null) { String fromIdValueAsString = fromIdValue.toString(); valMap.put("fromId", fromIdValueAsString); @@ -225,7 +225,7 @@ public String toUrlQueryString() { String endTimeValueAsString = endTimeValue.toString(); valMap.put("endTime", endTimeValueAsString); } - Integer limitValue = getLimit(); + Long limitValue = getLimit(); if (limitValue != null) { String limitValueAsString = limitValue.toString(); valMap.put("limit", limitValueAsString); diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeSignatureRequest.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeSignatureRequest.java new file mode 100644 index 000000000..892bba6b4 --- /dev/null +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/api/model/UserDataStreamSubscribeSignatureRequest.java @@ -0,0 +1,249 @@ +/* + * Binance Spot WebSocket API + * OpenAPI Specifications for the Binance Spot WebSocket API API documents: - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md) - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information) + * + * 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.spot.websocket.api.model; + +import com.binance.connector.client.common.DecimalFormatter; +import com.binance.connector.client.common.websocket.dtos.BaseDTO; +import com.binance.connector.client.spot.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.Valid; +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.*; + +/** UserDataStreamSubscribeSignatureRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class UserDataStreamSubscribeSignatureRequest extends BaseDTO { + public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + + @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @jakarta.annotation.Nullable + private Double recvWindow; + + public UserDataStreamSubscribeSignatureRequest() {} + + public UserDataStreamSubscribeSignatureRequest recvWindow( + @jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + return this; + } + + /** + * Get recvWindow + * + * @return recvWindow + */ + @jakarta.annotation.Nullable + @Valid + public Double getRecvWindow() { + return recvWindow; + } + + public void setRecvWindow(@jakarta.annotation.Nullable Double recvWindow) { + this.recvWindow = recvWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDataStreamSubscribeSignatureRequest userDataStreamSubscribeSignatureRequest = + (UserDataStreamSubscribeSignatureRequest) o; + return Objects.equals(this.recvWindow, userDataStreamSubscribeSignatureRequest.recvWindow); + } + + @Override + public int hashCode() { + return Objects.hash(recvWindow); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDataStreamSubscribeSignatureRequest {\n"); + sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + Map valMap = new TreeMap(); + valMap.put("apiKey", getApiKey()); + Double recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + String recvWindowValueAsString = + DecimalFormatter.getFormatter().format(recvWindowValue); + valMap.put("recvWindow", recvWindowValueAsString); + } + + 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 recvWindowValue = getRecvWindow(); + if (recvWindowValue != null) { + valMap.put("recvWindow", recvWindowValue); + } + + 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("recvWindow"); + + // 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 + * UserDataStreamSubscribeSignatureRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserDataStreamSubscribeSignatureRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " UserDataStreamSubscribeSignatureRequest is not found in the" + + " empty JSON string", + UserDataStreamSubscribeSignatureRequest.openapiRequiredFields + .toString())); + } + } + + Set> entries = jsonElement.getAsJsonObject().entrySet(); + // check to see if the JSON string contains additional fields + for (Map.Entry entry : entries) { + if (!UserDataStreamSubscribeSignatureRequest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException( + String.format( + "The field `%s` in the JSON string is not defined in the" + + " `UserDataStreamSubscribeSignatureRequest` properties. JSON:" + + " %s", + entry.getKey(), jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!UserDataStreamSubscribeSignatureRequest.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes 'UserDataStreamSubscribeSignatureRequest' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(UserDataStreamSubscribeSignatureRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, UserDataStreamSubscribeSignatureRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public UserDataStreamSubscribeSignatureRequest read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of UserDataStreamSubscribeSignatureRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserDataStreamSubscribeSignatureRequest + * @throws IOException if the JSON string is invalid with respect to + * UserDataStreamSubscribeSignatureRequest + */ + public static UserDataStreamSubscribeSignatureRequest fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, UserDataStreamSubscribeSignatureRequest.class); + } + + /** + * Convert an instance of UserDataStreamSubscribeSignatureRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/SpotWebSocketStreamsUtil.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/SpotWebSocketStreamsUtil.java index 4cbbf339a..3c50e2594 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/SpotWebSocketStreamsUtil.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/SpotWebSocketStreamsUtil.java @@ -7,11 +7,15 @@ public class SpotWebSocketStreamsUtil { private static final boolean HAS_TIME_UNIT = true; public static WebSocketClientConfiguration getClientConfiguration() { + return getClientConfiguration(""); + } + + public static WebSocketClientConfiguration getClientConfiguration(String path) { WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); if (!HAS_TIME_UNIT) { clientConfiguration.setTimeUnit(null); } - clientConfiguration.setUrl(BASE_URL + "/stream"); + clientConfiguration.setUrl(BASE_URL + path + "/stream"); clientConfiguration.setAutoLogon(false); return clientConfiguration; } diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java index c45a72297..010bf64be 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/SpotWebSocketStreams.java @@ -38,7 +38,7 @@ public class SpotWebSocketStreams { private static final String USER_AGENT = String.format( - "binance-spot/8.0.0 (Java/%s; %s; %s)", + "binance-spot/9.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java index 2fb389755..45a9a6059 100644 --- a/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java +++ b/clients/spot/src/main/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApi.java @@ -13,11 +13,16 @@ package com.binance.connector.client.spot.websocket.stream.api; import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.SystemUtil; import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionInterface; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionPoolWrapper; +import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; +import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; +import com.binance.connector.client.spot.websocket.stream.JSON; import com.binance.connector.client.spot.websocket.stream.model.AggTradeRequest; import com.binance.connector.client.spot.websocket.stream.model.AggTradeResponse; import com.binance.connector.client.spot.websocket.stream.model.AllMarketRollingWindowTickerRequest; @@ -55,11 +60,27 @@ import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; public class WebSocketStreamsApi { + private static final String USER_AGENT = + String.format( + "binance-spot/9.0.0 (Java/%s; %s; %s)", + SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); + private StreamConnectionInterface connection; public WebSocketStreamsApi() {} + public WebSocketStreamsApi(WebSocketClientConfiguration configuration) { + this( + configuration.getUsePool() + ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) + : new StreamConnectionWrapper(configuration, JSON.getGson())); + } + public WebSocketStreamsApi(StreamConnectionInterface connection) { + connection.setUserAgent(USER_AGENT); + if (!connection.isConnected()) { + connection.connect(); + } this.connection = connection; } diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java index 7b1ed213c..41184f7c1 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AccountApiTest.java @@ -91,6 +91,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); AccountApi accountApi = new AccountApi(connectionSpy); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AuthApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AuthApiTest.java index 6033a90d5..ebfec03c5 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AuthApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/AuthApiTest.java @@ -74,6 +74,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); AuthApi accountApi = new AuthApi(connectionSpy); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/GeneralApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/GeneralApiTest.java index c45835473..07f753ee5 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/GeneralApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/GeneralApiTest.java @@ -76,6 +76,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); GeneralApi accountApi = new GeneralApi(connectionSpy); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/MarketApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/MarketApiTest.java index 5cde0d83f..0aa10f3e8 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/MarketApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/MarketApiTest.java @@ -95,6 +95,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); MarketApi accountApi = new MarketApi(connectionSpy); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java index 0741a149b..f4daf24cb 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/TradeApiTest.java @@ -111,6 +111,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); TradeApi accountApi = new TradeApi(connectionSpy); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java index f69ffffac..c739b902b 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/api/api/UserDataStreamApiTest.java @@ -74,6 +74,7 @@ public void initApiClient() throws Exception { ConnectionWrapper connectionWrapper = new ConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); UserDataStreamApi accountApi = new UserDataStreamApi(connectionSpy); diff --git a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java index 24d626444..3ed1f3f92 100644 --- a/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java +++ b/clients/spot/src/test/java/com/binance/connector/client/spot/websocket/stream/api/WebSocketStreamsApiTest.java @@ -99,6 +99,7 @@ public void initApiClient() throws Exception { StreamConnectionWrapper connectionWrapper = new StreamConnectionWrapper(clientConfiguration, webSocketClient); connectionSpy = Mockito.spy(connectionWrapper); + Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); connectionSpy.connect(); WebSocketStreamsApi accountApi = new WebSocketStreamsApi(connectionSpy); diff --git a/clients/sub-account/CHANGELOG.md b/clients/sub-account/CHANGELOG.md index 3b175d2c4..d50fdd4b1 100644 --- a/clients/sub-account/CHANGELOG.md +++ b/clients/sub-account/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 5.0.0 - 2026-02-12 + +### Changed (2) + +- Added parameter `limit` + - affected methods: + - `getSummaryOfSubAccountsFuturesAccount()` (`GET /sapi/v1/sub-account/futures/accountSummary`) +- Added parameter `page` + - affected methods: + - `getSummaryOfSubAccountsFuturesAccount()` (`GET /sapi/v1/sub-account/futures/accountSummary`) + ## 4.0.0 - 2025-10-21 ### Changed (2) diff --git a/clients/sub-account/docs/AssetManagementApi.md b/clients/sub-account/docs/AssetManagementApi.md index 29860c954..3d4d5fbac 100644 --- a/clients/sub-account/docs/AssetManagementApi.md +++ b/clients/sub-account/docs/AssetManagementApi.md @@ -291,7 +291,7 @@ No authorization required Get Move Position History for Sub-account (For Master Account) (USER_DATA) -Query move position history * If `startTime` and `endTime` not sent, return records of the last 90 days by default with 1000 maximum limits * If `startTime` is sent and `endTime` is not sent, return records of [max(startTime, now-90d), now]. * If `startTime` is not sent and `endTime` is sent, return records of [max(now,endTime-90d), endTime]. Weight: 150 +Query move position history * If `startTime` and `endTime` not sent, return records of the last 90 days by default with 1000 maximum limits * If `startTime` is sent and `endTime` is not sent, return records of [max(startTime, now-90d), now]. * If `startTime` is not sent and `endTime` is sent, return records of [max(now,endTime-90d), endTime]. Weight: 1 ### Example ```java @@ -507,7 +507,7 @@ No authorization required # **getSummaryOfSubAccountsFuturesAccount** -> GetSummaryOfSubAccountsFuturesAccountResponse getSummaryOfSubAccountsFuturesAccount(recvWindow) +> GetSummaryOfSubAccountsFuturesAccountResponse getSummaryOfSubAccountsFuturesAccount(page, limit, recvWindow) Get Summary of Sub-account's Futures Account (For Master Account) (USER_DATA) @@ -528,9 +528,11 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); AssetManagementApi apiInstance = new AssetManagementApi(defaultClient); + Long page = 56L; // Long | Page + Long limit = 56L; // Long | Limit (Max: 500) Long recvWindow = 56L; // Long | try { - GetSummaryOfSubAccountsFuturesAccountResponse result = apiInstance.getSummaryOfSubAccountsFuturesAccount(recvWindow); + GetSummaryOfSubAccountsFuturesAccountResponse result = apiInstance.getSummaryOfSubAccountsFuturesAccount(page, limit, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AssetManagementApi#getSummaryOfSubAccountsFuturesAccount"); @@ -547,6 +549,8 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **page** | **Long**| Page | | +| **limit** | **Long**| Limit (Max: 500) | | | **recvWindow** | **Long**| | [optional] | ### Return type @@ -765,7 +769,7 @@ No authorization required Move Position for Sub-account (For Master Account) (USER_DATA) -Move position between sub-master, master-sub, or sub-sub accounts when necessary * You need to Enable Trading permission for the API Key which requests this endpoint. * This function only support VIP level 7-9. * Only master account can use the function * Quantity should be positive number only * The function support normal account, PM PRO and PM PRO SPAN. * Only support for from account has positions * For all orders in the same orderArgs request, if any symbol’s total close position quantity is bigger than the symbol’s current position quantity, all batch orders in the same list will fail simultaneously. * Only support cross margin mode * The price for move position is MarkPrice only. * Not support for MSA. * Not support for the symbol under Reduce-Only. Weight: 150 +Move position between sub-master, master-sub, or sub-sub accounts when necessary * You need to Enable Trading permission for the API Key which requests this endpoint. * This function only support VIP level 7-9. * Only master account can use the function * Quantity should be positive number only * The function support normal account, PM PRO and PM PRO SPAN. * Only support for from account has positions * For all orders in the same orderArgs request, if any symbol’s total close position quantity is bigger than the symbol’s current position quantity, all batch orders in the same list will fail simultaneously. * Only support cross margin mode * The price for move position is MarkPrice only. * Not support for MSA. * Not support for the symbol under Reduce-Only. Weight: 1 ### Example ```java diff --git a/clients/sub-account/docs/rest-api/migration-guide.md b/clients/sub-account/docs/rest-api/migration-guide.md index 8ac03ed14..1d625f941 100644 --- a/clients/sub-account/docs/rest-api/migration-guide.md +++ b/clients/sub-account/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-sub-account - 4.0.0 + 5.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-sub-account - 4.0.0 + 5.0.0 ``` diff --git a/clients/sub-account/pom.xml b/clients/sub-account/pom.xml index b06796926..a103fec3a 100644 --- a/clients/sub-account/pom.xml +++ b/clients/sub-account/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-sub-account sub-account - 4.0.0 + 5.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.1.1 + 2.3.1 \ No newline at end of file diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java index c1f4c568d..3b682283a 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AccountManagementApi.java @@ -53,7 +53,7 @@ public class AccountManagementApi { private static final String USER_AGENT = String.format( - "binance-sub-account/4.0.0 (Java/%s; %s; %s)", + "binance-sub-account/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java index 922c8ac8a..4bd685712 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ApiManagementApi.java @@ -46,7 +46,7 @@ public class ApiManagementApi { private static final String USER_AGENT = String.format( - "binance-sub-account/4.0.0 (Java/%s; %s; %s)", + "binance-sub-account/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java index b8ca3f3ed..2cddc0659 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApi.java @@ -74,7 +74,7 @@ public class AssetManagementApi { private static final String USER_AGENT = String.format( - "binance-sub-account/4.0.0 (Java/%s; %s; %s)", + "binance-sub-account/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -886,7 +886,7 @@ private okhttp3.Call getMovePositionHistoryForSubAccountValidateBeforeCall( * of the last 90 days by default with 1000 maximum limits * If `startTime` is sent * and `endTime` is not sent, return records of [max(startTime, now-90d), now]. * If * `startTime` is not sent and `endTime` is sent, return records of - * [max(now,endTime-90d), endTime]. Weight: 150 + * [max(now,endTime-90d), endTime]. Weight: 1 * * @param symbol (required) * @param page Page (required) @@ -1337,6 +1337,8 @@ public ApiResponse getSubAccountDepositHist /** * Build call for getSummaryOfSubAccountsFuturesAccount * + * @param page Page (required) + * @param limit Limit (Max: 500) (required) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1352,8 +1354,8 @@ public ApiResponse getSubAccountDepositHist * Summary of Sub-account's Futures Account (For Master Account) (USER_DATA) * Documentation */ - private okhttp3.Call getSummaryOfSubAccountsFuturesAccountCall(Long recvWindow) - throws ApiException { + private okhttp3.Call getSummaryOfSubAccountsFuturesAccountCall( + Long page, Long limit, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -1378,6 +1380,14 @@ private okhttp3.Call getSummaryOfSubAccountsFuturesAccountCall(Long recvWindow) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (page != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -1413,8 +1423,8 @@ private okhttp3.Call getSummaryOfSubAccountsFuturesAccountCall(Long recvWindow) } @SuppressWarnings("rawtypes") - private okhttp3.Call getSummaryOfSubAccountsFuturesAccountValidateBeforeCall(Long recvWindow) - throws ApiException { + private okhttp3.Call getSummaryOfSubAccountsFuturesAccountValidateBeforeCall( + Long page, Long limit, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -1424,14 +1434,19 @@ private okhttp3.Call getSummaryOfSubAccountsFuturesAccountValidateBeforeCall(Lon .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {recvWindow}; + Object[] parameterValues = {page, limit, recvWindow}; Method method = - this.getClass().getMethod("getSummaryOfSubAccountsFuturesAccount", Long.class); + this.getClass() + .getMethod( + "getSummaryOfSubAccountsFuturesAccount", + Long.class, + Long.class, + Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return getSummaryOfSubAccountsFuturesAccountCall(recvWindow); + return getSummaryOfSubAccountsFuturesAccountCall(page, limit, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -1448,6 +1463,8 @@ private okhttp3.Call getSummaryOfSubAccountsFuturesAccountValidateBeforeCall(Lon * Get Summary of Sub-account's Futures Account (For Master Account) (USER_DATA) Get Summary * of Sub-account's Futures Account Weight: 1 * + * @param page Page (required) + * @param limit Limit (Max: 500) (required) * @param recvWindow (optional) * @return ApiResponse<GetSummaryOfSubAccountsFuturesAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1465,9 +1482,10 @@ private okhttp3.Call getSummaryOfSubAccountsFuturesAccountValidateBeforeCall(Lon * Documentation */ public ApiResponse - getSummaryOfSubAccountsFuturesAccount(Long recvWindow) throws ApiException { + getSummaryOfSubAccountsFuturesAccount( + @NotNull Long page, @NotNull Long limit, Long recvWindow) throws ApiException { okhttp3.Call localVarCall = - getSummaryOfSubAccountsFuturesAccountValidateBeforeCall(recvWindow); + getSummaryOfSubAccountsFuturesAccountValidateBeforeCall(page, limit, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -2086,7 +2104,7 @@ private okhttp3.Call movePositionForSubAccountValidateBeforeCall( * close position quantity is bigger than the symbol’s current position quantity, all batch * orders in the same list will fail simultaneously. * Only support cross margin mode * The * price for move position is MarkPrice only. * Not support for MSA. * Not support for the - * symbol under Reduce-Only. Weight: 150 + * symbol under Reduce-Only. Weight: 1 * * @param movePositionForSubAccountRequest (required) * @return ApiResponse<MovePositionForSubAccountResponse> diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java index 08d318f6c..d658a08cd 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/ManagedSubAccountApi.java @@ -56,7 +56,7 @@ public class ManagedSubAccountApi { private static final String USER_AGENT = String.format( - "binance-sub-account/4.0.0 (Java/%s; %s; %s)", + "binance-sub-account/5.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java index 5b2e79735..a13acbd67 100644 --- a/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java +++ b/clients/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/api/SubAccountRestApi.java @@ -495,7 +495,7 @@ public ApiResponse futuresTransferForSubAc * of the last 90 days by default with 1000 maximum limits * If `startTime` is sent * and `endTime` is not sent, return records of [max(startTime, now-90d), now]. * If * `startTime` is not sent and `endTime` is sent, return records of - * [max(now,endTime-90d), endTime]. Weight: 150 + * [max(now,endTime-90d), endTime]. Weight: 1 * * @param symbol (required) * @param page Page (required) @@ -608,6 +608,8 @@ public ApiResponse getSubAccountDepositHist * Get Summary of Sub-account's Futures Account (For Master Account) (USER_DATA) Get Summary * of Sub-account's Futures Account Weight: 1 * + * @param page Page (required) + * @param limit Limit (Max: 500) (required) * @param recvWindow (optional) * @return ApiResponse<GetSummaryOfSubAccountsFuturesAccountResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -625,8 +627,9 @@ public ApiResponse getSubAccountDepositHist * Documentation */ public ApiResponse - getSummaryOfSubAccountsFuturesAccount(Long recvWindow) throws ApiException { - return assetManagementApi.getSummaryOfSubAccountsFuturesAccount(recvWindow); + getSummaryOfSubAccountsFuturesAccount(Long page, Long limit, Long recvWindow) + throws ApiException { + return assetManagementApi.getSummaryOfSubAccountsFuturesAccount(page, limit, recvWindow); } /** @@ -720,7 +723,7 @@ public ApiResponse marginTransferForSubAcco * close position quantity is bigger than the symbol’s current position quantity, all batch * orders in the same list will fail simultaneously. * Only support cross margin mode * The * price for move position is MarkPrice only. * Not support for MSA. * Not support for the - * symbol under Reduce-Only. Weight: 150 + * symbol under Reduce-Only. Weight: 1 * * @param movePositionForSubAccountRequest (required) * @return ApiResponse<MovePositionForSubAccountResponse> diff --git a/clients/sub-account/src/test/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApiTest.java b/clients/sub-account/src/test/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApiTest.java index e27ecdea2..bfc841108 100644 --- a/clients/sub-account/src/test/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApiTest.java +++ b/clients/sub-account/src/test/java/com/binance/connector/client/sub_account/rest/api/AssetManagementApiTest.java @@ -377,7 +377,7 @@ public void getSubAccountDepositHistoryTest() throws ApiException, CryptoExcepti public void getSummaryOfSubAccountsFuturesAccountTest() throws ApiException, CryptoException { Long recvWindow = 5000L; ApiResponse response = - api.getSummaryOfSubAccountsFuturesAccount(recvWindow); + api.getSummaryOfSubAccountsFuturesAccount(1L, 100L, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -389,9 +389,9 @@ public void getSummaryOfSubAccountsFuturesAccountTest() throws ApiException, Cry Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals("page=1&limit=100&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", + "896f98aeecf7fd75f5b6757aac79503b77ce8681d684a02de1677275f4e3217e", actualRequest.url().queryParameter("signature")); assertEquals( "/sapi/v1/sub-account/futures/accountSummary", actualRequest.url().encodedPath()); diff --git a/clients/vip-loan/CHANGELOG.md b/clients/vip-loan/CHANGELOG.md index 3dad0479a..023067cce 100644 --- a/clients/vip-loan/CHANGELOG.md +++ b/clients/vip-loan/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.0.0 - 2026-02-12 + +### Added (2) + +- `getVIPLoanAccruedInterest()` (`GET /sapi/v1/loan/vip/accruedInterest`) +- `getVIPLoanInterestRateHistory()` (`GET /sapi/v1/loan/vip/interestRateHistory`) + +### Changed (1) + +- Modified response for `getVIPLoanOngoingOrders()` (`GET /sapi/v1/loan/vip/ongoing/orders`): + - `rows`.items: property `loanRate` added + - `rows`.items: item property `loanRate` added + ## 2.0.0 - 2025-09-22 ### Changed (1) @@ -9,6 +22,7 @@ - `vipLoanBorrow()` (`POST /sapi/v1/loan/vip/borrow`) ## 1.2.1 - 2025-08-07 + - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. @@ -25,4 +39,4 @@ ## 1.0.0 - 2025-04-24 -- Initial release \ No newline at end of file +- Initial release diff --git a/clients/vip-loan/docs/GetVIPLoanAccruedInterestResponse.md b/clients/vip-loan/docs/GetVIPLoanAccruedInterestResponse.md new file mode 100644 index 000000000..1ee4a7099 --- /dev/null +++ b/clients/vip-loan/docs/GetVIPLoanAccruedInterestResponse.md @@ -0,0 +1,14 @@ + + +# GetVIPLoanAccruedInterestResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetVIPLoanAccruedInterestResponseRowsInner>**](GetVIPLoanAccruedInterestResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/vip-loan/docs/GetVIPLoanAccruedInterestResponseRowsInner.md b/clients/vip-loan/docs/GetVIPLoanAccruedInterestResponseRowsInner.md new file mode 100644 index 000000000..16150bc7f --- /dev/null +++ b/clients/vip-loan/docs/GetVIPLoanAccruedInterestResponseRowsInner.md @@ -0,0 +1,18 @@ + + +# GetVIPLoanAccruedInterestResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**loanCoin** | **String** | | [optional] | +|**principalAmount** | **String** | | [optional] | +|**interestAmount** | **String** | | [optional] | +|**annualInterestRate** | **String** | | [optional] | +|**accrualTime** | **Long** | | [optional] | +|**orderId** | **Long** | | [optional] | + + + diff --git a/clients/vip-loan/docs/GetVIPLoanInterestRateHistoryResponse.md b/clients/vip-loan/docs/GetVIPLoanInterestRateHistoryResponse.md new file mode 100644 index 000000000..418df5075 --- /dev/null +++ b/clients/vip-loan/docs/GetVIPLoanInterestRateHistoryResponse.md @@ -0,0 +1,14 @@ + + +# GetVIPLoanInterestRateHistoryResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**rows** | [**List<GetVIPLoanInterestRateHistoryResponseRowsInner>**](GetVIPLoanInterestRateHistoryResponseRowsInner.md) | | [optional] | +|**total** | **Long** | | [optional] | + + + diff --git a/clients/vip-loan/docs/GetVIPLoanInterestRateHistoryResponseRowsInner.md b/clients/vip-loan/docs/GetVIPLoanInterestRateHistoryResponseRowsInner.md new file mode 100644 index 000000000..231f2e1d0 --- /dev/null +++ b/clients/vip-loan/docs/GetVIPLoanInterestRateHistoryResponseRowsInner.md @@ -0,0 +1,15 @@ + + +# GetVIPLoanInterestRateHistoryResponseRowsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**coin** | **String** | | [optional] | +|**annualizedInterestRate** | **String** | | [optional] | +|**time** | **Long** | | [optional] | + + + diff --git a/clients/vip-loan/docs/GetVIPLoanOngoingOrdersResponseRowsInner.md b/clients/vip-loan/docs/GetVIPLoanOngoingOrdersResponseRowsInner.md index bf22f5dc5..2f6da2cfd 100644 --- a/clients/vip-loan/docs/GetVIPLoanOngoingOrdersResponseRowsInner.md +++ b/clients/vip-loan/docs/GetVIPLoanOngoingOrdersResponseRowsInner.md @@ -10,6 +10,7 @@ |**orderId** | **Long** | | [optional] | |**loanCoin** | **String** | | [optional] | |**totalDebt** | **String** | | [optional] | +|**loanRate** | **String** | | [optional] | |**residualInterest** | **String** | | [optional] | |**collateralAccountId** | **String** | | [optional] | |**collateralCoin** | **String** | | [optional] | diff --git a/clients/vip-loan/docs/MarketDataApi.md b/clients/vip-loan/docs/MarketDataApi.md index 45011ba11..1b4f1bdea 100644 --- a/clients/vip-loan/docs/MarketDataApi.md +++ b/clients/vip-loan/docs/MarketDataApi.md @@ -7,6 +7,7 @@ All URIs are relative to *https://api.binance.com* | [**getBorrowInterestRate**](MarketDataApi.md#getBorrowInterestRate) | **GET** /sapi/v1/loan/vip/request/interestRate | Get Borrow Interest Rate(USER_DATA) | | [**getCollateralAssetData**](MarketDataApi.md#getCollateralAssetData) | **GET** /sapi/v1/loan/vip/collateral/data | Get Collateral Asset Data(USER_DATA) | | [**getLoanableAssetsData**](MarketDataApi.md#getLoanableAssetsData) | **GET** /sapi/v1/loan/vip/loanable/data | Get Loanable Assets Data(USER_DATA) | +| [**getVIPLoanInterestRateHistory**](MarketDataApi.md#getVIPLoanInterestRateHistory) | **GET** /sapi/v1/loan/vip/interestRateHistory | Get VIP Loan Interest Rate History (USER_DATA) | @@ -203,3 +204,75 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Loanable Assets Data | - | + +# **getVIPLoanInterestRateHistory** +> GetVIPLoanInterestRateHistoryResponse getVIPLoanInterestRateHistory(coin, recvWindow, startTime, endTime, current, limit) + +Get VIP Loan Interest Rate History (USER_DATA) + +Check VIP Loan flexible interest rate history * If startTime and endTime are not sent, the recent 90-day data will be returned * The max interval between startTime and end Time is 180 days. * Time based on UTC+0. Weight: 400 + +### Example +```java +// Import classes: +import com.binance.connector.client.vip_loan.ApiClient; +import com.binance.connector.client.vip_loan.ApiException; +import com.binance.connector.client.vip_loan.Configuration; +import com.binance.connector.client.vip_loan.models.*; +import com.binance.connector.client.vip_loan.rest.api.MarketDataApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + MarketDataApi apiInstance = new MarketDataApi(defaultClient); + String coin = "coin_example"; // String | + Long recvWindow = 56L; // Long | + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Current querying page. Start from 1; default: 1; max: 1000 + Long limit = 56L; // Long | Default: 10; max: 100 + try { + GetVIPLoanInterestRateHistoryResponse result = apiInstance.getVIPLoanInterestRateHistory(coin, recvWindow, startTime, endTime, current, limit); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketDataApi#getVIPLoanInterestRateHistory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **coin** | **String**| | | +| **recvWindow** | **Long**| | | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Current querying page. Start from 1; default: 1; max: 1000 | [optional] | +| **limit** | **Long**| Default: 10; max: 100 | [optional] | + +### Return type + +[**GetVIPLoanInterestRateHistoryResponse**](GetVIPLoanInterestRateHistoryResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get VIP Loan Interest Rate History | - | + diff --git a/clients/vip-loan/docs/UserInformationApi.md b/clients/vip-loan/docs/UserInformationApi.md index 31f329ec2..c5cc67640 100644 --- a/clients/vip-loan/docs/UserInformationApi.md +++ b/clients/vip-loan/docs/UserInformationApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.binance.com* | Method | HTTP request | Description | |------------- | ------------- | -------------| | [**checkVIPLoanCollateralAccount**](UserInformationApi.md#checkVIPLoanCollateralAccount) | **GET** /sapi/v1/loan/vip/collateral/account | Check VIP Loan Collateral Account (USER_DATA) | +| [**getVIPLoanAccruedInterest**](UserInformationApi.md#getVIPLoanAccruedInterest) | **GET** /sapi/v1/loan/vip/accruedInterest | Get VIP Loan Accrued Interest (USER_DATA) | | [**getVIPLoanOngoingOrders**](UserInformationApi.md#getVIPLoanOngoingOrders) | **GET** /sapi/v1/loan/vip/ongoing/orders | Get VIP Loan Ongoing Orders(USER_DATA) | | [**queryApplicationStatus**](UserInformationApi.md#queryApplicationStatus) | **GET** /sapi/v1/loan/vip/request/data | Query Application Status(USER_DATA) | @@ -75,6 +76,80 @@ No authorization required |-------------|-------------|------------------| | **200** | Check VIP Loan Collateral Account | - | + +# **getVIPLoanAccruedInterest** +> GetVIPLoanAccruedInterestResponse getVIPLoanAccruedInterest(orderId, loanCoin, startTime, endTime, current, limit, recvWindow) + +Get VIP Loan Accrued Interest (USER_DATA) + +Check VIP Loan interest record * If startTime and endTime are not sent, the recent 90-day data will be returned. * The max interval between startTime and endTime is 90 days. Weight: 400 + +### Example +```java +// Import classes: +import com.binance.connector.client.vip_loan.ApiClient; +import com.binance.connector.client.vip_loan.ApiException; +import com.binance.connector.client.vip_loan.Configuration; +import com.binance.connector.client.vip_loan.models.*; +import com.binance.connector.client.vip_loan.rest.api.UserInformationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + UserInformationApi apiInstance = new UserInformationApi(defaultClient); + Long orderId = 56L; // Long | + String loanCoin = "loanCoin_example"; // String | + Long startTime = 56L; // Long | + Long endTime = 56L; // Long | + Long current = 56L; // Long | Current querying page. Start from 1; default: 1; max: 1000 + Long limit = 56L; // Long | Default: 10; max: 100 + Long recvWindow = 56L; // Long | + try { + GetVIPLoanAccruedInterestResponse result = apiInstance.getVIPLoanAccruedInterest(orderId, loanCoin, startTime, endTime, current, limit, recvWindow); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserInformationApi#getVIPLoanAccruedInterest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| | [optional] | +| **loanCoin** | **String**| | [optional] | +| **startTime** | **Long**| | [optional] | +| **endTime** | **Long**| | [optional] | +| **current** | **Long**| Current querying page. Start from 1; default: 1; max: 1000 | [optional] | +| **limit** | **Long**| Default: 10; max: 100 | [optional] | +| **recvWindow** | **Long**| | [optional] | + +### Return type + +[**GetVIPLoanAccruedInterestResponse**](GetVIPLoanAccruedInterestResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Get VIP Loan Accrued Interest | - | + # **getVIPLoanOngoingOrders** > GetVIPLoanOngoingOrdersResponse getVIPLoanOngoingOrders(orderId, collateralAccountId, loanCoin, collateralCoin, current, limit, recvWindow) @@ -102,8 +177,8 @@ public class Example { Long collateralAccountId = 56L; // Long | String loanCoin = "loanCoin_example"; // String | String collateralCoin = "collateralCoin_example"; // String | - Long current = 56L; // Long | Currently querying page. Start from 1, Default:1, Max: 1000. - Long limit = 56L; // Long | Default: 10, Max: 100 + Long current = 56L; // Long | Current querying page. Start from 1; default: 1; max: 1000 + Long limit = 56L; // Long | Default: 10; max: 100 Long recvWindow = 56L; // Long | try { GetVIPLoanOngoingOrdersResponse result = apiInstance.getVIPLoanOngoingOrders(orderId, collateralAccountId, loanCoin, collateralCoin, current, limit, recvWindow); @@ -127,8 +202,8 @@ public class Example { | **collateralAccountId** | **Long**| | [optional] | | **loanCoin** | **String**| | [optional] | | **collateralCoin** | **String**| | [optional] | -| **current** | **Long**| Currently querying page. Start from 1, Default:1, Max: 1000. | [optional] | -| **limit** | **Long**| Default: 10, Max: 100 | [optional] | +| **current** | **Long**| Current querying page. Start from 1; default: 1; max: 1000 | [optional] | +| **limit** | **Long**| Default: 10; max: 100 | [optional] | | **recvWindow** | **Long**| | [optional] | ### Return type @@ -172,8 +247,8 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); UserInformationApi apiInstance = new UserInformationApi(defaultClient); - Long current = 56L; // Long | Currently querying page. Start from 1, Default:1, Max: 1000. - Long limit = 56L; // Long | Default: 10, Max: 100 + Long current = 56L; // Long | Current querying page. Start from 1; default: 1; max: 1000 + Long limit = 56L; // Long | Default: 10; max: 100 Long recvWindow = 56L; // Long | try { QueryApplicationStatusResponse result = apiInstance.queryApplicationStatus(current, limit, recvWindow); @@ -193,8 +268,8 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **current** | **Long**| Currently querying page. Start from 1, Default:1, Max: 1000. | [optional] | -| **limit** | **Long**| Default: 10, Max: 100 | [optional] | +| **current** | **Long**| Current querying page. Start from 1; default: 1; max: 1000 | [optional] | +| **limit** | **Long**| Default: 10; max: 100 | [optional] | | **recvWindow** | **Long**| | [optional] | ### Return type diff --git a/clients/vip-loan/docs/rest-api/migration-guide.md b/clients/vip-loan/docs/rest-api/migration-guide.md index f556ce5c5..4931d511f 100644 --- a/clients/vip-loan/docs/rest-api/migration-guide.md +++ b/clients/vip-loan/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-vip-loan - 2.0.0 + 3.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-vip-loan - 2.0.0 + 3.0.0 ``` diff --git a/clients/vip-loan/example_rest.md b/clients/vip-loan/example_rest.md index d99765025..9d23d5f1c 100644 --- a/clients/vip-loan/example_rest.md +++ b/clients/vip-loan/example_rest.md @@ -6,6 +6,8 @@ [GET /sapi/v1/loan/vip/loanable/data](https://developers.binance.com/docs/vip_loan/market-data/Get-Loanable-Assets-Data) - getLoanableAssetsData - [GetLoanableAssetsDataExample.java:47](/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/marketdata/GetLoanableAssetsDataExample.java#L47) +[GET /sapi/v1/loan/vip/interestRateHistory](https://developers.binance.com/docs/vip_loan/market-data/Get-VIP-Loan-Interest-Rate-History) - getVIPLoanInterestRateHistory - [GetVIPLoanInterestRateHistoryExample.java:48](/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/marketdata/GetVIPLoanInterestRateHistoryExample.java#L48) + ## Trade [POST /sapi/v1/loan/vip/borrow](https://developers.binance.com/docs/vip_loan/trade/VIP-Loan-Borrow) - vipLoanBorrow - [VipLoanBorrowExample.java:49](/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/trade/VipLoanBorrowExample.java#L49) @@ -18,6 +20,8 @@ [GET /sapi/v1/loan/vip/collateral/account](https://developers.binance.com/docs/vip_loan/user-information/Check-Locked-Value-of-VIP-Collateral-Account) - checkVIPLoanCollateralAccount - [CheckVIPLoanCollateralAccountExample.java:48](/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/userinformation/CheckVIPLoanCollateralAccountExample.java#L48) +[GET /sapi/v1/loan/vip/accruedInterest](https://developers.binance.com/docs/vip_loan/user-information/Get-VIP-Loan-Accrued-Interest) - getVIPLoanAccruedInterest - [GetVIPLoanAccruedInterestExample.java:48](/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/userinformation/GetVIPLoanAccruedInterestExample.java#L48) + [GET /sapi/v1/loan/vip/ongoing/orders](https://developers.binance.com/docs/vip_loan/user-information/Get-VIP-Loan-Ongoing-Orders) - getVIPLoanOngoingOrders - [GetVIPLoanOngoingOrdersExample.java:46](/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/userinformation/GetVIPLoanOngoingOrdersExample.java#L46) [GET /sapi/v1/loan/vip/request/data](https://developers.binance.com/docs/vip_loan/user-information/Query-Application-Status) - queryApplicationStatus - [QueryApplicationStatusExample.java:46](/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/userinformation/QueryApplicationStatusExample.java#L46) diff --git a/clients/vip-loan/pom.xml b/clients/vip-loan/pom.xml index a05efd3dc..2a1c71a5e 100644 --- a/clients/vip-loan/pom.xml +++ b/clients/vip-loan/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-vip-loan vip-loan - 2.0.0 + 3.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.3.1 \ No newline at end of file diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/JSON.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/JSON.java index 412048112..3629e4754 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/JSON.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/JSON.java @@ -132,6 +132,18 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.vip_loan.rest.model .GetLoanableAssetsDataResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.vip_loan.rest.model + .GetVIPLoanAccruedInterestResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.vip_loan.rest.model + .GetVIPLoanAccruedInterestResponseRowsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.vip_loan.rest.model + .GetVIPLoanInterestRateHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.vip_loan.rest.model + .GetVIPLoanInterestRateHistoryResponseRowsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.vip_loan.rest.model.GetVIPLoanOngoingOrdersResponse .CustomTypeAdapterFactory()); diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java index efb0ff51e..62f92f8ff 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/MarketDataApi.java @@ -22,6 +22,7 @@ import com.binance.connector.client.vip_loan.rest.model.GetBorrowInterestRateResponse; import com.binance.connector.client.vip_loan.rest.model.GetCollateralAssetDataResponse; import com.binance.connector.client.vip_loan.rest.model.GetLoanableAssetsDataResponse; +import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanInterestRateHistoryResponse; import com.google.gson.reflect.TypeToken; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validation; @@ -44,7 +45,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-vip-loan/2.0.0 (Java/%s; %s; %s)", + "binance-vip-loan/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -515,4 +516,190 @@ public ApiResponse getLoanableAssetsData( new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } + + /** + * Build call for getVIPLoanInterestRateHistory + * + * @param coin (required) + * @param recvWindow (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get VIP Loan Interest Rate History -
+ * + * @see Get + * VIP Loan Interest Rate History (USER_DATA) Documentation + */ + private okhttp3.Call getVIPLoanInterestRateHistoryCall( + String coin, Long recvWindow, Long startTime, Long endTime, Long current, Long limit) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/loan/vip/interestRateHistory"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (coin != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("coin", coin)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getVIPLoanInterestRateHistoryValidateBeforeCall( + String coin, Long recvWindow, Long startTime, Long endTime, Long current, Long limit) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {coin, recvWindow, startTime, endTime, current, limit}; + Method method = + this.getClass() + .getMethod( + "getVIPLoanInterestRateHistory", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getVIPLoanInterestRateHistoryCall( + coin, recvWindow, startTime, endTime, current, limit); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get VIP Loan Interest Rate History (USER_DATA) Check VIP Loan flexible interest rate history + * * If startTime and endTime are not sent, the recent 90-day data will be returned * The max + * interval between startTime and end Time is 180 days. * Time based on UTC+0. Weight: 400 + * + * @param coin (required) + * @param recvWindow (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @return ApiResponse<GetVIPLoanInterestRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get VIP Loan Interest Rate History -
+ * + * @see Get + * VIP Loan Interest Rate History (USER_DATA) Documentation + */ + public ApiResponse getVIPLoanInterestRateHistory( + @NotNull String coin, + @NotNull Long recvWindow, + Long startTime, + Long endTime, + Long current, + Long limit) + throws ApiException { + okhttp3.Call localVarCall = + getVIPLoanInterestRateHistoryValidateBeforeCall( + coin, recvWindow, startTime, endTime, current, limit); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } } diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java index 259ceb5d1..d27645270 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/TradeApi.java @@ -49,7 +49,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-vip-loan/2.0.0 (Java/%s; %s; %s)", + "binance-vip-loan/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java index 539d84e1e..07266a180 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/UserInformationApi.java @@ -20,6 +20,7 @@ import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.vip_loan.rest.model.CheckVIPLoanCollateralAccountResponse; +import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanAccruedInterestResponse; import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanOngoingOrdersResponse; import com.binance.connector.client.vip_loan.rest.model.QueryApplicationStatusResponse; import com.google.gson.reflect.TypeToken; @@ -44,7 +45,7 @@ public class UserInformationApi { private static final String USER_AGENT = String.format( - "binance-vip-loan/2.0.0 (Java/%s; %s; %s)", + "binance-vip-loan/3.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -239,6 +240,214 @@ public ApiResponse checkVIPLoanCollateral return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for getVIPLoanAccruedInterest + * + * @param orderId (optional) + * @param loanCoin (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @param recvWindow (optional) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get VIP Loan Accrued Interest -
+ * + * @see Get + * VIP Loan Accrued Interest (USER_DATA) Documentation + */ + private okhttp3.Call getVIPLoanAccruedInterestCall( + Long orderId, + String loanCoin, + Long startTime, + Long endTime, + Long current, + Long limit, + Long recvWindow) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/loan/vip/accruedInterest"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (orderId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); + } + + if (loanCoin != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("loanCoin", loanCoin)); + } + + if (startTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); + } + + if (endTime != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("endTime", endTime)); + } + + if (current != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("current", current)); + } + + if (limit != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getVIPLoanAccruedInterestValidateBeforeCall( + Long orderId, + String loanCoin, + Long startTime, + Long endTime, + Long current, + Long limit, + Long recvWindow) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + orderId, loanCoin, startTime, endTime, current, limit, recvWindow + }; + Method method = + this.getClass() + .getMethod( + "getVIPLoanAccruedInterest", + Long.class, + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + Long.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getVIPLoanAccruedInterestCall( + orderId, loanCoin, startTime, endTime, current, limit, recvWindow); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Get VIP Loan Accrued Interest (USER_DATA) Check VIP Loan interest record * If startTime and + * endTime are not sent, the recent 90-day data will be returned. * The max interval between + * startTime and endTime is 90 days. Weight: 400 + * + * @param orderId (optional) + * @param loanCoin (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetVIPLoanAccruedInterestResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get VIP Loan Accrued Interest -
+ * + * @see Get + * VIP Loan Accrued Interest (USER_DATA) Documentation + */ + public ApiResponse getVIPLoanAccruedInterest( + Long orderId, + String loanCoin, + Long startTime, + Long endTime, + Long current, + Long limit, + Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = + getVIPLoanAccruedInterestValidateBeforeCall( + orderId, loanCoin, startTime, endTime, current, limit, recvWindow); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for getVIPLoanOngoingOrders * @@ -246,8 +455,8 @@ public ApiResponse checkVIPLoanCollateral * @param collateralAccountId (optional) * @param loanCoin (optional) * @param collateralCoin (optional) - * @param current Currently querying page. Start from 1, Default:1, Max: 1000. (optional) - * @param limit Default: 10, Max: 100 (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -419,8 +628,8 @@ private okhttp3.Call getVIPLoanOngoingOrdersValidateBeforeCall( * @param collateralAccountId (optional) * @param loanCoin (optional) * @param collateralCoin (optional) - * @param current Currently querying page. Start from 1, Default:1, Max: 1000. (optional) - * @param limit Default: 10, Max: 100 (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) * @param recvWindow (optional) * @return ApiResponse<GetVIPLoanOngoingOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -462,8 +671,8 @@ public ApiResponse getVIPLoanOngoingOrders( /** * Build call for queryApplicationStatus * - * @param current Currently querying page. Start from 1, Default:1, Max: 1000. (optional) - * @param limit Default: 10, Max: 100 (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -583,8 +792,8 @@ private okhttp3.Call queryApplicationStatusValidateBeforeCall( /** * Query Application Status(USER_DATA) Query Application Status Weight: 400 * - * @param current Currently querying page. Start from 1, Default:1, Max: 1000. (optional) - * @param limit Default: 10, Max: 100 (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) * @param recvWindow (optional) * @return ApiResponse<QueryApplicationStatusResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/VipLoanRestApi.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/VipLoanRestApi.java index 2f7ac079e..6bf6bb8e3 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/VipLoanRestApi.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/api/VipLoanRestApi.java @@ -9,6 +9,8 @@ import com.binance.connector.client.vip_loan.rest.model.GetBorrowInterestRateResponse; import com.binance.connector.client.vip_loan.rest.model.GetCollateralAssetDataResponse; import com.binance.connector.client.vip_loan.rest.model.GetLoanableAssetsDataResponse; +import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanAccruedInterestResponse; +import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanInterestRateHistoryResponse; import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanOngoingOrdersResponse; import com.binance.connector.client.vip_loan.rest.model.QueryApplicationStatusResponse; import com.binance.connector.client.vip_loan.rest.model.VipLoanBorrowRequest; @@ -108,6 +110,38 @@ public ApiResponse getLoanableAssetsData( return marketDataApi.getLoanableAssetsData(loanCoin, vipLevel, recvWindow); } + /** + * Get VIP Loan Interest Rate History (USER_DATA) Check VIP Loan flexible interest rate history + * * If startTime and endTime are not sent, the recent 90-day data will be returned * The max + * interval between startTime and end Time is 180 days. * Time based on UTC+0. Weight: 400 + * + * @param coin (required) + * @param recvWindow (required) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @return ApiResponse<GetVIPLoanInterestRateHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get VIP Loan Interest Rate History -
+ * + * @see Get + * VIP Loan Interest Rate History (USER_DATA) Documentation + */ + public ApiResponse getVIPLoanInterestRateHistory( + String coin, Long recvWindow, Long startTime, Long endTime, Long current, Long limit) + throws ApiException { + return marketDataApi.getVIPLoanInterestRateHistory( + coin, recvWindow, startTime, endTime, current, limit); + } + /** * VIP Loan Borrow(TRADE) VIP loan is available for VIP users only. * loanAccountId refer to * loan receiving account * Only master account applications are supported * loanAccountId and @@ -206,6 +240,45 @@ public ApiResponse checkVIPLoanCollateral orderId, collateralAccountId, recvWindow); } + /** + * Get VIP Loan Accrued Interest (USER_DATA) Check VIP Loan interest record * If startTime and + * endTime are not sent, the recent 90-day data will be returned. * The max interval between + * startTime and endTime is 90 days. Weight: 400 + * + * @param orderId (optional) + * @param loanCoin (optional) + * @param startTime (optional) + * @param endTime (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) + * @param recvWindow (optional) + * @return ApiResponse<GetVIPLoanAccruedInterestResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Get VIP Loan Accrued Interest -
+ * + * @see Get + * VIP Loan Accrued Interest (USER_DATA) Documentation + */ + public ApiResponse getVIPLoanAccruedInterest( + Long orderId, + String loanCoin, + Long startTime, + Long endTime, + Long current, + Long limit, + Long recvWindow) + throws ApiException { + return userInformationApi.getVIPLoanAccruedInterest( + orderId, loanCoin, startTime, endTime, current, limit, recvWindow); + } + /** * Get VIP Loan Ongoing Orders(USER_DATA) VIP loan is available for VIP users only. Weight: 400 * @@ -213,8 +286,8 @@ public ApiResponse checkVIPLoanCollateral * @param collateralAccountId (optional) * @param loanCoin (optional) * @param collateralCoin (optional) - * @param current Currently querying page. Start from 1, Default:1, Max: 1000. (optional) - * @param limit Default: 10, Max: 100 (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) * @param recvWindow (optional) * @return ApiResponse<GetVIPLoanOngoingOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -246,8 +319,8 @@ public ApiResponse getVIPLoanOngoingOrders( /** * Query Application Status(USER_DATA) Query Application Status Weight: 400 * - * @param current Currently querying page. Start from 1, Default:1, Max: 1000. (optional) - * @param limit Default: 10, Max: 100 (optional) + * @param current Current querying page. Start from 1; default: 1; max: 1000 (optional) + * @param limit Default: 10; max: 100 (optional) * @param recvWindow (optional) * @return ApiResponse<QueryApplicationStatusResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanAccruedInterestResponse.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanAccruedInterestResponse.java new file mode 100644 index 000000000..790ba8e0f --- /dev/null +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanAccruedInterestResponse.java @@ -0,0 +1,284 @@ +/* + * Binance VIP Loan REST API + * OpenAPI Specification for the Binance VIP Loan REST 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.vip_loan.rest.model; + +import com.binance.connector.client.vip_loan.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +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.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetVIPLoanAccruedInterestResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetVIPLoanAccruedInterestResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetVIPLoanAccruedInterestResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetVIPLoanAccruedInterestResponse() {} + + public GetVIPLoanAccruedInterestResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetVIPLoanAccruedInterestResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetVIPLoanAccruedInterestResponse addRowsItem( + GetVIPLoanAccruedInterestResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetVIPLoanAccruedInterestResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetVIPLoanAccruedInterestResponseRowsInner> rows) { + this.rows = rows; + } + + public GetVIPLoanAccruedInterestResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetVIPLoanAccruedInterestResponse getVIPLoanAccruedInterestResponse = + (GetVIPLoanAccruedInterestResponse) o; + return Objects.equals(this.rows, getVIPLoanAccruedInterestResponse.rows) + && Objects.equals(this.total, getVIPLoanAccruedInterestResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetVIPLoanAccruedInterestResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("rows"); + openapiFields.add("total"); + + // 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 + * GetVIPLoanAccruedInterestResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetVIPLoanAccruedInterestResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetVIPLoanAccruedInterestResponse is" + + " not found in the empty JSON string", + GetVIPLoanAccruedInterestResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetVIPLoanAccruedInterestResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetVIPLoanAccruedInterestResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetVIPLoanAccruedInterestResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetVIPLoanAccruedInterestResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetVIPLoanAccruedInterestResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetVIPLoanAccruedInterestResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetVIPLoanAccruedInterestResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetVIPLoanAccruedInterestResponse + * @throws IOException if the JSON string is invalid with respect to + * GetVIPLoanAccruedInterestResponse + */ + public static GetVIPLoanAccruedInterestResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetVIPLoanAccruedInterestResponse.class); + } + + /** + * Convert an instance of GetVIPLoanAccruedInterestResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanAccruedInterestResponseRowsInner.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanAccruedInterestResponseRowsInner.java new file mode 100644 index 000000000..592c49455 --- /dev/null +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanAccruedInterestResponseRowsInner.java @@ -0,0 +1,430 @@ +/* + * Binance VIP Loan REST API + * OpenAPI Specification for the Binance VIP Loan REST 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.vip_loan.rest.model; + +import com.binance.connector.client.vip_loan.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetVIPLoanAccruedInterestResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetVIPLoanAccruedInterestResponseRowsInner { + public static final String SERIALIZED_NAME_LOAN_COIN = "loanCoin"; + + @SerializedName(SERIALIZED_NAME_LOAN_COIN) + @jakarta.annotation.Nullable + private String loanCoin; + + public static final String SERIALIZED_NAME_PRINCIPAL_AMOUNT = "principalAmount"; + + @SerializedName(SERIALIZED_NAME_PRINCIPAL_AMOUNT) + @jakarta.annotation.Nullable + private String principalAmount; + + public static final String SERIALIZED_NAME_INTEREST_AMOUNT = "interestAmount"; + + @SerializedName(SERIALIZED_NAME_INTEREST_AMOUNT) + @jakarta.annotation.Nullable + private String interestAmount; + + public static final String SERIALIZED_NAME_ANNUAL_INTEREST_RATE = "annualInterestRate"; + + @SerializedName(SERIALIZED_NAME_ANNUAL_INTEREST_RATE) + @jakarta.annotation.Nullable + private String annualInterestRate; + + public static final String SERIALIZED_NAME_ACCRUAL_TIME = "accrualTime"; + + @SerializedName(SERIALIZED_NAME_ACCRUAL_TIME) + @jakarta.annotation.Nullable + private Long accrualTime; + + public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; + + @SerializedName(SERIALIZED_NAME_ORDER_ID) + @jakarta.annotation.Nullable + private Long orderId; + + public GetVIPLoanAccruedInterestResponseRowsInner() {} + + public GetVIPLoanAccruedInterestResponseRowsInner loanCoin( + @jakarta.annotation.Nullable String loanCoin) { + this.loanCoin = loanCoin; + return this; + } + + /** + * Get loanCoin + * + * @return loanCoin + */ + @jakarta.annotation.Nullable + public String getLoanCoin() { + return loanCoin; + } + + public void setLoanCoin(@jakarta.annotation.Nullable String loanCoin) { + this.loanCoin = loanCoin; + } + + public GetVIPLoanAccruedInterestResponseRowsInner principalAmount( + @jakarta.annotation.Nullable String principalAmount) { + this.principalAmount = principalAmount; + return this; + } + + /** + * Get principalAmount + * + * @return principalAmount + */ + @jakarta.annotation.Nullable + public String getPrincipalAmount() { + return principalAmount; + } + + public void setPrincipalAmount(@jakarta.annotation.Nullable String principalAmount) { + this.principalAmount = principalAmount; + } + + public GetVIPLoanAccruedInterestResponseRowsInner interestAmount( + @jakarta.annotation.Nullable String interestAmount) { + this.interestAmount = interestAmount; + return this; + } + + /** + * Get interestAmount + * + * @return interestAmount + */ + @jakarta.annotation.Nullable + public String getInterestAmount() { + return interestAmount; + } + + public void setInterestAmount(@jakarta.annotation.Nullable String interestAmount) { + this.interestAmount = interestAmount; + } + + public GetVIPLoanAccruedInterestResponseRowsInner annualInterestRate( + @jakarta.annotation.Nullable String annualInterestRate) { + this.annualInterestRate = annualInterestRate; + return this; + } + + /** + * Get annualInterestRate + * + * @return annualInterestRate + */ + @jakarta.annotation.Nullable + public String getAnnualInterestRate() { + return annualInterestRate; + } + + public void setAnnualInterestRate(@jakarta.annotation.Nullable String annualInterestRate) { + this.annualInterestRate = annualInterestRate; + } + + public GetVIPLoanAccruedInterestResponseRowsInner accrualTime( + @jakarta.annotation.Nullable Long accrualTime) { + this.accrualTime = accrualTime; + return this; + } + + /** + * Get accrualTime + * + * @return accrualTime + */ + @jakarta.annotation.Nullable + public Long getAccrualTime() { + return accrualTime; + } + + public void setAccrualTime(@jakarta.annotation.Nullable Long accrualTime) { + this.accrualTime = accrualTime; + } + + public GetVIPLoanAccruedInterestResponseRowsInner orderId( + @jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + return this; + } + + /** + * Get orderId + * + * @return orderId + */ + @jakarta.annotation.Nullable + public Long getOrderId() { + return orderId; + } + + public void setOrderId(@jakarta.annotation.Nullable Long orderId) { + this.orderId = orderId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetVIPLoanAccruedInterestResponseRowsInner getVIPLoanAccruedInterestResponseRowsInner = + (GetVIPLoanAccruedInterestResponseRowsInner) o; + return Objects.equals(this.loanCoin, getVIPLoanAccruedInterestResponseRowsInner.loanCoin) + && Objects.equals( + this.principalAmount, + getVIPLoanAccruedInterestResponseRowsInner.principalAmount) + && Objects.equals( + this.interestAmount, + getVIPLoanAccruedInterestResponseRowsInner.interestAmount) + && Objects.equals( + this.annualInterestRate, + getVIPLoanAccruedInterestResponseRowsInner.annualInterestRate) + && Objects.equals( + this.accrualTime, getVIPLoanAccruedInterestResponseRowsInner.accrualTime) + && Objects.equals(this.orderId, getVIPLoanAccruedInterestResponseRowsInner.orderId); + } + + @Override + public int hashCode() { + return Objects.hash( + loanCoin, + principalAmount, + interestAmount, + annualInterestRate, + accrualTime, + orderId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetVIPLoanAccruedInterestResponseRowsInner {\n"); + sb.append(" loanCoin: ").append(toIndentedString(loanCoin)).append("\n"); + sb.append(" principalAmount: ").append(toIndentedString(principalAmount)).append("\n"); + sb.append(" interestAmount: ").append(toIndentedString(interestAmount)).append("\n"); + sb.append(" annualInterestRate: ") + .append(toIndentedString(annualInterestRate)) + .append("\n"); + sb.append(" accrualTime: ").append(toIndentedString(accrualTime)).append("\n"); + sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object loanCoinValue = getLoanCoin(); + String loanCoinValueAsString = ""; + loanCoinValueAsString = loanCoinValue.toString(); + sb.append("loanCoin=").append(urlEncode(loanCoinValueAsString)).append(""); + Object principalAmountValue = getPrincipalAmount(); + String principalAmountValueAsString = ""; + principalAmountValueAsString = principalAmountValue.toString(); + sb.append("principalAmount=").append(urlEncode(principalAmountValueAsString)).append(""); + Object interestAmountValue = getInterestAmount(); + String interestAmountValueAsString = ""; + interestAmountValueAsString = interestAmountValue.toString(); + sb.append("interestAmount=").append(urlEncode(interestAmountValueAsString)).append(""); + Object annualInterestRateValue = getAnnualInterestRate(); + String annualInterestRateValueAsString = ""; + annualInterestRateValueAsString = annualInterestRateValue.toString(); + sb.append("annualInterestRate=") + .append(urlEncode(annualInterestRateValueAsString)) + .append(""); + Object accrualTimeValue = getAccrualTime(); + String accrualTimeValueAsString = ""; + accrualTimeValueAsString = accrualTimeValue.toString(); + sb.append("accrualTime=").append(urlEncode(accrualTimeValueAsString)).append(""); + Object orderIdValue = getOrderId(); + String orderIdValueAsString = ""; + orderIdValueAsString = orderIdValue.toString(); + sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("loanCoin"); + openapiFields.add("principalAmount"); + openapiFields.add("interestAmount"); + openapiFields.add("annualInterestRate"); + openapiFields.add("accrualTime"); + openapiFields.add("orderId"); + + // 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 + * GetVIPLoanAccruedInterestResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetVIPLoanAccruedInterestResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetVIPLoanAccruedInterestResponseRowsInner is not found in" + + " the empty JSON string", + GetVIPLoanAccruedInterestResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("loanCoin") != null && !jsonObj.get("loanCoin").isJsonNull()) + && !jsonObj.get("loanCoin").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `loanCoin` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("loanCoin").toString())); + } + if ((jsonObj.get("principalAmount") != null && !jsonObj.get("principalAmount").isJsonNull()) + && !jsonObj.get("principalAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `principalAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("principalAmount").toString())); + } + if ((jsonObj.get("interestAmount") != null && !jsonObj.get("interestAmount").isJsonNull()) + && !jsonObj.get("interestAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `interestAmount` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("interestAmount").toString())); + } + if ((jsonObj.get("annualInterestRate") != null + && !jsonObj.get("annualInterestRate").isJsonNull()) + && !jsonObj.get("annualInterestRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `annualInterestRate` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("annualInterestRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetVIPLoanAccruedInterestResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetVIPLoanAccruedInterestResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetVIPLoanAccruedInterestResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetVIPLoanAccruedInterestResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetVIPLoanAccruedInterestResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetVIPLoanAccruedInterestResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetVIPLoanAccruedInterestResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetVIPLoanAccruedInterestResponseRowsInner + */ + public static GetVIPLoanAccruedInterestResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetVIPLoanAccruedInterestResponseRowsInner.class); + } + + /** + * Convert an instance of GetVIPLoanAccruedInterestResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanInterestRateHistoryResponse.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanInterestRateHistoryResponse.java new file mode 100644 index 000000000..9930c4206 --- /dev/null +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanInterestRateHistoryResponse.java @@ -0,0 +1,286 @@ +/* + * Binance VIP Loan REST API + * OpenAPI Specification for the Binance VIP Loan REST 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.vip_loan.rest.model; + +import com.binance.connector.client.vip_loan.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +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.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** GetVIPLoanInterestRateHistoryResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetVIPLoanInterestRateHistoryResponse { + public static final String SERIALIZED_NAME_ROWS = "rows"; + + @SerializedName(SERIALIZED_NAME_ROWS) + @jakarta.annotation.Nullable + private List<@Valid GetVIPLoanInterestRateHistoryResponseRowsInner> rows; + + public static final String SERIALIZED_NAME_TOTAL = "total"; + + @SerializedName(SERIALIZED_NAME_TOTAL) + @jakarta.annotation.Nullable + private Long total; + + public GetVIPLoanInterestRateHistoryResponse() {} + + public GetVIPLoanInterestRateHistoryResponse rows( + @jakarta.annotation.Nullable + List<@Valid GetVIPLoanInterestRateHistoryResponseRowsInner> rows) { + this.rows = rows; + return this; + } + + public GetVIPLoanInterestRateHistoryResponse addRowsItem( + GetVIPLoanInterestRateHistoryResponseRowsInner rowsItem) { + if (this.rows == null) { + this.rows = new ArrayList<>(); + } + this.rows.add(rowsItem); + return this; + } + + /** + * Get rows + * + * @return rows + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid GetVIPLoanInterestRateHistoryResponseRowsInner> getRows() { + return rows; + } + + public void setRows( + @jakarta.annotation.Nullable + List<@Valid GetVIPLoanInterestRateHistoryResponseRowsInner> rows) { + this.rows = rows; + } + + public GetVIPLoanInterestRateHistoryResponse total(@jakarta.annotation.Nullable Long total) { + this.total = total; + return this; + } + + /** + * Get total + * + * @return total + */ + @jakarta.annotation.Nullable + public Long getTotal() { + return total; + } + + public void setTotal(@jakarta.annotation.Nullable Long total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetVIPLoanInterestRateHistoryResponse getVIPLoanInterestRateHistoryResponse = + (GetVIPLoanInterestRateHistoryResponse) o; + return Objects.equals(this.rows, getVIPLoanInterestRateHistoryResponse.rows) + && Objects.equals(this.total, getVIPLoanInterestRateHistoryResponse.total); + } + + @Override + public int hashCode() { + return Objects.hash(rows, total); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetVIPLoanInterestRateHistoryResponse {\n"); + sb.append(" rows: ").append(toIndentedString(rows)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object rowsValue = getRows(); + String rowsValueAsString = ""; + rowsValueAsString = + (String) + ((Collection) rowsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("rows=").append(urlEncode(rowsValueAsString)).append(""); + Object totalValue = getTotal(); + String totalValueAsString = ""; + totalValueAsString = totalValue.toString(); + sb.append("total=").append(urlEncode(totalValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("rows"); + openapiFields.add("total"); + + // 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 + * GetVIPLoanInterestRateHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetVIPLoanInterestRateHistoryResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetVIPLoanInterestRateHistoryResponse" + + " is not found in the empty JSON string", + GetVIPLoanInterestRateHistoryResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("rows") != null && !jsonObj.get("rows").isJsonNull()) { + JsonArray jsonArrayrows = jsonObj.getAsJsonArray("rows"); + if (jsonArrayrows != null) { + // ensure the json data is an array + if (!jsonObj.get("rows").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `rows` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("rows").toString())); + } + + // validate the optional field `rows` (array) + for (int i = 0; i < jsonArrayrows.size(); i++) { + GetVIPLoanInterestRateHistoryResponseRowsInner.validateJsonElement( + jsonArrayrows.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetVIPLoanInterestRateHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetVIPLoanInterestRateHistoryResponse' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetVIPLoanInterestRateHistoryResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, GetVIPLoanInterestRateHistoryResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetVIPLoanInterestRateHistoryResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetVIPLoanInterestRateHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetVIPLoanInterestRateHistoryResponse + * @throws IOException if the JSON string is invalid with respect to + * GetVIPLoanInterestRateHistoryResponse + */ + public static GetVIPLoanInterestRateHistoryResponse fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, GetVIPLoanInterestRateHistoryResponse.class); + } + + /** + * Convert an instance of GetVIPLoanInterestRateHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanInterestRateHistoryResponseRowsInner.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanInterestRateHistoryResponseRowsInner.java new file mode 100644 index 000000000..170a79e66 --- /dev/null +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanInterestRateHistoryResponseRowsInner.java @@ -0,0 +1,308 @@ +/* + * Binance VIP Loan REST API + * OpenAPI Specification for the Binance VIP Loan REST 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.vip_loan.rest.model; + +import com.binance.connector.client.vip_loan.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** GetVIPLoanInterestRateHistoryResponseRowsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetVIPLoanInterestRateHistoryResponseRowsInner { + public static final String SERIALIZED_NAME_COIN = "coin"; + + @SerializedName(SERIALIZED_NAME_COIN) + @jakarta.annotation.Nullable + private String coin; + + public static final String SERIALIZED_NAME_ANNUALIZED_INTEREST_RATE = "annualizedInterestRate"; + + @SerializedName(SERIALIZED_NAME_ANNUALIZED_INTEREST_RATE) + @jakarta.annotation.Nullable + private String annualizedInterestRate; + + public static final String SERIALIZED_NAME_TIME = "time"; + + @SerializedName(SERIALIZED_NAME_TIME) + @jakarta.annotation.Nullable + private Long time; + + public GetVIPLoanInterestRateHistoryResponseRowsInner() {} + + public GetVIPLoanInterestRateHistoryResponseRowsInner coin( + @jakarta.annotation.Nullable String coin) { + this.coin = coin; + return this; + } + + /** + * Get coin + * + * @return coin + */ + @jakarta.annotation.Nullable + public String getCoin() { + return coin; + } + + public void setCoin(@jakarta.annotation.Nullable String coin) { + this.coin = coin; + } + + public GetVIPLoanInterestRateHistoryResponseRowsInner annualizedInterestRate( + @jakarta.annotation.Nullable String annualizedInterestRate) { + this.annualizedInterestRate = annualizedInterestRate; + return this; + } + + /** + * Get annualizedInterestRate + * + * @return annualizedInterestRate + */ + @jakarta.annotation.Nullable + public String getAnnualizedInterestRate() { + return annualizedInterestRate; + } + + public void setAnnualizedInterestRate( + @jakarta.annotation.Nullable String annualizedInterestRate) { + this.annualizedInterestRate = annualizedInterestRate; + } + + public GetVIPLoanInterestRateHistoryResponseRowsInner time( + @jakarta.annotation.Nullable Long time) { + this.time = time; + return this; + } + + /** + * Get time + * + * @return time + */ + @jakarta.annotation.Nullable + public Long getTime() { + return time; + } + + public void setTime(@jakarta.annotation.Nullable Long time) { + this.time = time; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetVIPLoanInterestRateHistoryResponseRowsInner + getVIPLoanInterestRateHistoryResponseRowsInner = + (GetVIPLoanInterestRateHistoryResponseRowsInner) o; + return Objects.equals(this.coin, getVIPLoanInterestRateHistoryResponseRowsInner.coin) + && Objects.equals( + this.annualizedInterestRate, + getVIPLoanInterestRateHistoryResponseRowsInner.annualizedInterestRate) + && Objects.equals(this.time, getVIPLoanInterestRateHistoryResponseRowsInner.time); + } + + @Override + public int hashCode() { + return Objects.hash(coin, annualizedInterestRate, time); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetVIPLoanInterestRateHistoryResponseRowsInner {\n"); + sb.append(" coin: ").append(toIndentedString(coin)).append("\n"); + sb.append(" annualizedInterestRate: ") + .append(toIndentedString(annualizedInterestRate)) + .append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object coinValue = getCoin(); + String coinValueAsString = ""; + coinValueAsString = coinValue.toString(); + sb.append("coin=").append(urlEncode(coinValueAsString)).append(""); + Object annualizedInterestRateValue = getAnnualizedInterestRate(); + String annualizedInterestRateValueAsString = ""; + annualizedInterestRateValueAsString = annualizedInterestRateValue.toString(); + sb.append("annualizedInterestRate=") + .append(urlEncode(annualizedInterestRateValueAsString)) + .append(""); + Object timeValue = getTime(); + String timeValueAsString = ""; + timeValueAsString = timeValue.toString(); + sb.append("time=").append(urlEncode(timeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("coin"); + openapiFields.add("annualizedInterestRate"); + openapiFields.add("time"); + + // 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 + * GetVIPLoanInterestRateHistoryResponseRowsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetVIPLoanInterestRateHistoryResponseRowsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " GetVIPLoanInterestRateHistoryResponseRowsInner is not found" + + " in the empty JSON string", + GetVIPLoanInterestRateHistoryResponseRowsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("coin") != null && !jsonObj.get("coin").isJsonNull()) + && !jsonObj.get("coin").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `coin` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("coin").toString())); + } + if ((jsonObj.get("annualizedInterestRate") != null + && !jsonObj.get("annualizedInterestRate").isJsonNull()) + && !jsonObj.get("annualizedInterestRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `annualizedInterestRate` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("annualizedInterestRate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetVIPLoanInterestRateHistoryResponseRowsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'GetVIPLoanInterestRateHistoryResponseRowsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, + TypeToken.get(GetVIPLoanInterestRateHistoryResponseRowsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, + GetVIPLoanInterestRateHistoryResponseRowsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetVIPLoanInterestRateHistoryResponseRowsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetVIPLoanInterestRateHistoryResponseRowsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetVIPLoanInterestRateHistoryResponseRowsInner + * @throws IOException if the JSON string is invalid with respect to + * GetVIPLoanInterestRateHistoryResponseRowsInner + */ + public static GetVIPLoanInterestRateHistoryResponseRowsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson() + .fromJson(jsonString, GetVIPLoanInterestRateHistoryResponseRowsInner.class); + } + + /** + * Convert an instance of GetVIPLoanInterestRateHistoryResponseRowsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanOngoingOrdersResponseRowsInner.java b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanOngoingOrdersResponseRowsInner.java index 286cb4962..08c4dcb10 100644 --- a/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanOngoingOrdersResponseRowsInner.java +++ b/clients/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/model/GetVIPLoanOngoingOrdersResponseRowsInner.java @@ -54,6 +54,12 @@ public class GetVIPLoanOngoingOrdersResponseRowsInner { @jakarta.annotation.Nullable private String totalDebt; + public static final String SERIALIZED_NAME_LOAN_RATE = "loanRate"; + + @SerializedName(SERIALIZED_NAME_LOAN_RATE) + @jakarta.annotation.Nullable + private String loanRate; + public static final String SERIALIZED_NAME_RESIDUAL_INTEREST = "residualInterest"; @SerializedName(SERIALIZED_NAME_RESIDUAL_INTEREST) @@ -171,6 +177,26 @@ public void setTotalDebt(@jakarta.annotation.Nullable String totalDebt) { this.totalDebt = totalDebt; } + public GetVIPLoanOngoingOrdersResponseRowsInner loanRate( + @jakarta.annotation.Nullable String loanRate) { + this.loanRate = loanRate; + return this; + } + + /** + * Get loanRate + * + * @return loanRate + */ + @jakarta.annotation.Nullable + public String getLoanRate() { + return loanRate; + } + + public void setLoanRate(@jakarta.annotation.Nullable String loanRate) { + this.loanRate = loanRate; + } + public GetVIPLoanOngoingOrdersResponseRowsInner residualInterest( @jakarta.annotation.Nullable String residualInterest) { this.residualInterest = residualInterest; @@ -367,6 +393,7 @@ public boolean equals(Object o) { && Objects.equals(this.loanCoin, getVIPLoanOngoingOrdersResponseRowsInner.loanCoin) && Objects.equals( this.totalDebt, getVIPLoanOngoingOrdersResponseRowsInner.totalDebt) + && Objects.equals(this.loanRate, getVIPLoanOngoingOrdersResponseRowsInner.loanRate) && Objects.equals( this.residualInterest, getVIPLoanOngoingOrdersResponseRowsInner.residualInterest) @@ -397,6 +424,7 @@ public int hashCode() { orderId, loanCoin, totalDebt, + loanRate, residualInterest, collateralAccountId, collateralCoin, @@ -415,6 +443,7 @@ public String toString() { sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); sb.append(" loanCoin: ").append(toIndentedString(loanCoin)).append("\n"); sb.append(" totalDebt: ").append(toIndentedString(totalDebt)).append("\n"); + sb.append(" loanRate: ").append(toIndentedString(loanRate)).append("\n"); sb.append(" residualInterest: ").append(toIndentedString(residualInterest)).append("\n"); sb.append(" collateralAccountId: ") .append(toIndentedString(collateralAccountId)) @@ -449,6 +478,10 @@ public String toUrlQueryString() { String totalDebtValueAsString = ""; totalDebtValueAsString = totalDebtValue.toString(); sb.append("totalDebt=").append(urlEncode(totalDebtValueAsString)).append(""); + Object loanRateValue = getLoanRate(); + String loanRateValueAsString = ""; + loanRateValueAsString = loanRateValue.toString(); + sb.append("loanRate=").append(urlEncode(loanRateValueAsString)).append(""); Object residualInterestValue = getResidualInterest(); String residualInterestValueAsString = ""; residualInterestValueAsString = residualInterestValue.toString(); @@ -523,6 +556,7 @@ private String toIndentedString(Object o) { openapiFields.add("orderId"); openapiFields.add("loanCoin"); openapiFields.add("totalDebt"); + openapiFields.add("loanRate"); openapiFields.add("residualInterest"); openapiFields.add("collateralAccountId"); openapiFields.add("collateralCoin"); @@ -574,6 +608,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("totalDebt").toString())); } + if ((jsonObj.get("loanRate") != null && !jsonObj.get("loanRate").isJsonNull()) + && !jsonObj.get("loanRate").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `loanRate` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("loanRate").toString())); + } if ((jsonObj.get("residualInterest") != null && !jsonObj.get("residualInterest").isJsonNull()) && !jsonObj.get("residualInterest").isJsonPrimitive()) { diff --git a/clients/wallet/CHANGELOG.md b/clients/wallet/CHANGELOG.md index 72bfa5b51..8143c4d99 100644 --- a/clients/wallet/CHANGELOG.md +++ b/clients/wallet/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## 4.0.0 - 2026-02-12 + +### Added (3) + +- `dustConvert()` (`POST /sapi/v1/asset/dust-convert/convert`) +- `dustConvertibleAssets()` (`POST /sapi/v1/asset/dust-convert/query-convertible-assets`) +- `submitDepositQuestionnaireV2()` (`PUT /sapi/v2/localentity/deposit/provide-info`) + +### Changed (6) + +- Added parameter `accountType` + - affected methods: + - `dustlog()` (`GET /sapi/v1/asset/dribblet`) +- Added parameter `asset` + - affected methods: + - `assetDetail()` (`GET /sapi/v1/asset/assetDetail`) +- Modified parameter `depositId`: + - type `string` → `integer` + - affected methods: + - `submitDepositQuestionnaire()` (`PUT /sapi/v1/localentity/broker/deposit/provide-info`) +- Modified response for `assetDividendRecord()` (`GET /sapi/v1/asset/assetDividend`): + - `rows`.items: property `direction` added + - `rows`.items: item property `direction` added + +- Modified response for `withdrawHistoryV1()` (`GET /sapi/v1/localentity/withdraw/history`): + - items: property `addressTag` deleted + - items: item property `addressTag` deleted + +- Modified response for `withdrawHistoryV2()` (`GET /sapi/v2/localentity/withdraw/history`): + - items: property `addressTag` deleted + - items: item property `addressTag` deleted + ## 3.0.0 - 2025-09-22 ### Changed (1) diff --git a/clients/wallet/docs/AssetApi.md b/clients/wallet/docs/AssetApi.md index 3eddf88f1..a1e5c83a2 100644 --- a/clients/wallet/docs/AssetApi.md +++ b/clients/wallet/docs/AssetApi.md @@ -6,6 +6,8 @@ All URIs are relative to *https://api.binance.com* |------------- | ------------- | -------------| | [**assetDetail**](AssetApi.md#assetDetail) | **GET** /sapi/v1/asset/assetDetail | Asset Detail (USER_DATA) | | [**assetDividendRecord**](AssetApi.md#assetDividendRecord) | **GET** /sapi/v1/asset/assetDividend | Asset Dividend Record (USER_DATA) | +| [**dustConvert**](AssetApi.md#dustConvert) | **POST** /sapi/v1/asset/dust-convert/convert | Dust Convert (USER_DATA) | +| [**dustConvertibleAssets**](AssetApi.md#dustConvertibleAssets) | **POST** /sapi/v1/asset/dust-convert/query-convertible-assets | Dust Convertible Assets (USER_DATA) | | [**dustTransfer**](AssetApi.md#dustTransfer) | **POST** /sapi/v1/asset/dust | Dust Transfer (USER_DATA) | | [**dustlog**](AssetApi.md#dustlog) | **GET** /sapi/v1/asset/dribblet | DustLog(USER_DATA) | | [**fundingWallet**](AssetApi.md#fundingWallet) | **POST** /sapi/v1/asset/get-funding-asset | Funding Wallet (USER_DATA) | @@ -23,7 +25,7 @@ All URIs are relative to *https://api.binance.com* # **assetDetail** -> AssetDetailResponse assetDetail(recvWindow) +> AssetDetailResponse assetDetail(asset, recvWindow) Asset Detail (USER_DATA) @@ -44,9 +46,10 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); AssetApi apiInstance = new AssetApi(defaultClient); + String asset = "asset_example"; // String | Long recvWindow = 56L; // Long | try { - AssetDetailResponse result = apiInstance.assetDetail(recvWindow); + AssetDetailResponse result = apiInstance.assetDetail(asset, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AssetApi#assetDetail"); @@ -63,6 +66,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **asset** | **String**| | [optional] | | **recvWindow** | **Long**| | [optional] | ### Return type @@ -153,6 +157,130 @@ No authorization required |-------------|-------------|------------------| | **200** | Asset Dividend Record | - | + +# **dustConvert** +> DustConvertResponse dustConvert(dustConvertRequest) + +Dust Convert (USER_DATA) + +Convert dust assets Weight: 10 + +### Example +```java +// Import classes: +import com.binance.connector.client.wallet.ApiClient; +import com.binance.connector.client.wallet.ApiException; +import com.binance.connector.client.wallet.Configuration; +import com.binance.connector.client.wallet.models.*; +import com.binance.connector.client.wallet.rest.api.AssetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + AssetApi apiInstance = new AssetApi(defaultClient); + DustConvertRequest dustConvertRequest = new DustConvertRequest(); // DustConvertRequest | + try { + DustConvertResponse result = apiInstance.dustConvert(dustConvertRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AssetApi#dustConvert"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **dustConvertRequest** | [**DustConvertRequest**](DustConvertRequest.md)| | | + +### Return type + +[**DustConvertResponse**](DustConvertResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Dust Convert | - | + + +# **dustConvertibleAssets** +> DustConvertibleAssetsResponse dustConvertibleAssets(dustConvertibleAssetsRequest) + +Dust Convertible Assets (USER_DATA) + +Query dust convertible assets Weight: 1 + +### Example +```java +// Import classes: +import com.binance.connector.client.wallet.ApiClient; +import com.binance.connector.client.wallet.ApiException; +import com.binance.connector.client.wallet.Configuration; +import com.binance.connector.client.wallet.models.*; +import com.binance.connector.client.wallet.rest.api.AssetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + AssetApi apiInstance = new AssetApi(defaultClient); + DustConvertibleAssetsRequest dustConvertibleAssetsRequest = new DustConvertibleAssetsRequest(); // DustConvertibleAssetsRequest | + try { + DustConvertibleAssetsResponse result = apiInstance.dustConvertibleAssets(dustConvertibleAssetsRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AssetApi#dustConvertibleAssets"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **dustConvertibleAssetsRequest** | [**DustConvertibleAssetsRequest**](DustConvertibleAssetsRequest.md)| | | + +### Return type + +[**DustConvertibleAssetsResponse**](DustConvertibleAssetsResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Dust Convertible Assets | - | + # **dustTransfer** > DustTransferResponse dustTransfer(dustTransferRequest) @@ -217,7 +345,7 @@ No authorization required # **dustlog** -> DustlogResponse dustlog(startTime, endTime, recvWindow) +> DustlogResponse dustlog(accountType, startTime, endTime, recvWindow) DustLog(USER_DATA) @@ -238,11 +366,12 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); AssetApi apiInstance = new AssetApi(defaultClient); + String accountType = "accountType_example"; // String | `SPOT`or`MARGIN`,default`SPOT` Long startTime = 56L; // Long | Long endTime = 56L; // Long | Long recvWindow = 56L; // Long | try { - DustlogResponse result = apiInstance.dustlog(startTime, endTime, recvWindow); + DustlogResponse result = apiInstance.dustlog(accountType, startTime, endTime, recvWindow); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AssetApi#dustlog"); @@ -259,6 +388,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| +| **accountType** | **String**| `SPOT`or`MARGIN`,default`SPOT` | [optional] | | **startTime** | **Long**| | [optional] | | **endTime** | **Long**| | [optional] | | **recvWindow** | **Long**| | [optional] | @@ -543,7 +673,7 @@ No authorization required Query User Delegation History(For Master Account)(USER_DATA) -Query User Delegation History * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint Weight: 60 +Query User Delegation History Weight: 60 ### Example ```java diff --git a/clients/wallet/docs/AssetDividendRecordResponseRowsInner.md b/clients/wallet/docs/AssetDividendRecordResponseRowsInner.md index 2a31de9a4..00fcaad2f 100644 --- a/clients/wallet/docs/AssetDividendRecordResponseRowsInner.md +++ b/clients/wallet/docs/AssetDividendRecordResponseRowsInner.md @@ -13,6 +13,7 @@ |**divTime** | **Long** | | [optional] | |**enInfo** | **String** | | [optional] | |**tranId** | **Long** | | [optional] | +|**direction** | **Long** | | [optional] | diff --git a/clients/wallet/docs/DustConvertRequest.md b/clients/wallet/docs/DustConvertRequest.md new file mode 100644 index 000000000..cdfbf3737 --- /dev/null +++ b/clients/wallet/docs/DustConvertRequest.md @@ -0,0 +1,17 @@ + + +# DustConvertRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**asset** | **String** | | | +|**clientId** | **String** | | [optional] | +|**targetAsset** | **String** | | [optional] | +|**thirdPartyClientId** | **String** | | [optional] | +|**dustQuotaAssetToTargetAssetPrice** | **Double** | | [optional] | + + + diff --git a/clients/wallet/docs/DustConvertResponse.md b/clients/wallet/docs/DustConvertResponse.md new file mode 100644 index 000000000..e84658e77 --- /dev/null +++ b/clients/wallet/docs/DustConvertResponse.md @@ -0,0 +1,15 @@ + + +# DustConvertResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**totalTransfered** | **String** | | [optional] | +|**totalServiceCharge** | **String** | | [optional] | +|**transferResult** | [**List<DustConvertResponseTransferResultInner>**](DustConvertResponseTransferResultInner.md) | | [optional] | + + + diff --git a/clients/wallet/docs/DustConvertResponseTransferResultInner.md b/clients/wallet/docs/DustConvertResponseTransferResultInner.md new file mode 100644 index 000000000..6d9817036 --- /dev/null +++ b/clients/wallet/docs/DustConvertResponseTransferResultInner.md @@ -0,0 +1,18 @@ + + +# DustConvertResponseTransferResultInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**tranId** | **Long** | | [optional] | +|**fromAsset** | **String** | | [optional] | +|**amount** | **String** | | [optional] | +|**transferedAmount** | **String** | | [optional] | +|**serviceChargeAmount** | **String** | | [optional] | +|**operateTime** | **Long** | | [optional] | + + + diff --git a/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginRequest.md b/clients/wallet/docs/DustConvertibleAssetsRequest.md similarity index 51% rename from clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginRequest.md rename to clients/wallet/docs/DustConvertibleAssetsRequest.md index d0228b729..2cf0ae2a1 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/docs/RedeemBfusdForPortfolioMarginRequest.md +++ b/clients/wallet/docs/DustConvertibleAssetsRequest.md @@ -1,16 +1,14 @@ -# RedeemBfusdForPortfolioMarginRequest +# DustConvertibleAssetsRequest ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**fromAsset** | **String** | | | |**targetAsset** | **String** | | | -|**amount** | **Double** | | | -|**recvWindow** | **Long** | | [optional] | +|**dustQuotaAssetToTargetAssetPrice** | **Double** | | [optional] | diff --git a/clients/wallet/docs/DustConvertibleAssetsResponse.md b/clients/wallet/docs/DustConvertibleAssetsResponse.md new file mode 100644 index 000000000..3bd106daa --- /dev/null +++ b/clients/wallet/docs/DustConvertibleAssetsResponse.md @@ -0,0 +1,17 @@ + + +# DustConvertibleAssetsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dribbletPercentage** | **String** | | [optional] | +|**totalTransferQuotaAssetAmount** | **String** | | [optional] | +|**totalTransferTargetAssetAmount** | **String** | | [optional] | +|**dribbletBase** | **String** | | [optional] | +|**details** | [**List<DustConvertibleAssetsResponseDetailsInner>**](DustConvertibleAssetsResponseDetailsInner.md) | | [optional] | + + + diff --git a/clients/wallet/docs/DustConvertibleAssetsResponseDetailsInner.md b/clients/wallet/docs/DustConvertibleAssetsResponseDetailsInner.md new file mode 100644 index 000000000..c6d27e316 --- /dev/null +++ b/clients/wallet/docs/DustConvertibleAssetsResponseDetailsInner.md @@ -0,0 +1,19 @@ + + +# DustConvertibleAssetsResponseDetailsInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**asset** | **String** | | [optional] | +|**assetFullName** | **String** | | [optional] | +|**amountFree** | **String** | | [optional] | +|**exchange** | **String** | | [optional] | +|**toQuotaAssetAmount** | **String** | | [optional] | +|**toTargetAssetAmount** | **String** | | [optional] | +|**toTargetAssetOffExchange** | **String** | | [optional] | + + + diff --git a/clients/wallet/docs/OneClickArrivalDepositApplyRequest.md b/clients/wallet/docs/OneClickArrivalDepositApplyRequest.md index 1b43213f1..fd64bbce4 100644 --- a/clients/wallet/docs/OneClickArrivalDepositApplyRequest.md +++ b/clients/wallet/docs/OneClickArrivalDepositApplyRequest.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**depositId** | **String** | | [optional] | +|**depositId** | **Long** | | [optional] | |**txId** | **String** | | [optional] | |**subAccountId** | **String** | | [optional] | |**subUserId** | **Long** | | [optional] | diff --git a/clients/wallet/docs/SubmitDepositQuestionnaireRequest.md b/clients/wallet/docs/SubmitDepositQuestionnaireRequest.md index 26f696c74..066816dfb 100644 --- a/clients/wallet/docs/SubmitDepositQuestionnaireRequest.md +++ b/clients/wallet/docs/SubmitDepositQuestionnaireRequest.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**subAccountId** | **String** | | | -|**depositId** | **String** | | | +|**depositId** | **Long** | | | |**questionnaire** | **String** | | | |**beneficiaryPii** | **String** | | | |**network** | **String** | | [optional] | diff --git a/clients/wallet/docs/SubmitDepositQuestionnaireV2Request.md b/clients/wallet/docs/SubmitDepositQuestionnaireV2Request.md new file mode 100644 index 000000000..b56938559 --- /dev/null +++ b/clients/wallet/docs/SubmitDepositQuestionnaireV2Request.md @@ -0,0 +1,14 @@ + + +# SubmitDepositQuestionnaireV2Request + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**depositId** | **Long** | | | +|**questionnaire** | **String** | | | + + + diff --git a/clients/wallet/docs/SubmitDepositQuestionnaireV2Response.md b/clients/wallet/docs/SubmitDepositQuestionnaireV2Response.md new file mode 100644 index 000000000..8ce0fea55 --- /dev/null +++ b/clients/wallet/docs/SubmitDepositQuestionnaireV2Response.md @@ -0,0 +1,15 @@ + + +# SubmitDepositQuestionnaireV2Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**trId** | **Long** | | [optional] | +|**accepted** | **Boolean** | | [optional] | +|**info** | **String** | | [optional] | + + + diff --git a/clients/wallet/docs/TravelRuleApi.md b/clients/wallet/docs/TravelRuleApi.md index 3e56f3f07..fe83c6f18 100644 --- a/clients/wallet/docs/TravelRuleApi.md +++ b/clients/wallet/docs/TravelRuleApi.md @@ -11,6 +11,7 @@ All URIs are relative to *https://api.binance.com* | [**fetchAddressVerificationList**](TravelRuleApi.md#fetchAddressVerificationList) | **GET** /sapi/v1/addressVerify/list | Fetch address verification list (USER_DATA) | | [**submitDepositQuestionnaire**](TravelRuleApi.md#submitDepositQuestionnaire) | **PUT** /sapi/v1/localentity/broker/deposit/provide-info | Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA) | | [**submitDepositQuestionnaireTravelRule**](TravelRuleApi.md#submitDepositQuestionnaireTravelRule) | **PUT** /sapi/v1/localentity/deposit/provide-info | Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (USER_DATA) | +| [**submitDepositQuestionnaireV2**](TravelRuleApi.md#submitDepositQuestionnaireV2) | **PUT** /sapi/v2/localentity/deposit/provide-info | Submit Deposit Questionnaire V2 (For local entities that require travel rule) (supporting network) (USER_DATA) | | [**vaspList**](TravelRuleApi.md#vaspList) | **GET** /sapi/v1/localentity/vasp | VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) | | [**withdrawHistoryV1**](TravelRuleApi.md#withdrawHistoryV1) | **GET** /sapi/v1/localentity/withdraw/history | Withdraw History (for local entities that require travel rule) (supporting network) (USER_DATA) | | [**withdrawHistoryV2**](TravelRuleApi.md#withdrawHistoryV2) | **GET** /sapi/v2/localentity/withdraw/history | Withdraw History V2 (for local entities that require travel rule) (supporting network) (USER_DATA) | @@ -246,7 +247,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TravelRuleApi apiInstance = new TravelRuleApi(defaultClient); - String depositId = "depositId_example"; // String | Comma(,) separated list of wallet tran Ids. + Long depositId = 56L; // Long | Comma(,) separated list of wallet tran Ids. String txId = "txId_example"; // String | String network = "network_example"; // String | String coin = "coin_example"; // String | @@ -273,7 +274,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **depositId** | **String**| Comma(,) separated list of wallet tran Ids. | [optional] | +| **depositId** | **Long**| Comma(,) separated list of wallet tran Ids. | [optional] | | **txId** | **String**| | [optional] | | **network** | **String**| | [optional] | | **coin** | **String**| | [optional] | @@ -487,6 +488,68 @@ No authorization required |-------------|-------------|------------------| | **200** | Submit Deposit Questionnaire | - | + +# **submitDepositQuestionnaireV2** +> SubmitDepositQuestionnaireV2Response submitDepositQuestionnaireV2(submitDepositQuestionnaireV2Request) + +Submit Deposit Questionnaire V2 (For local entities that require travel rule) (supporting network) (USER_DATA) + +Submit questionnaire for local entities that require travel rule. The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not yet onboarded with GTR. * Questionnaire is different for each local entity, please refer * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`, Weight: 600 + +### Example +```java +// Import classes: +import com.binance.connector.client.wallet.ApiClient; +import com.binance.connector.client.wallet.ApiException; +import com.binance.connector.client.wallet.Configuration; +import com.binance.connector.client.wallet.models.*; +import com.binance.connector.client.wallet.rest.api.TravelRuleApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + TravelRuleApi apiInstance = new TravelRuleApi(defaultClient); + SubmitDepositQuestionnaireV2Request submitDepositQuestionnaireV2Request = new SubmitDepositQuestionnaireV2Request(); // SubmitDepositQuestionnaireV2Request | + try { + SubmitDepositQuestionnaireV2Response result = apiInstance.submitDepositQuestionnaireV2(submitDepositQuestionnaireV2Request); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TravelRuleApi#submitDepositQuestionnaireV2"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **submitDepositQuestionnaireV2Request** | [**SubmitDepositQuestionnaireV2Request**](SubmitDepositQuestionnaireV2Request.md)| | | + +### Return type + +[**SubmitDepositQuestionnaireV2Response**](SubmitDepositQuestionnaireV2Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Submit Deposit Questionnaire V2 | - | + # **vaspList** > VaspListResponse vaspList(recvWindow) diff --git a/clients/wallet/docs/WithdrawHistoryV2ResponseInner.md b/clients/wallet/docs/WithdrawHistoryV2ResponseInner.md index 13cc0f529..08f3eefb2 100644 --- a/clients/wallet/docs/WithdrawHistoryV2ResponseInner.md +++ b/clients/wallet/docs/WithdrawHistoryV2ResponseInner.md @@ -15,7 +15,6 @@ |**withdrawalStatus** | **Long** | | [optional] | |**travelRuleStatus** | **Long** | | [optional] | |**address** | **String** | | [optional] | -|**addressTag** | **String** | | [optional] | |**txId** | **String** | | [optional] | |**applyTime** | **String** | | [optional] | |**network** | **String** | | [optional] | diff --git a/clients/wallet/docs/rest-api/migration-guide.md b/clients/wallet/docs/rest-api/migration-guide.md index 2c2adf048..1dc3a83c8 100644 --- a/clients/wallet/docs/rest-api/migration-guide.md +++ b/clients/wallet/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-wallet - 3.0.0 + 4.0.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-wallet - 3.0.0 + 4.0.0 ``` diff --git a/clients/wallet/example_rest.md b/clients/wallet/example_rest.md index f3878cf63..019ed5bb0 100644 --- a/clients/wallet/example_rest.md +++ b/clients/wallet/example_rest.md @@ -20,6 +20,10 @@ [GET /sapi/v1/asset/assetDividend](https://developers.binance.com/docs/wallet/asset/assets-divided-record) - assetDividendRecord - [AssetDividendRecordExample.java:47](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/AssetDividendRecordExample.java#L47) +[POST /sapi/v1/asset/dust-convert/convert](https://developers.binance.com/docs/wallet/asset/Dust-Convert) - dustConvert - [DustConvertExample.java:47](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertExample.java#L47) + +[POST /sapi/v1/asset/dust-convert/query-convertible-assets](https://developers.binance.com/docs/wallet/asset/Dust-Convertible-Assets) - dustConvertibleAssets - [DustConvertibleAssetsExample.java:47](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertibleAssetsExample.java#L47) + [POST /sapi/v1/asset/dust](https://developers.binance.com/docs/wallet/asset/Dust-Transfer) - dustTransfer - [DustTransferExample.java:48](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustTransferExample.java#L48) [GET /sapi/v1/asset/dribblet](https://developers.binance.com/docs/wallet/asset/dust-log) - dustlog - [DustlogExample.java:46](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustlogExample.java#L46) @@ -32,11 +36,11 @@ [GET /sapi/v1/spot/open-symbol-list](https://developers.binance.com/docs/wallet/asset/open-symbol-list) - getOpenSymbolList - [GetOpenSymbolListExample.java:47](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/GetOpenSymbolListExample.java#L47) -[GET /sapi/v1/asset/custody/transfer-history](https://developers.binance.com/docs/wallet/asset/query-user-delegation) - queryUserDelegationHistory - [QueryUserDelegationHistoryExample.java:47](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserDelegationHistoryExample.java#L47) +[GET /sapi/v1/asset/custody/transfer-history](https://developers.binance.com/docs/wallet/asset/query-user-delegation) - queryUserDelegationHistory - [QueryUserDelegationHistoryExample.java:46](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserDelegationHistoryExample.java#L46) [GET /sapi/v1/asset/transfer](https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer) - queryUserUniversalTransferHistory - [QueryUserUniversalTransferHistoryExample.java:50](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserUniversalTransferHistoryExample.java#L50) -[GET /sapi/v1/asset/wallet/balance](https://developers.binance.com/docs/wallet/asset/Query-User-Wallet-Balance) - queryUserWalletBalance - [QueryUserWalletBalanceExample.java:47](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserWalletBalanceExample.java#L47) +[GET /sapi/v1/asset/wallet/balance](https://developers.binance.com/docs/wallet/asset/Query-User-Wallet-Balance) - queryUserWalletBalance - [QueryUserWalletBalanceExample.java:46](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserWalletBalanceExample.java#L46) [POST /sapi/v1/bnbBurn](https://developers.binance.com/docs/wallet/asset/Toggle-BNB-Burn-On-Spot-Trade-And-Margin-Interest) - toggleBnbBurnOnSpotTradeAndMarginInterest - [ToggleBnbBurnOnSpotTradeAndMarginInterestExample.java:48](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/ToggleBnbBurnOnSpotTradeAndMarginInterestExample.java#L48) @@ -62,7 +66,7 @@ [POST /sapi/v1/capital/deposit/credit-apply](https://developers.binance.com/docs/wallet/capital/one-click-arrival-deposite-apply) - oneClickArrivalDepositApply - [OneClickArrivalDepositApplyExample.java:48](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/OneClickArrivalDepositApplyExample.java#L48) -[POST /sapi/v1/capital/withdraw/apply](https://developers.binance.com/docs/wallet/capital/Withdraw) - withdraw - [WithdrawExample.java:50](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/WithdrawExample.java#L50) +[POST /sapi/v1/capital/withdraw/apply](https://developers.binance.com/docs/wallet/capital/Withdraw) - withdraw - [WithdrawExample.java:55](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/WithdrawExample.java#L55) [GET /sapi/v1/capital/withdraw/history](https://developers.binance.com/docs/wallet/capital/Withdraw-History) - withdrawHistory - [WithdrawHistoryExample.java:54](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/capital/WithdrawHistoryExample.java#L54) @@ -76,19 +80,25 @@ [POST /sapi/v1/localentity/broker/withdraw/apply](https://developers.binance.com/docs/wallet/travel-rule/Broker-Withdraw) - brokerWithdraw - [BrokerWithdrawExample.java:52](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/BrokerWithdrawExample.java#L52) +[GET /sapi/v1/localentity/questionnaire-requirements](https://developers.binance.com/docs/wallet/travel-rule/questionnaire-requirements) - checkQuestionnaireRequirements - [CheckQuestionnaireRequirementsExample.java:48](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/CheckQuestionnaireRequirementsExample.java#L48) + [GET /sapi/v1/localentity/deposit/history](https://developers.binance.com/docs/wallet/travel-rule/Deposit-History) - depositHistoryTravelRule - [DepositHistoryTravelRuleExample.java:51](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryTravelRuleExample.java#L51) -[GET /sapi/v1/addressVerify/list](https://developers.binance.com/docs/wallet/travel-rule/address-verification-list) - fetchAddressVerificationList - [FetchAddressVerificationListExample.java:46](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java#L46) +[GET /sapi/v2/localentity/deposit/history](https://developers.binance.com/docs/wallet/travel-rule/Deposit-History-V2) - depositHistoryV2 - [DepositHistoryV2Example.java:51](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java#L51) -[GET /sapi/v1/localentity/vasp](https://developers.binance.com/docs/wallet/travel-rule/Onboarded-VASP-list) - onboardedVaspList - [OnboardedVaspListExample.java:52](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/OnboardedVaspListExample.java#L52) +[GET /sapi/v1/addressVerify/list](https://developers.binance.com/docs/wallet/travel-rule/address-verification-list) - fetchAddressVerificationList - [FetchAddressVerificationListExample.java:47](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/FetchAddressVerificationListExample.java#L47) [PUT /sapi/v1/localentity/broker/deposit/provide-info](https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info) - submitDepositQuestionnaire - [SubmitDepositQuestionnaireExample.java:52](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireExample.java#L52) [PUT /sapi/v1/localentity/deposit/provide-info](https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info) - submitDepositQuestionnaireTravelRule - [SubmitDepositQuestionnaireTravelRuleExample.java:52](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireTravelRuleExample.java#L52) -[GET /sapi/v1/localentity/withdraw/history](https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History) - withdrawHistoryV1 - [WithdrawHistoryV1Example.java:55](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV1Example.java#L55) +[PUT /sapi/v2/localentity/deposit/provide-info](https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info-v2) - submitDepositQuestionnaireV2 - [SubmitDepositQuestionnaireV2Example.java:52](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireV2Example.java#L52) + +[GET /sapi/v1/localentity/vasp](https://developers.binance.com/docs/wallet/travel-rule/onboarded-vasp-list) - vaspList - [VaspListExample.java:46](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/VaspListExample.java#L46) + +[GET /sapi/v1/localentity/withdraw/history](https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History) - withdrawHistoryV1 - [WithdrawHistoryV1Example.java:51](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV1Example.java#L51) -[GET /sapi/v2/localentity/withdraw/history](https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History-V2) - withdrawHistoryV2 - [WithdrawHistoryV2Example.java:61](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV2Example.java#L61) +[GET /sapi/v2/localentity/withdraw/history](https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History-V2) - withdrawHistoryV2 - [WithdrawHistoryV2Example.java:56](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawHistoryV2Example.java#L56) [POST /sapi/v1/localentity/withdraw/apply](https://developers.binance.com/docs/wallet/travel-rule/Withdraw) - withdrawTravelRule - [WithdrawTravelRuleExample.java:53](/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/WithdrawTravelRuleExample.java#L53) diff --git a/clients/wallet/pom.xml b/clients/wallet/pom.xml index 058489bd4..41b6927e8 100644 --- a/clients/wallet/pom.xml +++ b/clients/wallet/pom.xml @@ -5,7 +5,7 @@ 4.0.0 binance-wallet wallet - 3.0.0 + 4.0.0 jar @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.3.1 \ No newline at end of file diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java index b38053ddf..c00586dd1 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/JSON.java @@ -211,6 +211,24 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.DisableFastWithdrawSwitchRequest .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.DustConvertRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.DustConvertResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .DustConvertResponseTransferResultInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsRequest + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsResponse + .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .DustConvertibleAssetsResponseDetailsInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.DustTransferRequest .CustomTypeAdapterFactory()); @@ -343,6 +361,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model .SubmitDepositQuestionnaireTravelRuleResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .SubmitDepositQuestionnaireV2Request.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.wallet.rest.model + .SubmitDepositQuestionnaireV2Response.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.wallet.rest.model.SystemStatusResponse .CustomTypeAdapterFactory()); diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java index 4e2b13ba3..d8991894f 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AccountApi.java @@ -49,7 +49,7 @@ public class AccountApi { private static final String USER_AGENT = String.format( - "binance-wallet/3.0.0 (Java/%s; %s; %s)", + "binance-wallet/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java index 2a4aa9686..a75e56434 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/AssetApi.java @@ -22,6 +22,10 @@ import com.binance.connector.client.common.exception.ConstraintViolationException; import com.binance.connector.client.wallet.rest.model.AssetDetailResponse; import com.binance.connector.client.wallet.rest.model.AssetDividendRecordResponse; +import com.binance.connector.client.wallet.rest.model.DustConvertRequest; +import com.binance.connector.client.wallet.rest.model.DustConvertResponse; +import com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsRequest; +import com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsResponse; import com.binance.connector.client.wallet.rest.model.DustTransferRequest; import com.binance.connector.client.wallet.rest.model.DustTransferResponse; import com.binance.connector.client.wallet.rest.model.DustlogResponse; @@ -64,7 +68,7 @@ public class AssetApi { private static final String USER_AGENT = String.format( - "binance-wallet/3.0.0 (Java/%s; %s; %s)", + "binance-wallet/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -104,6 +108,7 @@ public void setCustomBaseUrl(String customBaseUrl) { /** * Build call for assetDetail * + * @param asset (optional) * @param recvWindow (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -117,7 +122,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * @see Asset Detail * (USER_DATA) Documentation */ - private okhttp3.Call assetDetailCall(Long recvWindow) throws ApiException { + private okhttp3.Call assetDetailCall(String asset, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -142,6 +147,10 @@ private okhttp3.Call assetDetailCall(Long recvWindow) throws ApiException { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (asset != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("asset", asset)); + } + if (recvWindow != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); } @@ -177,7 +186,8 @@ private okhttp3.Call assetDetailCall(Long recvWindow) throws ApiException { } @SuppressWarnings("rawtypes") - private okhttp3.Call assetDetailValidateBeforeCall(Long recvWindow) throws ApiException { + private okhttp3.Call assetDetailValidateBeforeCall(String asset, Long recvWindow) + throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -187,13 +197,13 @@ private okhttp3.Call assetDetailValidateBeforeCall(Long recvWindow) throws ApiEx .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {recvWindow}; - Method method = this.getClass().getMethod("assetDetail", Long.class); + Object[] parameterValues = {asset, recvWindow}; + Method method = this.getClass().getMethod("assetDetail", String.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return assetDetailCall(recvWindow); + return assetDetailCall(asset, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -211,6 +221,7 @@ private okhttp3.Call assetDetailValidateBeforeCall(Long recvWindow) throws ApiEx * and other deposit or withdraw details from ``GET * /sapi/v1/capital/config/getall``. Weight: 1 * + * @param asset (optional) * @param recvWindow (optional) * @return ApiResponse<AssetDetailResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -225,8 +236,9 @@ private okhttp3.Call assetDetailValidateBeforeCall(Long recvWindow) throws ApiEx * @see Asset Detail * (USER_DATA) Documentation */ - public ApiResponse assetDetail(Long recvWindow) throws ApiException { - okhttp3.Call localVarCall = assetDetailValidateBeforeCall(recvWindow); + public ApiResponse assetDetail(String asset, Long recvWindow) + throws ApiException { + okhttp3.Call localVarCall = assetDetailValidateBeforeCall(asset, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); @@ -401,6 +413,303 @@ public ApiResponse assetDividendRecord( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for dustConvert + * + * @param dustConvertRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Dust Convert -
+ * + * @see Dust Convert + * (USER_DATA) Documentation + */ + private okhttp3.Call dustConvertCall(DustConvertRequest dustConvertRequest) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/asset/dust-convert/convert"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (dustConvertRequest.getAsset() != null) { + localVarFormParams.put("asset", dustConvertRequest.getAsset()); + } + + if (dustConvertRequest.getClientId() != null) { + localVarFormParams.put("clientId", dustConvertRequest.getClientId()); + } + + if (dustConvertRequest.getTargetAsset() != null) { + localVarFormParams.put("targetAsset", dustConvertRequest.getTargetAsset()); + } + + if (dustConvertRequest.getThirdPartyClientId() != null) { + localVarFormParams.put( + "thirdPartyClientId", dustConvertRequest.getThirdPartyClientId()); + } + + if (dustConvertRequest.getDustQuotaAssetToTargetAssetPrice() != null) { + localVarFormParams.put( + "dustQuotaAssetToTargetAssetPrice", + DecimalFormatter.getFormatter() + .format(dustConvertRequest.getDustQuotaAssetToTargetAssetPrice())); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call dustConvertValidateBeforeCall(DustConvertRequest dustConvertRequest) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {dustConvertRequest}; + Method method = this.getClass().getMethod("dustConvert", DustConvertRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return dustConvertCall(dustConvertRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Dust Convert (USER_DATA) Convert dust assets Weight: 10 + * + * @param dustConvertRequest (required) + * @return ApiResponse<DustConvertResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Dust Convert -
+ * + * @see Dust Convert + * (USER_DATA) Documentation + */ + public ApiResponse dustConvert( + @Valid @NotNull DustConvertRequest dustConvertRequest) throws ApiException { + okhttp3.Call localVarCall = dustConvertValidateBeforeCall(dustConvertRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Build call for dustConvertibleAssets + * + * @param dustConvertibleAssetsRequest (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Dust Convertible Assets -
+ * + * @see Dust + * Convertible Assets (USER_DATA) Documentation + */ + private okhttp3.Call dustConvertibleAssetsCall( + DustConvertibleAssetsRequest dustConvertibleAssetsRequest) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v1/asset/dust-convert/query-convertible-assets"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (dustConvertibleAssetsRequest.getTargetAsset() != null) { + localVarFormParams.put("targetAsset", dustConvertibleAssetsRequest.getTargetAsset()); + } + + if (dustConvertibleAssetsRequest.getDustQuotaAssetToTargetAssetPrice() != null) { + localVarFormParams.put( + "dustQuotaAssetToTargetAssetPrice", + DecimalFormatter.getFormatter() + .format( + dustConvertibleAssetsRequest + .getDustQuotaAssetToTargetAssetPrice())); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call dustConvertibleAssetsValidateBeforeCall( + DustConvertibleAssetsRequest dustConvertibleAssetsRequest) throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {dustConvertibleAssetsRequest}; + Method method = + this.getClass() + .getMethod("dustConvertibleAssets", DustConvertibleAssetsRequest.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return dustConvertibleAssetsCall(dustConvertibleAssetsRequest); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Dust Convertible Assets (USER_DATA) Query dust convertible assets Weight: 1 + * + * @param dustConvertibleAssetsRequest (required) + * @return ApiResponse<DustConvertibleAssetsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Dust Convertible Assets -
+ * + * @see Dust + * Convertible Assets (USER_DATA) Documentation + */ + public ApiResponse dustConvertibleAssets( + @Valid @NotNull DustConvertibleAssetsRequest dustConvertibleAssetsRequest) + throws ApiException { + okhttp3.Call localVarCall = + dustConvertibleAssetsValidateBeforeCall(dustConvertibleAssetsRequest); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for dustTransfer * @@ -546,6 +855,7 @@ public ApiResponse dustTransfer( /** * Build call for dustlog * + * @param accountType `SPOT`or`MARGIN`,default`SPOT` (optional) * @param startTime (optional) * @param endTime (optional) * @param recvWindow (optional) @@ -561,8 +871,8 @@ public ApiResponse dustTransfer( * @see DustLog(USER_DATA) * Documentation */ - private okhttp3.Call dustlogCall(Long startTime, Long endTime, Long recvWindow) - throws ApiException { + private okhttp3.Call dustlogCall( + String accountType, Long startTime, Long endTime, Long recvWindow) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] {}; @@ -587,6 +897,11 @@ private okhttp3.Call dustlogCall(Long startTime, Long endTime, Long recvWindow) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (accountType != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("accountType", accountType)); + } + if (startTime != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startTime", startTime)); } @@ -630,8 +945,8 @@ private okhttp3.Call dustlogCall(Long startTime, Long endTime, Long recvWindow) } @SuppressWarnings("rawtypes") - private okhttp3.Call dustlogValidateBeforeCall(Long startTime, Long endTime, Long recvWindow) - throws ApiException { + private okhttp3.Call dustlogValidateBeforeCall( + String accountType, Long startTime, Long endTime, Long recvWindow) throws ApiException { try { Validator validator = Validation.byDefaultProvider() @@ -641,14 +956,15 @@ private okhttp3.Call dustlogValidateBeforeCall(Long startTime, Long endTime, Lon .getValidator(); ExecutableValidator executableValidator = validator.forExecutables(); - Object[] parameterValues = {startTime, endTime, recvWindow}; + Object[] parameterValues = {accountType, startTime, endTime, recvWindow}; Method method = - this.getClass().getMethod("dustlog", Long.class, Long.class, Long.class); + this.getClass() + .getMethod("dustlog", String.class, Long.class, Long.class, Long.class); Set> violations = executableValidator.validateParameters(this, method, parameterValues); if (violations.size() == 0) { - return dustlogCall(startTime, endTime, recvWindow); + return dustlogCall(accountType, startTime, endTime, recvWindow); } else { throw new ConstraintViolationException((Set) violations); } @@ -665,6 +981,7 @@ private okhttp3.Call dustlogValidateBeforeCall(Long startTime, Long endTime, Lon * DustLog(USER_DATA) Dustlog * Only return last 100 records * Only return records after * 2020/12/01 Weight: 1 * + * @param accountType `SPOT`or`MARGIN`,default`SPOT` (optional) * @param startTime (optional) * @param endTime (optional) * @param recvWindow (optional) @@ -681,9 +998,10 @@ private okhttp3.Call dustlogValidateBeforeCall(Long startTime, Long endTime, Lon * @see DustLog(USER_DATA) * Documentation */ - public ApiResponse dustlog(Long startTime, Long endTime, Long recvWindow) - throws ApiException { - okhttp3.Call localVarCall = dustlogValidateBeforeCall(startTime, endTime, recvWindow); + public ApiResponse dustlog( + String accountType, Long startTime, Long endTime, Long recvWindow) throws ApiException { + okhttp3.Call localVarCall = + dustlogValidateBeforeCall(accountType, startTime, endTime, recvWindow); java.lang.reflect.Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -1488,9 +1806,8 @@ private okhttp3.Call queryUserDelegationHistoryValidateBeforeCall( } /** - * Query User Delegation History(For Master Account)(USER_DATA) Query User Delegation History * - * You need to open Enable Spot & Margin Trading permission for the API Key which requests - * this endpoint Weight: 60 + * Query User Delegation History(For Master Account)(USER_DATA) Query User Delegation History + * Weight: 60 * * @param email (required) * @param startTime (required) diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java index 4c3f3e439..147e648a7 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/CapitalApi.java @@ -54,7 +54,7 @@ public class CapitalApi { private static final String USER_AGENT = String.format( - "binance-wallet/3.0.0 (Java/%s; %s; %s)", + "binance-wallet/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java index 1057eca6e..250d23541 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/OthersApi.java @@ -43,7 +43,7 @@ public class OthersApi { private static final String USER_AGENT = String.format( - "binance-wallet/3.0.0 (Java/%s; %s; %s)", + "binance-wallet/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java index 24a597b1e..17968be65 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/TravelRuleApi.java @@ -30,6 +30,8 @@ import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireResponse; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleRequest; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleResponse; +import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireV2Request; +import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireV2Response; import com.binance.connector.client.wallet.rest.model.VaspListResponse; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV1Response; import com.binance.connector.client.wallet.rest.model.WithdrawHistoryV2Response; @@ -58,7 +60,7 @@ public class TravelRuleApi { private static final String USER_AGENT = String.format( - "binance-wallet/3.0.0 (Java/%s; %s; %s)", + "binance-wallet/4.0.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -734,7 +736,7 @@ public ApiResponse depositHistoryTravelRule( * (USER_DATA) Documentation */ private okhttp3.Call depositHistoryV2Call( - String depositId, + Long depositId, String txId, String network, String coin, @@ -838,7 +840,7 @@ private okhttp3.Call depositHistoryV2Call( @SuppressWarnings("rawtypes") private okhttp3.Call depositHistoryV2ValidateBeforeCall( - String depositId, + Long depositId, String txId, String network, String coin, @@ -872,7 +874,7 @@ private okhttp3.Call depositHistoryV2ValidateBeforeCall( this.getClass() .getMethod( "depositHistoryV2", - String.class, + Long.class, String.class, String.class, String.class, @@ -941,7 +943,7 @@ private okhttp3.Call depositHistoryV2ValidateBeforeCall( * (USER_DATA) Documentation */ public ApiResponse depositHistoryV2( - String depositId, + Long depositId, String txId, String network, String coin, @@ -1453,6 +1455,160 @@ private okhttp3.Call submitDepositQuestionnaireTravelRuleValidateBeforeCall( return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for submitDepositQuestionnaireV2 + * + * @param submitDepositQuestionnaireV2Request (required) + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Submit Deposit Questionnaire V2 -
+ * + * @see Submit + * Deposit Questionnaire V2 (For local entities that require travel rule) (supporting + * network) (USER_DATA) Documentation + */ + private okhttp3.Call submitDepositQuestionnaireV2Call( + SubmitDepositQuestionnaireV2Request submitDepositQuestionnaireV2Request) + throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] {}; + + // Determine Base Path to Use + if (localCustomBaseUrl != null) { + basePath = localCustomBaseUrl; + } else if (localBasePaths.length > 0) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sapi/v2/localentity/deposit/provide-info"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (submitDepositQuestionnaireV2Request.getDepositId() != null) { + localVarFormParams.put("depositId", submitDepositQuestionnaireV2Request.getDepositId()); + } + + if (submitDepositQuestionnaireV2Request.getQuestionnaire() != null) { + localVarFormParams.put( + "questionnaire", submitDepositQuestionnaireV2Request.getQuestionnaire()); + } + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; + final String localVarContentType = + localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (!localVarFormParams.isEmpty() && localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + Set localVarAuthNames = new HashSet<>(); + localVarAuthNames.add("binanceSignature"); + if (HAS_TIME_UNIT) { + localVarAuthNames.add("timeUnit"); + } + return localVarApiClient.buildCall( + basePath, + localVarPath, + "PUT", + localVarQueryParams, + localVarCollectionQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAuthNames); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitDepositQuestionnaireV2ValidateBeforeCall( + SubmitDepositQuestionnaireV2Request submitDepositQuestionnaireV2Request) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {submitDepositQuestionnaireV2Request}; + Method method = + this.getClass() + .getMethod( + "submitDepositQuestionnaireV2", + SubmitDepositQuestionnaireV2Request.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return submitDepositQuestionnaireV2Call(submitDepositQuestionnaireV2Request); + } else { + throw new ConstraintViolationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + } + + /** + * Submit Deposit Questionnaire V2 (For local entities that require travel rule) (supporting + * network) (USER_DATA) Submit questionnaire for local entities that require travel rule. The + * questionnaire is only applies to transactions from unhosted wallets or VASPs that are not yet + * onboarded with GTR. * Questionnaire is different for each local entity, please refer * If + * getting error like `Questionnaire format not valid.` or `Questionnaire must + * not be blank`, Weight: 600 + * + * @param submitDepositQuestionnaireV2Request (required) + * @return ApiResponse<SubmitDepositQuestionnaireV2Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Submit Deposit Questionnaire V2 -
+ * + * @see Submit + * Deposit Questionnaire V2 (For local entities that require travel rule) (supporting + * network) (USER_DATA) Documentation + */ + public ApiResponse submitDepositQuestionnaireV2( + @Valid @NotNull SubmitDepositQuestionnaireV2Request submitDepositQuestionnaireV2Request) + throws ApiException { + okhttp3.Call localVarCall = + submitDepositQuestionnaireV2ValidateBeforeCall(submitDepositQuestionnaireV2Request); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for vaspList * diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java index 421bdab9a..2cd3ef574 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/api/WalletRestApi.java @@ -20,6 +20,10 @@ import com.binance.connector.client.wallet.rest.model.DepositHistoryTravelRuleResponse; import com.binance.connector.client.wallet.rest.model.DepositHistoryV2Response; import com.binance.connector.client.wallet.rest.model.DisableFastWithdrawSwitchRequest; +import com.binance.connector.client.wallet.rest.model.DustConvertRequest; +import com.binance.connector.client.wallet.rest.model.DustConvertResponse; +import com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsRequest; +import com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsResponse; import com.binance.connector.client.wallet.rest.model.DustTransferRequest; import com.binance.connector.client.wallet.rest.model.DustTransferResponse; import com.binance.connector.client.wallet.rest.model.DustlogResponse; @@ -45,6 +49,8 @@ import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireResponse; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleRequest; import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireTravelRuleResponse; +import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireV2Request; +import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireV2Response; import com.binance.connector.client.wallet.rest.model.SystemStatusResponse; import com.binance.connector.client.wallet.rest.model.ToggleBnbBurnOnSpotTradeAndMarginInterestRequest; import com.binance.connector.client.wallet.rest.model.ToggleBnbBurnOnSpotTradeAndMarginInterestResponse; @@ -253,6 +259,7 @@ public ApiResponse getApiKeyPermission(Long recvWin * and other deposit or withdraw details from ``GET * /sapi/v1/capital/config/getall``. Weight: 1 * + * @param asset (optional) * @param recvWindow (optional) * @return ApiResponse<AssetDetailResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -267,8 +274,9 @@ public ApiResponse getApiKeyPermission(Long recvWin * @see Asset Detail * (USER_DATA) Documentation */ - public ApiResponse assetDetail(Long recvWindow) throws ApiException { - return assetApi.assetDetail(recvWindow); + public ApiResponse assetDetail(String asset, Long recvWindow) + throws ApiException { + return assetApi.assetDetail(asset, recvWindow); } /** @@ -299,6 +307,50 @@ public ApiResponse assetDividendRecord( return assetApi.assetDividendRecord(asset, startTime, endTime, limit, recvWindow); } + /** + * Dust Convert (USER_DATA) Convert dust assets Weight: 10 + * + * @param dustConvertRequest (required) + * @return ApiResponse<DustConvertResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Dust Convert -
+ * + * @see Dust Convert + * (USER_DATA) Documentation + */ + public ApiResponse dustConvert(DustConvertRequest dustConvertRequest) + throws ApiException { + return assetApi.dustConvert(dustConvertRequest); + } + + /** + * Dust Convertible Assets (USER_DATA) Query dust convertible assets Weight: 1 + * + * @param dustConvertibleAssetsRequest (required) + * @return ApiResponse<DustConvertibleAssetsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Dust Convertible Assets -
+ * + * @see Dust + * Convertible Assets (USER_DATA) Documentation + */ + public ApiResponse dustConvertibleAssets( + DustConvertibleAssetsRequest dustConvertibleAssetsRequest) throws ApiException { + return assetApi.dustConvertibleAssets(dustConvertibleAssetsRequest); + } + /** * Dust Transfer (USER_DATA) Convert dust assets to BNB. * You need to open`Enable Spot * & Margin Trading` permission for the API Key which requests this endpoint. Weight: @@ -327,6 +379,7 @@ public ApiResponse dustTransfer(DustTransferRequest dustTr * DustLog(USER_DATA) Dustlog * Only return last 100 records * Only return records after * 2020/12/01 Weight: 1 * + * @param accountType `SPOT`or`MARGIN`,default`SPOT` (optional) * @param startTime (optional) * @param endTime (optional) * @param recvWindow (optional) @@ -343,9 +396,9 @@ public ApiResponse dustTransfer(DustTransferRequest dustTr * @see DustLog(USER_DATA) * Documentation */ - public ApiResponse dustlog(Long startTime, Long endTime, Long recvWindow) - throws ApiException { - return assetApi.dustlog(startTime, endTime, recvWindow); + public ApiResponse dustlog( + String accountType, Long startTime, Long endTime, Long recvWindow) throws ApiException { + return assetApi.dustlog(accountType, startTime, endTime, recvWindow); } /** @@ -461,9 +514,8 @@ public ApiResponse getOpenSymbolList() throws ApiExce } /** - * Query User Delegation History(For Master Account)(USER_DATA) Query User Delegation History * - * You need to open Enable Spot & Margin Trading permission for the API Key which requests - * this endpoint Weight: 60 + * Query User Delegation History(For Master Account)(USER_DATA) Query User Delegation History + * Weight: 60 * * @param email (required) * @param startTime (required) @@ -1171,7 +1223,7 @@ public ApiResponse depositHistoryTravelRule( * (USER_DATA) Documentation */ public ApiResponse depositHistoryV2( - String depositId, + Long depositId, String txId, String network, String coin, @@ -1280,6 +1332,36 @@ public ApiResponse submitDepositQuestionnair submitDepositQuestionnaireTravelRuleRequest); } + /** + * Submit Deposit Questionnaire V2 (For local entities that require travel rule) (supporting + * network) (USER_DATA) Submit questionnaire for local entities that require travel rule. The + * questionnaire is only applies to transactions from unhosted wallets or VASPs that are not yet + * onboarded with GTR. * Questionnaire is different for each local entity, please refer * If + * getting error like `Questionnaire format not valid.` or `Questionnaire must + * not be blank`, Weight: 600 + * + * @param submitDepositQuestionnaireV2Request (required) + * @return ApiResponse<SubmitDepositQuestionnaireV2Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the + * response body + * @http.response.details + * + * + * + * + *
Response Details
Status Code Description Response Headers
200 Submit Deposit Questionnaire V2 -
+ * + * @see Submit + * Deposit Questionnaire V2 (For local entities that require travel rule) (supporting + * network) (USER_DATA) Documentation + */ + public ApiResponse submitDepositQuestionnaireV2( + SubmitDepositQuestionnaireV2Request submitDepositQuestionnaireV2Request) + throws ApiException { + return travelRuleApi.submitDepositQuestionnaireV2(submitDepositQuestionnaireV2Request); + } + /** * VASP list (for local entities that require travel rule) (supporting network) (USER_DATA) * Fetch the VASP list for local entities. Weight: 1 diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AssetDividendRecordResponseRowsInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AssetDividendRecordResponseRowsInner.java index 8f316b597..de9ada888 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AssetDividendRecordResponseRowsInner.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/AssetDividendRecordResponseRowsInner.java @@ -72,6 +72,12 @@ public class AssetDividendRecordResponseRowsInner { @jakarta.annotation.Nullable private Long tranId; + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + + @SerializedName(SERIALIZED_NAME_DIRECTION) + @jakarta.annotation.Nullable + private Long direction; + public AssetDividendRecordResponseRowsInner() {} public AssetDividendRecordResponseRowsInner id(@jakarta.annotation.Nullable Long id) { @@ -188,6 +194,26 @@ public void setTranId(@jakarta.annotation.Nullable Long tranId) { this.tranId = tranId; } + public AssetDividendRecordResponseRowsInner direction( + @jakarta.annotation.Nullable Long direction) { + this.direction = direction; + return this; + } + + /** + * Get direction + * + * @return direction + */ + @jakarta.annotation.Nullable + public Long getDirection() { + return direction; + } + + public void setDirection(@jakarta.annotation.Nullable Long direction) { + this.direction = direction; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -203,12 +229,13 @@ public boolean equals(Object o) { && Objects.equals(this.asset, assetDividendRecordResponseRowsInner.asset) && Objects.equals(this.divTime, assetDividendRecordResponseRowsInner.divTime) && Objects.equals(this.enInfo, assetDividendRecordResponseRowsInner.enInfo) - && Objects.equals(this.tranId, assetDividendRecordResponseRowsInner.tranId); + && Objects.equals(this.tranId, assetDividendRecordResponseRowsInner.tranId) + && Objects.equals(this.direction, assetDividendRecordResponseRowsInner.direction); } @Override public int hashCode() { - return Objects.hash(id, amount, asset, divTime, enInfo, tranId); + return Objects.hash(id, amount, asset, divTime, enInfo, tranId, direction); } @Override @@ -221,6 +248,7 @@ public String toString() { sb.append(" divTime: ").append(toIndentedString(divTime)).append("\n"); sb.append(" enInfo: ").append(toIndentedString(enInfo)).append("\n"); sb.append(" tranId: ").append(toIndentedString(tranId)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); sb.append("}"); return sb.toString(); } @@ -252,6 +280,10 @@ public String toUrlQueryString() { String tranIdValueAsString = ""; tranIdValueAsString = tranIdValue.toString(); sb.append("tranId=").append(urlEncode(tranIdValueAsString)).append(""); + Object directionValue = getDirection(); + String directionValueAsString = ""; + directionValueAsString = directionValue.toString(); + sb.append("direction=").append(urlEncode(directionValueAsString)).append(""); return sb.toString(); } @@ -286,6 +318,7 @@ private String toIndentedString(Object o) { openapiFields.add("divTime"); openapiFields.add("enInfo"); openapiFields.add("tranId"); + openapiFields.add("direction"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertRequest.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertRequest.java new file mode 100644 index 000000000..58e5e34f2 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertRequest.java @@ -0,0 +1,392 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST 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.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.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.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DustConvertRequest */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DustConvertRequest { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nonnull + private String asset; + + public static final String SERIALIZED_NAME_CLIENT_ID = "clientId"; + + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @jakarta.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; + + @SerializedName(SERIALIZED_NAME_TARGET_ASSET) + @jakarta.annotation.Nullable + private String targetAsset; + + public static final String SERIALIZED_NAME_THIRD_PARTY_CLIENT_ID = "thirdPartyClientId"; + + @SerializedName(SERIALIZED_NAME_THIRD_PARTY_CLIENT_ID) + @jakarta.annotation.Nullable + private String thirdPartyClientId; + + public static final String SERIALIZED_NAME_DUST_QUOTA_ASSET_TO_TARGET_ASSET_PRICE = + "dustQuotaAssetToTargetAssetPrice"; + + @SerializedName(SERIALIZED_NAME_DUST_QUOTA_ASSET_TO_TARGET_ASSET_PRICE) + @jakarta.annotation.Nullable + private Double dustQuotaAssetToTargetAssetPrice; + + public DustConvertRequest() {} + + public DustConvertRequest asset(@jakarta.annotation.Nonnull String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nonnull + @NotNull + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nonnull String asset) { + this.asset = asset; + } + + public DustConvertRequest clientId(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * + * @return clientId + */ + @jakarta.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@jakarta.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + public DustConvertRequest targetAsset(@jakarta.annotation.Nullable String targetAsset) { + this.targetAsset = targetAsset; + return this; + } + + /** + * Get targetAsset + * + * @return targetAsset + */ + @jakarta.annotation.Nullable + public String getTargetAsset() { + return targetAsset; + } + + public void setTargetAsset(@jakarta.annotation.Nullable String targetAsset) { + this.targetAsset = targetAsset; + } + + public DustConvertRequest thirdPartyClientId( + @jakarta.annotation.Nullable String thirdPartyClientId) { + this.thirdPartyClientId = thirdPartyClientId; + return this; + } + + /** + * Get thirdPartyClientId + * + * @return thirdPartyClientId + */ + @jakarta.annotation.Nullable + public String getThirdPartyClientId() { + return thirdPartyClientId; + } + + public void setThirdPartyClientId(@jakarta.annotation.Nullable String thirdPartyClientId) { + this.thirdPartyClientId = thirdPartyClientId; + } + + public DustConvertRequest dustQuotaAssetToTargetAssetPrice( + @jakarta.annotation.Nullable Double dustQuotaAssetToTargetAssetPrice) { + this.dustQuotaAssetToTargetAssetPrice = dustQuotaAssetToTargetAssetPrice; + return this; + } + + /** + * Get dustQuotaAssetToTargetAssetPrice + * + * @return dustQuotaAssetToTargetAssetPrice + */ + @jakarta.annotation.Nullable + @Valid + public Double getDustQuotaAssetToTargetAssetPrice() { + return dustQuotaAssetToTargetAssetPrice; + } + + public void setDustQuotaAssetToTargetAssetPrice( + @jakarta.annotation.Nullable Double dustQuotaAssetToTargetAssetPrice) { + this.dustQuotaAssetToTargetAssetPrice = dustQuotaAssetToTargetAssetPrice; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DustConvertRequest dustConvertRequest = (DustConvertRequest) o; + return Objects.equals(this.asset, dustConvertRequest.asset) + && Objects.equals(this.clientId, dustConvertRequest.clientId) + && Objects.equals(this.targetAsset, dustConvertRequest.targetAsset) + && Objects.equals(this.thirdPartyClientId, dustConvertRequest.thirdPartyClientId) + && Objects.equals( + this.dustQuotaAssetToTargetAssetPrice, + dustConvertRequest.dustQuotaAssetToTargetAssetPrice); + } + + @Override + public int hashCode() { + return Objects.hash( + asset, clientId, targetAsset, thirdPartyClientId, dustQuotaAssetToTargetAssetPrice); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DustConvertRequest {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); + sb.append(" thirdPartyClientId: ") + .append(toIndentedString(thirdPartyClientId)) + .append("\n"); + sb.append(" dustQuotaAssetToTargetAssetPrice: ") + .append(toIndentedString(dustQuotaAssetToTargetAssetPrice)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object clientIdValue = getClientId(); + String clientIdValueAsString = ""; + clientIdValueAsString = clientIdValue.toString(); + sb.append("clientId=").append(urlEncode(clientIdValueAsString)).append(""); + Object targetAssetValue = getTargetAsset(); + String targetAssetValueAsString = ""; + targetAssetValueAsString = targetAssetValue.toString(); + sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); + Object thirdPartyClientIdValue = getThirdPartyClientId(); + String thirdPartyClientIdValueAsString = ""; + thirdPartyClientIdValueAsString = thirdPartyClientIdValue.toString(); + sb.append("thirdPartyClientId=") + .append(urlEncode(thirdPartyClientIdValueAsString)) + .append(""); + Object dustQuotaAssetToTargetAssetPriceValue = getDustQuotaAssetToTargetAssetPrice(); + String dustQuotaAssetToTargetAssetPriceValueAsString = ""; + dustQuotaAssetToTargetAssetPriceValueAsString = + dustQuotaAssetToTargetAssetPriceValue.toString(); + sb.append("dustQuotaAssetToTargetAssetPrice=") + .append(urlEncode(dustQuotaAssetToTargetAssetPriceValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("asset"); + openapiFields.add("clientId"); + openapiFields.add("targetAsset"); + openapiFields.add("thirdPartyClientId"); + openapiFields.add("dustQuotaAssetToTargetAssetPrice"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("asset"); + } + + /** + * 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 DustConvertRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DustConvertRequest.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DustConvertRequest is not found in the" + + " empty JSON string", + DustConvertRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DustConvertRequest.openapiRequiredFields) { + if (jsonElement.getAsJsonObject().get(requiredField) == null) { + throw new IllegalArgumentException( + String.format( + "The required field `%s` is not found in the JSON string: %s", + requiredField, jsonElement.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (!jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("clientId") != null && !jsonObj.get("clientId").isJsonNull()) + && !jsonObj.get("clientId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `clientId` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("clientId").toString())); + } + if ((jsonObj.get("targetAsset") != null && !jsonObj.get("targetAsset").isJsonNull()) + && !jsonObj.get("targetAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `targetAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("targetAsset").toString())); + } + if ((jsonObj.get("thirdPartyClientId") != null + && !jsonObj.get("thirdPartyClientId").isJsonNull()) + && !jsonObj.get("thirdPartyClientId").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `thirdPartyClientId` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("thirdPartyClientId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DustConvertRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DustConvertRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DustConvertRequest.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DustConvertRequest value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DustConvertRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DustConvertRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DustConvertRequest + * @throws IOException if the JSON string is invalid with respect to DustConvertRequest + */ + public static DustConvertRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DustConvertRequest.class); + } + + /** + * Convert an instance of DustConvertRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertResponse.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertResponse.java new file mode 100644 index 000000000..5be2b00a6 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertResponse.java @@ -0,0 +1,332 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST 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.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +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.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** DustConvertResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DustConvertResponse { + public static final String SERIALIZED_NAME_TOTAL_TRANSFERED = "totalTransfered"; + + @SerializedName(SERIALIZED_NAME_TOTAL_TRANSFERED) + @jakarta.annotation.Nullable + private String totalTransfered; + + public static final String SERIALIZED_NAME_TOTAL_SERVICE_CHARGE = "totalServiceCharge"; + + @SerializedName(SERIALIZED_NAME_TOTAL_SERVICE_CHARGE) + @jakarta.annotation.Nullable + private String totalServiceCharge; + + public static final String SERIALIZED_NAME_TRANSFER_RESULT = "transferResult"; + + @SerializedName(SERIALIZED_NAME_TRANSFER_RESULT) + @jakarta.annotation.Nullable + private List<@Valid DustConvertResponseTransferResultInner> transferResult; + + public DustConvertResponse() {} + + public DustConvertResponse totalTransfered( + @jakarta.annotation.Nullable String totalTransfered) { + this.totalTransfered = totalTransfered; + return this; + } + + /** + * Get totalTransfered + * + * @return totalTransfered + */ + @jakarta.annotation.Nullable + public String getTotalTransfered() { + return totalTransfered; + } + + public void setTotalTransfered(@jakarta.annotation.Nullable String totalTransfered) { + this.totalTransfered = totalTransfered; + } + + public DustConvertResponse totalServiceCharge( + @jakarta.annotation.Nullable String totalServiceCharge) { + this.totalServiceCharge = totalServiceCharge; + return this; + } + + /** + * Get totalServiceCharge + * + * @return totalServiceCharge + */ + @jakarta.annotation.Nullable + public String getTotalServiceCharge() { + return totalServiceCharge; + } + + public void setTotalServiceCharge(@jakarta.annotation.Nullable String totalServiceCharge) { + this.totalServiceCharge = totalServiceCharge; + } + + public DustConvertResponse transferResult( + @jakarta.annotation.Nullable + List<@Valid DustConvertResponseTransferResultInner> transferResult) { + this.transferResult = transferResult; + return this; + } + + public DustConvertResponse addTransferResultItem( + DustConvertResponseTransferResultInner transferResultItem) { + if (this.transferResult == null) { + this.transferResult = new ArrayList<>(); + } + this.transferResult.add(transferResultItem); + return this; + } + + /** + * Get transferResult + * + * @return transferResult + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid DustConvertResponseTransferResultInner> getTransferResult() { + return transferResult; + } + + public void setTransferResult( + @jakarta.annotation.Nullable + List<@Valid DustConvertResponseTransferResultInner> transferResult) { + this.transferResult = transferResult; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DustConvertResponse dustConvertResponse = (DustConvertResponse) o; + return Objects.equals(this.totalTransfered, dustConvertResponse.totalTransfered) + && Objects.equals(this.totalServiceCharge, dustConvertResponse.totalServiceCharge) + && Objects.equals(this.transferResult, dustConvertResponse.transferResult); + } + + @Override + public int hashCode() { + return Objects.hash(totalTransfered, totalServiceCharge, transferResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DustConvertResponse {\n"); + sb.append(" totalTransfered: ").append(toIndentedString(totalTransfered)).append("\n"); + sb.append(" totalServiceCharge: ") + .append(toIndentedString(totalServiceCharge)) + .append("\n"); + sb.append(" transferResult: ").append(toIndentedString(transferResult)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object totalTransferedValue = getTotalTransfered(); + String totalTransferedValueAsString = ""; + totalTransferedValueAsString = totalTransferedValue.toString(); + sb.append("totalTransfered=").append(urlEncode(totalTransferedValueAsString)).append(""); + Object totalServiceChargeValue = getTotalServiceCharge(); + String totalServiceChargeValueAsString = ""; + totalServiceChargeValueAsString = totalServiceChargeValue.toString(); + sb.append("totalServiceCharge=") + .append(urlEncode(totalServiceChargeValueAsString)) + .append(""); + Object transferResultValue = getTransferResult(); + String transferResultValueAsString = ""; + transferResultValueAsString = + (String) + ((Collection) transferResultValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("transferResult=").append(urlEncode(transferResultValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("totalTransfered"); + openapiFields.add("totalServiceCharge"); + openapiFields.add("transferResult"); + + // 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 DustConvertResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DustConvertResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DustConvertResponse is not found in" + + " the empty JSON string", + DustConvertResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("totalTransfered") != null && !jsonObj.get("totalTransfered").isJsonNull()) + && !jsonObj.get("totalTransfered").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalTransfered` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("totalTransfered").toString())); + } + if ((jsonObj.get("totalServiceCharge") != null + && !jsonObj.get("totalServiceCharge").isJsonNull()) + && !jsonObj.get("totalServiceCharge").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalServiceCharge` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("totalServiceCharge").toString())); + } + if (jsonObj.get("transferResult") != null && !jsonObj.get("transferResult").isJsonNull()) { + JsonArray jsonArraytransferResult = jsonObj.getAsJsonArray("transferResult"); + if (jsonArraytransferResult != null) { + // ensure the json data is an array + if (!jsonObj.get("transferResult").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transferResult` to be an array in the JSON" + + " string but got `%s`", + jsonObj.get("transferResult").toString())); + } + + // validate the optional field `transferResult` (array) + for (int i = 0; i < jsonArraytransferResult.size(); i++) { + DustConvertResponseTransferResultInner.validateJsonElement( + jsonArraytransferResult.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DustConvertResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DustConvertResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter(this, TypeToken.get(DustConvertResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DustConvertResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DustConvertResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DustConvertResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DustConvertResponse + * @throws IOException if the JSON string is invalid with respect to DustConvertResponse + */ + public static DustConvertResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DustConvertResponse.class); + } + + /** + * Convert an instance of DustConvertResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertResponseTransferResultInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertResponseTransferResultInner.java new file mode 100644 index 000000000..38a969764 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertResponseTransferResultInner.java @@ -0,0 +1,420 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST 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.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DustConvertResponseTransferResultInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DustConvertResponseTransferResultInner { + public static final String SERIALIZED_NAME_TRAN_ID = "tranId"; + + @SerializedName(SERIALIZED_NAME_TRAN_ID) + @jakarta.annotation.Nullable + private Long tranId; + + public static final String SERIALIZED_NAME_FROM_ASSET = "fromAsset"; + + @SerializedName(SERIALIZED_NAME_FROM_ASSET) + @jakarta.annotation.Nullable + private String fromAsset; + + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + + @SerializedName(SERIALIZED_NAME_AMOUNT) + @jakarta.annotation.Nullable + private String amount; + + public static final String SERIALIZED_NAME_TRANSFERED_AMOUNT = "transferedAmount"; + + @SerializedName(SERIALIZED_NAME_TRANSFERED_AMOUNT) + @jakarta.annotation.Nullable + private String transferedAmount; + + public static final String SERIALIZED_NAME_SERVICE_CHARGE_AMOUNT = "serviceChargeAmount"; + + @SerializedName(SERIALIZED_NAME_SERVICE_CHARGE_AMOUNT) + @jakarta.annotation.Nullable + private String serviceChargeAmount; + + public static final String SERIALIZED_NAME_OPERATE_TIME = "operateTime"; + + @SerializedName(SERIALIZED_NAME_OPERATE_TIME) + @jakarta.annotation.Nullable + private Long operateTime; + + public DustConvertResponseTransferResultInner() {} + + public DustConvertResponseTransferResultInner tranId(@jakarta.annotation.Nullable Long tranId) { + this.tranId = tranId; + return this; + } + + /** + * Get tranId + * + * @return tranId + */ + @jakarta.annotation.Nullable + public Long getTranId() { + return tranId; + } + + public void setTranId(@jakarta.annotation.Nullable Long tranId) { + this.tranId = tranId; + } + + public DustConvertResponseTransferResultInner fromAsset( + @jakarta.annotation.Nullable String fromAsset) { + this.fromAsset = fromAsset; + return this; + } + + /** + * Get fromAsset + * + * @return fromAsset + */ + @jakarta.annotation.Nullable + public String getFromAsset() { + return fromAsset; + } + + public void setFromAsset(@jakarta.annotation.Nullable String fromAsset) { + this.fromAsset = fromAsset; + } + + public DustConvertResponseTransferResultInner amount( + @jakarta.annotation.Nullable String amount) { + this.amount = amount; + return this; + } + + /** + * Get amount + * + * @return amount + */ + @jakarta.annotation.Nullable + public String getAmount() { + return amount; + } + + public void setAmount(@jakarta.annotation.Nullable String amount) { + this.amount = amount; + } + + public DustConvertResponseTransferResultInner transferedAmount( + @jakarta.annotation.Nullable String transferedAmount) { + this.transferedAmount = transferedAmount; + return this; + } + + /** + * Get transferedAmount + * + * @return transferedAmount + */ + @jakarta.annotation.Nullable + public String getTransferedAmount() { + return transferedAmount; + } + + public void setTransferedAmount(@jakarta.annotation.Nullable String transferedAmount) { + this.transferedAmount = transferedAmount; + } + + public DustConvertResponseTransferResultInner serviceChargeAmount( + @jakarta.annotation.Nullable String serviceChargeAmount) { + this.serviceChargeAmount = serviceChargeAmount; + return this; + } + + /** + * Get serviceChargeAmount + * + * @return serviceChargeAmount + */ + @jakarta.annotation.Nullable + public String getServiceChargeAmount() { + return serviceChargeAmount; + } + + public void setServiceChargeAmount(@jakarta.annotation.Nullable String serviceChargeAmount) { + this.serviceChargeAmount = serviceChargeAmount; + } + + public DustConvertResponseTransferResultInner operateTime( + @jakarta.annotation.Nullable Long operateTime) { + this.operateTime = operateTime; + return this; + } + + /** + * Get operateTime + * + * @return operateTime + */ + @jakarta.annotation.Nullable + public Long getOperateTime() { + return operateTime; + } + + public void setOperateTime(@jakarta.annotation.Nullable Long operateTime) { + this.operateTime = operateTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DustConvertResponseTransferResultInner dustConvertResponseTransferResultInner = + (DustConvertResponseTransferResultInner) o; + return Objects.equals(this.tranId, dustConvertResponseTransferResultInner.tranId) + && Objects.equals(this.fromAsset, dustConvertResponseTransferResultInner.fromAsset) + && Objects.equals(this.amount, dustConvertResponseTransferResultInner.amount) + && Objects.equals( + this.transferedAmount, + dustConvertResponseTransferResultInner.transferedAmount) + && Objects.equals( + this.serviceChargeAmount, + dustConvertResponseTransferResultInner.serviceChargeAmount) + && Objects.equals( + this.operateTime, dustConvertResponseTransferResultInner.operateTime); + } + + @Override + public int hashCode() { + return Objects.hash( + tranId, fromAsset, amount, transferedAmount, serviceChargeAmount, operateTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DustConvertResponseTransferResultInner {\n"); + sb.append(" tranId: ").append(toIndentedString(tranId)).append("\n"); + sb.append(" fromAsset: ").append(toIndentedString(fromAsset)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" transferedAmount: ").append(toIndentedString(transferedAmount)).append("\n"); + sb.append(" serviceChargeAmount: ") + .append(toIndentedString(serviceChargeAmount)) + .append("\n"); + sb.append(" operateTime: ").append(toIndentedString(operateTime)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object tranIdValue = getTranId(); + String tranIdValueAsString = ""; + tranIdValueAsString = tranIdValue.toString(); + sb.append("tranId=").append(urlEncode(tranIdValueAsString)).append(""); + Object fromAssetValue = getFromAsset(); + String fromAssetValueAsString = ""; + fromAssetValueAsString = fromAssetValue.toString(); + sb.append("fromAsset=").append(urlEncode(fromAssetValueAsString)).append(""); + Object amountValue = getAmount(); + String amountValueAsString = ""; + amountValueAsString = amountValue.toString(); + sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); + Object transferedAmountValue = getTransferedAmount(); + String transferedAmountValueAsString = ""; + transferedAmountValueAsString = transferedAmountValue.toString(); + sb.append("transferedAmount=").append(urlEncode(transferedAmountValueAsString)).append(""); + Object serviceChargeAmountValue = getServiceChargeAmount(); + String serviceChargeAmountValueAsString = ""; + serviceChargeAmountValueAsString = serviceChargeAmountValue.toString(); + sb.append("serviceChargeAmount=") + .append(urlEncode(serviceChargeAmountValueAsString)) + .append(""); + Object operateTimeValue = getOperateTime(); + String operateTimeValueAsString = ""; + operateTimeValueAsString = operateTimeValue.toString(); + sb.append("operateTime=").append(urlEncode(operateTimeValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("tranId"); + openapiFields.add("fromAsset"); + openapiFields.add("amount"); + openapiFields.add("transferedAmount"); + openapiFields.add("serviceChargeAmount"); + openapiFields.add("operateTime"); + + // 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 + * DustConvertResponseTransferResultInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DustConvertResponseTransferResultInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DustConvertResponseTransferResultInner" + + " is not found in the empty JSON string", + DustConvertResponseTransferResultInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("fromAsset") != null && !jsonObj.get("fromAsset").isJsonNull()) + && !jsonObj.get("fromAsset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `fromAsset` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("fromAsset").toString())); + } + if ((jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonNull()) + && !jsonObj.get("amount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amount` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("amount").toString())); + } + if ((jsonObj.get("transferedAmount") != null + && !jsonObj.get("transferedAmount").isJsonNull()) + && !jsonObj.get("transferedAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `transferedAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("transferedAmount").toString())); + } + if ((jsonObj.get("serviceChargeAmount") != null + && !jsonObj.get("serviceChargeAmount").isJsonNull()) + && !jsonObj.get("serviceChargeAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `serviceChargeAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("serviceChargeAmount").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DustConvertResponseTransferResultInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DustConvertResponseTransferResultInner' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DustConvertResponseTransferResultInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DustConvertResponseTransferResultInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DustConvertResponseTransferResultInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DustConvertResponseTransferResultInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DustConvertResponseTransferResultInner + * @throws IOException if the JSON string is invalid with respect to + * DustConvertResponseTransferResultInner + */ + public static DustConvertResponseTransferResultInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DustConvertResponseTransferResultInner.class); + } + + /** + * Convert an instance of DustConvertResponseTransferResultInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginRequest.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsRequest.java similarity index 51% rename from clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginRequest.java rename to clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsRequest.java index 980a46e01..023449858 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/model/MintBfusdForPortfolioMarginRequest.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsRequest.java @@ -1,6 +1,6 @@ /* - * Binance Derivatives Trading Portfolio Margin Pro REST API - * OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro REST API + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST API * * The version of the OpenAPI document: 1.0.0 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model; +package com.binance.connector.client.wallet.rest.model; -import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.JSON; +import com.binance.connector.client.wallet.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -32,59 +32,27 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** MintBfusdForPortfolioMarginRequest */ +/** DustConvertibleAssetsRequest */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class MintBfusdForPortfolioMarginRequest { - public static final String SERIALIZED_NAME_FROM_ASSET = "fromAsset"; - - @SerializedName(SERIALIZED_NAME_FROM_ASSET) - @jakarta.annotation.Nonnull - private String fromAsset; - +public class DustConvertibleAssetsRequest { public static final String SERIALIZED_NAME_TARGET_ASSET = "targetAsset"; @SerializedName(SERIALIZED_NAME_TARGET_ASSET) @jakarta.annotation.Nonnull private String targetAsset; - public static final String SERIALIZED_NAME_AMOUNT = "amount"; - - @SerializedName(SERIALIZED_NAME_AMOUNT) - @jakarta.annotation.Nonnull - private Double amount; - - public static final String SERIALIZED_NAME_RECV_WINDOW = "recvWindow"; + public static final String SERIALIZED_NAME_DUST_QUOTA_ASSET_TO_TARGET_ASSET_PRICE = + "dustQuotaAssetToTargetAssetPrice"; - @SerializedName(SERIALIZED_NAME_RECV_WINDOW) + @SerializedName(SERIALIZED_NAME_DUST_QUOTA_ASSET_TO_TARGET_ASSET_PRICE) @jakarta.annotation.Nullable - private Long recvWindow; + private Double dustQuotaAssetToTargetAssetPrice; - public MintBfusdForPortfolioMarginRequest() {} + public DustConvertibleAssetsRequest() {} - public MintBfusdForPortfolioMarginRequest fromAsset( - @jakarta.annotation.Nonnull String fromAsset) { - this.fromAsset = fromAsset; - return this; - } - - /** - * Get fromAsset - * - * @return fromAsset - */ - @jakarta.annotation.Nonnull - @NotNull - public String getFromAsset() { - return fromAsset; - } - - public void setFromAsset(@jakarta.annotation.Nonnull String fromAsset) { - this.fromAsset = fromAsset; - } - - public MintBfusdForPortfolioMarginRequest targetAsset( + public DustConvertibleAssetsRequest targetAsset( @jakarta.annotation.Nonnull String targetAsset) { this.targetAsset = targetAsset; return this; @@ -105,45 +73,26 @@ public void setTargetAsset(@jakarta.annotation.Nonnull String targetAsset) { this.targetAsset = targetAsset; } - public MintBfusdForPortfolioMarginRequest amount(@jakarta.annotation.Nonnull Double amount) { - this.amount = amount; + public DustConvertibleAssetsRequest dustQuotaAssetToTargetAssetPrice( + @jakarta.annotation.Nullable Double dustQuotaAssetToTargetAssetPrice) { + this.dustQuotaAssetToTargetAssetPrice = dustQuotaAssetToTargetAssetPrice; return this; } /** - * Get amount + * Get dustQuotaAssetToTargetAssetPrice * - * @return amount - */ - @jakarta.annotation.Nonnull - @NotNull - @Valid - public Double getAmount() { - return amount; - } - - public void setAmount(@jakarta.annotation.Nonnull Double amount) { - this.amount = amount; - } - - public MintBfusdForPortfolioMarginRequest recvWindow( - @jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; - return this; - } - - /** - * Get recvWindow - * - * @return recvWindow + * @return dustQuotaAssetToTargetAssetPrice */ @jakarta.annotation.Nullable - public Long getRecvWindow() { - return recvWindow; + @Valid + public Double getDustQuotaAssetToTargetAssetPrice() { + return dustQuotaAssetToTargetAssetPrice; } - public void setRecvWindow(@jakarta.annotation.Nullable Long recvWindow) { - this.recvWindow = recvWindow; + public void setDustQuotaAssetToTargetAssetPrice( + @jakarta.annotation.Nullable Double dustQuotaAssetToTargetAssetPrice) { + this.dustQuotaAssetToTargetAssetPrice = dustQuotaAssetToTargetAssetPrice; } @Override @@ -154,27 +103,27 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - MintBfusdForPortfolioMarginRequest mintBfusdForPortfolioMarginRequest = - (MintBfusdForPortfolioMarginRequest) o; - return Objects.equals(this.fromAsset, mintBfusdForPortfolioMarginRequest.fromAsset) - && Objects.equals(this.targetAsset, mintBfusdForPortfolioMarginRequest.targetAsset) - && Objects.equals(this.amount, mintBfusdForPortfolioMarginRequest.amount) - && Objects.equals(this.recvWindow, mintBfusdForPortfolioMarginRequest.recvWindow); + DustConvertibleAssetsRequest dustConvertibleAssetsRequest = + (DustConvertibleAssetsRequest) o; + return Objects.equals(this.targetAsset, dustConvertibleAssetsRequest.targetAsset) + && Objects.equals( + this.dustQuotaAssetToTargetAssetPrice, + dustConvertibleAssetsRequest.dustQuotaAssetToTargetAssetPrice); } @Override public int hashCode() { - return Objects.hash(fromAsset, targetAsset, amount, recvWindow); + return Objects.hash(targetAsset, dustQuotaAssetToTargetAssetPrice); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class MintBfusdForPortfolioMarginRequest {\n"); - sb.append(" fromAsset: ").append(toIndentedString(fromAsset)).append("\n"); + sb.append("class DustConvertibleAssetsRequest {\n"); sb.append(" targetAsset: ").append(toIndentedString(targetAsset)).append("\n"); - sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); - sb.append(" recvWindow: ").append(toIndentedString(recvWindow)).append("\n"); + sb.append(" dustQuotaAssetToTargetAssetPrice: ") + .append(toIndentedString(dustQuotaAssetToTargetAssetPrice)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -182,22 +131,17 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object fromAssetValue = getFromAsset(); - String fromAssetValueAsString = ""; - fromAssetValueAsString = fromAssetValue.toString(); - sb.append("fromAsset=").append(urlEncode(fromAssetValueAsString)).append(""); Object targetAssetValue = getTargetAsset(); String targetAssetValueAsString = ""; targetAssetValueAsString = targetAssetValue.toString(); sb.append("targetAsset=").append(urlEncode(targetAssetValueAsString)).append(""); - Object amountValue = getAmount(); - String amountValueAsString = ""; - amountValueAsString = amountValue.toString(); - sb.append("amount=").append(urlEncode(amountValueAsString)).append(""); - Object recvWindowValue = getRecvWindow(); - String recvWindowValueAsString = ""; - recvWindowValueAsString = recvWindowValue.toString(); - sb.append("recvWindow=").append(urlEncode(recvWindowValueAsString)).append(""); + Object dustQuotaAssetToTargetAssetPriceValue = getDustQuotaAssetToTargetAssetPrice(); + String dustQuotaAssetToTargetAssetPriceValueAsString = ""; + dustQuotaAssetToTargetAssetPriceValueAsString = + dustQuotaAssetToTargetAssetPriceValue.toString(); + sb.append("dustQuotaAssetToTargetAssetPrice=") + .append(urlEncode(dustQuotaAssetToTargetAssetPriceValueAsString)) + .append(""); return sb.toString(); } @@ -226,16 +170,12 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("fromAsset"); openapiFields.add("targetAsset"); - openapiFields.add("amount"); - openapiFields.add("recvWindow"); + openapiFields.add("dustQuotaAssetToTargetAssetPrice"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("fromAsset"); openapiRequiredFields.add("targetAsset"); - openapiRequiredFields.add("amount"); } /** @@ -243,23 +183,22 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * MintBfusdForPortfolioMarginRequest + * DustConvertibleAssetsRequest */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!MintBfusdForPortfolioMarginRequest.openapiRequiredFields + if (!DustConvertibleAssetsRequest.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in MintBfusdForPortfolioMarginRequest is" - + " not found in the empty JSON string", - MintBfusdForPortfolioMarginRequest.openapiRequiredFields - .toString())); + "The required field(s) %s in DustConvertibleAssetsRequest is not" + + " found in the empty JSON string", + DustConvertibleAssetsRequest.openapiRequiredFields.toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : MintBfusdForPortfolioMarginRequest.openapiRequiredFields) { + for (String requiredField : DustConvertibleAssetsRequest.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -268,13 +207,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("fromAsset").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `fromAsset` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("fromAsset").toString())); - } if (!jsonObj.get("targetAsset").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( @@ -288,27 +220,26 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!MintBfusdForPortfolioMarginRequest.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'MintBfusdForPortfolioMarginRequest' and - // its subtypes + if (!DustConvertibleAssetsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DustConvertibleAssetsRequest' and its + // subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, TypeToken.get(MintBfusdForPortfolioMarginRequest.class)); + this, TypeToken.get(DustConvertibleAssetsRequest.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write(JsonWriter out, MintBfusdForPortfolioMarginRequest value) + public void write(JsonWriter out, DustConvertibleAssetsRequest value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public MintBfusdForPortfolioMarginRequest read(JsonReader in) - throws IOException { + public DustConvertibleAssetsRequest read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); return thisAdapter.fromJsonTree(jsonElement); @@ -318,20 +249,19 @@ public MintBfusdForPortfolioMarginRequest read(JsonReader in) } /** - * Create an instance of MintBfusdForPortfolioMarginRequest given an JSON string + * Create an instance of DustConvertibleAssetsRequest given an JSON string * * @param jsonString JSON string - * @return An instance of MintBfusdForPortfolioMarginRequest + * @return An instance of DustConvertibleAssetsRequest * @throws IOException if the JSON string is invalid with respect to - * MintBfusdForPortfolioMarginRequest + * DustConvertibleAssetsRequest */ - public static MintBfusdForPortfolioMarginRequest fromJson(String jsonString) - throws IOException { - return JSON.getGson().fromJson(jsonString, MintBfusdForPortfolioMarginRequest.class); + public static DustConvertibleAssetsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DustConvertibleAssetsRequest.class); } /** - * Convert an instance of MintBfusdForPortfolioMarginRequest to an JSON string + * Convert an instance of DustConvertibleAssetsRequest to an JSON string * * @return JSON string */ diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsResponse.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsResponse.java new file mode 100644 index 000000000..5c5c22b2f --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsResponse.java @@ -0,0 +1,445 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST 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.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.JSON; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +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.Valid; +import jakarta.validation.constraints.*; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import org.hibernate.validator.constraints.*; + +/** DustConvertibleAssetsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DustConvertibleAssetsResponse { + public static final String SERIALIZED_NAME_DRIBBLET_PERCENTAGE = "dribbletPercentage"; + + @SerializedName(SERIALIZED_NAME_DRIBBLET_PERCENTAGE) + @jakarta.annotation.Nullable + private String dribbletPercentage; + + public static final String SERIALIZED_NAME_TOTAL_TRANSFER_QUOTA_ASSET_AMOUNT = + "totalTransferQuotaAssetAmount"; + + @SerializedName(SERIALIZED_NAME_TOTAL_TRANSFER_QUOTA_ASSET_AMOUNT) + @jakarta.annotation.Nullable + private String totalTransferQuotaAssetAmount; + + public static final String SERIALIZED_NAME_TOTAL_TRANSFER_TARGET_ASSET_AMOUNT = + "totalTransferTargetAssetAmount"; + + @SerializedName(SERIALIZED_NAME_TOTAL_TRANSFER_TARGET_ASSET_AMOUNT) + @jakarta.annotation.Nullable + private String totalTransferTargetAssetAmount; + + public static final String SERIALIZED_NAME_DRIBBLET_BASE = "dribbletBase"; + + @SerializedName(SERIALIZED_NAME_DRIBBLET_BASE) + @jakarta.annotation.Nullable + private String dribbletBase; + + public static final String SERIALIZED_NAME_DETAILS = "details"; + + @SerializedName(SERIALIZED_NAME_DETAILS) + @jakarta.annotation.Nullable + private List<@Valid DustConvertibleAssetsResponseDetailsInner> details; + + public DustConvertibleAssetsResponse() {} + + public DustConvertibleAssetsResponse dribbletPercentage( + @jakarta.annotation.Nullable String dribbletPercentage) { + this.dribbletPercentage = dribbletPercentage; + return this; + } + + /** + * Get dribbletPercentage + * + * @return dribbletPercentage + */ + @jakarta.annotation.Nullable + public String getDribbletPercentage() { + return dribbletPercentage; + } + + public void setDribbletPercentage(@jakarta.annotation.Nullable String dribbletPercentage) { + this.dribbletPercentage = dribbletPercentage; + } + + public DustConvertibleAssetsResponse totalTransferQuotaAssetAmount( + @jakarta.annotation.Nullable String totalTransferQuotaAssetAmount) { + this.totalTransferQuotaAssetAmount = totalTransferQuotaAssetAmount; + return this; + } + + /** + * Get totalTransferQuotaAssetAmount + * + * @return totalTransferQuotaAssetAmount + */ + @jakarta.annotation.Nullable + public String getTotalTransferQuotaAssetAmount() { + return totalTransferQuotaAssetAmount; + } + + public void setTotalTransferQuotaAssetAmount( + @jakarta.annotation.Nullable String totalTransferQuotaAssetAmount) { + this.totalTransferQuotaAssetAmount = totalTransferQuotaAssetAmount; + } + + public DustConvertibleAssetsResponse totalTransferTargetAssetAmount( + @jakarta.annotation.Nullable String totalTransferTargetAssetAmount) { + this.totalTransferTargetAssetAmount = totalTransferTargetAssetAmount; + return this; + } + + /** + * Get totalTransferTargetAssetAmount + * + * @return totalTransferTargetAssetAmount + */ + @jakarta.annotation.Nullable + public String getTotalTransferTargetAssetAmount() { + return totalTransferTargetAssetAmount; + } + + public void setTotalTransferTargetAssetAmount( + @jakarta.annotation.Nullable String totalTransferTargetAssetAmount) { + this.totalTransferTargetAssetAmount = totalTransferTargetAssetAmount; + } + + public DustConvertibleAssetsResponse dribbletBase( + @jakarta.annotation.Nullable String dribbletBase) { + this.dribbletBase = dribbletBase; + return this; + } + + /** + * Get dribbletBase + * + * @return dribbletBase + */ + @jakarta.annotation.Nullable + public String getDribbletBase() { + return dribbletBase; + } + + public void setDribbletBase(@jakarta.annotation.Nullable String dribbletBase) { + this.dribbletBase = dribbletBase; + } + + public DustConvertibleAssetsResponse details( + @jakarta.annotation.Nullable + List<@Valid DustConvertibleAssetsResponseDetailsInner> details) { + this.details = details; + return this; + } + + public DustConvertibleAssetsResponse addDetailsItem( + DustConvertibleAssetsResponseDetailsInner detailsItem) { + if (this.details == null) { + this.details = new ArrayList<>(); + } + this.details.add(detailsItem); + return this; + } + + /** + * Get details + * + * @return details + */ + @jakarta.annotation.Nullable + @Valid + public List<@Valid DustConvertibleAssetsResponseDetailsInner> getDetails() { + return details; + } + + public void setDetails( + @jakarta.annotation.Nullable + List<@Valid DustConvertibleAssetsResponseDetailsInner> details) { + this.details = details; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DustConvertibleAssetsResponse dustConvertibleAssetsResponse = + (DustConvertibleAssetsResponse) o; + return Objects.equals( + this.dribbletPercentage, dustConvertibleAssetsResponse.dribbletPercentage) + && Objects.equals( + this.totalTransferQuotaAssetAmount, + dustConvertibleAssetsResponse.totalTransferQuotaAssetAmount) + && Objects.equals( + this.totalTransferTargetAssetAmount, + dustConvertibleAssetsResponse.totalTransferTargetAssetAmount) + && Objects.equals(this.dribbletBase, dustConvertibleAssetsResponse.dribbletBase) + && Objects.equals(this.details, dustConvertibleAssetsResponse.details); + } + + @Override + public int hashCode() { + return Objects.hash( + dribbletPercentage, + totalTransferQuotaAssetAmount, + totalTransferTargetAssetAmount, + dribbletBase, + details); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DustConvertibleAssetsResponse {\n"); + sb.append(" dribbletPercentage: ") + .append(toIndentedString(dribbletPercentage)) + .append("\n"); + sb.append(" totalTransferQuotaAssetAmount: ") + .append(toIndentedString(totalTransferQuotaAssetAmount)) + .append("\n"); + sb.append(" totalTransferTargetAssetAmount: ") + .append(toIndentedString(totalTransferTargetAssetAmount)) + .append("\n"); + sb.append(" dribbletBase: ").append(toIndentedString(dribbletBase)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object dribbletPercentageValue = getDribbletPercentage(); + String dribbletPercentageValueAsString = ""; + dribbletPercentageValueAsString = dribbletPercentageValue.toString(); + sb.append("dribbletPercentage=") + .append(urlEncode(dribbletPercentageValueAsString)) + .append(""); + Object totalTransferQuotaAssetAmountValue = getTotalTransferQuotaAssetAmount(); + String totalTransferQuotaAssetAmountValueAsString = ""; + totalTransferQuotaAssetAmountValueAsString = totalTransferQuotaAssetAmountValue.toString(); + sb.append("totalTransferQuotaAssetAmount=") + .append(urlEncode(totalTransferQuotaAssetAmountValueAsString)) + .append(""); + Object totalTransferTargetAssetAmountValue = getTotalTransferTargetAssetAmount(); + String totalTransferTargetAssetAmountValueAsString = ""; + totalTransferTargetAssetAmountValueAsString = + totalTransferTargetAssetAmountValue.toString(); + sb.append("totalTransferTargetAssetAmount=") + .append(urlEncode(totalTransferTargetAssetAmountValueAsString)) + .append(""); + Object dribbletBaseValue = getDribbletBase(); + String dribbletBaseValueAsString = ""; + dribbletBaseValueAsString = dribbletBaseValue.toString(); + sb.append("dribbletBase=").append(urlEncode(dribbletBaseValueAsString)).append(""); + Object detailsValue = getDetails(); + String detailsValueAsString = ""; + detailsValueAsString = + (String) + ((Collection) detailsValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("details=").append(urlEncode(detailsValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("dribbletPercentage"); + openapiFields.add("totalTransferQuotaAssetAmount"); + openapiFields.add("totalTransferTargetAssetAmount"); + openapiFields.add("dribbletBase"); + openapiFields.add("details"); + + // 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 + * DustConvertibleAssetsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DustConvertibleAssetsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in DustConvertibleAssetsResponse is not" + + " found in the empty JSON string", + DustConvertibleAssetsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("dribbletPercentage") != null + && !jsonObj.get("dribbletPercentage").isJsonNull()) + && !jsonObj.get("dribbletPercentage").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dribbletPercentage` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("dribbletPercentage").toString())); + } + if ((jsonObj.get("totalTransferQuotaAssetAmount") != null + && !jsonObj.get("totalTransferQuotaAssetAmount").isJsonNull()) + && !jsonObj.get("totalTransferQuotaAssetAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalTransferQuotaAssetAmount` to be a primitive" + + " type in the JSON string but got `%s`", + jsonObj.get("totalTransferQuotaAssetAmount").toString())); + } + if ((jsonObj.get("totalTransferTargetAssetAmount") != null + && !jsonObj.get("totalTransferTargetAssetAmount").isJsonNull()) + && !jsonObj.get("totalTransferTargetAssetAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `totalTransferTargetAssetAmount` to be a primitive" + + " type in the JSON string but got `%s`", + jsonObj.get("totalTransferTargetAssetAmount").toString())); + } + if ((jsonObj.get("dribbletBase") != null && !jsonObj.get("dribbletBase").isJsonNull()) + && !jsonObj.get("dribbletBase").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `dribbletBase` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("dribbletBase").toString())); + } + if (jsonObj.get("details") != null && !jsonObj.get("details").isJsonNull()) { + JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); + if (jsonArraydetails != null) { + // ensure the json data is an array + if (!jsonObj.get("details").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `details` to be an array in the JSON string" + + " but got `%s`", + jsonObj.get("details").toString())); + } + + // validate the optional field `details` (array) + for (int i = 0; i < jsonArraydetails.size(); i++) { + DustConvertibleAssetsResponseDetailsInner.validateJsonElement( + jsonArraydetails.get(i)); + } + ; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DustConvertibleAssetsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DustConvertibleAssetsResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DustConvertibleAssetsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, DustConvertibleAssetsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DustConvertibleAssetsResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DustConvertibleAssetsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DustConvertibleAssetsResponse + * @throws IOException if the JSON string is invalid with respect to + * DustConvertibleAssetsResponse + */ + public static DustConvertibleAssetsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DustConvertibleAssetsResponse.class); + } + + /** + * Convert an instance of DustConvertibleAssetsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsResponseDetailsInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsResponseDetailsInner.java new file mode 100644 index 000000000..c46dd555d --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/DustConvertibleAssetsResponseDetailsInner.java @@ -0,0 +1,500 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST 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.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** DustConvertibleAssetsResponseDetailsInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class DustConvertibleAssetsResponseDetailsInner { + public static final String SERIALIZED_NAME_ASSET = "asset"; + + @SerializedName(SERIALIZED_NAME_ASSET) + @jakarta.annotation.Nullable + private String asset; + + public static final String SERIALIZED_NAME_ASSET_FULL_NAME = "assetFullName"; + + @SerializedName(SERIALIZED_NAME_ASSET_FULL_NAME) + @jakarta.annotation.Nullable + private String assetFullName; + + public static final String SERIALIZED_NAME_AMOUNT_FREE = "amountFree"; + + @SerializedName(SERIALIZED_NAME_AMOUNT_FREE) + @jakarta.annotation.Nullable + private String amountFree; + + public static final String SERIALIZED_NAME_EXCHANGE = "exchange"; + + @SerializedName(SERIALIZED_NAME_EXCHANGE) + @jakarta.annotation.Nullable + private String exchange; + + public static final String SERIALIZED_NAME_TO_QUOTA_ASSET_AMOUNT = "toQuotaAssetAmount"; + + @SerializedName(SERIALIZED_NAME_TO_QUOTA_ASSET_AMOUNT) + @jakarta.annotation.Nullable + private String toQuotaAssetAmount; + + public static final String SERIALIZED_NAME_TO_TARGET_ASSET_AMOUNT = "toTargetAssetAmount"; + + @SerializedName(SERIALIZED_NAME_TO_TARGET_ASSET_AMOUNT) + @jakarta.annotation.Nullable + private String toTargetAssetAmount; + + public static final String SERIALIZED_NAME_TO_TARGET_ASSET_OFF_EXCHANGE = + "toTargetAssetOffExchange"; + + @SerializedName(SERIALIZED_NAME_TO_TARGET_ASSET_OFF_EXCHANGE) + @jakarta.annotation.Nullable + private String toTargetAssetOffExchange; + + public DustConvertibleAssetsResponseDetailsInner() {} + + public DustConvertibleAssetsResponseDetailsInner asset( + @jakarta.annotation.Nullable String asset) { + this.asset = asset; + return this; + } + + /** + * Get asset + * + * @return asset + */ + @jakarta.annotation.Nullable + public String getAsset() { + return asset; + } + + public void setAsset(@jakarta.annotation.Nullable String asset) { + this.asset = asset; + } + + public DustConvertibleAssetsResponseDetailsInner assetFullName( + @jakarta.annotation.Nullable String assetFullName) { + this.assetFullName = assetFullName; + return this; + } + + /** + * Get assetFullName + * + * @return assetFullName + */ + @jakarta.annotation.Nullable + public String getAssetFullName() { + return assetFullName; + } + + public void setAssetFullName(@jakarta.annotation.Nullable String assetFullName) { + this.assetFullName = assetFullName; + } + + public DustConvertibleAssetsResponseDetailsInner amountFree( + @jakarta.annotation.Nullable String amountFree) { + this.amountFree = amountFree; + return this; + } + + /** + * Get amountFree + * + * @return amountFree + */ + @jakarta.annotation.Nullable + public String getAmountFree() { + return amountFree; + } + + public void setAmountFree(@jakarta.annotation.Nullable String amountFree) { + this.amountFree = amountFree; + } + + public DustConvertibleAssetsResponseDetailsInner exchange( + @jakarta.annotation.Nullable String exchange) { + this.exchange = exchange; + return this; + } + + /** + * Get exchange + * + * @return exchange + */ + @jakarta.annotation.Nullable + public String getExchange() { + return exchange; + } + + public void setExchange(@jakarta.annotation.Nullable String exchange) { + this.exchange = exchange; + } + + public DustConvertibleAssetsResponseDetailsInner toQuotaAssetAmount( + @jakarta.annotation.Nullable String toQuotaAssetAmount) { + this.toQuotaAssetAmount = toQuotaAssetAmount; + return this; + } + + /** + * Get toQuotaAssetAmount + * + * @return toQuotaAssetAmount + */ + @jakarta.annotation.Nullable + public String getToQuotaAssetAmount() { + return toQuotaAssetAmount; + } + + public void setToQuotaAssetAmount(@jakarta.annotation.Nullable String toQuotaAssetAmount) { + this.toQuotaAssetAmount = toQuotaAssetAmount; + } + + public DustConvertibleAssetsResponseDetailsInner toTargetAssetAmount( + @jakarta.annotation.Nullable String toTargetAssetAmount) { + this.toTargetAssetAmount = toTargetAssetAmount; + return this; + } + + /** + * Get toTargetAssetAmount + * + * @return toTargetAssetAmount + */ + @jakarta.annotation.Nullable + public String getToTargetAssetAmount() { + return toTargetAssetAmount; + } + + public void setToTargetAssetAmount(@jakarta.annotation.Nullable String toTargetAssetAmount) { + this.toTargetAssetAmount = toTargetAssetAmount; + } + + public DustConvertibleAssetsResponseDetailsInner toTargetAssetOffExchange( + @jakarta.annotation.Nullable String toTargetAssetOffExchange) { + this.toTargetAssetOffExchange = toTargetAssetOffExchange; + return this; + } + + /** + * Get toTargetAssetOffExchange + * + * @return toTargetAssetOffExchange + */ + @jakarta.annotation.Nullable + public String getToTargetAssetOffExchange() { + return toTargetAssetOffExchange; + } + + public void setToTargetAssetOffExchange( + @jakarta.annotation.Nullable String toTargetAssetOffExchange) { + this.toTargetAssetOffExchange = toTargetAssetOffExchange; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DustConvertibleAssetsResponseDetailsInner dustConvertibleAssetsResponseDetailsInner = + (DustConvertibleAssetsResponseDetailsInner) o; + return Objects.equals(this.asset, dustConvertibleAssetsResponseDetailsInner.asset) + && Objects.equals( + this.assetFullName, dustConvertibleAssetsResponseDetailsInner.assetFullName) + && Objects.equals( + this.amountFree, dustConvertibleAssetsResponseDetailsInner.amountFree) + && Objects.equals(this.exchange, dustConvertibleAssetsResponseDetailsInner.exchange) + && Objects.equals( + this.toQuotaAssetAmount, + dustConvertibleAssetsResponseDetailsInner.toQuotaAssetAmount) + && Objects.equals( + this.toTargetAssetAmount, + dustConvertibleAssetsResponseDetailsInner.toTargetAssetAmount) + && Objects.equals( + this.toTargetAssetOffExchange, + dustConvertibleAssetsResponseDetailsInner.toTargetAssetOffExchange); + } + + @Override + public int hashCode() { + return Objects.hash( + asset, + assetFullName, + amountFree, + exchange, + toQuotaAssetAmount, + toTargetAssetAmount, + toTargetAssetOffExchange); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DustConvertibleAssetsResponseDetailsInner {\n"); + sb.append(" asset: ").append(toIndentedString(asset)).append("\n"); + sb.append(" assetFullName: ").append(toIndentedString(assetFullName)).append("\n"); + sb.append(" amountFree: ").append(toIndentedString(amountFree)).append("\n"); + sb.append(" exchange: ").append(toIndentedString(exchange)).append("\n"); + sb.append(" toQuotaAssetAmount: ") + .append(toIndentedString(toQuotaAssetAmount)) + .append("\n"); + sb.append(" toTargetAssetAmount: ") + .append(toIndentedString(toTargetAssetAmount)) + .append("\n"); + sb.append(" toTargetAssetOffExchange: ") + .append(toIndentedString(toTargetAssetOffExchange)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object assetValue = getAsset(); + String assetValueAsString = ""; + assetValueAsString = assetValue.toString(); + sb.append("asset=").append(urlEncode(assetValueAsString)).append(""); + Object assetFullNameValue = getAssetFullName(); + String assetFullNameValueAsString = ""; + assetFullNameValueAsString = assetFullNameValue.toString(); + sb.append("assetFullName=").append(urlEncode(assetFullNameValueAsString)).append(""); + Object amountFreeValue = getAmountFree(); + String amountFreeValueAsString = ""; + amountFreeValueAsString = amountFreeValue.toString(); + sb.append("amountFree=").append(urlEncode(amountFreeValueAsString)).append(""); + Object exchangeValue = getExchange(); + String exchangeValueAsString = ""; + exchangeValueAsString = exchangeValue.toString(); + sb.append("exchange=").append(urlEncode(exchangeValueAsString)).append(""); + Object toQuotaAssetAmountValue = getToQuotaAssetAmount(); + String toQuotaAssetAmountValueAsString = ""; + toQuotaAssetAmountValueAsString = toQuotaAssetAmountValue.toString(); + sb.append("toQuotaAssetAmount=") + .append(urlEncode(toQuotaAssetAmountValueAsString)) + .append(""); + Object toTargetAssetAmountValue = getToTargetAssetAmount(); + String toTargetAssetAmountValueAsString = ""; + toTargetAssetAmountValueAsString = toTargetAssetAmountValue.toString(); + sb.append("toTargetAssetAmount=") + .append(urlEncode(toTargetAssetAmountValueAsString)) + .append(""); + Object toTargetAssetOffExchangeValue = getToTargetAssetOffExchange(); + String toTargetAssetOffExchangeValueAsString = ""; + toTargetAssetOffExchangeValueAsString = toTargetAssetOffExchangeValue.toString(); + sb.append("toTargetAssetOffExchange=") + .append(urlEncode(toTargetAssetOffExchangeValueAsString)) + .append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("asset"); + openapiFields.add("assetFullName"); + openapiFields.add("amountFree"); + openapiFields.add("exchange"); + openapiFields.add("toQuotaAssetAmount"); + openapiFields.add("toTargetAssetAmount"); + openapiFields.add("toTargetAssetOffExchange"); + + // 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 + * DustConvertibleAssetsResponseDetailsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DustConvertibleAssetsResponseDetailsInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in" + + " DustConvertibleAssetsResponseDetailsInner is not found in" + + " the empty JSON string", + DustConvertibleAssetsResponseDetailsInner.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("asset") != null && !jsonObj.get("asset").isJsonNull()) + && !jsonObj.get("asset").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `asset` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("asset").toString())); + } + if ((jsonObj.get("assetFullName") != null && !jsonObj.get("assetFullName").isJsonNull()) + && !jsonObj.get("assetFullName").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `assetFullName` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("assetFullName").toString())); + } + if ((jsonObj.get("amountFree") != null && !jsonObj.get("amountFree").isJsonNull()) + && !jsonObj.get("amountFree").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `amountFree` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("amountFree").toString())); + } + if ((jsonObj.get("exchange") != null && !jsonObj.get("exchange").isJsonNull()) + && !jsonObj.get("exchange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `exchange` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("exchange").toString())); + } + if ((jsonObj.get("toQuotaAssetAmount") != null + && !jsonObj.get("toQuotaAssetAmount").isJsonNull()) + && !jsonObj.get("toQuotaAssetAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `toQuotaAssetAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("toQuotaAssetAmount").toString())); + } + if ((jsonObj.get("toTargetAssetAmount") != null + && !jsonObj.get("toTargetAssetAmount").isJsonNull()) + && !jsonObj.get("toTargetAssetAmount").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `toTargetAssetAmount` to be a primitive type in the" + + " JSON string but got `%s`", + jsonObj.get("toTargetAssetAmount").toString())); + } + if ((jsonObj.get("toTargetAssetOffExchange") != null + && !jsonObj.get("toTargetAssetOffExchange").isJsonNull()) + && !jsonObj.get("toTargetAssetOffExchange").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `toTargetAssetOffExchange` to be a primitive type" + + " in the JSON string but got `%s`", + jsonObj.get("toTargetAssetOffExchange").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!DustConvertibleAssetsResponseDetailsInner.class.isAssignableFrom( + type.getRawType())) { + return null; // this class only serializes + // 'DustConvertibleAssetsResponseDetailsInner' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(DustConvertibleAssetsResponseDetailsInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, DustConvertibleAssetsResponseDetailsInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public DustConvertibleAssetsResponseDetailsInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of DustConvertibleAssetsResponseDetailsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of DustConvertibleAssetsResponseDetailsInner + * @throws IOException if the JSON string is invalid with respect to + * DustConvertibleAssetsResponseDetailsInner + */ + public static DustConvertibleAssetsResponseDetailsInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, DustConvertibleAssetsResponseDetailsInner.class); + } + + /** + * Convert an instance of DustConvertibleAssetsResponseDetailsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OneClickArrivalDepositApplyRequest.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OneClickArrivalDepositApplyRequest.java index 113b50098..4ade06746 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OneClickArrivalDepositApplyRequest.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/OneClickArrivalDepositApplyRequest.java @@ -40,7 +40,7 @@ public class OneClickArrivalDepositApplyRequest { @SerializedName(SERIALIZED_NAME_DEPOSIT_ID) @jakarta.annotation.Nullable - private String depositId; + private Long depositId; public static final String SERIALIZED_NAME_TX_ID = "txId"; @@ -63,7 +63,7 @@ public class OneClickArrivalDepositApplyRequest { public OneClickArrivalDepositApplyRequest() {} public OneClickArrivalDepositApplyRequest depositId( - @jakarta.annotation.Nullable String depositId) { + @jakarta.annotation.Nullable Long depositId) { this.depositId = depositId; return this; } @@ -74,11 +74,11 @@ public OneClickArrivalDepositApplyRequest depositId( * @return depositId */ @jakarta.annotation.Nullable - public String getDepositId() { + public Long getDepositId() { return depositId; } - public void setDepositId(@jakarta.annotation.Nullable String depositId) { + public void setDepositId(@jakarta.annotation.Nullable Long depositId) { this.depositId = depositId; } @@ -251,14 +251,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("depositId") != null && !jsonObj.get("depositId").isJsonNull()) - && !jsonObj.get("depositId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `depositId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("depositId").toString())); - } if ((jsonObj.get("txId") != null && !jsonObj.get("txId").isJsonNull()) && !jsonObj.get("txId").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireRequest.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireRequest.java index 3dc5ed003..671ebdc2f 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireRequest.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireRequest.java @@ -47,7 +47,7 @@ public class SubmitDepositQuestionnaireRequest { @SerializedName(SERIALIZED_NAME_DEPOSIT_ID) @jakarta.annotation.Nonnull - private String depositId; + private Long depositId; public static final String SERIALIZED_NAME_QUESTIONNAIRE = "questionnaire"; @@ -120,8 +120,7 @@ public void setSubAccountId(@jakarta.annotation.Nonnull String subAccountId) { this.subAccountId = subAccountId; } - public SubmitDepositQuestionnaireRequest depositId( - @jakarta.annotation.Nonnull String depositId) { + public SubmitDepositQuestionnaireRequest depositId(@jakarta.annotation.Nonnull Long depositId) { this.depositId = depositId; return this; } @@ -133,11 +132,11 @@ public SubmitDepositQuestionnaireRequest depositId( */ @jakarta.annotation.Nonnull @NotNull - public String getDepositId() { + public Long getDepositId() { return depositId; } - public void setDepositId(@jakarta.annotation.Nonnull String depositId) { + public void setDepositId(@jakarta.annotation.Nonnull Long depositId) { this.depositId = depositId; } @@ -486,13 +485,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " string but got `%s`", jsonObj.get("subAccountId").toString())); } - if (!jsonObj.get("depositId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `depositId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("depositId").toString())); - } if (!jsonObj.get("questionnaire").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( diff --git a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/KeepaliveIsolatedMarginUserDataStreamRequest.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireV2Request.java similarity index 51% rename from clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/KeepaliveIsolatedMarginUserDataStreamRequest.java rename to clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireV2Request.java index bd3fea596..f53926794 100644 --- a/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/KeepaliveIsolatedMarginUserDataStreamRequest.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireV2Request.java @@ -1,6 +1,6 @@ /* - * Binance Margin Trading REST API - * OpenAPI Specification for the Binance Margin Trading REST API + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST API * * The version of the OpenAPI document: 1.0.0 * @@ -10,9 +10,9 @@ * Do not edit the class manually. */ -package com.binance.connector.client.margin_trading.rest.model; +package com.binance.connector.client.wallet.rest.model; -import com.binance.connector.client.margin_trading.rest.JSON; +import com.binance.connector.client.wallet.rest.JSON; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -31,65 +31,65 @@ import java.util.Objects; import org.hibernate.validator.constraints.*; -/** KeepaliveIsolatedMarginUserDataStreamRequest */ +/** SubmitDepositQuestionnaireV2Request */ @jakarta.annotation.Generated( value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0") -public class KeepaliveIsolatedMarginUserDataStreamRequest { - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; +public class SubmitDepositQuestionnaireV2Request { + public static final String SERIALIZED_NAME_DEPOSIT_ID = "depositId"; - @SerializedName(SERIALIZED_NAME_SYMBOL) + @SerializedName(SERIALIZED_NAME_DEPOSIT_ID) @jakarta.annotation.Nonnull - private String symbol; + private Long depositId; - public static final String SERIALIZED_NAME_LISTEN_KEY = "listenKey"; + public static final String SERIALIZED_NAME_QUESTIONNAIRE = "questionnaire"; - @SerializedName(SERIALIZED_NAME_LISTEN_KEY) + @SerializedName(SERIALIZED_NAME_QUESTIONNAIRE) @jakarta.annotation.Nonnull - private String listenKey; + private String questionnaire; - public KeepaliveIsolatedMarginUserDataStreamRequest() {} + public SubmitDepositQuestionnaireV2Request() {} - public KeepaliveIsolatedMarginUserDataStreamRequest symbol( - @jakarta.annotation.Nonnull String symbol) { - this.symbol = symbol; + public SubmitDepositQuestionnaireV2Request depositId( + @jakarta.annotation.Nonnull Long depositId) { + this.depositId = depositId; return this; } /** - * Get symbol + * Get depositId * - * @return symbol + * @return depositId */ @jakarta.annotation.Nonnull @NotNull - public String getSymbol() { - return symbol; + public Long getDepositId() { + return depositId; } - public void setSymbol(@jakarta.annotation.Nonnull String symbol) { - this.symbol = symbol; + public void setDepositId(@jakarta.annotation.Nonnull Long depositId) { + this.depositId = depositId; } - public KeepaliveIsolatedMarginUserDataStreamRequest listenKey( - @jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; + public SubmitDepositQuestionnaireV2Request questionnaire( + @jakarta.annotation.Nonnull String questionnaire) { + this.questionnaire = questionnaire; return this; } /** - * Get listenKey + * Get questionnaire * - * @return listenKey + * @return questionnaire */ @jakarta.annotation.Nonnull @NotNull - public String getListenKey() { - return listenKey; + public String getQuestionnaire() { + return questionnaire; } - public void setListenKey(@jakarta.annotation.Nonnull String listenKey) { - this.listenKey = listenKey; + public void setQuestionnaire(@jakarta.annotation.Nonnull String questionnaire) { + this.questionnaire = questionnaire; } @Override @@ -100,24 +100,24 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - KeepaliveIsolatedMarginUserDataStreamRequest keepaliveIsolatedMarginUserDataStreamRequest = - (KeepaliveIsolatedMarginUserDataStreamRequest) o; - return Objects.equals(this.symbol, keepaliveIsolatedMarginUserDataStreamRequest.symbol) + SubmitDepositQuestionnaireV2Request submitDepositQuestionnaireV2Request = + (SubmitDepositQuestionnaireV2Request) o; + return Objects.equals(this.depositId, submitDepositQuestionnaireV2Request.depositId) && Objects.equals( - this.listenKey, keepaliveIsolatedMarginUserDataStreamRequest.listenKey); + this.questionnaire, submitDepositQuestionnaireV2Request.questionnaire); } @Override public int hashCode() { - return Objects.hash(symbol, listenKey); + return Objects.hash(depositId, questionnaire); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class KeepaliveIsolatedMarginUserDataStreamRequest {\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" listenKey: ").append(toIndentedString(listenKey)).append("\n"); + sb.append("class SubmitDepositQuestionnaireV2Request {\n"); + sb.append(" depositId: ").append(toIndentedString(depositId)).append("\n"); + sb.append(" questionnaire: ").append(toIndentedString(questionnaire)).append("\n"); sb.append("}"); return sb.toString(); } @@ -125,14 +125,14 @@ public String toString() { public String toUrlQueryString() { StringBuilder sb = new StringBuilder(); - Object symbolValue = getSymbol(); - String symbolValueAsString = ""; - symbolValueAsString = symbolValue.toString(); - sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); - Object listenKeyValue = getListenKey(); - String listenKeyValueAsString = ""; - listenKeyValueAsString = listenKeyValue.toString(); - sb.append("listenKey=").append(urlEncode(listenKeyValueAsString)).append(""); + Object depositIdValue = getDepositId(); + String depositIdValueAsString = ""; + depositIdValueAsString = depositIdValue.toString(); + sb.append("depositId=").append(urlEncode(depositIdValueAsString)).append(""); + Object questionnaireValue = getQuestionnaire(); + String questionnaireValueAsString = ""; + questionnaireValueAsString = questionnaireValue.toString(); + sb.append("questionnaire=").append(urlEncode(questionnaireValueAsString)).append(""); return sb.toString(); } @@ -161,13 +161,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("symbol"); - openapiFields.add("listenKey"); + openapiFields.add("depositId"); + openapiFields.add("questionnaire"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("symbol"); - openapiRequiredFields.add("listenKey"); + openapiRequiredFields.add("depositId"); + openapiRequiredFields.add("questionnaire"); } /** @@ -175,25 +175,23 @@ private String toIndentedString(Object o) { * * @param jsonElement JSON Element * @throws IOException if the JSON Element is invalid with respect to - * KeepaliveIsolatedMarginUserDataStreamRequest + * SubmitDepositQuestionnaireV2Request */ public static void validateJsonElement(JsonElement jsonElement) throws IOException { if (jsonElement == null) { - if (!KeepaliveIsolatedMarginUserDataStreamRequest.openapiRequiredFields + if (!SubmitDepositQuestionnaireV2Request.openapiRequiredFields .isEmpty()) { // has required fields but JSON element is null throw new IllegalArgumentException( String.format( - "The required field(s) %s in" - + " KeepaliveIsolatedMarginUserDataStreamRequest is not found" - + " in the empty JSON string", - KeepaliveIsolatedMarginUserDataStreamRequest.openapiRequiredFields + "The required field(s) %s in SubmitDepositQuestionnaireV2Request is" + + " not found in the empty JSON string", + SubmitDepositQuestionnaireV2Request.openapiRequiredFields .toString())); } } // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : - KeepaliveIsolatedMarginUserDataStreamRequest.openapiRequiredFields) { + for (String requiredField : SubmitDepositQuestionnaireV2Request.openapiRequiredFields) { if (jsonElement.getAsJsonObject().get(requiredField) == null) { throw new IllegalArgumentException( String.format( @@ -202,19 +200,12 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti } } JsonObject jsonObj = jsonElement.getAsJsonObject(); - if (!jsonObj.get("symbol").isJsonPrimitive()) { + if (!jsonObj.get("questionnaire").isJsonPrimitive()) { throw new IllegalArgumentException( String.format( - "Expected the field `symbol` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("symbol").toString())); - } - if (!jsonObj.get("listenKey").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `listenKey` to be a primitive type in the JSON" + "Expected the field `questionnaire` to be a primitive type in the JSON" + " string but got `%s`", - jsonObj.get("listenKey").toString())); + jsonObj.get("questionnaire").toString())); } } @@ -222,29 +213,26 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!KeepaliveIsolatedMarginUserDataStreamRequest.class.isAssignableFrom( - type.getRawType())) { - return null; // this class only serializes - // 'KeepaliveIsolatedMarginUserDataStreamRequest' and its subtypes + if (!SubmitDepositQuestionnaireV2Request.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitDepositQuestionnaireV2Request' and + // its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = + final TypeAdapter thisAdapter = gson.getDelegateAdapter( - this, - TypeToken.get(KeepaliveIsolatedMarginUserDataStreamRequest.class)); + this, TypeToken.get(SubmitDepositQuestionnaireV2Request.class)); return (TypeAdapter) - new TypeAdapter() { + new TypeAdapter() { @Override - public void write( - JsonWriter out, KeepaliveIsolatedMarginUserDataStreamRequest value) + public void write(JsonWriter out, SubmitDepositQuestionnaireV2Request value) throws IOException { JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public KeepaliveIsolatedMarginUserDataStreamRequest read(JsonReader in) + public SubmitDepositQuestionnaireV2Request read(JsonReader in) throws IOException { JsonElement jsonElement = elementAdapter.read(in); // validateJsonElement(jsonElement); @@ -255,21 +243,20 @@ public KeepaliveIsolatedMarginUserDataStreamRequest read(JsonReader in) } /** - * Create an instance of KeepaliveIsolatedMarginUserDataStreamRequest given an JSON string + * Create an instance of SubmitDepositQuestionnaireV2Request given an JSON string * * @param jsonString JSON string - * @return An instance of KeepaliveIsolatedMarginUserDataStreamRequest + * @return An instance of SubmitDepositQuestionnaireV2Request * @throws IOException if the JSON string is invalid with respect to - * KeepaliveIsolatedMarginUserDataStreamRequest + * SubmitDepositQuestionnaireV2Request */ - public static KeepaliveIsolatedMarginUserDataStreamRequest fromJson(String jsonString) + public static SubmitDepositQuestionnaireV2Request fromJson(String jsonString) throws IOException { - return JSON.getGson() - .fromJson(jsonString, KeepaliveIsolatedMarginUserDataStreamRequest.class); + return JSON.getGson().fromJson(jsonString, SubmitDepositQuestionnaireV2Request.class); } /** - * Convert an instance of KeepaliveIsolatedMarginUserDataStreamRequest to an JSON string + * Convert an instance of SubmitDepositQuestionnaireV2Request to an JSON string * * @return JSON string */ diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireV2Response.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireV2Response.java new file mode 100644 index 000000000..15695a664 --- /dev/null +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/SubmitDepositQuestionnaireV2Response.java @@ -0,0 +1,284 @@ +/* + * Binance Wallet REST API + * OpenAPI Specification for the Binance Wallet REST 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.wallet.rest.model; + +import com.binance.connector.client.wallet.rest.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.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashSet; +import java.util.Objects; +import org.hibernate.validator.constraints.*; + +/** SubmitDepositQuestionnaireV2Response */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class SubmitDepositQuestionnaireV2Response { + public static final String SERIALIZED_NAME_TR_ID = "trId"; + + @SerializedName(SERIALIZED_NAME_TR_ID) + @jakarta.annotation.Nullable + private Long trId; + + public static final String SERIALIZED_NAME_ACCEPTED = "accepted"; + + @SerializedName(SERIALIZED_NAME_ACCEPTED) + @jakarta.annotation.Nullable + private Boolean accepted; + + public static final String SERIALIZED_NAME_INFO = "info"; + + @SerializedName(SERIALIZED_NAME_INFO) + @jakarta.annotation.Nullable + private String info; + + public SubmitDepositQuestionnaireV2Response() {} + + public SubmitDepositQuestionnaireV2Response trId(@jakarta.annotation.Nullable Long trId) { + this.trId = trId; + return this; + } + + /** + * Get trId + * + * @return trId + */ + @jakarta.annotation.Nullable + public Long getTrId() { + return trId; + } + + public void setTrId(@jakarta.annotation.Nullable Long trId) { + this.trId = trId; + } + + public SubmitDepositQuestionnaireV2Response accepted( + @jakarta.annotation.Nullable Boolean accepted) { + this.accepted = accepted; + return this; + } + + /** + * Get accepted + * + * @return accepted + */ + @jakarta.annotation.Nullable + public Boolean getAccepted() { + return accepted; + } + + public void setAccepted(@jakarta.annotation.Nullable Boolean accepted) { + this.accepted = accepted; + } + + public SubmitDepositQuestionnaireV2Response info(@jakarta.annotation.Nullable String info) { + this.info = info; + return this; + } + + /** + * Get info + * + * @return info + */ + @jakarta.annotation.Nullable + public String getInfo() { + return info; + } + + public void setInfo(@jakarta.annotation.Nullable String info) { + this.info = info; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubmitDepositQuestionnaireV2Response submitDepositQuestionnaireV2Response = + (SubmitDepositQuestionnaireV2Response) o; + return Objects.equals(this.trId, submitDepositQuestionnaireV2Response.trId) + && Objects.equals(this.accepted, submitDepositQuestionnaireV2Response.accepted) + && Objects.equals(this.info, submitDepositQuestionnaireV2Response.info); + } + + @Override + public int hashCode() { + return Objects.hash(trId, accepted, info); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubmitDepositQuestionnaireV2Response {\n"); + sb.append(" trId: ").append(toIndentedString(trId)).append("\n"); + sb.append(" accepted: ").append(toIndentedString(accepted)).append("\n"); + sb.append(" info: ").append(toIndentedString(info)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object trIdValue = getTrId(); + String trIdValueAsString = ""; + trIdValueAsString = trIdValue.toString(); + sb.append("trId=").append(urlEncode(trIdValueAsString)).append(""); + Object acceptedValue = getAccepted(); + String acceptedValueAsString = ""; + acceptedValueAsString = acceptedValue.toString(); + sb.append("accepted=").append(urlEncode(acceptedValueAsString)).append(""); + Object infoValue = getInfo(); + String infoValueAsString = ""; + infoValueAsString = infoValue.toString(); + sb.append("info=").append(urlEncode(infoValueAsString)).append(""); + return sb.toString(); + } + + public static String urlEncode(String s) { + try { + return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); + } + } + + /** + * 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("trId"); + openapiFields.add("accepted"); + openapiFields.add("info"); + + // 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 + * SubmitDepositQuestionnaireV2Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SubmitDepositQuestionnaireV2Response.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in SubmitDepositQuestionnaireV2Response" + + " is not found in the empty JSON string", + SubmitDepositQuestionnaireV2Response.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("info") != null && !jsonObj.get("info").isJsonNull()) + && !jsonObj.get("info").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `info` to be a primitive type in the JSON string" + + " but got `%s`", + jsonObj.get("info").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SubmitDepositQuestionnaireV2Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SubmitDepositQuestionnaireV2Response' + // and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(SubmitDepositQuestionnaireV2Response.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write( + JsonWriter out, SubmitDepositQuestionnaireV2Response value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SubmitDepositQuestionnaireV2Response read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of SubmitDepositQuestionnaireV2Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubmitDepositQuestionnaireV2Response + * @throws IOException if the JSON string is invalid with respect to + * SubmitDepositQuestionnaireV2Response + */ + public static SubmitDepositQuestionnaireV2Response fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, SubmitDepositQuestionnaireV2Response.class); + } + + /** + * Convert an instance of SubmitDepositQuestionnaireV2Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/WithdrawHistoryV2ResponseInner.java b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/WithdrawHistoryV2ResponseInner.java index cea4a8bff..68d21b544 100644 --- a/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/WithdrawHistoryV2ResponseInner.java +++ b/clients/wallet/src/main/java/com/binance/connector/client/wallet/rest/model/WithdrawHistoryV2ResponseInner.java @@ -84,12 +84,6 @@ public class WithdrawHistoryV2ResponseInner { @jakarta.annotation.Nullable private String address; - public static final String SERIALIZED_NAME_ADDRESS_TAG = "addressTag"; - - @SerializedName(SERIALIZED_NAME_ADDRESS_TAG) - @jakarta.annotation.Nullable - private String addressTag; - public static final String SERIALIZED_NAME_TX_ID = "txId"; @SerializedName(SERIALIZED_NAME_TX_ID) @@ -313,26 +307,6 @@ public void setAddress(@jakarta.annotation.Nullable String address) { this.address = address; } - public WithdrawHistoryV2ResponseInner addressTag( - @jakarta.annotation.Nullable String addressTag) { - this.addressTag = addressTag; - return this; - } - - /** - * Get addressTag - * - * @return addressTag - */ - @jakarta.annotation.Nullable - public String getAddressTag() { - return addressTag; - } - - public void setAddressTag(@jakarta.annotation.Nullable String addressTag) { - this.addressTag = addressTag; - } - public WithdrawHistoryV2ResponseInner txId(@jakarta.annotation.Nullable String txId) { this.txId = txId; return this; @@ -567,7 +541,6 @@ public boolean equals(Object o) { && Objects.equals( this.travelRuleStatus, withdrawHistoryV2ResponseInner.travelRuleStatus) && Objects.equals(this.address, withdrawHistoryV2ResponseInner.address) - && Objects.equals(this.addressTag, withdrawHistoryV2ResponseInner.addressTag) && Objects.equals(this.txId, withdrawHistoryV2ResponseInner.txId) && Objects.equals(this.applyTime, withdrawHistoryV2ResponseInner.applyTime) && Objects.equals(this.network, withdrawHistoryV2ResponseInner.network) @@ -593,7 +566,6 @@ public int hashCode() { withdrawalStatus, travelRuleStatus, address, - addressTag, txId, applyTime, network, @@ -619,7 +591,6 @@ public String toString() { sb.append(" withdrawalStatus: ").append(toIndentedString(withdrawalStatus)).append("\n"); sb.append(" travelRuleStatus: ").append(toIndentedString(travelRuleStatus)).append("\n"); sb.append(" address: ").append(toIndentedString(address)).append("\n"); - sb.append(" addressTag: ").append(toIndentedString(addressTag)).append("\n"); sb.append(" txId: ").append(toIndentedString(txId)).append("\n"); sb.append(" applyTime: ").append(toIndentedString(applyTime)).append("\n"); sb.append(" network: ").append(toIndentedString(network)).append("\n"); @@ -670,10 +641,6 @@ public String toUrlQueryString() { String addressValueAsString = ""; addressValueAsString = addressValue.toString(); sb.append("address=").append(urlEncode(addressValueAsString)).append(""); - Object addressTagValue = getAddressTag(); - String addressTagValueAsString = ""; - addressTagValueAsString = addressTagValue.toString(); - sb.append("addressTag=").append(urlEncode(addressTagValueAsString)).append(""); Object txIdValue = getTxId(); String txIdValueAsString = ""; txIdValueAsString = txIdValue.toString(); @@ -754,7 +721,6 @@ private String toIndentedString(Object o) { openapiFields.add("withdrawalStatus"); openapiFields.add("travelRuleStatus"); openapiFields.add("address"); - openapiFields.add("addressTag"); openapiFields.add("txId"); openapiFields.add("applyTime"); openapiFields.add("network"); @@ -830,14 +796,6 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti + " but got `%s`", jsonObj.get("address").toString())); } - if ((jsonObj.get("addressTag") != null && !jsonObj.get("addressTag").isJsonNull()) - && !jsonObj.get("addressTag").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `addressTag` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("addressTag").toString())); - } if ((jsonObj.get("txId") != null && !jsonObj.get("txId").isJsonNull()) && !jsonObj.get("txId").isJsonPrimitive()) { throw new IllegalArgumentException( diff --git a/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/AssetApiTest.java b/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/AssetApiTest.java index 7f8fe40f7..d62414d6c 100644 --- a/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/AssetApiTest.java +++ b/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/AssetApiTest.java @@ -106,7 +106,7 @@ public void initApiClient() throws ApiException { @Test public void assetDetailTest() throws ApiException, CryptoException { Long recvWindow = 5000L; - ApiResponse response = api.assetDetail(recvWindow); + ApiResponse response = api.assetDetail("BTCUSDT", recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -118,9 +118,9 @@ public void assetDetailTest() throws ApiException, CryptoException { Call captorValue = callArgumentCaptor.getValue(); Request actualRequest = captorValue.request(); - assertEquals("recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); + assertEquals("asset=BTCUSDT&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "2cdd1e484bce80021437bee6b762e6a276b1954c3a0c011a16f6f2f6a47aba75", + "016fc03fd04451f16c6eba4bd92c9769396a6229a5fb8ca539d2ba74e3038a25", actualRequest.url().queryParameter("signature")); assertEquals("/sapi/v1/asset/assetDetail", actualRequest.url().encodedPath()); } @@ -207,7 +207,7 @@ public void dustlogTest() throws ApiException, CryptoException { Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long recvWindow = 5000L; - ApiResponse response = api.dustlog(startTime, endTime, recvWindow); + ApiResponse response = api.dustlog("", startTime, endTime, recvWindow); ArgumentCaptor callArgumentCaptor = ArgumentCaptor.forClass(Call.class); Mockito.verify(apiClientSpy) @@ -220,10 +220,10 @@ public void dustlogTest() throws ApiException, CryptoException { Request actualRequest = captorValue.request(); assertEquals( - "startTime=1623319461670&endTime=1641782889000&recvWindow=5000×tamp=1736393892000", + "accountType=&startTime=1623319461670&endTime=1641782889000&recvWindow=5000×tamp=1736393892000", signInputCaptor.getValue()); assertEquals( - "812caedbe8f349196a4532c2050ff706ed2569fed185039c7b60a78cd84bc718", + "80bec9d0114cf17ecc91114a2fa12987d44598afe1067a64d0a4641af84b67bc", actualRequest.url().queryParameter("signature")); assertEquals("/sapi/v1/asset/dribblet", actualRequest.url().encodedPath()); } diff --git a/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java b/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java index 39f12fd3e..72fd32c5f 100644 --- a/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java +++ b/clients/wallet/src/test/java/com/binance/connector/client/wallet/rest/api/TravelRuleApiTest.java @@ -242,7 +242,7 @@ public void submitDepositQuestionnaireTest() throws ApiException, CryptoExceptio new SubmitDepositQuestionnaireRequest(); submitDepositQuestionnaireRequest.subAccountId("1"); - submitDepositQuestionnaireRequest.depositId("1"); + submitDepositQuestionnaireRequest.depositId(1L); submitDepositQuestionnaireRequest.questionnaire(""); submitDepositQuestionnaireRequest.beneficiaryPii(""); submitDepositQuestionnaireRequest.signature(""); diff --git a/examples/convert/pom.xml b/examples/convert/pom.xml index 3178ac74d..b37bc3851 100644 --- a/examples/convert/pom.xml +++ b/examples/convert/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-convert - 1.2.1 + 2.0.0 \ No newline at end of file diff --git a/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/QueryLimitOpenOrdersExample.java b/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/QueryLimitOpenOrdersExample.java index d9e927906..e0b0f0bc3 100644 --- a/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/QueryLimitOpenOrdersExample.java +++ b/examples/convert/src/main/java/com/binance/connector/client/convert/rest/trade/QueryLimitOpenOrdersExample.java @@ -18,7 +18,6 @@ import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.convert.rest.ConvertRestApiUtil; import com.binance.connector.client.convert.rest.api.ConvertRestApi; -import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersRequest; import com.binance.connector.client.convert.rest.model.QueryLimitOpenOrdersResponse; /** API examples for TradeApi */ @@ -45,9 +44,9 @@ public ConvertRestApi getApi() { * @throws ApiException if the Api call fails */ public void queryLimitOpenOrdersExample() throws ApiException { - QueryLimitOpenOrdersRequest queryLimitOpenOrdersRequest = new QueryLimitOpenOrdersRequest(); + Long recvWindow = 5000L; ApiResponse response = - getApi().queryLimitOpenOrders(queryLimitOpenOrdersRequest); + getApi().queryLimitOpenOrders(recvWindow); System.out.println(response.getData()); } } diff --git a/examples/crypto-loan/pom.xml b/examples/crypto-loan/pom.xml index 790e62f50..51ae1baae 100644 --- a/examples/crypto-loan/pom.xml +++ b/examples/crypto-loan/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-crypto-loan - 3.0.0 + 4.0.0 \ No newline at end of file diff --git a/examples/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/flexiblerate/GetFlexibleLoanInterestRateHistoryExample.java b/examples/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/flexiblerate/GetFlexibleLoanInterestRateHistoryExample.java new file mode 100644 index 000000000..770207c5f --- /dev/null +++ b/examples/crypto-loan/src/main/java/com/binance/connector/client/crypto_loan/rest/flexiblerate/GetFlexibleLoanInterestRateHistoryExample.java @@ -0,0 +1,61 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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.crypto_loan.rest.flexiblerate; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.crypto_loan.rest.CryptoLoanRestApiUtil; +import com.binance.connector.client.crypto_loan.rest.api.CryptoLoanRestApi; +import com.binance.connector.client.crypto_loan.rest.model.GetFlexibleLoanInterestRateHistoryResponse; + +/** API examples for FlexibleRateApi */ +public class GetFlexibleLoanInterestRateHistoryExample { + private CryptoLoanRestApi api; + + public CryptoLoanRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + CryptoLoanRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new CryptoLoanRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Flexible Loan Interest Rate History (USER_DATA) + * + *

Check Flexible Loan interest rate history * If startTime and endTime are not sent, the + * recent 90-day data will be returned * The max interval between startTime and endTime is 90 + * days. * Time based on UTC+0. Weight: 400 + * + * @throws ApiException if the Api call fails + */ + public void getFlexibleLoanInterestRateHistoryExample() throws ApiException { + String coin = ""; + Long recvWindow = 5000L; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long limit = 10L; + ApiResponse response = + getApi().getFlexibleLoanInterestRateHistory( + coin, recvWindow, startTime, endTime, current, limit); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-coin-futures/pom.xml b/examples/derivatives-trading-coin-futures/pom.xml index 4959cd6b2..03122fe35 100644 --- a/examples/derivatives-trading-coin-futures/pom.xml +++ b/examples/derivatives-trading-coin-futures/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-coin-futures - 5.0.0 + 6.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/AutoCancelAllOpenOrdersExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/AutoCancelAllOpenOrdersExample.java index 1facd1b4a..5f30afe0e 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/AutoCancelAllOpenOrdersExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/AutoCancelAllOpenOrdersExample.java @@ -13,11 +13,13 @@ package com.binance.connector.client.derivatives_trading_coin_futures.rest.trade; import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_coin_futures.rest.DerivativesTradingCoinFuturesRestApiUtil; import com.binance.connector.client.derivatives_trading_coin_futures.rest.api.DerivativesTradingCoinFuturesRestApi; import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCancelAllOpenOrdersRequest; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.AutoCancelAllOpenOrdersResponse; /** API examples for TradeApi */ public class AutoCancelAllOpenOrdersExample { @@ -57,6 +59,8 @@ public void autoCancelAllOpenOrdersExample() throws ApiException { new AutoCancelAllOpenOrdersRequest(); autoCancelAllOpenOrdersRequest.symbol(""); autoCancelAllOpenOrdersRequest.countdownTime(0L); - getApi().autoCancelAllOpenOrders(autoCancelAllOpenOrdersRequest); + ApiResponse response = + getApi().autoCancelAllOpenOrders(autoCancelAllOpenOrdersRequest); + System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/PlaceMultipleOrdersExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/PlaceMultipleOrdersExample.java new file mode 100644 index 000000000..e980bb776 --- /dev/null +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/trade/PlaceMultipleOrdersExample.java @@ -0,0 +1,58 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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_coin_futures.rest.trade; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.DerivativesTradingCoinFuturesRestApiUtil; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.api.DerivativesTradingCoinFuturesRestApi; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.BatchOrdersPlaceMultipleOrders; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PlaceMultipleOrdersRequest; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.PlaceMultipleOrdersResponse; + +/** API examples for TradeApi */ +public class PlaceMultipleOrdersExample { + private DerivativesTradingCoinFuturesRestApi api; + + public DerivativesTradingCoinFuturesRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingCoinFuturesRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingCoinFuturesRestApi(clientConfiguration); + } + return api; + } + + /** + * Place Multiple Orders(TRADE) + * + *

Place multiple orders * Parameter rules are same with `New Order` * Batch orders + * are processed concurrently, and the order of matching is not guaranteed. * The order of + * returned contents for batch orders is the same as the order of the order list. Weight: 5 + * + * @throws ApiException if the Api call fails + */ + public void placeMultipleOrdersExample() throws ApiException { + PlaceMultipleOrdersRequest placeMultipleOrdersRequest = new PlaceMultipleOrdersRequest(); + placeMultipleOrdersRequest.batchOrders(new BatchOrdersPlaceMultipleOrders()); + ApiResponse response = + getApi().placeMultipleOrders(placeMultipleOrdersRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/KeepaliveUserDataStreamExample.java b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/KeepaliveUserDataStreamExample.java index 01fe9b229..a6088115f 100644 --- a/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/KeepaliveUserDataStreamExample.java +++ b/examples/derivatives-trading-coin-futures/src/main/java/com/binance/connector/client/derivatives_trading_coin_futures/rest/userdatastreams/KeepaliveUserDataStreamExample.java @@ -13,10 +13,12 @@ package com.binance.connector.client.derivatives_trading_coin_futures.rest.userdatastreams; import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; import com.binance.connector.client.common.configuration.ClientConfiguration; import com.binance.connector.client.common.configuration.SignatureConfiguration; import com.binance.connector.client.derivatives_trading_coin_futures.rest.DerivativesTradingCoinFuturesRestApiUtil; import com.binance.connector.client.derivatives_trading_coin_futures.rest.api.DerivativesTradingCoinFuturesRestApi; +import com.binance.connector.client.derivatives_trading_coin_futures.rest.model.KeepaliveUserDataStreamResponse; /** API examples for UserDataStreamsApi */ public class KeepaliveUserDataStreamExample { @@ -44,6 +46,7 @@ public DerivativesTradingCoinFuturesRestApi getApi() { * @throws ApiException if the Api call fails */ public void keepaliveUserDataStreamExample() throws ApiException { - getApi().keepaliveUserDataStream(); + ApiResponse response = getApi().keepaliveUserDataStream(); + System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-portfolio-margin-pro/pom.xml b/examples/derivatives-trading-portfolio-margin-pro/pom.xml index fe42d288f..387d0231a 100644 --- a/examples/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/examples/derivatives-trading-portfolio-margin-pro/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin-pro - 5.0.0 + 6.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetDeltaModeStatusExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetDeltaModeStatusExample.java new file mode 100644 index 000000000..4a3a7eef2 --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/GetDeltaModeStatusExample.java @@ -0,0 +1,52 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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_portfolio_margin_pro.rest.account; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.GetDeltaModeStatusResponse; + +/** API examples for AccountApi */ +public class GetDeltaModeStatusExample { + private DerivativesTradingPortfolioMarginProRestApi api; + + public DerivativesTradingPortfolioMarginProRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginProRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginProRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Delta Mode Status(USER_DATA) + * + *

Query the Delta mode status of current account. Weight: 1500 + * + * @throws ApiException if the Api call fails + */ + public void getDeltaModeStatusExample() throws ApiException { + Long recvWindow = 5000L; + ApiResponse response = getApi().getDeltaModeStatus(recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/PortfolioMarginProBankruptcyLoanRepayExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/PortfolioMarginProBankruptcyLoanRepayExample.java index b525c96e6..784f25d18 100644 --- a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/PortfolioMarginProBankruptcyLoanRepayExample.java +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/PortfolioMarginProBankruptcyLoanRepayExample.java @@ -41,7 +41,8 @@ public DerivativesTradingPortfolioMarginProRestApi getApi() { /** * Portfolio Margin Pro Bankruptcy Loan Repay * - *

Repay Portfolio Margin Pro Bankruptcy Loan Weight: 3000 + *

Repay Portfolio Margin Pro Bankruptcy Loan * Please note that the API Key has enabled Spot + * & Margin Trading permissions to access this endpoint. Weight: 3000 * * @throws ApiException if the Api call fails */ diff --git a/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SwitchDeltaModeExample.java b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SwitchDeltaModeExample.java new file mode 100644 index 000000000..1b99c2cb9 --- /dev/null +++ b/examples/derivatives-trading-portfolio-margin-pro/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin_pro/rest/account/SwitchDeltaModeExample.java @@ -0,0 +1,55 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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_portfolio_margin_pro.rest.account; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.DerivativesTradingPortfolioMarginProRestApiUtil; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.api.DerivativesTradingPortfolioMarginProRestApi; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeRequest; +import com.binance.connector.client.derivatives_trading_portfolio_margin_pro.rest.model.SwitchDeltaModeResponse; + +/** API examples for AccountApi */ +public class SwitchDeltaModeExample { + private DerivativesTradingPortfolioMarginProRestApi api; + + public DerivativesTradingPortfolioMarginProRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + DerivativesTradingPortfolioMarginProRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new DerivativesTradingPortfolioMarginProRestApi(clientConfiguration); + } + return api; + } + + /** + * Switch Delta Mode(TRADE) + * + *

Switch the Delta mode for existing PM PRO / PM RETAIL accounts. Weight: 1500 + * + * @throws ApiException if the Api call fails + */ + public void switchDeltaModeExample() throws ApiException { + SwitchDeltaModeRequest switchDeltaModeRequest = new SwitchDeltaModeRequest(); + switchDeltaModeRequest.deltaEnabled(""); + ApiResponse response = + getApi().switchDeltaMode(switchDeltaModeRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/derivatives-trading-portfolio-margin/pom.xml b/examples/derivatives-trading-portfolio-margin/pom.xml index be18022a8..ec286a86d 100644 --- a/examples/derivatives-trading-portfolio-margin/pom.xml +++ b/examples/derivatives-trading-portfolio-margin/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-derivatives-trading-portfolio-margin - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java index 07a7dda00..b546ce826 100644 --- a/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java +++ b/examples/derivatives-trading-portfolio-margin/src/main/java/com/binance/connector/client/derivatives_trading_portfolio_margin/rest/trade/QueryCurrentUmOpenConditionalOrderExample.java @@ -42,7 +42,7 @@ public DerivativesTradingPortfolioMarginRestApi getApi() { * *

Query Current UM Open Conditional Order * Either `strategyId` or * `newClientStrategyId` must be sent. * If the queried order has been - * `CANCELED`, `TRIGGERED`或`EXPIRED`, the error message + * `CANCELED`, `TRIGGERED` or `EXPIRED`, the error message * \"Order does not exist\" will be returned. Weight: 1 * * @throws ApiException if the Api call fails diff --git a/examples/derivatives-trading-usds-futures/pom.xml b/examples/derivatives-trading-usds-futures/pom.xml index 5c054e8ce..0cf360b22 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 - 8.0.0 + 9.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/GetFundingRateInfoExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/GetFundingRateInfoExample.java index fa6d8f693..0580498bf 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/GetFundingRateInfoExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/marketdata/GetFundingRateInfoExample.java @@ -42,7 +42,7 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { * *

Query funding rate info for symbols that had FundingRateCap/ FundingRateFloor / * fundingIntervalHours adjustment Weight: 0 share 500/5min/IP rate limit with GET - * /fapi/v1/fundingInfo + * /fapi/v1/fundingRate * * @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/CancelAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAlgoOrderExample.java index 909b0534e..6363fabf2 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAlgoOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/trade/CancelAlgoOrderExample.java @@ -40,17 +40,17 @@ public DerivativesTradingUsdsFuturesRestApi getApi() { /** * Cancel Algo Order (TRADE) * - *

Cancel an active algo order. * Either `algoid` or `clientalgoid` must + *

Cancel an active algo order. * Either `algoId` or `clientAlgoId` must * be sent. Weight: 1 * * @throws ApiException if the Api call fails */ public void cancelAlgoOrderExample() throws ApiException { - Long algoid = 0L; - String clientalgoid = ""; + Long algoId = 1L; + String clientAlgoId = "1"; Long recvWindow = 5000L; ApiResponse response = - getApi().cancelAlgoOrder(algoid, clientalgoid, recvWindow); + getApi().cancelAlgoOrder(algoId, clientAlgoId, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2Example.java similarity index 82% rename from examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java rename to examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2Example.java index 9183ae242..bd71cc526 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleAsync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2Example.java @@ -21,7 +21,7 @@ import java.util.concurrent.CompletableFuture; /** API examples for AccountApi */ -public class AccountInformationV2ExampleAsync { +public class AccountInformationV2Example { private DerivativesTradingUsdsFuturesWebSocketApi api; public DerivativesTradingUsdsFuturesWebSocketApi getApi() { @@ -59,4 +59,18 @@ public void accountInformationV2ExampleAsync() { return response; }); } + + /** + * Account Information V2(USER_DATA) + * + *

Get current account information. User in single-asset/ multi-assets mode will see + * different value, see comments in response section for detail. Weight: 5 + */ + public void accountInformationV2ExampleSync() { + AccountInformationV2Request accountInformationV2Request = new AccountInformationV2Request(); + CompletableFuture future = + getApi().accountInformationV2(accountInformationV2Request); + AccountInformationV2Response response = future.join(); + System.out.println(response); + } } diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleSync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleSync.java deleted file mode 100644 index e2f4a6078..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/AccountInformationV2ExampleSync.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * 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.account; - -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.DerivativesTradingUsdsFuturesWebSocketApiUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.api.DerivativesTradingUsdsFuturesWebSocketApi; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.AccountInformationV2Request; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.AccountInformationV2Response; -import java.util.concurrent.CompletableFuture; - -/** API examples for AccountApi */ -public class AccountInformationV2ExampleSync { - private DerivativesTradingUsdsFuturesWebSocketApi api; - - public DerivativesTradingUsdsFuturesWebSocketApi getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - // if you want the connection to be auto logged on: - // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests - clientConfiguration.setAutoLogon(true); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("/path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingUsdsFuturesWebSocketApi(clientConfiguration); - } - return api; - } - - /** - * Account Information V2(USER_DATA) - * - *

Get current account information. User in single-asset/ multi-assets mode will see - * different value, see comments in response section for detail. Weight: 5 - */ - public void accountInformationV2ExampleSync() { - AccountInformationV2Request accountInformationV2Request = new AccountInformationV2Request(); - CompletableFuture future = - getApi().accountInformationV2(accountInformationV2Request); - AccountInformationV2Response response = future.join(); - System.out.println(response); - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2Example.java similarity index 83% rename from examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java rename to examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2Example.java index c63c1e5a5..0c3866136 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleAsync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2Example.java @@ -21,7 +21,7 @@ import java.util.concurrent.CompletableFuture; /** API examples for AccountApi */ -public class FuturesAccountBalanceV2ExampleAsync { +public class FuturesAccountBalanceV2Example { private DerivativesTradingUsdsFuturesWebSocketApi api; public DerivativesTradingUsdsFuturesWebSocketApi getApi() { @@ -59,4 +59,18 @@ public void futuresAccountBalanceV2ExampleAsync() { return response; }); } + + /** + * Futures Account Balance V2(USER_DATA) + * + *

Query account balance info Weight: 5 + */ + public void futuresAccountBalanceV2ExampleSync() { + FuturesAccountBalanceV2Request futuresAccountBalanceV2Request = + new FuturesAccountBalanceV2Request(); + CompletableFuture future = + getApi().futuresAccountBalanceV2(futuresAccountBalanceV2Request); + FuturesAccountBalanceV2Response response = future.join(); + System.out.println(response); + } } diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleSync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleSync.java deleted file mode 100644 index 05f9f01ac..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/account/FuturesAccountBalanceV2ExampleSync.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * 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.account; - -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.DerivativesTradingUsdsFuturesWebSocketApiUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.api.DerivativesTradingUsdsFuturesWebSocketApi; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.FuturesAccountBalanceV2Request; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.FuturesAccountBalanceV2Response; -import java.util.concurrent.CompletableFuture; - -/** API examples for AccountApi */ -public class FuturesAccountBalanceV2ExampleSync { - private DerivativesTradingUsdsFuturesWebSocketApi api; - - public DerivativesTradingUsdsFuturesWebSocketApi getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - // if you want the connection to be auto logged on: - // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests - clientConfiguration.setAutoLogon(true); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("/path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingUsdsFuturesWebSocketApi(clientConfiguration); - } - return api; - } - - /** - * Futures Account Balance V2(USER_DATA) - * - *

Query account balance info Weight: 5 - */ - public void futuresAccountBalanceV2ExampleSync() { - FuturesAccountBalanceV2Request futuresAccountBalanceV2Request = - new FuturesAccountBalanceV2Request(); - CompletableFuture future = - getApi().futuresAccountBalanceV2(futuresAccountBalanceV2Request); - FuturesAccountBalanceV2Response response = future.join(); - System.out.println(response); - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java index a4cc6e732..310f25050 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/CancelAlgoOrderExample.java @@ -43,7 +43,7 @@ public DerivativesTradingUsdsFuturesWebSocketApi getApi() { /** * Cancel Algo Order (TRADE) * - *

Cancel an active algo order. * Either `algoid` or `clientalgoid` must + *

Cancel an active algo order. * Either `algoId` or `clientAlgoId` must * be sent. Weight: 1 */ public void cancelAlgoOrderExampleAsync() { @@ -63,7 +63,7 @@ public void cancelAlgoOrderExampleAsync() { /** * Cancel Algo Order (TRADE) * - *

Cancel an active algo order. * Either `algoid` or `clientalgoid` must + *

Cancel an active algo order. * Either `algoId` or `clientAlgoId` must * be sent. Weight: 1 */ public void cancelAlgoOrderExampleSync() { diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2Example.java similarity index 81% rename from examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java rename to examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2Example.java index f7e563bc4..35d01f7ac 100644 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleAsync.java +++ b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2Example.java @@ -21,7 +21,7 @@ import java.util.concurrent.CompletableFuture; /** API examples for TradeApi */ -public class PositionInformationV2ExampleAsync { +public class PositionInformationV2Example { private DerivativesTradingUsdsFuturesWebSocketApi api; public DerivativesTradingUsdsFuturesWebSocketApi getApi() { @@ -61,4 +61,20 @@ public void positionInformationV2ExampleAsync() { return response; }); } + + /** + * Position Information V2 (USER_DATA) + * + *

Get current position information(only symbol that has position or open orders will be + * returned). * Please use with user data stream `ACCOUNT_UPDATE` to meet your + * timeliness and accuracy needs. Weight: 5 + */ + public void positionInformationV2ExampleSync() { + PositionInformationV2Request positionInformationV2Request = + new PositionInformationV2Request(); + CompletableFuture future = + getApi().positionInformationV2(positionInformationV2Request); + PositionInformationV2Response response = future.join(); + System.out.println(response); + } } diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleSync.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleSync.java deleted file mode 100644 index 70184a242..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/api/trade/PositionInformationV2ExampleSync.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * 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.trade; - -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.DerivativesTradingUsdsFuturesWebSocketApiUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.api.DerivativesTradingUsdsFuturesWebSocketApi; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.PositionInformationV2Request; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.api.model.PositionInformationV2Response; -import java.util.concurrent.CompletableFuture; - -/** API examples for TradeApi */ -public class PositionInformationV2ExampleSync { - private DerivativesTradingUsdsFuturesWebSocketApi api; - - public DerivativesTradingUsdsFuturesWebSocketApi getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketApiUtil.getClientConfiguration(); - // if you want the connection to be auto logged on: - // https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/authentication-requests - clientConfiguration.setAutoLogon(true); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - signatureConfiguration.setPrivateKey("/path/to/private.key"); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - api = new DerivativesTradingUsdsFuturesWebSocketApi(clientConfiguration); - } - return api; - } - - /** - * Position Information V2 (USER_DATA) - * - *

Get current position information(only symbol that has position or open orders will be - * returned). * Please use with user data stream `ACCOUNT_UPDATE` to meet your - * timeliness and accuracy needs. Weight: 5 - */ - public void positionInformationV2ExampleSync() { - PositionInformationV2Request positionInformationV2Request = - new PositionInformationV2Request(); - CompletableFuture future = - getApi().positionInformationV2(positionInformationV2Request); - PositionInformationV2Response response = future.join(); - System.out.println(response); - } -} diff --git a/examples/margin-trading/pom.xml b/examples/margin-trading/pom.xml index 684d9dacc..1beb9fe53 100644 --- a/examples/margin-trading/pom.xml +++ b/examples/margin-trading/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-margin-trading - 5.0.0 + 6.0.0 \ No newline at end of file diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginAssetRiskBasedLiquidationRatioExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginAssetRiskBasedLiquidationRatioExample.java new file mode 100644 index 000000000..99f6dc796 --- /dev/null +++ b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginAssetRiskBasedLiquidationRatioExample.java @@ -0,0 +1,52 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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.margin_trading.rest.marketdata; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.margin_trading.rest.MarginTradingRestApiUtil; +import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; +import com.binance.connector.client.margin_trading.rest.model.GetMarginAssetRiskBasedLiquidationRatioResponse; + +/** API examples for MarketDataApi */ +public class GetMarginAssetRiskBasedLiquidationRatioExample { + private MarginTradingRestApi api; + + public MarginTradingRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = + MarginTradingRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new MarginTradingRestApi(clientConfiguration); + } + return api; + } + + /** + * Get Margin Asset Risk-Based Liquidation Ratio (MARKET_DATA) + * + *

Get Margin Asset Risk-Based Liquidation Ratio Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void getMarginAssetRiskBasedLiquidationRatioExample() throws ApiException { + ApiResponse response = + getApi().getMarginAssetRiskBasedLiquidationRatio(); + System.out.println(response.getData()); + } +} diff --git a/examples/mining/pom.xml b/examples/mining/pom.xml index 9b07a15d8..8053cfa80 100644 --- a/examples/mining/pom.xml +++ b/examples/mining/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-mining - 2.1.1 + 3.0.0 \ No newline at end of file diff --git a/examples/mining/src/main/java/com/binance/connector/client/mining/rest/mining/HashrateResaleDetailExample.java b/examples/mining/src/main/java/com/binance/connector/client/mining/rest/mining/HashrateResaleDetailExample.java index f40ec8b62..6cbcdfc01 100644 --- a/examples/mining/src/main/java/com/binance/connector/client/mining/rest/mining/HashrateResaleDetailExample.java +++ b/examples/mining/src/main/java/com/binance/connector/client/mining/rest/mining/HashrateResaleDetailExample.java @@ -45,12 +45,11 @@ public MiningRestApi getApi() { */ public void hashrateResaleDetailExample() throws ApiException { Long configId = 1L; - String userName = ""; Long pageIndex = 1L; Long pageSize = 0L; Long recvWindow = 5000L; ApiResponse response = - getApi().hashrateResaleDetail(configId, userName, pageIndex, pageSize, recvWindow); + getApi().hashrateResaleDetail(configId, pageIndex, pageSize, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/simple-earn/pom.xml b/examples/simple-earn/pom.xml index 5aa40d37e..3dc6cefb9 100644 --- a/examples/simple-earn/pom.xml +++ b/examples/simple-earn/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-simple-earn - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/spot/pom.xml b/examples/spot/pom.xml index dd6d102ca..b29a4b03d 100644 --- a/examples/spot/pom.xml +++ b/examples/spot/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-spot - 8.0.0 + 9.0.0 \ No newline at end of file diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/Ticker24hrExample.java similarity index 99% rename from examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java rename to examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/Ticker24hrExample.java index 2f39bc335..5b2b957fd 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/HrExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/market/Ticker24hrExample.java @@ -21,7 +21,7 @@ import java.util.concurrent.CompletableFuture; /** API examples for MarketApi */ -public class HrExample { +public class Ticker24hrExample { private SpotWebSocketApi api; public SpotWebSocketApi getApi() { diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java index 9f57db71e..243d3bf3a 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamSubscribeSignatureExample.java @@ -19,6 +19,7 @@ import com.binance.connector.client.spot.websocket.api.SpotWebSocketApiUtil; import com.binance.connector.client.spot.websocket.api.api.SpotWebSocketApi; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamEventsResponse; +import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureRequest; import com.binance.connector.client.spot.websocket.api.model.UserDataStreamSubscribeSignatureResponse; /** API examples for UserDataStreamApi */ @@ -48,7 +49,7 @@ public SpotWebSocketApi getApi() { */ public void userDataStreamSubscribeSignatureExampleStream() throws InterruptedException { StreamResponse - resp = getApi().userDataStreamSubscribeSignature(); + resp = getApi().userDataStreamSubscribeSignature(new UserDataStreamSubscribeSignatureRequest()); resp.getResponse() .thenAccept( responseResult -> { diff --git a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java index eace0d661..5573087eb 100644 --- a/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java +++ b/examples/spot/src/main/java/com/binance/connector/client/spot/websocket/api/userdatastream/UserDataStreamUnsubscribeExample.java @@ -45,7 +45,7 @@ public SpotWebSocketApi getApi() { * *

Stop listening to the User Data Stream in the current WebSocket connection. Note that * `session.logout` will only close the subscription created with - * `userdataStream.subscribe` but not subscriptions opened with + * `userDataStream.subscribe` but not subscriptions opened with * `userDataStream.subscribe.signature`. Weight: 2 */ public void userDataStreamUnsubscribeExampleAsync() { @@ -68,7 +68,7 @@ public void userDataStreamUnsubscribeExampleAsync() { * *

Stop listening to the User Data Stream in the current WebSocket connection. Note that * `session.logout` will only close the subscription created with - * `userdataStream.subscribe` but not subscriptions opened with + * `userDataStream.subscribe` but not subscriptions opened with * `userDataStream.subscribe.signature`. Weight: 2 */ public void userDataStreamUnsubscribeExampleSync() { diff --git a/examples/sub-account/pom.xml b/examples/sub-account/pom.xml index 1f5859a3e..0fb7557f3 100644 --- a/examples/sub-account/pom.xml +++ b/examples/sub-account/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-sub-account - 4.0.0 + 5.0.0 \ No newline at end of file diff --git a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetMovePositionHistoryForSubAccountExample.java b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetMovePositionHistoryForSubAccountExample.java index 19c3cd620..978f59070 100644 --- a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetMovePositionHistoryForSubAccountExample.java +++ b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetMovePositionHistoryForSubAccountExample.java @@ -44,7 +44,7 @@ public SubAccountRestApi getApi() { * return records of the last 90 days by default with 1000 maximum limits * If * `startTime` is sent and `endTime` is not sent, return records of * [max(startTime, now-90d), now]. * If `startTime` is not sent and - * `endTime` is sent, return records of [max(now,endTime-90d), endTime]. Weight: 150 + * `endTime` is sent, return records of [max(now,endTime-90d), endTime]. Weight: 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetSummaryOfSubAccountsFuturesAccountExample.java b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetSummaryOfSubAccountsFuturesAccountExample.java index 0d024d2e1..d9922997a 100644 --- a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetSummaryOfSubAccountsFuturesAccountExample.java +++ b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/GetSummaryOfSubAccountsFuturesAccountExample.java @@ -45,9 +45,11 @@ public SubAccountRestApi getApi() { * @throws ApiException if the Api call fails */ public void getSummaryOfSubAccountsFuturesAccountExample() throws ApiException { + Long page = 0L; + Long limit = 0L; Long recvWindow = 5000L; ApiResponse response = - getApi().getSummaryOfSubAccountsFuturesAccount(recvWindow); + getApi().getSummaryOfSubAccountsFuturesAccount(page, limit, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/MovePositionForSubAccountExample.java b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/MovePositionForSubAccountExample.java index 58af04f98..422958c91 100644 --- a/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/MovePositionForSubAccountExample.java +++ b/examples/sub-account/src/main/java/com/binance/connector/client/sub_account/rest/assetmanagement/MovePositionForSubAccountExample.java @@ -50,7 +50,7 @@ public SubAccountRestApi getApi() { * if any symbol’s total close position quantity is bigger than the symbol’s current position * quantity, all batch orders in the same list will fail simultaneously. * Only support cross * margin mode * The price for move position is MarkPrice only. * Not support for MSA. * Not - * support for the symbol under Reduce-Only. Weight: 150 + * support for the symbol under Reduce-Only. Weight: 1 * * @throws ApiException if the Api call fails */ diff --git a/examples/vip-loan/pom.xml b/examples/vip-loan/pom.xml index 3b6572485..ca30ba331 100644 --- a/examples/vip-loan/pom.xml +++ b/examples/vip-loan/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-vip-loan - 2.0.0 + 3.0.0 \ No newline at end of file diff --git a/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/marketdata/GetVIPLoanInterestRateHistoryExample.java b/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/marketdata/GetVIPLoanInterestRateHistoryExample.java new file mode 100644 index 000000000..c96e1f242 --- /dev/null +++ b/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/marketdata/GetVIPLoanInterestRateHistoryExample.java @@ -0,0 +1,60 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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.vip_loan.rest.marketdata; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.vip_loan.rest.VipLoanRestApiUtil; +import com.binance.connector.client.vip_loan.rest.api.VipLoanRestApi; +import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanInterestRateHistoryResponse; + +/** API examples for MarketDataApi */ +public class GetVIPLoanInterestRateHistoryExample { + private VipLoanRestApi api; + + public VipLoanRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = VipLoanRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new VipLoanRestApi(clientConfiguration); + } + return api; + } + + /** + * Get VIP Loan Interest Rate History (USER_DATA) + * + *

Check VIP Loan flexible interest rate history * If startTime and endTime are not sent, the + * recent 90-day data will be returned * The max interval between startTime and end Time is 180 + * days. * Time based on UTC+0. Weight: 400 + * + * @throws ApiException if the Api call fails + */ + public void getVIPLoanInterestRateHistoryExample() throws ApiException { + String coin = ""; + Long recvWindow = 5000L; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long limit = 10L; + ApiResponse response = + getApi().getVIPLoanInterestRateHistory( + coin, recvWindow, startTime, endTime, current, limit); + System.out.println(response.getData()); + } +} diff --git a/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/userinformation/GetVIPLoanAccruedInterestExample.java b/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/userinformation/GetVIPLoanAccruedInterestExample.java new file mode 100644 index 000000000..bca2ba3bc --- /dev/null +++ b/examples/vip-loan/src/main/java/com/binance/connector/client/vip_loan/rest/userinformation/GetVIPLoanAccruedInterestExample.java @@ -0,0 +1,61 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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.vip_loan.rest.userinformation; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.vip_loan.rest.VipLoanRestApiUtil; +import com.binance.connector.client.vip_loan.rest.api.VipLoanRestApi; +import com.binance.connector.client.vip_loan.rest.model.GetVIPLoanAccruedInterestResponse; + +/** API examples for UserInformationApi */ +public class GetVIPLoanAccruedInterestExample { + private VipLoanRestApi api; + + public VipLoanRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = VipLoanRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new VipLoanRestApi(clientConfiguration); + } + return api; + } + + /** + * Get VIP Loan Accrued Interest (USER_DATA) + * + *

Check VIP Loan interest record * If startTime and endTime are not sent, the recent 90-day + * data will be returned. * The max interval between startTime and endTime is 90 days. Weight: + * 400 + * + * @throws ApiException if the Api call fails + */ + public void getVIPLoanAccruedInterestExample() throws ApiException { + Long orderId = 1L; + String loanCoin = ""; + Long startTime = 1623319461670L; + Long endTime = 1641782889000L; + Long current = 1L; + Long limit = 10L; + Long recvWindow = 5000L; + ApiResponse response = + getApi().getVIPLoanAccruedInterest( + orderId, loanCoin, startTime, endTime, current, limit, recvWindow); + System.out.println(response.getData()); + } +} diff --git a/examples/wallet/pom.xml b/examples/wallet/pom.xml index 5d5d88d61..0c845691b 100644 --- a/examples/wallet/pom.xml +++ b/examples/wallet/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-wallet - 3.0.0 + 4.0.0 \ No newline at end of file diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/AssetDetailExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/AssetDetailExample.java index aa4d0063e..23f61e490 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/AssetDetailExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/AssetDetailExample.java @@ -45,8 +45,9 @@ public WalletRestApi getApi() { * @throws ApiException if the Api call fails */ public void assetDetailExample() throws ApiException { + String asset = ""; Long recvWindow = 5000L; - ApiResponse response = getApi().assetDetail(recvWindow); + ApiResponse response = getApi().assetDetail(asset, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertExample.java new file mode 100644 index 000000000..21bda5ffc --- /dev/null +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertExample.java @@ -0,0 +1,53 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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.wallet.rest.asset; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.wallet.rest.WalletRestApiUtil; +import com.binance.connector.client.wallet.rest.api.WalletRestApi; +import com.binance.connector.client.wallet.rest.model.DustConvertRequest; +import com.binance.connector.client.wallet.rest.model.DustConvertResponse; + +/** API examples for AssetApi */ +public class DustConvertExample { + private WalletRestApi api; + + public WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Dust Convert (USER_DATA) + * + *

Convert dust assets Weight: 10 + * + * @throws ApiException if the Api call fails + */ + public void dustConvertExample() throws ApiException { + DustConvertRequest dustConvertRequest = new DustConvertRequest(); + dustConvertRequest.asset(""); + ApiResponse response = getApi().dustConvert(dustConvertRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertibleAssetsExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertibleAssetsExample.java new file mode 100644 index 000000000..fbdb747cc --- /dev/null +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustConvertibleAssetsExample.java @@ -0,0 +1,55 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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.wallet.rest.asset; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.wallet.rest.WalletRestApiUtil; +import com.binance.connector.client.wallet.rest.api.WalletRestApi; +import com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsRequest; +import com.binance.connector.client.wallet.rest.model.DustConvertibleAssetsResponse; + +/** API examples for AssetApi */ +public class DustConvertibleAssetsExample { + private WalletRestApi api; + + public WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Dust Convertible Assets (USER_DATA) + * + *

Query dust convertible assets Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void dustConvertibleAssetsExample() throws ApiException { + DustConvertibleAssetsRequest dustConvertibleAssetsRequest = + new DustConvertibleAssetsRequest(); + dustConvertibleAssetsRequest.targetAsset(""); + ApiResponse response = + getApi().dustConvertibleAssets(dustConvertibleAssetsRequest); + System.out.println(response.getData()); + } +} diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustlogExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustlogExample.java index 1a304ae97..b3b7db321 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustlogExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/DustlogExample.java @@ -44,10 +44,12 @@ public WalletRestApi getApi() { * @throws ApiException if the Api call fails */ public void dustlogExample() throws ApiException { + String accountType = "SPOT"; Long startTime = 1623319461670L; Long endTime = 1641782889000L; Long recvWindow = 5000L; - ApiResponse response = getApi().dustlog(startTime, endTime, recvWindow); + ApiResponse response = + getApi().dustlog(accountType, startTime, endTime, recvWindow); System.out.println(response.getData()); } } diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserDelegationHistoryExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserDelegationHistoryExample.java index 310dc56ab..5ed8d6b34 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserDelegationHistoryExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/asset/QueryUserDelegationHistoryExample.java @@ -39,8 +39,7 @@ public WalletRestApi getApi() { /** * Query User Delegation History(For Master Account)(USER_DATA) * - *

Query User Delegation History * You need to open Enable Spot & Margin Trading - * permission for the API Key which requests this endpoint Weight: 60 + *

Query User Delegation History Weight: 60 * * @throws ApiException if the Api call fails */ diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java index 3389156dc..096e7564d 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/DepositHistoryV2Example.java @@ -49,7 +49,7 @@ public WalletRestApi getApi() { * @throws ApiException if the Api call fails */ public void depositHistoryV2Example() throws ApiException { - String depositId = "1"; + Long depositId = 1L; String txId = "1"; String network = ""; String coin = ""; diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireExample.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireExample.java index 55330c626..f3eeadfb7 100644 --- a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireExample.java +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireExample.java @@ -53,7 +53,7 @@ public void submitDepositQuestionnaireExample() throws ApiException { SubmitDepositQuestionnaireRequest submitDepositQuestionnaireRequest = new SubmitDepositQuestionnaireRequest(); submitDepositQuestionnaireRequest.subAccountId("1"); - submitDepositQuestionnaireRequest.depositId("1"); + submitDepositQuestionnaireRequest.depositId(1L); submitDepositQuestionnaireRequest.questionnaire(""); submitDepositQuestionnaireRequest.beneficiaryPii(""); submitDepositQuestionnaireRequest.signature(""); diff --git a/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireV2Example.java b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireV2Example.java new file mode 100644 index 000000000..f8e9d0523 --- /dev/null +++ b/examples/wallet/src/main/java/com/binance/connector/client/wallet/rest/travelrule/SubmitDepositQuestionnaireV2Example.java @@ -0,0 +1,61 @@ +/* + * Binance Spot REST API + * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) + * + * 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.wallet.rest.travelrule; + +import com.binance.connector.client.common.ApiException; +import com.binance.connector.client.common.ApiResponse; +import com.binance.connector.client.common.configuration.ClientConfiguration; +import com.binance.connector.client.common.configuration.SignatureConfiguration; +import com.binance.connector.client.wallet.rest.WalletRestApiUtil; +import com.binance.connector.client.wallet.rest.api.WalletRestApi; +import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireV2Request; +import com.binance.connector.client.wallet.rest.model.SubmitDepositQuestionnaireV2Response; + +/** API examples for TravelRuleApi */ +public class SubmitDepositQuestionnaireV2Example { + private WalletRestApi api; + + public WalletRestApi getApi() { + if (api == null) { + ClientConfiguration clientConfiguration = WalletRestApiUtil.getClientConfiguration(); + SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); + signatureConfiguration.setApiKey("apiKey"); + signatureConfiguration.setPrivateKey("path/to/private.key"); + clientConfiguration.setSignatureConfiguration(signatureConfiguration); + api = new WalletRestApi(clientConfiguration); + } + return api; + } + + /** + * Submit Deposit Questionnaire V2 (For local entities that require travel rule) (supporting + * network) (USER_DATA) + * + *

Submit questionnaire for local entities that require travel rule. The questionnaire is + * only applies to transactions from unhosted wallets or VASPs that are not yet onboarded with + * GTR. * Questionnaire is different for each local entity, please refer * If getting error like + * `Questionnaire format not valid.` or `Questionnaire must not be blank`, + * Weight: 600 + * + * @throws ApiException if the Api call fails + */ + public void submitDepositQuestionnaireV2Example() throws ApiException { + SubmitDepositQuestionnaireV2Request submitDepositQuestionnaireV2Request = + new SubmitDepositQuestionnaireV2Request(); + submitDepositQuestionnaireV2Request.depositId(1L); + submitDepositQuestionnaireV2Request.questionnaire(""); + ApiResponse response = + getApi().submitDepositQuestionnaireV2(submitDepositQuestionnaireV2Request); + System.out.println(response.getData()); + } +}