Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions clients/margin-trading/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.0.0 - 2025-06-17

### Added (1)

- `get_list_schedule()` (`GET /sapi/v1/margin/list-schedule`)

## 1.1.0 - 2025-05-02

- Update `binance/common` module to version `1.1.0`.
Expand Down
4 changes: 2 additions & 2 deletions clients/margin-trading/docs/rest-api/migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ With the transition to a modularized structure, the Binance Connector has been s
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-margin-trading</artifactId>
<version>1.1.0</version>
<version>2.0.0</version>
</dependency>
```

Expand Down Expand Up @@ -91,7 +91,7 @@ by:
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-margin-trading</artifactId>
<version>1.1.0</version>
<version>2.0.0</version>
</dependency>
```

Expand Down
2 changes: 2 additions & 0 deletions clients/margin-trading/example_rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

[GET /sapi/v1/margin/delist-schedule](https://developers.binance.com/docs/margin_trading/market-data/Get-Delist-Schedule) - getDelistSchedule - [GetDelistScheduleExample.java:47](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetDelistScheduleExample.java#L47)

[GET /sapi/v1/margin/list-schedule](https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule) - getListSchedule - [GetListScheduleExample.java:48](/examples/margin-trading/src/main/java/com/binance/connector/client/margin_trading/rest/marketdata/GetListScheduleExample.java#L48)

[GET /sapi/v1/margin/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)
Expand Down
4 changes: 2 additions & 2 deletions clients/margin-trading/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>binance-margin-trading</artifactId>
<name>margin-trading</name>
<version>1.1.0</version>
<version>2.0.0</version>
<packaging>jar</packaging>

<parent>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>1.1.0</version>
<version>1.2.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapterFactory(
new com.binance.connector.client.margin_trading.rest.model
.GetInterestHistoryResponseRowsInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new com.binance.connector.client.margin_trading.rest.model
.GetListScheduleResponseInner.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new com.binance.connector.client.margin_trading.rest.model
.GetSmallLiabilityExchangeCoinListResponse.CustomTypeAdapterFactory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class AccountApi {

private static final String USER_AGENT =
String.format(
"binance-margin-trading/1.1.0 (Java/%s; %s; %s)",
"binance-margin-trading/2.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());
private static final boolean HAS_TIME_UNIT = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class BorrowRepayApi {

private static final String USER_AGENT =
String.format(
"binance-margin-trading/1.1.0 (Java/%s; %s; %s)",
"binance-margin-trading/2.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());
private static final boolean HAS_TIME_UNIT = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.binance.connector.client.margin_trading.rest.model.GetForceLiquidationRecordResponse;
import com.binance.connector.client.margin_trading.rest.model.GetFutureHourlyInterestRateResponse;
import com.binance.connector.client.margin_trading.rest.model.GetInterestHistoryResponse;
import com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse;
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;
Expand Down Expand Up @@ -716,6 +717,30 @@ public ApiResponse<GetDelistScheduleResponse> getDelistSchedule(Long recvWindow)
return marketDataApi.getDelistSchedule(recvWindow);
}

/**
* Get list Schedule (MARKET_DATA) Get the upcoming tokens or symbols listing schedule for Cross
* Margin and Isolated Margin. Weight: 100
*
* @param recvWindow No more than 60000 (optional)
* @return ApiResponse&lt;GetListScheduleResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
* @http.response.details
* <table border="1">
* <caption>Response Details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> Get list Schedule </td><td> - </td></tr>
* </table>
*
* @see <a
* href="https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule">Get
* list Schedule (MARKET_DATA) Documentation</a>
*/
public ApiResponse<GetListScheduleResponse> getListSchedule(Long recvWindow)
throws ApiException {
return marketDataApi.getListSchedule(recvWindow);
}

/**
* 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.binance.connector.client.margin_trading.rest.model.GetAllIsolatedMarginSymbolResponse;
import com.binance.connector.client.margin_trading.rest.model.GetAllMarginAssetsResponse;
import com.binance.connector.client.margin_trading.rest.model.GetDelistScheduleResponse;
import com.binance.connector.client.margin_trading.rest.model.GetListScheduleResponse;
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;
Expand All @@ -50,7 +51,7 @@ public class MarketDataApi {

private static final String USER_AGENT =
String.format(
"binance-margin-trading/1.1.0 (Java/%s; %s; %s)",
"binance-margin-trading/2.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());
private static final boolean HAS_TIME_UNIT = false;

Expand Down Expand Up @@ -754,6 +755,139 @@ public ApiResponse<GetDelistScheduleResponse> getDelistSchedule(Long recvWindow)
return localVarApiClient.execute(localVarCall, localVarReturnType);
}

/**
* Build call for getListSchedule
*
* @param recvWindow No more than 60000 (optional)
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
* <table border="1">
* <caption>Response Details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> Get list Schedule </td><td> - </td></tr>
* </table>
*
* @see <a
* href="https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule">Get
* list Schedule (MARKET_DATA) Documentation</a>
*/
private okhttp3.Call getListScheduleCall(Long recvWindow) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] {};

// Determine Base Path to Use
if (localCustomBaseUrl != null) {
basePath = localCustomBaseUrl;
} else if (localBasePaths.length > 0) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}

Object localVarPostBody = null;

// create path and map variables
String localVarPath = "/sapi/v1/margin/list-schedule";

List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();

if (recvWindow != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow));
}

final String[] localVarAccepts = {"application/json"};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}

final String[] localVarContentTypes = {"application/x-www-form-urlencoded"};
final String localVarContentType =
localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
List<String> localVarAuthNames = new ArrayList<>();
localVarAuthNames.addAll(Arrays.asList(new String[] {}));
if (HAS_TIME_UNIT) {
localVarAuthNames.add("timeUnit");
}
return localVarApiClient.buildCall(
basePath,
localVarPath,
"GET",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAuthNames.toArray(new String[0]));
}

