Skip to content
Merged
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
2 changes: 1 addition & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For Spot (Spot package):
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-spot</artifactId>
<version>9.0.0</version>
<version>10.0.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Each connector is published as a separate maven dependency. For example:
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-spot</artifactId>
<version>9.0.0</version>
<version>10.0.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion clients/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

<artifactId>binance-common</artifactId>
<name>common</name>
<version>2.3.1</version>
<version>2.4.1</version>
<packaging>jar</packaging>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ public void onWebSocketText(String message) {
try {
JsonElement root = JsonParser.parseString(message);
JsonObject obj = root.getAsJsonObject();

if (handleShutdownMessage(obj)) {
return;
}

JsonElement idElem = obj.get("id");
String id = idElem == null ? null : idElem.getAsString();
RequestWrapperDTO requestWrapperDTO = null;
Expand All @@ -455,8 +460,8 @@ public void onWebSocketText(String message) {
}

if (requestWrapperDTO == null) {
JsonElement eventElem = obj.get("event");
for (BlockingQueue<String> streamQueue : streamQueues) {
JsonElement eventElem = obj.get("event");
streamQueue.offer(eventElem != null ? eventElem.toString() : message);
}
return;
Expand Down Expand Up @@ -493,6 +498,23 @@ public boolean canReconnect() {
return isReady && pendingRequest.isEmpty();
}

protected boolean handleShutdownMessage(JsonObject jsonObj) {
JsonElement eventElem = jsonObj.get("event");
if (eventElem != null) {
JsonObject eventElemObj = eventElem.getAsJsonObject();
JsonElement eElement = eventElemObj.get("e");
if (eElement != null && "serverShutdown".equals(eElement.getAsString())) {
if (canReconnect()) {
connect();
} else {
pendingReconnect = true;
}
return true;
}
}
return false;
}

protected void beforeConnect() {
// session exists and is open, it's a reconnect
if (this.session != null && this.session.isOpen()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ public void onWebSocketText(String message) {
try {
JsonElement root = JsonParser.parseString(message);
JsonObject obj = root.getAsJsonObject();

if (handleShutdownMessage(obj)) {
return;
}

// Response to subscribe
JsonElement id = obj.get("id");
if (id != null) {
Expand Down
12 changes: 12 additions & 0 deletions clients/derivatives-trading-coin-futures/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 7.0.0 - 2026-03-18

### Changed (1)

#### REST API

- Modified response for `exchangeInformation()` (`GET /dapi/v1/exchangeInfo`):
- `symbols`.items: property `orderTypes` added
- `symbols`.items: property `OrderType` deleted
- `symbols`.items: item property `orderTypes` added
- `symbols`.items: item property `OrderType` deleted

## 6.0.0 - 2026-02-12

### Changed (2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**filters** | [**List&lt;ExchangeInformationResponseSymbolsInnerFiltersInner&gt;**](ExchangeInformationResponseSymbolsInnerFiltersInner.md) | | [optional] |
|**orderType** | **List&lt;String&gt;** | | [optional] |
|**orderTypes** | **List&lt;String&gt;** | | [optional] |
|**timeInForce** | **List&lt;String&gt;** | | [optional] |
|**liquidationFee** | **String** | | [optional] |
|**marketTakeBound** | **String** | | [optional] |
Expand Down
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-derivatives-trading-coin-futures</artifactId>
<version>6.0.0</version>
<version>7.0.0</version>
</dependency>
```

Expand Down Expand Up @@ -91,7 +91,7 @@ by:
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-derivatives-trading-coin-futures</artifactId>
<version>6.0.0</version>
<version>7.0.0</version>
</dependency>
```

Expand Down
4 changes: 2 additions & 2 deletions clients/derivatives-trading-coin-futures/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-derivatives-trading-coin-futures</artifactId>
<name>derivatives-trading-coin-futures</name>
<version>6.0.0</version>
<version>7.0.0</version>
<packaging>jar</packaging>

<parent>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>io.github.binance</groupId>
<artifactId>binance-common</artifactId>
<version>2.3.1</version>
<version>2.4.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class AccountApi {

private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.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 @@ -69,7 +69,7 @@ public class MarketDataApi {

private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.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 @@ -42,7 +42,7 @@ public class PortfolioMarginEndpointsApi {

private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.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 @@ -79,7 +79,7 @@ public class TradeApi {

private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.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 UserDataStreamsApi {

private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.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 @@ -48,11 +48,11 @@ public class ExchangeInformationResponseSymbolsInner {
@jakarta.annotation.Nullable
private List<@Valid ExchangeInformationResponseSymbolsInnerFiltersInner> filters;

public static final String SERIALIZED_NAME_ORDER_TYPE = "OrderType";
public static final String SERIALIZED_NAME_ORDER_TYPES = "orderTypes";

@SerializedName(SERIALIZED_NAME_ORDER_TYPE)
@SerializedName(SERIALIZED_NAME_ORDER_TYPES)
@jakarta.annotation.Nullable
private List<String> orderType;
private List<String> orderTypes;

public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce";

Expand Down Expand Up @@ -227,32 +227,32 @@ public void setFilters(
this.filters = filters;
}

public ExchangeInformationResponseSymbolsInner orderType(
@jakarta.annotation.Nullable List<String> orderType) {
this.orderType = orderType;
public ExchangeInformationResponseSymbolsInner orderTypes(
@jakarta.annotation.Nullable List<String> orderTypes) {
this.orderTypes = orderTypes;
return this;
}

public ExchangeInformationResponseSymbolsInner addOrderTypeItem(String orderTypeItem) {
if (this.orderType == null) {
this.orderType = new ArrayList<>();
public ExchangeInformationResponseSymbolsInner addOrderTypesItem(String orderTypesItem) {
if (this.orderTypes == null) {
this.orderTypes = new ArrayList<>();
}
this.orderType.add(orderTypeItem);
this.orderTypes.add(orderTypesItem);
return this;
}

/**
* Get orderType
* Get orderTypes
*
* @return orderType
* @return orderTypes
*/
@jakarta.annotation.Nullable
public List<String> getOrderType() {
return orderType;
public List<String> getOrderTypes() {
return orderTypes;
}

public void setOrderType(@jakarta.annotation.Nullable List<String> orderType) {
this.orderType = orderType;
public void setOrderTypes(@jakarta.annotation.Nullable List<String> orderTypes) {
this.orderTypes = orderTypes;
}

public ExchangeInformationResponseSymbolsInner timeInForce(
Expand Down Expand Up @@ -743,7 +743,8 @@ public boolean equals(Object o) {
ExchangeInformationResponseSymbolsInner exchangeInformationResponseSymbolsInner =
(ExchangeInformationResponseSymbolsInner) o;
return Objects.equals(this.filters, exchangeInformationResponseSymbolsInner.filters)
&& Objects.equals(this.orderType, exchangeInformationResponseSymbolsInner.orderType)
&& Objects.equals(
this.orderTypes, exchangeInformationResponseSymbolsInner.orderTypes)
&& Objects.equals(
this.timeInForce, exchangeInformationResponseSymbolsInner.timeInForce)
&& Objects.equals(
Expand Down Expand Up @@ -800,7 +801,7 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(
filters,
orderType,
orderTypes,
timeInForce,
liquidationFee,
marketTakeBound,
Expand Down Expand Up @@ -831,7 +832,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ExchangeInformationResponseSymbolsInner {\n");
sb.append(" filters: ").append(toIndentedString(filters)).append("\n");
sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n");
sb.append(" orderTypes: ").append(toIndentedString(orderTypes)).append("\n");
sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n");
sb.append(" liquidationFee: ").append(toIndentedString(liquidationFee)).append("\n");
sb.append(" marketTakeBound: ").append(toIndentedString(marketTakeBound)).append("\n");
Expand Down Expand Up @@ -875,13 +876,13 @@ public String toUrlQueryString() {
((Collection) filtersValue)
.stream().map(Object::toString).collect(Collectors.joining(","));
sb.append("filters=").append(urlEncode(filtersValueAsString)).append("");
Object orderTypeValue = getOrderType();
String orderTypeValueAsString = "";
orderTypeValueAsString =
Object orderTypesValue = getOrderTypes();
String orderTypesValueAsString = "";
orderTypesValueAsString =
(String)
((Collection) orderTypeValue)
((Collection) orderTypesValue)
.stream().map(Object::toString).collect(Collectors.joining(","));
sb.append("orderType=").append(urlEncode(orderTypeValueAsString)).append("");
sb.append("orderTypes=").append(urlEncode(orderTypesValueAsString)).append("");
Object timeInForceValue = getTimeInForce();
String timeInForceValueAsString = "";
timeInForceValueAsString =
Expand Down Expand Up @@ -1021,7 +1022,7 @@ private String toIndentedString(Object o) {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("filters");
openapiFields.add("OrderType");
openapiFields.add("orderTypes");
openapiFields.add("timeInForce");
openapiFields.add("liquidationFee");
openapiFields.add("marketTakeBound");
Expand Down Expand Up @@ -1092,14 +1093,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
// ensure the optional json data is an array if present
if (jsonObj.get("OrderType") != null
&& !jsonObj.get("OrderType").isJsonNull()
&& !jsonObj.get("OrderType").isJsonArray()) {
if (jsonObj.get("orderTypes") != null
&& !jsonObj.get("orderTypes").isJsonNull()
&& !jsonObj.get("orderTypes").isJsonArray()) {
throw new IllegalArgumentException(
String.format(
"Expected the field `OrderType` to be an array in the JSON string but"
"Expected the field `orderTypes` to be an array in the JSON string but"
+ " got `%s`",
jsonObj.get("OrderType").toString()));
jsonObj.get("orderTypes").toString()));
}
// ensure the optional json data is an array if present
if (jsonObj.get("timeInForce") != null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class DerivativesTradingCoinFuturesWebSocketApi {
private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());

private AccountApi accountApi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
public class DerivativesTradingCoinFuturesWebSocketStreams {
private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());

private final StreamConnectionInterface connection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
public class WebsocketMarketStreamsApi {
private static final String USER_AGENT =
String.format(
"binance-derivatives-trading-coin-futures/6.0.0 (Java/%s; %s; %s)",
"binance-derivatives-trading-coin-futures/7.0.0 (Java/%s; %s; %s)",
SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch());

private StreamConnectionInterface connection;
Expand Down
9 changes: 9 additions & 0 deletions clients/derivatives-trading-options/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 6.0.0 - 2026-03-18

### Changed (1)

#### REST API

- Modified response for `cancelAllOptionOrdersOnSpecificSymbol()` (`DELETE /eapi/v1/allOpenOrders`):
- `code`: type `integer` → `string`

## 5.0.0 - 2025-12-16

### Changed (2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**code** | **Long** | | [optional] |
|**code** | **String** | | [optional] |
|**msg** | **String** | | [optional] |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ No authorization required

Set Auto-Cancel All Open Orders (Kill-Switch) Config (TRADE)

This endpoint sets the parameters of the auto-cancel feature which cancels all open orders (both market maker protection and non market maker protection order types) of the underlying symbol at the end of the specified countdown time period if no heartbeat message is sent. After the countdown time period, all open orders will be cancelled and new orders will be rejected with error code -2010 until either a heartbeat message is sent or the auto-cancel feature is turned off by setting countdownTime to 0. * This rest endpoint sets up the parameters to cancel your open orders in case of an outage or disconnection. * Example usage: Call this endpoint with a countdownTime value of 10000 (10 seconds) to turn on the auto-cancel feature. If the corresponding countdownCancelAllHeartBeat endpoint is not called within 10 seconds with the specified underlying symbol, all open orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped. * The system will check all countdowns approximately every 1000 milliseconds, **please note that sufficient redundancy should be considered when using this function**. We do not recommend setting the countdown time to be too precise or too small. Weight: 1
This endpoint sets the parameters of the auto-cancel feature which cancels all open orders (both market maker protection and non market maker protection order types) of the underlying symbol at the end of the specified countdown time period if no heartbeat message is sent. After the countdown time period, all open orders will be cancelled and new orders will be rejected with error code -2010 until either a heartbeat message is sent or the auto-cancel feature is turned off by setting countdownTime to 0. * This rest endpoint sets up the parameters to cancel your open orders in case of an outage or disconnection. * Example usage: Call this endpoint with a countdownTime value of 10000 (10 seconds) to turn on the auto-cancel feature. If the corresponding countdownCancelAllHeartBeat endpoint is not called within 10 seconds with the specified underlying symbol, all open orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped. * The system will check all countdowns approximately every 100 milliseconds, **please note that sufficient redundancy should be considered when using this function**. We do not recommend setting the countdown time to be too precise or too small. Weight: 1

### Example
```java
Expand Down
Loading
Loading