Skip to content

Commit 19a3e19

Browse files
author
github-actions
committed
Release v28.0.0
**C2c** ### Changed (2) - Added parameter `rows` - affected methods: - `get_c2_c_trade_history()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`) - Added parameter `tradeType` - affected methods: - `get_c2_c_trade_history()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
1 parent 2b712ce commit 19a3e19

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 28.0.0 - 2025-11-06
4+
5+
**C2c**
6+
7+
### Changed (2)
8+
9+
- Added parameter `rows`
10+
- affected methods:
11+
- `get_c2_c_trade_history()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
12+
- Added parameter `tradeType`
13+
- affected methods:
14+
- `get_c2_c_trade_history()` (`GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`)
15+
316
## 27.0.0 - 2025-10-30
417

518
**Simple Earn**

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "binance-sdk"
3-
version = "27.0.0"
3+
version = "28.0.0"
44
authors = [ "Binance" ]
55
edition = "2024"
66
resolver = "3"

src/c2c/rest_api/apis/c2_c_api.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ impl C2CApiClient {
5555
#[derive(Clone, Debug, Builder, Default)]
5656
#[builder(pattern = "owned", build_fn(error = "ParamBuildError"))]
5757
pub struct GetC2CTradeHistoryParams {
58+
/// BUY, SELL
59+
///
60+
/// This field is **optional.
61+
#[builder(setter(into), default)]
62+
pub trade_type: Option<String>,
5863
///
5964
/// The `start_time` parameter.
6065
///
@@ -72,6 +77,11 @@ pub struct GetC2CTradeHistoryParams {
7277
/// This field is **optional.
7378
#[builder(setter(into), default)]
7479
pub page: Option<i64>,
80+
/// default 100, max 100
81+
///
82+
/// This field is **optional.
83+
#[builder(setter(into), default)]
84+
pub rows: Option<i64>,
7585
///
7686
/// The `recv_window` parameter.
7787
///
@@ -96,14 +106,20 @@ impl C2CApi for C2CApiClient {
96106
params: GetC2CTradeHistoryParams,
97107
) -> anyhow::Result<RestApiResponse<models::GetC2CTradeHistoryResponse>> {
98108
let GetC2CTradeHistoryParams {
109+
trade_type,
99110
start_time,
100111
end_time,
101112
page,
113+
rows,
102114
recv_window,
103115
} = params;
104116

105117
let mut query_params = BTreeMap::new();
106118

119+
if let Some(rw) = trade_type {
120+
query_params.insert("tradeType".to_string(), json!(rw));
121+
}
122+
107123
if let Some(rw) = start_time {
108124
query_params.insert("startTime".to_string(), json!(rw));
109125
}
@@ -116,6 +132,10 @@ impl C2CApi for C2CApiClient {
116132
query_params.insert("page".to_string(), json!(rw));
117133
}
118134

135+
if let Some(rw) = rows {
136+
query_params.insert("rows".to_string(), json!(rw));
137+
}
138+
119139
if let Some(rw) = recv_window {
120140
query_params.insert("recvWindow".to_string(), json!(rw));
121141
}
@@ -216,7 +236,7 @@ mod tests {
216236
TOKIO_SHARED_RT.block_on(async {
217237
let client = MockC2CApiClient { force_error: false };
218238

219-
let params = GetC2CTradeHistoryParams::builder().start_time(1623319461670).end_time(1641782889000).page(1).recv_window(5000).build().unwrap();
239+
let params = GetC2CTradeHistoryParams::builder().trade_type("trade_type_example".to_string()).start_time(1623319461670).end_time(1641782889000).page(1).rows(100).recv_window(5000).build().unwrap();
220240

221241
let resp_json: Value = serde_json::from_str(r#"{"code":"000000","message":"success","data":[{"orderNumber":"20219644646554779648","advNo":"11218246497340923904","tradeType":"SELL","asset":"BUSD","fiat":"CNY","fiatSymbol":"¥","amount":"5000.00000000","totalPrice":"33400.00000000","unitPrice":"6.68","orderStatus":"COMPLETED","createTime":1619361369000,"commission":"0","counterPartNickName":"ab***","advertisementRole":"TAKER"}],"total":1,"success":true}"#).unwrap();
222242
let expected_response : models::GetC2CTradeHistoryResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::GetC2CTradeHistoryResponse");

src/c2c/rest_api/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ impl RestApi {
9494
/// Get C2C Trade History
9595
///
9696
/// * The max interval between startTime and endTime is 30 days.
97-
/// * If startTime and endTime are not sent, the recent 7 days' data will be returned.
98-
/// * The earliest startTime is supported on June 10, 2020
99-
/// * Return up to 200 records per request.
97+
/// * If startTime and endTime are not sent, the recent 30 days' data will be returned.
98+
/// * You can only view data from the past 6 months. To see all C2C orders, please check <https://c2c.binance.com/en/fiatOrder>
10099
///
101100
/// Weight: 1
102101
///

0 commit comments

Comments
 (0)