@SuppressWarnings("rawtypes")
private okhttp3.Call getListScheduleValidateBeforeCall(Long recvWindow) throws ApiException {
try {
Validator validator =
Validation.byDefaultProvider()
.configure()
.messageInterpolator(new ParameterMessageInterpolator())
.buildValidatorFactory()
.getValidator();
ExecutableValidator executableValidator = validator.forExecutables();

Object[] parameterValues = {recvWindow};
Method method = this.getClass().getMethod("getListSchedule", Long.class);
Set<ConstraintViolation<MarketDataApi>> violations =
executableValidator.validateParameters(this, method, parameterValues);

if (violations.size() == 0) {
return getListScheduleCall(recvWindow);
} else {
throw new ConstraintViolationException((Set) violations);
}
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new ApiException(e.getMessage());
} catch (SecurityException e) {
e.printStackTrace();
throw new ApiException(e.getMessage());
}
}

/**
* Get list Schedule (MARKET_DATA) Get the upcoming tokens or symbols listing schedule for Cross
* Margin and Isolated Margin. Weight: 100
*
* @param recvWindow No more than 60000 (optional)
* @return ApiResponse&lt;GetListScheduleResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
* @http.response.details
* <table border="1">
* <caption>Response Details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> Get list Schedule </td><td> - </td></tr>
* </table>
*
* @see <a
* href="https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule">Get
* list Schedule (MARKET_DATA) Documentation</a>
*/
public ApiResponse<GetListScheduleResponse> getListSchedule(Long recvWindow)
throws ApiException {
okhttp3.Call localVarCall = getListScheduleValidateBeforeCall(recvWindow);
java.lang.reflect.Type localVarReturnType =
new TypeToken<GetListScheduleResponse>() {}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}

/**
* Build call for queryIsolatedMarginTierData
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class RiskDataStreamApi {

private static final String USER_AGENT =
String.format(
"binance-margin-trading/1.1.0 (Java/%s; %s; %s)",
"binance-margin-trading/2.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());
private static final boolean HAS_TIME_UNIT = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class TradeApi {

private static final String USER_AGENT =
String.format(
"binance-margin-trading/1.1.0 (Java/%s; %s; %s)",
"binance-margin-trading/2.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());
private static final boolean HAS_TIME_UNIT = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class TradeDataStreamApi {

private static final String USER_AGENT =
String.format(
"binance-margin-trading/1.1.0 (Java/%s; %s; %s)",
"binance-margin-trading/2.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());
private static final boolean HAS_TIME_UNIT = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class TransferApi {

private static final String USER_AGENT =
String.format(
"binance-margin-trading/1.1.0 (Java/%s; %s; %s)",
"binance-margin-trading/2.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());
private static final boolean HAS_TIME_UNIT = false;

Expand Down
Loading