From 63410330e2d2cc5173d964d727ec5b8d9d14057f Mon Sep 17 00:00:00 2001 From: theo-s68 <194042188+theo-s68@users.noreply.github.com> Date: Thu, 12 Feb 2026 18:35:50 +0700 Subject: [PATCH] margin-trading 6.1.0 --- clients/margin-trading/CHANGELOG.md | 9 + .../docs/GetMarginRestrictedAssetsResponse.md | 14 + clients/margin-trading/docs/MarketDataApi.md | 59 ++ .../docs/QueryPreventedMatchesResponse.md | 12 + .../QueryPreventedMatchesResponseInner.md | 22 + clients/margin-trading/docs/TradeApi.md | 117 +++- .../docs/rest-api/migration-guide.md | 4 +- clients/margin-trading/example_rest.md | 4 + clients/margin-trading/pom.xml | 2 +- .../client/margin_trading/rest/JSON.java | 9 + .../margin_trading/rest/api/AccountApi.java | 2 +- .../rest/api/BorrowRepayApi.java | 2 +- .../rest/api/MarginTradingRestApi.java | 104 +++- .../rest/api/MarketDataApi.java | 128 +++- .../rest/api/RiskDataStreamApi.java | 2 +- .../margin_trading/rest/api/TradeApi.java | 302 +++++++-- .../margin_trading/rest/api/TransferApi.java | 2 +- .../GetMarginRestrictedAssetsResponse.java | 307 ++++++++++ .../model/QueryPreventedMatchesResponse.java | 187 ++++++ .../QueryPreventedMatchesResponseInner.java | 578 ++++++++++++++++++ .../api/MarginTradingWebSocketStreams.java | 2 +- examples/margin-trading/pom.xml | 2 +- .../GetMarginRestrictedAssetsExample.java | 52 ++ .../trade/QueryPreventedMatchesExample.java | 64 ++ 24 files changed, 1887 insertions(+), 99 deletions(-) create mode 100644 clients/margin-trading/docs/GetMarginRestrictedAssetsResponse.md create mode 100644 clients/margin-trading/docs/QueryPreventedMatchesResponse.md create mode 100644 clients/margin-trading/docs/QueryPreventedMatchesResponseInner.md create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginRestrictedAssetsResponse.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/QueryPreventedMatchesResponse.java create mode 100644 clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/QueryPreventedMatchesResponseInner.java create mode 100644 examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginRestrictedAssetsExample.java create mode 100644 examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryPreventedMatchesExample.java diff --git a/clients/margin-trading/CHANGELOG.md b/clients/margin-trading/CHANGELOG.md index 8ac213b7..c8ee2728 100644 --- a/clients/margin-trading/CHANGELOG.md +++ b/clients/margin-trading/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 6.1.0 - 2026-02-12 + +### Added (2) + +#### REST API + +- `getMarginRestrictedAssets()` (`GET /sapi/v1/margin/restricted-asset`) +- `queryPreventedMatches()` (`GET /sapi/v1/margin/myPreventedMatches`) + ## 6.0.0 - 2026-02-12 ### Added (1) diff --git a/clients/margin-trading/docs/GetMarginRestrictedAssetsResponse.md b/clients/margin-trading/docs/GetMarginRestrictedAssetsResponse.md new file mode 100644 index 00000000..fcb6e1a7 --- /dev/null +++ b/clients/margin-trading/docs/GetMarginRestrictedAssetsResponse.md @@ -0,0 +1,14 @@ + + +# GetMarginRestrictedAssetsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**openLongRestrictedAsset** | **List<String>** | | [optional] | +|**maxCollateralExceededAsset** | **List<String>** | | [optional] | + + + diff --git a/clients/margin-trading/docs/MarketDataApi.md b/clients/margin-trading/docs/MarketDataApi.md index 682811c5..a8362472 100644 --- a/clients/margin-trading/docs/MarketDataApi.md +++ b/clients/margin-trading/docs/MarketDataApi.md @@ -12,6 +12,7 @@ All URIs are relative to *https://api.binance.com* | [**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) | +| [**getMarginRestrictedAssets**](MarketDataApi.md#getMarginRestrictedAssets) | **GET** /sapi/v1/margin/restricted-asset | Get Margin Restricted Assets (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) | @@ -504,6 +505,64 @@ No authorization required |-------------|-------------|------------------| | **200** | Get Margin Asset Risk-Based Liquidation Ratio | - | + +# **getMarginRestrictedAssets** +> GetMarginRestrictedAssetsResponse getMarginRestrictedAssets() + +Get Margin Restricted Assets (MARKET_DATA) + +Get Margin Restricted Assets 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 { + GetMarginRestrictedAssetsResponse result = apiInstance.getMarginRestrictedAssets(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling MarketDataApi#getMarginRestrictedAssets"); + 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 + +[**GetMarginRestrictedAssetsResponse**](GetMarginRestrictedAssetsResponse.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 Restricted Assets | - | + # **queryIsolatedMarginTierData** > QueryIsolatedMarginTierDataResponse queryIsolatedMarginTierData(symbol, tier, recvWindow) diff --git a/clients/margin-trading/docs/QueryPreventedMatchesResponse.md b/clients/margin-trading/docs/QueryPreventedMatchesResponse.md new file mode 100644 index 00000000..bc0e5598 --- /dev/null +++ b/clients/margin-trading/docs/QueryPreventedMatchesResponse.md @@ -0,0 +1,12 @@ + + +# QueryPreventedMatchesResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/clients/margin-trading/docs/QueryPreventedMatchesResponseInner.md b/clients/margin-trading/docs/QueryPreventedMatchesResponseInner.md new file mode 100644 index 00000000..51fc84ec --- /dev/null +++ b/clients/margin-trading/docs/QueryPreventedMatchesResponseInner.md @@ -0,0 +1,22 @@ + + +# QueryPreventedMatchesResponseInner + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**symbol** | **String** | | [optional] | +|**preventedMatchId** | **Long** | | [optional] | +|**takerOrderId** | **Long** | | [optional] | +|**makerSymbol** | **String** | | [optional] | +|**makerOrderId** | **Long** | | [optional] | +|**tradeGroupId** | **Long** | | [optional] | +|**selfTradePreventionMode** | **String** | | [optional] | +|**price** | **String** | | [optional] | +|**makerPreventedQuantity** | **String** | | [optional] | +|**transactTime** | **Long** | | [optional] | + + + diff --git a/clients/margin-trading/docs/TradeApi.md b/clients/margin-trading/docs/TradeApi.md index c36b04f4..5a95719d 100644 --- a/clients/margin-trading/docs/TradeApi.md +++ b/clients/margin-trading/docs/TradeApi.md @@ -26,6 +26,7 @@ All URIs are relative to *https://api.binance.com* | [**queryMarginAccountsOpenOrders**](TradeApi.md#queryMarginAccountsOpenOrders) | **GET** /sapi/v1/margin/openOrders | Query Margin Account's Open Orders (USER_DATA) | | [**queryMarginAccountsOrder**](TradeApi.md#queryMarginAccountsOrder) | **GET** /sapi/v1/margin/order | Query Margin Account's Order (USER_DATA) | | [**queryMarginAccountsTradeList**](TradeApi.md#queryMarginAccountsTradeList) | **GET** /sapi/v1/margin/myTrades | Query Margin Account's Trade List (USER_DATA) | +| [**queryPreventedMatches**](TradeApi.md#queryPreventedMatches) | **GET** /sapi/v1/margin/myPreventedMatches | Query Prevented Matches(USER_DATA) | | [**querySpecialKey**](TradeApi.md#querySpecialKey) | **GET** /sapi/v1/margin/apiKey | Query Special key(Low Latency Trading)(TRADE) | | [**querySpecialKeyList**](TradeApi.md#querySpecialKeyList) | **GET** /sapi/v1/margin/api-key-list | Query Special key List(Low Latency Trading)(TRADE) | | [**smallLiabilityExchange**](TradeApi.md#smallLiabilityExchange) | **POST** /sapi/v1/margin/exchange-small-liability | Small Liability Exchange (MARGIN) | @@ -447,7 +448,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" Long recvWindow = 56L; // Long | No more than 60000 try { MarginAccountCancelAllOpenOrdersOnASymbolResponse result = apiInstance.marginAccountCancelAllOpenOrdersOnASymbol(symbol, isIsolated, recvWindow); @@ -468,7 +469,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| | | -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | ### Return type @@ -513,7 +514,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" Long orderListId = 56L; // Long | Either `orderListId` or `listClientOrderId` must be provided String listClientOrderId = "listClientOrderId_example"; // String | Either `orderListId` or `listClientOrderId` must be provided String newClientOrderId = "newClientOrderId_example"; // String | Used to uniquely identify this cancel. Automatically generated by default @@ -537,7 +538,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| | | -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **orderListId** | **Long**| Either `orderListId` or `listClientOrderId` must be provided | [optional] | | **listClientOrderId** | **String**| Either `orderListId` or `listClientOrderId` must be provided | [optional] | | **newClientOrderId** | **String**| Used to uniquely identify this cancel. Automatically generated by default | [optional] | @@ -585,7 +586,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" Long orderId = 56L; // Long | String origClientOrderId = "origClientOrderId_example"; // String | String newClientOrderId = "newClientOrderId_example"; // String | Used to uniquely identify this cancel. Automatically generated by default @@ -609,7 +610,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| | | -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **orderId** | **Long**| | [optional] | | **origClientOrderId** | **String**| | [optional] | | **newClientOrderId** | **String**| Used to uniquely identify this cancel. Automatically generated by default | [optional] | @@ -966,7 +967,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TradeApi apiInstance = new TradeApi(defaultClient); - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" String symbol = "symbol_example"; // String | isolated margin pair Long recvWindow = 56L; // Long | No more than 60000 try { @@ -987,7 +988,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **symbol** | **String**| isolated margin pair | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | @@ -1032,7 +1033,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TradeApi apiInstance = new TradeApi(defaultClient); - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + 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 | 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. @@ -1057,7 +1058,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **symbol** | **String**| isolated margin pair | [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] | @@ -1107,7 +1108,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" Long orderId = 56L; // Long | Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | @@ -1132,7 +1133,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| | | -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **orderId** | **Long**| | [optional] | | **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | @@ -1180,7 +1181,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TradeApi apiInstance = new TradeApi(defaultClient); - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" String symbol = "symbol_example"; // String | isolated margin pair Long orderListId = 56L; // Long | Either `orderListId` or `listClientOrderId` must be provided String origClientOrderId = "origClientOrderId_example"; // String | @@ -1203,7 +1204,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **symbol** | **String**| isolated margin pair | [optional] | | **orderListId** | **Long**| Either `orderListId` or `listClientOrderId` must be provided | [optional] | | **origClientOrderId** | **String**| | [optional] | @@ -1250,7 +1251,7 @@ public class Example { defaultClient.setBasePath("https://api.binance.com"); TradeApi apiInstance = new TradeApi(defaultClient); - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" String symbol = "symbol_example"; // String | isolated margin pair Long recvWindow = 56L; // Long | No more than 60000 try { @@ -1271,7 +1272,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **symbol** | **String**| isolated margin pair | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | @@ -1317,7 +1318,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | isolated margin pair - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" Long recvWindow = 56L; // Long | No more than 60000 try { QueryMarginAccountsOpenOrdersResponse result = apiInstance.queryMarginAccountsOpenOrders(symbol, isIsolated, recvWindow); @@ -1338,7 +1339,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| isolated margin pair | [optional] | -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | ### Return type @@ -1383,7 +1384,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" Long orderId = 56L; // Long | String origClientOrderId = "origClientOrderId_example"; // String | Long recvWindow = 56L; // Long | No more than 60000 @@ -1406,7 +1407,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| | | -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **orderId** | **Long**| | [optional] | | **origClientOrderId** | **String**| | [optional] | | **recvWindow** | **Long**| No more than 60000 | [optional] | @@ -1453,7 +1454,7 @@ public class Example { TradeApi apiInstance = new TradeApi(defaultClient); String symbol = "symbol_example"; // String | - String isIsolated = "isIsolated_example"; // String | for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" Long orderId = 56L; // Long | Long startTime = 56L; // Long | Only supports querying data from the past 90 days. Long endTime = 56L; // Long | @@ -1479,7 +1480,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **symbol** | **String**| | | -| **isIsolated** | **String**| for isolated margin or not, \"TRUE\", \"FALSE\",default \"FALSE\" | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | | **orderId** | **Long**| | [optional] | | **startTime** | **Long**| Only supports querying data from the past 90 days. | [optional] | | **endTime** | **Long**| | [optional] | @@ -1505,6 +1506,78 @@ No authorization required |-------------|-------------|------------------| | **200** | Margin Account's Trade List | - | + +# **queryPreventedMatches** +> QueryPreventedMatchesResponse queryPreventedMatches(symbol, preventedMatchId, orderId, fromPreventedMatchId, recvWindow, isIsolated) + +Query Prevented Matches(USER_DATA) + + Weight: 10(IP) + +### 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.TradeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.binance.com"); + + TradeApi apiInstance = new TradeApi(defaultClient); + String symbol = "symbol_example"; // String | + Long preventedMatchId = 56L; // Long | + Long orderId = 56L; // Long | + Long fromPreventedMatchId = 56L; // Long | + Long recvWindow = 56L; // Long | No more than 60000 + String isIsolated = "isIsolated_example"; // String | For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" + try { + QueryPreventedMatchesResponse result = apiInstance.queryPreventedMatches(symbol, preventedMatchId, orderId, fromPreventedMatchId, recvWindow, isIsolated); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TradeApi#queryPreventedMatches"); + 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**| | | +| **preventedMatchId** | **Long**| | [optional] | +| **orderId** | **Long**| | [optional] | +| **fromPreventedMatchId** | **Long**| | [optional] | +| **recvWindow** | **Long**| No more than 60000 | [optional] | +| **isIsolated** | **String**| For isolated margin or not, \"TRUE\", \"FALSE\", default \"FALSE\" | [optional] | + +### Return type + +[**QueryPreventedMatchesResponse**](QueryPreventedMatchesResponse.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** | Prevented Matches | - | + # **querySpecialKey** > QuerySpecialKeyResponse querySpecialKey(symbol, recvWindow) diff --git a/clients/margin-trading/docs/rest-api/migration-guide.md b/clients/margin-trading/docs/rest-api/migration-guide.md index c2b5524d..c1098dd7 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 - 6.0.0 + 6.1.0 ``` @@ -91,7 +91,7 @@ by: io.github.binance binance-margin-trading - 6.0.0 + 6.1.0 ``` diff --git a/clients/margin-trading/example_rest.md b/clients/margin-trading/example_rest.md index 03ed1541..d35a78bf 100644 --- a/clients/margin-trading/example_rest.md +++ b/clients/margin-trading/example_rest.md @@ -54,6 +54,8 @@ [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/restricted-asset](https://developers.binance.com/docs/margin_trading/market-data/Get-Margin-Restricted-Assets) - getMarginRestrictedAssets - [GetMarginRestrictedAssetsExample.java:47](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginRestrictedAssetsExample.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) @@ -116,6 +118,8 @@ [GET /sapi/v1/margin/myTrades](https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List) - queryMarginAccountsTradeList - [QueryMarginAccountsTradeListExample.java:49](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryMarginAccountsTradeListExample.java#L49) +[GET /sapi/v1/margin/myPreventedMatches](https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Prevented-Matches) - queryPreventedMatches - [QueryPreventedMatchesExample.java:47](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryPreventedMatchesExample.java#L47) + [GET /sapi/v1/margin/apiKey](https://developers.binance.com/docs/margin_trading/trade/Query-Special-Key-of-Low-Latency-Trading) - querySpecialKey - [QuerySpecialKeyExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QuerySpecialKeyExample.java#L48) [GET /sapi/v1/margin/api-key-list](https://developers.binance.com/docs/margin_trading/trade/Query-Special-Key-List-of-Low-Latency-Trading) - querySpecialKeyList - [QuerySpecialKeyListExample.java:47](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QuerySpecialKeyListExample.java#L47) diff --git a/clients/margin-trading/pom.xml b/clients/margin-trading/pom.xml index 5af48e30..d9b4e829 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 - 6.0.0 + 6.1.0 jar 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 5c62444b..f3528f92 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 @@ -213,6 +213,9 @@ private static Class getClassByDiscriminator( new com.binance.connector.client.margin_trading.rest.model .GetMarginAssetRiskBasedLiquidationRatioResponseInner .CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.rest.model + .GetMarginRestrictedAssetsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .GetSmallLiabilityExchangeCoinListResponse.CustomTypeAdapterFactory()); @@ -465,6 +468,12 @@ private static Class getClassByDiscriminator( gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .QueryMaxTransferOutAmountResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.rest.model + .QueryPreventedMatchesResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory( + new com.binance.connector.client.margin_trading.rest.model + .QueryPreventedMatchesResponseInner.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory( new com.binance.connector.client.margin_trading.rest.model .QuerySpecialKeyListResponse.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 e4eb5a50..b0fd6eeb 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/6.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.1.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/BorrowRepayApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/BorrowRepayApi.java index 705b925b..f57e2d4c 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/6.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.1.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/MarginTradingRestApi.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/api/MarginTradingRestApi.java index 41d2b73d..0f621f66 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 @@ -26,6 +26,7 @@ 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.GetMarginRestrictedAssetsResponse; 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; @@ -67,6 +68,7 @@ import com.binance.connector.client.margin_trading.rest.model.QueryMarginPriceindexResponse; import com.binance.connector.client.margin_trading.rest.model.QueryMaxBorrowResponse; import com.binance.connector.client.margin_trading.rest.model.QueryMaxTransferOutAmountResponse; +import com.binance.connector.client.margin_trading.rest.model.QueryPreventedMatchesResponse; import com.binance.connector.client.margin_trading.rest.model.QuerySpecialKeyListResponse; import com.binance.connector.client.margin_trading.rest.model.QuerySpecialKeyResponse; import com.binance.connector.client.margin_trading.rest.model.SmallLiabilityExchangeRequest; @@ -792,6 +794,28 @@ public ApiResponse getListSchedule(Long recvWindow) return marketDataApi.getMarginAssetRiskBasedLiquidationRatio(); } + /** + * Get Margin Restricted Assets (MARKET_DATA) Get Margin Restricted Assets Weight: 1 + * + * @return ApiResponse<GetMarginRestrictedAssetsResponse> + * @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 Restricted Assets -
+ * + * @see Get + * Margin Restricted Assets (MARKET_DATA) Documentation + */ + public ApiResponse getMarginRestrictedAssets() + throws ApiException { + return marketDataApi.getMarginRestrictedAssets(); + } + /** * 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) @@ -1137,8 +1161,8 @@ public ApiResponse getSmallLiabilityEx * symbol for margin account.<br></br> This includes OCO orders. Weight: 1 * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<MarginAccountCancelAllOpenOrdersOnASymbolResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1165,8 +1189,8 @@ public ApiResponse getSmallLiabilityEx * Canceling an individual leg will cancel the entire OCO Weight: 1(UID) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) * @param listClientOrderId Either `orderListId` or `listClientOrderId` must @@ -1205,8 +1229,8 @@ public ApiResponse marginAccountCancelOco( * orderId or origClientOrderId must be sent. Weight: 10(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param origClientOrderId (optional) * @param newClientOrderId Used to uniquely identify this cancel. Automatically generated by @@ -1391,8 +1415,8 @@ public ApiResponse marginManualLiquidation( * Query Current Margin Order Count Usage (TRADE) Displays the user's current margin order * count usage for all intervals. Weight: 20(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryCurrentMarginOrderCountUsageResponse> @@ -1418,8 +1442,8 @@ public ApiResponse queryCurrentMargin * Query Margin Account's all OCO (USER_DATA) Retrieves all OCO for a specific margin * account based on provided optional parameters Weight: 200(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param fromId If `fromId` is set, data with `id` greater than * `fromId` will be returned. Otherwise, the latest data will be returned. @@ -1464,8 +1488,8 @@ public ApiResponse queryMarginAccountsAllOco( * Weight: 200(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) @@ -1503,8 +1527,8 @@ public ApiResponse queryMarginAccountsAllO * Query Margin Account's OCO (USER_DATA) Retrieves a specific OCO based on provided * optional parameters Weight: 10(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) @@ -1539,8 +1563,8 @@ public ApiResponse queryMarginAccountsOco( * Query Margin Account's Open OCO (USER_DATA) Query Margin Account's Open OCO Weight: * 10(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsOpenOcoResponse> @@ -1570,8 +1594,8 @@ public ApiResponse queryMarginAccountsOpenOc * =\"TRUE\", symbol must be sent. Weight: 10(IP) * * @param symbol isolated margin pair (optional) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1598,8 +1622,8 @@ public ApiResponse queryMarginAccountsOpe * will be < 0, meaning the data is not available at this time. Weight: 10(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param origClientOrderId (optional) * @param recvWindow No more than 60000 (optional) @@ -1634,8 +1658,8 @@ public ApiResponse queryMarginAccountsOrder( * hours are returned. * Less than 24 hours between startTime and endTime. Weight: 10(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) @@ -1673,6 +1697,42 @@ public ApiResponse queryMarginAccountsTrad symbol, isIsolated, orderId, startTime, endTime, fromId, limit, recvWindow); } + /** + * Query Prevented Matches(USER_DATA) Weight: 10(IP) + * + * @param symbol (required) + * @param preventedMatchId (optional) + * @param orderId (optional) + * @param fromPreventedMatchId (optional) + * @param recvWindow No more than 60000 (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) + * @return ApiResponse<QueryPreventedMatchesResponse> + * @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 Prevented Matches -
+ * + * @see Query + * Prevented Matches(USER_DATA) Documentation + */ + public ApiResponse queryPreventedMatches( + String symbol, + Long preventedMatchId, + Long orderId, + Long fromPreventedMatchId, + Long recvWindow, + String isIsolated) + throws ApiException { + return tradeApi.queryPreventedMatches( + symbol, preventedMatchId, orderId, fromPreventedMatchId, recvWindow, isIsolated); + } + /** * Query Special key(Low Latency Trading)(TRADE) Query Special Key Information. This only * applies to Special Key for Low Latency Trading. Weight: 1(UID) 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 56d68e8d..5e1121f0 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 @@ -27,6 +27,7 @@ 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.GetMarginRestrictedAssetsResponse; 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; @@ -53,7 +54,7 @@ public class MarketDataApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.1.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1144,6 +1145,131 @@ private okhttp3.Call getMarginAssetRiskBasedLiquidationRatioValidateBeforeCall() return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for getMarginRestrictedAssets + * + * @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 Restricted Assets -
+ * + * @see Get + * Margin Restricted Assets (MARKET_DATA) Documentation + */ + private okhttp3.Call getMarginRestrictedAssetsCall() 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/restricted-asset"; + + 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 getMarginRestrictedAssetsValidateBeforeCall() throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = {}; + Method method = this.getClass().getMethod("getMarginRestrictedAssets"); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return getMarginRestrictedAssetsCall(); + } 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 Restricted Assets (MARKET_DATA) Get Margin Restricted Assets Weight: 1 + * + * @return ApiResponse<GetMarginRestrictedAssetsResponse> + * @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 Restricted Assets -
+ * + * @see Get + * Margin Restricted Assets (MARKET_DATA) Documentation + */ + public ApiResponse getMarginRestrictedAssets() + throws ApiException { + okhttp3.Call localVarCall = getMarginRestrictedAssetsValidateBeforeCall(); + 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 efbab0c4..80e69b33 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/6.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.1.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 fe373fb3..c921a7c2 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 @@ -48,6 +48,7 @@ import com.binance.connector.client.margin_trading.rest.model.QueryMarginAccountsOpenOrdersResponse; import com.binance.connector.client.margin_trading.rest.model.QueryMarginAccountsOrderResponse; import com.binance.connector.client.margin_trading.rest.model.QueryMarginAccountsTradeListResponse; +import com.binance.connector.client.margin_trading.rest.model.QueryPreventedMatchesResponse; import com.binance.connector.client.margin_trading.rest.model.QuerySpecialKeyListResponse; import com.binance.connector.client.margin_trading.rest.model.QuerySpecialKeyResponse; import com.binance.connector.client.margin_trading.rest.model.SmallLiabilityExchangeRequest; @@ -74,7 +75,7 @@ public class TradeApi { private static final String USER_AGENT = String.format( - "binance-margin-trading/6.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.1.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private static final boolean HAS_TIME_UNIT = false; @@ -1089,8 +1090,8 @@ public ApiResponse getSmallLiabilityEx * Build call for marginAccountCancelAllOpenOrdersOnASymbol * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -1216,8 +1217,8 @@ private okhttp3.Call marginAccountCancelAllOpenOrdersOnASymbolValidateBeforeCall * symbol for margin account.<br></br> This includes OCO orders. Weight: 1 * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<MarginAccountCancelAllOpenOrdersOnASymbolResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -1249,8 +1250,8 @@ private okhttp3.Call marginAccountCancelAllOpenOrdersOnASymbolValidateBeforeCall * Build call for marginAccountCancelOco * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) * @param listClientOrderId Either `orderListId` or `listClientOrderId` must @@ -1419,8 +1420,8 @@ private okhttp3.Call marginAccountCancelOcoValidateBeforeCall( * Canceling an individual leg will cancel the entire OCO Weight: 1(UID) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) * @param listClientOrderId Either `orderListId` or `listClientOrderId` must @@ -1467,8 +1468,8 @@ public ApiResponse marginAccountCancelOco( * Build call for marginAccountCancelOrder * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param origClientOrderId (optional) * @param newClientOrderId Used to uniquely identify this cancel. Automatically generated by @@ -1634,8 +1635,8 @@ private okhttp3.Call marginAccountCancelOrderValidateBeforeCall( * orderId or origClientOrderId must be sent. Weight: 10(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param origClientOrderId (optional) * @param newClientOrderId Used to uniquely identify this cancel. Automatically generated by @@ -2880,8 +2881,8 @@ public ApiResponse marginManualLiquidation( /** * Build call for queryCurrentMarginOrderCountUsage * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute @@ -3006,8 +3007,8 @@ private okhttp3.Call queryCurrentMarginOrderCountUsageValidateBeforeCall( * Query Current Margin Order Count Usage (TRADE) Displays the user's current margin order * count usage for all intervals. Weight: 20(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryCurrentMarginOrderCountUsageResponse> @@ -3036,8 +3037,8 @@ public ApiResponse queryCurrentMargin /** * Build call for queryMarginAccountsAllOco * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param fromId If `fromId` is set, data with `id` greater than * `fromId` will be returned. Otherwise, the latest data will be returned. @@ -3206,8 +3207,8 @@ private okhttp3.Call queryMarginAccountsAllOcoValidateBeforeCall( * Query Margin Account's all OCO (USER_DATA) Retrieves all OCO for a specific margin * account based on provided optional parameters Weight: 200(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param fromId If `fromId` is set, data with `id` greater than * `fromId` will be returned. Otherwise, the latest data will be returned. @@ -3252,8 +3253,8 @@ public ApiResponse queryMarginAccountsAllOco( * Build call for queryMarginAccountsAllOrders * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) @@ -3423,8 +3424,8 @@ private okhttp3.Call queryMarginAccountsAllOrdersValidateBeforeCall( * Weight: 200(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) @@ -3465,8 +3466,8 @@ public ApiResponse queryMarginAccountsAllO /** * Build call for queryMarginAccountsOco * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) @@ -3619,8 +3620,8 @@ private okhttp3.Call queryMarginAccountsOcoValidateBeforeCall( * Query Margin Account's OCO (USER_DATA) Retrieves a specific OCO based on provided * optional parameters Weight: 10(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param orderListId Either `orderListId` or `listClientOrderId` must be * provided (optional) @@ -3658,8 +3659,8 @@ public ApiResponse queryMarginAccountsOco( /** * Build call for queryMarginAccountsOpenOco * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute @@ -3784,8 +3785,8 @@ private okhttp3.Call queryMarginAccountsOpenOcoValidateBeforeCall( * Query Margin Account's Open OCO (USER_DATA) Query Margin Account's Open OCO Weight: * 10(IP) * - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param symbol isolated margin pair (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsOpenOcoResponse> @@ -3815,8 +3816,8 @@ public ApiResponse queryMarginAccountsOpenOc * Build call for queryMarginAccountsOpenOrders * * @param symbol isolated margin pair (optional) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param recvWindow No more than 60000 (optional) * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -3944,8 +3945,8 @@ private okhttp3.Call queryMarginAccountsOpenOrdersValidateBeforeCall( * =\"TRUE\", symbol must be sent. Weight: 10(IP) * * @param symbol isolated margin pair (optional) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param recvWindow No more than 60000 (optional) * @return ApiResponse<QueryMarginAccountsOpenOrdersResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the @@ -3974,8 +3975,8 @@ public ApiResponse queryMarginAccountsOpe * Build call for queryMarginAccountsOrder * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param origClientOrderId (optional) * @param recvWindow No more than 60000 (optional) @@ -4125,8 +4126,8 @@ private okhttp3.Call queryMarginAccountsOrderValidateBeforeCall( * will be < 0, meaning the data is not available at this time. Weight: 10(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param origClientOrderId (optional) * @param recvWindow No more than 60000 (optional) @@ -4163,8 +4164,8 @@ public ApiResponse queryMarginAccountsOrder( * Build call for queryMarginAccountsTradeList * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) @@ -4342,8 +4343,8 @@ private okhttp3.Call queryMarginAccountsTradeListValidateBeforeCall( * hours are returned. * Less than 24 hours between startTime and endTime. Weight: 10(IP) * * @param symbol (required) - * @param isIsolated for isolated margin or not, \"TRUE\", \"FALSE\",default - * \"FALSE\" (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) * @param orderId (optional) * @param startTime Only supports querying data from the past 90 days. (optional) * @param endTime (optional) @@ -4385,6 +4386,217 @@ public ApiResponse queryMarginAccountsTrad return localVarApiClient.execute(localVarCall, localVarReturnType); } + /** + * Build call for queryPreventedMatches + * + * @param symbol (required) + * @param preventedMatchId (optional) + * @param orderId (optional) + * @param fromPreventedMatchId (optional) + * @param recvWindow No more than 60000 (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (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 Prevented Matches -
+ * + * @see Query + * Prevented Matches(USER_DATA) Documentation + */ + private okhttp3.Call queryPreventedMatchesCall( + String symbol, + Long preventedMatchId, + Long orderId, + Long fromPreventedMatchId, + Long recvWindow, + String isIsolated) + 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/myPreventedMatches"; + + 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 (preventedMatchId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair("preventedMatchId", preventedMatchId)); + } + + if (orderId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderId", orderId)); + } + + if (fromPreventedMatchId != null) { + localVarQueryParams.addAll( + localVarApiClient.parameterToPair( + "fromPreventedMatchId", fromPreventedMatchId)); + } + + if (recvWindow != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow)); + } + + if (isIsolated != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isIsolated", isIsolated)); + } + + 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 queryPreventedMatchesValidateBeforeCall( + String symbol, + Long preventedMatchId, + Long orderId, + Long fromPreventedMatchId, + Long recvWindow, + String isIsolated) + throws ApiException { + try { + Validator validator = + Validation.byDefaultProvider() + .configure() + .messageInterpolator(new ParameterMessageInterpolator()) + .buildValidatorFactory() + .getValidator(); + ExecutableValidator executableValidator = validator.forExecutables(); + + Object[] parameterValues = { + symbol, preventedMatchId, orderId, fromPreventedMatchId, recvWindow, isIsolated + }; + Method method = + this.getClass() + .getMethod( + "queryPreventedMatches", + String.class, + Long.class, + Long.class, + Long.class, + Long.class, + String.class); + Set> violations = + executableValidator.validateParameters(this, method, parameterValues); + + if (violations.size() == 0) { + return queryPreventedMatchesCall( + symbol, + preventedMatchId, + orderId, + fromPreventedMatchId, + recvWindow, + isIsolated); + } 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()); + } + } + + /** + * Query Prevented Matches(USER_DATA) Weight: 10(IP) + * + * @param symbol (required) + * @param preventedMatchId (optional) + * @param orderId (optional) + * @param fromPreventedMatchId (optional) + * @param recvWindow No more than 60000 (optional) + * @param isIsolated For isolated margin or not, \"TRUE\", \"FALSE\", + * default \"FALSE\" (optional) + * @return ApiResponse<QueryPreventedMatchesResponse> + * @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 Prevented Matches -
+ * + * @see Query + * Prevented Matches(USER_DATA) Documentation + */ + public ApiResponse queryPreventedMatches( + @NotNull String symbol, + Long preventedMatchId, + Long orderId, + Long fromPreventedMatchId, + Long recvWindow, + String isIsolated) + throws ApiException { + okhttp3.Call localVarCall = + queryPreventedMatchesValidateBeforeCall( + symbol, + preventedMatchId, + orderId, + fromPreventedMatchId, + recvWindow, + isIsolated); + java.lang.reflect.Type localVarReturnType = + new TypeToken() {}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + /** * Build call for querySpecialKey * 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 907f26d0..9c87c627 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/6.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.1.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/model/GetMarginRestrictedAssetsResponse.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginRestrictedAssetsResponse.java new file mode 100644 index 00000000..1a12af4b --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/GetMarginRestrictedAssetsResponse.java @@ -0,0 +1,307 @@ +/* + * 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.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.*; + +/** GetMarginRestrictedAssetsResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class GetMarginRestrictedAssetsResponse { + public static final String SERIALIZED_NAME_OPEN_LONG_RESTRICTED_ASSET = + "openLongRestrictedAsset"; + + @SerializedName(SERIALIZED_NAME_OPEN_LONG_RESTRICTED_ASSET) + @jakarta.annotation.Nullable + private List openLongRestrictedAsset; + + public static final String SERIALIZED_NAME_MAX_COLLATERAL_EXCEEDED_ASSET = + "maxCollateralExceededAsset"; + + @SerializedName(SERIALIZED_NAME_MAX_COLLATERAL_EXCEEDED_ASSET) + @jakarta.annotation.Nullable + private List maxCollateralExceededAsset; + + public GetMarginRestrictedAssetsResponse() {} + + public GetMarginRestrictedAssetsResponse openLongRestrictedAsset( + @jakarta.annotation.Nullable List openLongRestrictedAsset) { + this.openLongRestrictedAsset = openLongRestrictedAsset; + return this; + } + + public GetMarginRestrictedAssetsResponse addOpenLongRestrictedAssetItem( + String openLongRestrictedAssetItem) { + if (this.openLongRestrictedAsset == null) { + this.openLongRestrictedAsset = new ArrayList<>(); + } + this.openLongRestrictedAsset.add(openLongRestrictedAssetItem); + return this; + } + + /** + * Get openLongRestrictedAsset + * + * @return openLongRestrictedAsset + */ + @jakarta.annotation.Nullable + public List getOpenLongRestrictedAsset() { + return openLongRestrictedAsset; + } + + public void setOpenLongRestrictedAsset( + @jakarta.annotation.Nullable List openLongRestrictedAsset) { + this.openLongRestrictedAsset = openLongRestrictedAsset; + } + + public GetMarginRestrictedAssetsResponse maxCollateralExceededAsset( + @jakarta.annotation.Nullable List maxCollateralExceededAsset) { + this.maxCollateralExceededAsset = maxCollateralExceededAsset; + return this; + } + + public GetMarginRestrictedAssetsResponse addMaxCollateralExceededAssetItem( + String maxCollateralExceededAssetItem) { + if (this.maxCollateralExceededAsset == null) { + this.maxCollateralExceededAsset = new ArrayList<>(); + } + this.maxCollateralExceededAsset.add(maxCollateralExceededAssetItem); + return this; + } + + /** + * Get maxCollateralExceededAsset + * + * @return maxCollateralExceededAsset + */ + @jakarta.annotation.Nullable + public List getMaxCollateralExceededAsset() { + return maxCollateralExceededAsset; + } + + public void setMaxCollateralExceededAsset( + @jakarta.annotation.Nullable List maxCollateralExceededAsset) { + this.maxCollateralExceededAsset = maxCollateralExceededAsset; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMarginRestrictedAssetsResponse getMarginRestrictedAssetsResponse = + (GetMarginRestrictedAssetsResponse) o; + return Objects.equals( + this.openLongRestrictedAsset, + getMarginRestrictedAssetsResponse.openLongRestrictedAsset) + && Objects.equals( + this.maxCollateralExceededAsset, + getMarginRestrictedAssetsResponse.maxCollateralExceededAsset); + } + + @Override + public int hashCode() { + return Objects.hash(openLongRestrictedAsset, maxCollateralExceededAsset); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetMarginRestrictedAssetsResponse {\n"); + sb.append(" openLongRestrictedAsset: ") + .append(toIndentedString(openLongRestrictedAsset)) + .append("\n"); + sb.append(" maxCollateralExceededAsset: ") + .append(toIndentedString(maxCollateralExceededAsset)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + public String toUrlQueryString() { + StringBuilder sb = new StringBuilder(); + + Object openLongRestrictedAssetValue = getOpenLongRestrictedAsset(); + String openLongRestrictedAssetValueAsString = ""; + openLongRestrictedAssetValueAsString = + (String) + ((Collection) openLongRestrictedAssetValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("openLongRestrictedAsset=") + .append(urlEncode(openLongRestrictedAssetValueAsString)) + .append(""); + Object maxCollateralExceededAssetValue = getMaxCollateralExceededAsset(); + String maxCollateralExceededAssetValueAsString = ""; + maxCollateralExceededAssetValueAsString = + (String) + ((Collection) maxCollateralExceededAssetValue) + .stream().map(Object::toString).collect(Collectors.joining(",")); + sb.append("maxCollateralExceededAsset=") + .append(urlEncode(maxCollateralExceededAssetValueAsString)) + .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("openLongRestrictedAsset"); + openapiFields.add("maxCollateralExceededAsset"); + + // 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 + * GetMarginRestrictedAssetsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetMarginRestrictedAssetsResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in GetMarginRestrictedAssetsResponse is" + + " not found in the empty JSON string", + GetMarginRestrictedAssetsResponse.openapiRequiredFields + .toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("openLongRestrictedAsset") != null + && !jsonObj.get("openLongRestrictedAsset").isJsonNull() + && !jsonObj.get("openLongRestrictedAsset").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `openLongRestrictedAsset` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("openLongRestrictedAsset").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("maxCollateralExceededAsset") != null + && !jsonObj.get("maxCollateralExceededAsset").isJsonNull() + && !jsonObj.get("maxCollateralExceededAsset").isJsonArray()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `maxCollateralExceededAsset` to be an array in the" + + " JSON string but got `%s`", + jsonObj.get("maxCollateralExceededAsset").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!GetMarginRestrictedAssetsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetMarginRestrictedAssetsResponse' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(GetMarginRestrictedAssetsResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, GetMarginRestrictedAssetsResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public GetMarginRestrictedAssetsResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of GetMarginRestrictedAssetsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetMarginRestrictedAssetsResponse + * @throws IOException if the JSON string is invalid with respect to + * GetMarginRestrictedAssetsResponse + */ + public static GetMarginRestrictedAssetsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetMarginRestrictedAssetsResponse.class); + } + + /** + * Convert an instance of GetMarginRestrictedAssetsResponse 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/QueryPreventedMatchesResponse.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/QueryPreventedMatchesResponse.java new file mode 100644 index 00000000..f1d4622c --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/QueryPreventedMatchesResponse.java @@ -0,0 +1,187 @@ +/* + * 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.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.*; + +/** QueryPreventedMatchesResponse */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryPreventedMatchesResponse extends ArrayList { + public QueryPreventedMatchesResponse() {} + + @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 QueryPreventedMatchesResponse {\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 + * QueryPreventedMatchesResponse + */ + 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) { + QueryPreventedMatchesResponseInner.validateJsonElement(element); + } + if (jsonElement == null) { + if (!QueryPreventedMatchesResponse.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryPreventedMatchesResponse is not" + + " found in the empty JSON string", + QueryPreventedMatchesResponse.openapiRequiredFields.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryPreventedMatchesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryPreventedMatchesResponse' and its + // subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QueryPreventedMatchesResponse.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryPreventedMatchesResponse value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonArray(); + elementAdapter.write(out, obj); + } + + @Override + public QueryPreventedMatchesResponse read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryPreventedMatchesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryPreventedMatchesResponse + * @throws IOException if the JSON string is invalid with respect to + * QueryPreventedMatchesResponse + */ + public static QueryPreventedMatchesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryPreventedMatchesResponse.class); + } + + /** + * Convert an instance of QueryPreventedMatchesResponse 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/QueryPreventedMatchesResponseInner.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/QueryPreventedMatchesResponseInner.java new file mode 100644 index 00000000..8b39eec9 --- /dev/null +++ b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/model/QueryPreventedMatchesResponseInner.java @@ -0,0 +1,578 @@ +/* + * 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.*; + +/** QueryPreventedMatchesResponseInner */ +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.12.0") +public class QueryPreventedMatchesResponseInner { + public static final String SERIALIZED_NAME_SYMBOL = "symbol"; + + @SerializedName(SERIALIZED_NAME_SYMBOL) + @jakarta.annotation.Nullable + private String symbol; + + public static final String SERIALIZED_NAME_PREVENTED_MATCH_ID = "preventedMatchId"; + + @SerializedName(SERIALIZED_NAME_PREVENTED_MATCH_ID) + @jakarta.annotation.Nullable + private Long preventedMatchId; + + public static final String SERIALIZED_NAME_TAKER_ORDER_ID = "takerOrderId"; + + @SerializedName(SERIALIZED_NAME_TAKER_ORDER_ID) + @jakarta.annotation.Nullable + private Long takerOrderId; + + public static final String SERIALIZED_NAME_MAKER_SYMBOL = "makerSymbol"; + + @SerializedName(SERIALIZED_NAME_MAKER_SYMBOL) + @jakarta.annotation.Nullable + private String makerSymbol; + + public static final String SERIALIZED_NAME_MAKER_ORDER_ID = "makerOrderId"; + + @SerializedName(SERIALIZED_NAME_MAKER_ORDER_ID) + @jakarta.annotation.Nullable + private Long makerOrderId; + + public static final String SERIALIZED_NAME_TRADE_GROUP_ID = "tradeGroupId"; + + @SerializedName(SERIALIZED_NAME_TRADE_GROUP_ID) + @jakarta.annotation.Nullable + private Long tradeGroupId; + + public static final String SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE = + "selfTradePreventionMode"; + + @SerializedName(SERIALIZED_NAME_SELF_TRADE_PREVENTION_MODE) + @jakarta.annotation.Nullable + private String selfTradePreventionMode; + + public static final String SERIALIZED_NAME_PRICE = "price"; + + @SerializedName(SERIALIZED_NAME_PRICE) + @jakarta.annotation.Nullable + private String price; + + public static final String SERIALIZED_NAME_MAKER_PREVENTED_QUANTITY = "makerPreventedQuantity"; + + @SerializedName(SERIALIZED_NAME_MAKER_PREVENTED_QUANTITY) + @jakarta.annotation.Nullable + private String makerPreventedQuantity; + + public static final String SERIALIZED_NAME_TRANSACT_TIME = "transactTime"; + + @SerializedName(SERIALIZED_NAME_TRANSACT_TIME) + @jakarta.annotation.Nullable + private Long transactTime; + + public QueryPreventedMatchesResponseInner() {} + + public QueryPreventedMatchesResponseInner 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 QueryPreventedMatchesResponseInner preventedMatchId( + @jakarta.annotation.Nullable Long preventedMatchId) { + this.preventedMatchId = preventedMatchId; + return this; + } + + /** + * Get preventedMatchId + * + * @return preventedMatchId + */ + @jakarta.annotation.Nullable + public Long getPreventedMatchId() { + return preventedMatchId; + } + + public void setPreventedMatchId(@jakarta.annotation.Nullable Long preventedMatchId) { + this.preventedMatchId = preventedMatchId; + } + + public QueryPreventedMatchesResponseInner takerOrderId( + @jakarta.annotation.Nullable Long takerOrderId) { + this.takerOrderId = takerOrderId; + return this; + } + + /** + * Get takerOrderId + * + * @return takerOrderId + */ + @jakarta.annotation.Nullable + public Long getTakerOrderId() { + return takerOrderId; + } + + public void setTakerOrderId(@jakarta.annotation.Nullable Long takerOrderId) { + this.takerOrderId = takerOrderId; + } + + public QueryPreventedMatchesResponseInner makerSymbol( + @jakarta.annotation.Nullable String makerSymbol) { + this.makerSymbol = makerSymbol; + return this; + } + + /** + * Get makerSymbol + * + * @return makerSymbol + */ + @jakarta.annotation.Nullable + public String getMakerSymbol() { + return makerSymbol; + } + + public void setMakerSymbol(@jakarta.annotation.Nullable String makerSymbol) { + this.makerSymbol = makerSymbol; + } + + public QueryPreventedMatchesResponseInner makerOrderId( + @jakarta.annotation.Nullable Long makerOrderId) { + this.makerOrderId = makerOrderId; + return this; + } + + /** + * Get makerOrderId + * + * @return makerOrderId + */ + @jakarta.annotation.Nullable + public Long getMakerOrderId() { + return makerOrderId; + } + + public void setMakerOrderId(@jakarta.annotation.Nullable Long makerOrderId) { + this.makerOrderId = makerOrderId; + } + + public QueryPreventedMatchesResponseInner tradeGroupId( + @jakarta.annotation.Nullable Long tradeGroupId) { + this.tradeGroupId = tradeGroupId; + return this; + } + + /** + * Get tradeGroupId + * + * @return tradeGroupId + */ + @jakarta.annotation.Nullable + public Long getTradeGroupId() { + return tradeGroupId; + } + + public void setTradeGroupId(@jakarta.annotation.Nullable Long tradeGroupId) { + this.tradeGroupId = tradeGroupId; + } + + public QueryPreventedMatchesResponseInner 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 QueryPreventedMatchesResponseInner 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 QueryPreventedMatchesResponseInner makerPreventedQuantity( + @jakarta.annotation.Nullable String makerPreventedQuantity) { + this.makerPreventedQuantity = makerPreventedQuantity; + return this; + } + + /** + * Get makerPreventedQuantity + * + * @return makerPreventedQuantity + */ + @jakarta.annotation.Nullable + public String getMakerPreventedQuantity() { + return makerPreventedQuantity; + } + + public void setMakerPreventedQuantity( + @jakarta.annotation.Nullable String makerPreventedQuantity) { + this.makerPreventedQuantity = makerPreventedQuantity; + } + + public QueryPreventedMatchesResponseInner transactTime( + @jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + return this; + } + + /** + * Get transactTime + * + * @return transactTime + */ + @jakarta.annotation.Nullable + public Long getTransactTime() { + return transactTime; + } + + public void setTransactTime(@jakarta.annotation.Nullable Long transactTime) { + this.transactTime = transactTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryPreventedMatchesResponseInner queryPreventedMatchesResponseInner = + (QueryPreventedMatchesResponseInner) o; + return Objects.equals(this.symbol, queryPreventedMatchesResponseInner.symbol) + && Objects.equals( + this.preventedMatchId, queryPreventedMatchesResponseInner.preventedMatchId) + && Objects.equals( + this.takerOrderId, queryPreventedMatchesResponseInner.takerOrderId) + && Objects.equals(this.makerSymbol, queryPreventedMatchesResponseInner.makerSymbol) + && Objects.equals( + this.makerOrderId, queryPreventedMatchesResponseInner.makerOrderId) + && Objects.equals( + this.tradeGroupId, queryPreventedMatchesResponseInner.tradeGroupId) + && Objects.equals( + this.selfTradePreventionMode, + queryPreventedMatchesResponseInner.selfTradePreventionMode) + && Objects.equals(this.price, queryPreventedMatchesResponseInner.price) + && Objects.equals( + this.makerPreventedQuantity, + queryPreventedMatchesResponseInner.makerPreventedQuantity) + && Objects.equals( + this.transactTime, queryPreventedMatchesResponseInner.transactTime); + } + + @Override + public int hashCode() { + return Objects.hash( + symbol, + preventedMatchId, + takerOrderId, + makerSymbol, + makerOrderId, + tradeGroupId, + selfTradePreventionMode, + price, + makerPreventedQuantity, + transactTime); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryPreventedMatchesResponseInner {\n"); + sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); + sb.append(" preventedMatchId: ").append(toIndentedString(preventedMatchId)).append("\n"); + sb.append(" takerOrderId: ").append(toIndentedString(takerOrderId)).append("\n"); + sb.append(" makerSymbol: ").append(toIndentedString(makerSymbol)).append("\n"); + sb.append(" makerOrderId: ").append(toIndentedString(makerOrderId)).append("\n"); + sb.append(" tradeGroupId: ").append(toIndentedString(tradeGroupId)).append("\n"); + sb.append(" selfTradePreventionMode: ") + .append(toIndentedString(selfTradePreventionMode)) + .append("\n"); + sb.append(" price: ").append(toIndentedString(price)).append("\n"); + sb.append(" makerPreventedQuantity: ") + .append(toIndentedString(makerPreventedQuantity)) + .append("\n"); + sb.append(" transactTime: ").append(toIndentedString(transactTime)).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 preventedMatchIdValue = getPreventedMatchId(); + String preventedMatchIdValueAsString = ""; + preventedMatchIdValueAsString = preventedMatchIdValue.toString(); + sb.append("preventedMatchId=").append(urlEncode(preventedMatchIdValueAsString)).append(""); + Object takerOrderIdValue = getTakerOrderId(); + String takerOrderIdValueAsString = ""; + takerOrderIdValueAsString = takerOrderIdValue.toString(); + sb.append("takerOrderId=").append(urlEncode(takerOrderIdValueAsString)).append(""); + Object makerSymbolValue = getMakerSymbol(); + String makerSymbolValueAsString = ""; + makerSymbolValueAsString = makerSymbolValue.toString(); + sb.append("makerSymbol=").append(urlEncode(makerSymbolValueAsString)).append(""); + Object makerOrderIdValue = getMakerOrderId(); + String makerOrderIdValueAsString = ""; + makerOrderIdValueAsString = makerOrderIdValue.toString(); + sb.append("makerOrderId=").append(urlEncode(makerOrderIdValueAsString)).append(""); + Object tradeGroupIdValue = getTradeGroupId(); + String tradeGroupIdValueAsString = ""; + tradeGroupIdValueAsString = tradeGroupIdValue.toString(); + sb.append("tradeGroupId=").append(urlEncode(tradeGroupIdValueAsString)).append(""); + Object selfTradePreventionModeValue = getSelfTradePreventionMode(); + String selfTradePreventionModeValueAsString = ""; + selfTradePreventionModeValueAsString = selfTradePreventionModeValue.toString(); + sb.append("selfTradePreventionMode=") + .append(urlEncode(selfTradePreventionModeValueAsString)) + .append(""); + Object priceValue = getPrice(); + String priceValueAsString = ""; + priceValueAsString = priceValue.toString(); + sb.append("price=").append(urlEncode(priceValueAsString)).append(""); + Object makerPreventedQuantityValue = getMakerPreventedQuantity(); + String makerPreventedQuantityValueAsString = ""; + makerPreventedQuantityValueAsString = makerPreventedQuantityValue.toString(); + sb.append("makerPreventedQuantity=") + .append(urlEncode(makerPreventedQuantityValueAsString)) + .append(""); + Object transactTimeValue = getTransactTime(); + String transactTimeValueAsString = ""; + transactTimeValueAsString = transactTimeValue.toString(); + sb.append("transactTime=").append(urlEncode(transactTimeValueAsString)).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("preventedMatchId"); + openapiFields.add("takerOrderId"); + openapiFields.add("makerSymbol"); + openapiFields.add("makerOrderId"); + openapiFields.add("tradeGroupId"); + openapiFields.add("selfTradePreventionMode"); + openapiFields.add("price"); + openapiFields.add("makerPreventedQuantity"); + openapiFields.add("transactTime"); + + // 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 + * QueryPreventedMatchesResponseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryPreventedMatchesResponseInner.openapiRequiredFields + .isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException( + String.format( + "The required field(s) %s in QueryPreventedMatchesResponseInner is" + + " not found in the empty JSON string", + QueryPreventedMatchesResponseInner.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("makerSymbol") != null && !jsonObj.get("makerSymbol").isJsonNull()) + && !jsonObj.get("makerSymbol").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `makerSymbol` to be a primitive type in the JSON" + + " string but got `%s`", + jsonObj.get("makerSymbol").toString())); + } + if ((jsonObj.get("selfTradePreventionMode") != null + && !jsonObj.get("selfTradePreventionMode").isJsonNull()) + && !jsonObj.get("selfTradePreventionMode").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `selfTradePreventionMode` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("selfTradePreventionMode").toString())); + } + if ((jsonObj.get("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("makerPreventedQuantity") != null + && !jsonObj.get("makerPreventedQuantity").isJsonNull()) + && !jsonObj.get("makerPreventedQuantity").isJsonPrimitive()) { + throw new IllegalArgumentException( + String.format( + "Expected the field `makerPreventedQuantity` to be a primitive type in" + + " the JSON string but got `%s`", + jsonObj.get("makerPreventedQuantity").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!QueryPreventedMatchesResponseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryPreventedMatchesResponseInner' and + // its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter = + gson.getDelegateAdapter( + this, TypeToken.get(QueryPreventedMatchesResponseInner.class)); + + return (TypeAdapter) + new TypeAdapter() { + @Override + public void write(JsonWriter out, QueryPreventedMatchesResponseInner value) + throws IOException { + JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public QueryPreventedMatchesResponseInner read(JsonReader in) + throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + // validateJsonElement(jsonElement); + return thisAdapter.fromJsonTree(jsonElement); + } + }.nullSafe(); + } + } + + /** + * Create an instance of QueryPreventedMatchesResponseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryPreventedMatchesResponseInner + * @throws IOException if the JSON string is invalid with respect to + * QueryPreventedMatchesResponseInner + */ + public static QueryPreventedMatchesResponseInner fromJson(String jsonString) + throws IOException { + return JSON.getGson().fromJson(jsonString, QueryPreventedMatchesResponseInner.class); + } + + /** + * Convert an instance of QueryPreventedMatchesResponseInner 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/api/MarginTradingWebSocketStreams.java b/clients/margin-trading/src/main/java/com/binance/connector/client/margin_trading/websocket/stream/api/MarginTradingWebSocketStreams.java index de0a5b42..46563b37 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/6.0.0 (Java/%s; %s; %s)", + "binance-margin-trading/6.1.0 (Java/%s; %s; %s)", SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); private final StreamConnectionInterface connection; diff --git a/examples/margin-trading/pom.xml b/examples/margin-trading/pom.xml index 1beb9fe5..0f7263e3 100644 --- a/examples/margin-trading/pom.xml +++ b/examples/margin-trading/pom.xml @@ -31,7 +31,7 @@ io.github.binance binance-margin-trading - 6.0.0 + 6.1.0 \ No newline at end of file diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginRestrictedAssetsExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginRestrictedAssetsExample.java new file mode 100644 index 00000000..6d67cee2 --- /dev/null +++ b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetMarginRestrictedAssetsExample.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.GetMarginRestrictedAssetsResponse; + +/** API examples for MarketDataApi */ +public class GetMarginRestrictedAssetsExample { + 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 Restricted Assets (MARKET_DATA) + * + *

Get Margin Restricted Assets Weight: 1 + * + * @throws ApiException if the Api call fails + */ + public void getMarginRestrictedAssetsExample() throws ApiException { + ApiResponse response = + getApi().getMarginRestrictedAssets(); + System.out.println(response.getData()); + } +} diff --git a/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryPreventedMatchesExample.java b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryPreventedMatchesExample.java new file mode 100644 index 00000000..e7c3f6d1 --- /dev/null +++ b/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/trade/QueryPreventedMatchesExample.java @@ -0,0 +1,64 @@ +/* + * 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.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.margin_trading.rest.MarginTradingRestApiUtil; +import com.binance.connector.client.margin_trading.rest.api.MarginTradingRestApi; +import com.binance.connector.client.margin_trading.rest.model.QueryPreventedMatchesResponse; + +/** API examples for TradeApi */ +public class QueryPreventedMatchesExample { + 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; + } + + /** + * Query Prevented Matches(USER_DATA) + * + *

Weight: 10(IP) + * + * @throws ApiException if the Api call fails + */ + public void queryPreventedMatchesExample() throws ApiException { + String symbol = ""; + Long preventedMatchId = 1L; + Long orderId = 1L; + Long fromPreventedMatchId = 1L; + Long recvWindow = 5000L; + String isIsolated = "false"; + ApiResponse response = + getApi().queryPreventedMatches( + symbol, + preventedMatchId, + orderId, + fromPreventedMatchId, + recvWindow, + isIsolated); + System.out.println(response.getData()); + } +}