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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 25 additions & 1 deletion clients/c2c/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# Changelog

## 2.0.0 - 2025-12-16

### Changed (6)

- Added parameter `endTimestamp`
- affected methods:
- `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
- Added parameter `rows`
- affected methods:
- `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
- Added parameter `startTimestamp`
- affected methods:
- `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
- Added parameter `tradeType`
- affected methods:
- `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
- Deleted parameter `endTime`
- affected methods:
- `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
- Deleted parameter `startTime`
- affected methods:
- `getC2CTradeHistory()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)

## 1.2.1 - 2025-08-07

- Update `binance/common` module to version `2.0.0`.
- Add `Content-Type` header only if there is a body.

Expand All @@ -17,4 +41,4 @@

## 1.0.0 - 2025-04-24

- Initial release
- Initial release
18 changes: 11 additions & 7 deletions clients/c2c/docs/C2CApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ All URIs are relative to *https://api.binance.com*

<a id="getC2CTradeHistory"></a>
# **getC2CTradeHistory**
> GetC2CTradeHistoryResponse getC2CTradeHistory(startTime, endTime, page, recvWindow)
> GetC2CTradeHistoryResponse getC2CTradeHistory(tradeType, startTimestamp, endTimestamp, page, rows, recvWindow)

Get C2C Trade History (USER_DATA)

Get C2C Trade History * The max interval between startTime and endTime is 30 days. * If startTime and endTime are not sent, the recent 7 days&#39; data will be returned. * The earliest startTime is supported on June 10, 2020 * Return up to 200 records per request. Weight: 1
Get C2C Trade History * The max interval between startTimestamp and endTimestamp is 30 days. * If startTimestamp and endTimestamp are not sent, the recent 30 days&#39; data will be returned. * You can only view data from the past 6 months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder Weight: 1

### Example
```java
Expand All @@ -30,12 +30,14 @@ public class Example {
defaultClient.setBasePath("https://api.binance.com");

C2CApi apiInstance = new C2CApi(defaultClient);
Long startTime = 56L; // Long |
Long endTime = 56L; // Long |
String tradeType = "tradeType_example"; // String | BUY, SELL
Long startTimestamp = 56L; // Long |
Long endTimestamp = 56L; // Long |
Long page = 56L; // Long | Default 1
Long rows = 56L; // Long | default 100, max 100
Long recvWindow = 56L; // Long |
try {
GetC2CTradeHistoryResponse result = apiInstance.getC2CTradeHistory(startTime, endTime, page, recvWindow);
GetC2CTradeHistoryResponse result = apiInstance.getC2CTradeHistory(tradeType, startTimestamp, endTimestamp, page, rows, recvWindow);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling C2CApi#getC2CTradeHistory");
Expand All @@ -52,9 +54,11 @@ public class Example {

| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **startTime** | **Long**| | [optional] |
| **endTime** | **Long**| | [optional] |
| **tradeType** | **String**| BUY, SELL | [optional] |
| **startTimestamp** | **Long**| | [optional] |
| **endTimestamp** | **Long**| | [optional] |
| **page** | **Long**| Default 1 | [optional] |
| **rows** | **Long**| default 100, max 100 | [optional] |
| **recvWindow** | **Long**| | [optional] |

### Return type
Expand Down
4 changes: 2 additions & 2 deletions clients/c2c/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-c2c</artifactId>
<version>1.2.1</version>
<version>2.0.0</version>
</dependency>
```

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

Expand Down
4 changes: 2 additions & 2 deletions clients/c2c/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-c2c</artifactId>
<name>c2c</name>
<version>1.2.1</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>2.0.0</version>
<version>2.2.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class C2CApi {

private static final String USER_AGENT =
String.format(
"binance-c2c/1.2.1 (Java/%s; %s; %s)",
"binance-c2c/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 @@ -82,9 +82,11 @@ public void setCustomBaseUrl(String customBaseUrl) {
/**
* Build call for getC2CTradeHistory
*
* @param startTime (optional)
* @param endTime (optional)
* @param tradeType BUY, SELL (optional)
* @param startTimestamp (optional)
* @param endTimestamp (optional)
* @param page Default 1 (optional)
* @param rows default 100, max 100 (optional)
* @param recvWindow (optional)
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
Expand All @@ -99,7 +101,13 @@ public void setCustomBaseUrl(String customBaseUrl) {
* Trade History (USER_DATA) Documentation</a>
*/
private okhttp3.Call getC2CTradeHistoryCall(
Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException {
String tradeType,
Long startTimestamp,
Long endTimestamp,
Long page,
Long rows,
Long recvWindow)
throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] {};
Expand All @@ -124,18 +132,28 @@ private okhttp3.Call getC2CTradeHistoryCall(
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();

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

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

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

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

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

if (recvWindow != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("recvWindow", recvWindow));
}
Expand Down Expand Up @@ -172,7 +190,13 @@ private okhttp3.Call getC2CTradeHistoryCall(

@SuppressWarnings("rawtypes")
private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException {
String tradeType,
Long startTimestamp,
Long endTimestamp,
Long page,
Long rows,
Long recvWindow)
throws ApiException {
try {
Validator validator =
Validation.byDefaultProvider()
Expand All @@ -182,11 +206,15 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
.getValidator();
ExecutableValidator executableValidator = validator.forExecutables();

Object[] parameterValues = {startTime, endTime, page, recvWindow};
Object[] parameterValues = {
tradeType, startTimestamp, endTimestamp, page, rows, recvWindow
};
Method method =
this.getClass()
.getMethod(
"getC2CTradeHistory",
String.class,
Long.class,
Long.class,
Long.class,
Long.class,
Expand All @@ -195,7 +223,8 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
executableValidator.validateParameters(this, method, parameterValues);

if (violations.size() == 0) {
return getC2CTradeHistoryCall(startTime, endTime, page, recvWindow);
return getC2CTradeHistoryCall(
tradeType, startTimestamp, endTimestamp, page, rows, recvWindow);
} else {
throw new ConstraintViolationException((Set) violations);
}
Expand All @@ -209,14 +238,16 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
}

/**
* Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between startTime
* and endTime is 30 days. * If startTime and endTime are not sent, the recent 7 days&#39; data
* will be returned. * The earliest startTime is supported on June 10, 2020 * Return up to 200
* records per request. Weight: 1
* Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between
* startTimestamp and endTimestamp is 30 days. * If startTimestamp and endTimestamp are not
* sent, the recent 30 days&#39; data will be returned. * You can only view data from the past 6
* months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder Weight: 1
*
* @param startTime (optional)
* @param endTime (optional)
* @param tradeType BUY, SELL (optional)
* @param startTimestamp (optional)
* @param endTimestamp (optional)
* @param page Default 1 (optional)
* @param rows default 100, max 100 (optional)
* @param recvWindow (optional)
* @return ApiResponse&lt;GetC2CTradeHistoryResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
Expand All @@ -232,9 +263,16 @@ private okhttp3.Call getC2CTradeHistoryValidateBeforeCall(
* Trade History (USER_DATA) Documentation</a>
*/
public ApiResponse<GetC2CTradeHistoryResponse> getC2CTradeHistory(
Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException {
String tradeType,
Long startTimestamp,
Long endTimestamp,
Long page,
Long rows,
Long recvWindow)
throws ApiException {
okhttp3.Call localVarCall =
getC2CTradeHistoryValidateBeforeCall(startTime, endTime, page, recvWindow);
getC2CTradeHistoryValidateBeforeCall(
tradeType, startTimestamp, endTimestamp, page, rows, recvWindow);
java.lang.reflect.Type localVarReturnType =
new TypeToken<GetC2CTradeHistoryResponse>() {}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ public C2cRestApi(ApiClient apiClient) {
}

/**
* Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between startTime
* and endTime is 30 days. * If startTime and endTime are not sent, the recent 7 days&#39; data
* will be returned. * The earliest startTime is supported on June 10, 2020 * Return up to 200
* records per request. Weight: 1
* Get C2C Trade History (USER_DATA) Get C2C Trade History * The max interval between
* startTimestamp and endTimestamp is 30 days. * If startTimestamp and endTimestamp are not
* sent, the recent 30 days&#39; data will be returned. * You can only view data from the past 6
* months. To see all C2C orders, please check https://c2c.binance.com/en/fiatOrder Weight: 1
*
* @param startTime (optional)
* @param endTime (optional)
* @param tradeType BUY, SELL (optional)
* @param startTimestamp (optional)
* @param endTimestamp (optional)
* @param page Default 1 (optional)
* @param rows default 100, max 100 (optional)
* @param recvWindow (optional)
* @return ApiResponse&lt;GetC2CTradeHistoryResponse&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
Expand All @@ -43,7 +45,14 @@ public C2cRestApi(ApiClient apiClient) {
* Trade History (USER_DATA) Documentation</a>
*/
public ApiResponse<GetC2CTradeHistoryResponse> getC2CTradeHistory(
Long startTime, Long endTime, Long page, Long recvWindow) throws ApiException {
return c2CApi.getC2CTradeHistory(startTime, endTime, page, recvWindow);
String tradeType,
Long startTimestamp,
Long endTimestamp,
Long page,
Long rows,
Long recvWindow)
throws ApiException {
return c2CApi.getC2CTradeHistory(
tradeType, startTimestamp, endTimestamp, page, rows, recvWindow);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@ public void initApiClient() throws ApiException {
*/
@Test
public void getC2CTradeHistoryTest() throws ApiException, CryptoException {
Long startTime = 1623319461670L;
Long endTime = 1641782889000L;
String tradeType = "BUY";
Long startTimestamp = 1623319461670L;
Long endTimestamp = 1641782889000L;
Long page = 1L;
Long rows = 100L;
Long recvWindow = 5000L;
ApiResponse<GetC2CTradeHistoryResponse> response =
api.getC2CTradeHistory(startTime, endTime, page, recvWindow);
api.getC2CTradeHistory(tradeType, startTimestamp, endTimestamp, page, rows, recvWindow);

ArgumentCaptor<Call> callArgumentCaptor = ArgumentCaptor.forClass(Call.class);
Mockito.verify(apiClientSpy)
Expand All @@ -105,10 +107,10 @@ public void getC2CTradeHistoryTest() throws ApiException, CryptoException {
Request actualRequest = captorValue.request();

assertEquals(
"startTime=1623319461670&endTime=1641782889000&page=1&recvWindow=5000&timestamp=1736393892000",
"tradeType=BUY&startTimestamp=1623319461670&endTimestamp=1641782889000&page=1&rows=100&recvWindow=5000&timestamp=1736393892000",
signInputCaptor.getValue());
assertEquals(
"d8669595398c3478db78736dbf4210642841e9920062e47dd9e504f877e947a8",
"b832525dad5bec73a86b8ad4a5bda7aaa6e4708aeb1c6f85d37ef00a5aefc693",
actualRequest.url().queryParameter("signature"));
assertEquals(
"/sapi/v1/c2c/orderMatch/listUserOrderHistory", actualRequest.url().encodedPath());
Expand Down
46 changes: 46 additions & 0 deletions clients/convert/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
docs/AcceptQuoteRequest.md
docs/AcceptQuoteResponse.md
docs/CancelLimitOrderRequest.md
docs/CancelLimitOrderResponse.md
docs/GetConvertTradeHistoryResponse.md
docs/GetConvertTradeHistoryResponseListInner.md
docs/ListAllConvertPairsResponse.md
docs/ListAllConvertPairsResponseInner.md
docs/MarketDataApi.md
docs/OrderStatusResponse.md
docs/PlaceLimitOrderRequest.md
docs/PlaceLimitOrderResponse.md
docs/QueryLimitOpenOrdersResponse.md
docs/QueryLimitOpenOrdersResponseListInner.md
docs/QueryOrderQuantityPrecisionPerAssetResponse.md
docs/QueryOrderQuantityPrecisionPerAssetResponseInner.md
docs/SendQuoteRequestRequest.md
docs/SendQuoteRequestResponse.md
docs/TradeApi.md
example_rest.md
pom.xml
pom_example.xml
src/main/java/com/binance/connector/client/convert/rest/ConvertRestApiUtil.java
src/main/java/com/binance/connector/client/convert/rest/JSON.java
src/main/java/com/binance/connector/client/convert/rest/api/ConvertRestApi.java
src/main/java/com/binance/connector/client/convert/rest/api/MarketDataApi.java
src/main/java/com/binance/connector/client/convert/rest/api/TradeApi.java
src/main/java/com/binance/connector/client/convert/rest/example/MarketDataApiExample.java
src/main/java/com/binance/connector/client/convert/rest/example/TradeApiExample.java
src/main/java/com/binance/connector/client/convert/rest/model/AcceptQuoteRequest.java
src/main/java/com/binance/connector/client/convert/rest/model/AcceptQuoteResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/CancelLimitOrderRequest.java
src/main/java/com/binance/connector/client/convert/rest/model/CancelLimitOrderResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/GetConvertTradeHistoryResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/GetConvertTradeHistoryResponseListInner.java
src/main/java/com/binance/connector/client/convert/rest/model/ListAllConvertPairsResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/ListAllConvertPairsResponseInner.java
src/main/java/com/binance/connector/client/convert/rest/model/OrderStatusResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderRequest.java
src/main/java/com/binance/connector/client/convert/rest/model/PlaceLimitOrderResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/QueryLimitOpenOrdersResponseListInner.java
src/main/java/com/binance/connector/client/convert/rest/model/QueryOrderQuantityPrecisionPerAssetResponse.java
src/main/java/com/binance/connector/client/convert/rest/model/QueryOrderQuantityPrecisionPerAssetResponseInner.java
src/main/java/com/binance/connector/client/convert/rest/model/SendQuoteRequestRequest.java
src/main/java/com/binance/connector/client/convert/rest/model/SendQuoteRequestResponse.java
1 change: 1 addition & 0 deletions clients/convert/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.12.0
Loading
Loading