Skip to content

Commit 0c2873f

Browse files
author
github-actions
committed
Release v19.0.0
**Derivatives Trading Portfolio Margin** ### Changed (2) #### REST API - Modified response for `margin_max_borrow()` (`GET /papi/v1/margin/maxBorrowable`): - `amount`: type `number` → `string` - `borrowLimit`: type `integer` → `string` - Modified response for `new_margin_order()` (`POST /papi/v1/margin/order`): - `marginBuyBorrowAmount`: type `integer` → `string`
1 parent 592c4cf commit 0c2873f

File tree

7 files changed

+29
-14
lines changed

7 files changed

+29
-14
lines changed

CHANGELOG.md

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

3+
## 19.0.0 - 2025-09-17
4+
5+
**Derivatives Trading Portfolio Margin**
6+
7+
### Changed (2)
8+
9+
#### REST API
10+
11+
- Modified response for `margin_max_borrow()` (`GET /papi/v1/margin/maxBorrowable`):
12+
- `amount`: type `number``string`
13+
- `borrowLimit`: type `integer``string`
14+
15+
- Modified response for `new_margin_order()` (`POST /papi/v1/margin/order`):
16+
- `marginBuyBorrowAmount`: type `integer``string`
17+
318
## 18.0.0 - 2025-09-15
419

520
**Pay**

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 = "18.0.0"
3+
version = "19.0.0"
44
authors = [ "Binance" ]
55
edition = "2024"
66
resolver = "3"

examples/derivatives_trading_portfolio_margin/rest_api/account_api/change_auto_repay_futures_status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async fn main() -> Result<()> {
2323
let rest_client = DerivativesTradingPortfolioMarginRestApi::production(rest_conf);
2424

2525
// Setup the API parameters
26-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new()).build()?;
26+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string()).build()?;
2727

2828
// Make the API call
2929
let response = rest_client

src/derivatives_trading_portfolio_margin/rest_api/apis/account_api.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3936,7 +3936,7 @@ mod tests {
39363936
}
39373937

39383938
let resp_json: Value =
3939-
serde_json::from_str(r#"{"amount":1.69248805,"borrowLimit":60}"#).unwrap();
3939+
serde_json::from_str(r#"{"amount":"1.69248805","borrowLimit":"60"}"#).unwrap();
39403940
let dummy_response: models::MarginMaxBorrowResponse =
39413941
serde_json::from_value(resp_json.clone())
39423942
.expect("should parse into models::MarginMaxBorrowResponse");
@@ -4466,7 +4466,7 @@ mod tests {
44664466
TOKIO_SHARED_RT.block_on(async {
44674467
let client = MockAccountApiClient { force_error: false };
44684468

4469-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new())
4469+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string())
44704470
.build()
44714471
.unwrap();
44724472

@@ -4490,7 +4490,7 @@ mod tests {
44904490
TOKIO_SHARED_RT.block_on(async {
44914491
let client = MockAccountApiClient { force_error: false };
44924492

4493-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new())
4493+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string())
44944494
.recv_window(5000)
44954495
.build()
44964496
.unwrap();
@@ -4515,7 +4515,7 @@ mod tests {
45154515
TOKIO_SHARED_RT.block_on(async {
45164516
let client = MockAccountApiClient { force_error: true };
45174517

4518-
let params = ChangeAutoRepayFuturesStatusParams::builder(String::new())
4518+
let params = ChangeAutoRepayFuturesStatusParams::builder("true".to_string())
45194519
.build()
45204520
.unwrap();
45214521

@@ -6013,7 +6013,7 @@ mod tests {
60136013
.unwrap();
60146014

60156015
let resp_json: Value =
6016-
serde_json::from_str(r#"{"amount":1.69248805,"borrowLimit":60}"#).unwrap();
6016+
serde_json::from_str(r#"{"amount":"1.69248805","borrowLimit":"60"}"#).unwrap();
60176017
let expected_response: models::MarginMaxBorrowResponse =
60186018
serde_json::from_value(resp_json.clone())
60196019
.expect("should parse into models::MarginMaxBorrowResponse");
@@ -6039,7 +6039,7 @@ mod tests {
60396039
.unwrap();
60406040

60416041
let resp_json: Value =
6042-
serde_json::from_str(r#"{"amount":1.69248805,"borrowLimit":60}"#).unwrap();
6042+
serde_json::from_str(r#"{"amount":"1.69248805","borrowLimit":"60"}"#).unwrap();
60436043
let expected_response: models::MarginMaxBorrowResponse =
60446044
serde_json::from_value(resp_json.clone())
60456045
.expect("should parse into models::MarginMaxBorrowResponse");

src/derivatives_trading_portfolio_margin/rest_api/apis/trade_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8045,7 +8045,7 @@ mod tests {
80458045
);
80468046
}
80478047

8048-
let resp_json: Value = serde_json::from_str(r#"{"symbol":"BTCUSDT","orderId":28,"clientOrderId":"6gCrw2kRUAF9CvJDGP16IP","transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","cummulativeQuoteQty":"10.00000000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","marginBuyBorrowAmount":5,"marginBuyBorrowAsset":"BTC","fills":[{"price":"4000.00000000","qty":"1.00000000","commission":"4.00000000","commissionAsset":"USDT"},{"price":"3999.00000000","qty":"5.00000000","commission":"19.99500000","commissionAsset":"USDT"}]}"#).unwrap();
8048+
let resp_json: Value = serde_json::from_str(r#"{"symbol":"BTCUSDT","orderId":28,"clientOrderId":"6gCrw2kRUAF9CvJDGP16IP","transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","cummulativeQuoteQty":"10.00000000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","marginBuyBorrowAmount":"5","marginBuyBorrowAsset":"BTC","fills":[{"price":"4000.00000000","qty":"1.00000000","commission":"4.00000000","commissionAsset":"USDT"},{"price":"3999.00000000","qty":"5.00000000","commission":"19.99500000","commissionAsset":"USDT"}]}"#).unwrap();
80498049
let dummy_response: models::NewMarginOrderResponse =
80508050
serde_json::from_value(resp_json.clone())
80518051
.expect("should parse into models::NewMarginOrderResponse");
@@ -10206,7 +10206,7 @@ mod tests {
1020610206

1020710207
let params = NewMarginOrderParams::builder("symbol_example".to_string(),NewMarginOrderSideEnum::Buy,NewMarginOrderTypeEnum::Limit,).build().unwrap();
1020810208

10209-
let resp_json: Value = serde_json::from_str(r#"{"symbol":"BTCUSDT","orderId":28,"clientOrderId":"6gCrw2kRUAF9CvJDGP16IP","transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","cummulativeQuoteQty":"10.00000000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","marginBuyBorrowAmount":5,"marginBuyBorrowAsset":"BTC","fills":[{"price":"4000.00000000","qty":"1.00000000","commission":"4.00000000","commissionAsset":"USDT"},{"price":"3999.00000000","qty":"5.00000000","commission":"19.99500000","commissionAsset":"USDT"}]}"#).unwrap();
10209+
let resp_json: Value = serde_json::from_str(r#"{"symbol":"BTCUSDT","orderId":28,"clientOrderId":"6gCrw2kRUAF9CvJDGP16IP","transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","cummulativeQuoteQty":"10.00000000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","marginBuyBorrowAmount":"5","marginBuyBorrowAsset":"BTC","fills":[{"price":"4000.00000000","qty":"1.00000000","commission":"4.00000000","commissionAsset":"USDT"},{"price":"3999.00000000","qty":"5.00000000","commission":"19.99500000","commissionAsset":"USDT"}]}"#).unwrap();
1021010210
let expected_response : models::NewMarginOrderResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::NewMarginOrderResponse");
1021110211

1021210212
let resp = client.new_margin_order(params).await.expect("Expected a response");
@@ -10223,7 +10223,7 @@ mod tests {
1022310223

1022410224
let params = NewMarginOrderParams::builder("symbol_example".to_string(),NewMarginOrderSideEnum::Buy,NewMarginOrderTypeEnum::Limit,).quantity(dec!(1.0)).quote_order_qty(dec!(1.0)).price(dec!(1.0)).stop_price(dec!(1.0)).new_client_order_id("1".to_string()).new_order_resp_type(NewMarginOrderNewOrderRespTypeEnum::Ack).iceberg_qty(dec!(1.0)).side_effect_type(NewMarginOrderSideEffectTypeEnum::NoSideEffect).time_in_force(NewMarginOrderTimeInForceEnum::Gtc).self_trade_prevention_mode(NewMarginOrderSelfTradePreventionModeEnum::None).auto_repay_at_cancel(true).recv_window(5000).build().unwrap();
1022510225

10226-
let resp_json: Value = serde_json::from_str(r#"{"symbol":"BTCUSDT","orderId":28,"clientOrderId":"6gCrw2kRUAF9CvJDGP16IP","transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","cummulativeQuoteQty":"10.00000000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","marginBuyBorrowAmount":5,"marginBuyBorrowAsset":"BTC","fills":[{"price":"4000.00000000","qty":"1.00000000","commission":"4.00000000","commissionAsset":"USDT"},{"price":"3999.00000000","qty":"5.00000000","commission":"19.99500000","commissionAsset":"USDT"}]}"#).unwrap();
10226+
let resp_json: Value = serde_json::from_str(r#"{"symbol":"BTCUSDT","orderId":28,"clientOrderId":"6gCrw2kRUAF9CvJDGP16IP","transactTime":1507725176595,"price":"1.00000000","origQty":"10.00000000","executedQty":"10.00000000","cummulativeQuoteQty":"10.00000000","status":"FILLED","timeInForce":"GTC","type":"MARKET","side":"SELL","marginBuyBorrowAmount":"5","marginBuyBorrowAsset":"BTC","fills":[{"price":"4000.00000000","qty":"1.00000000","commission":"4.00000000","commissionAsset":"USDT"},{"price":"3999.00000000","qty":"5.00000000","commission":"19.99500000","commissionAsset":"USDT"}]}"#).unwrap();
1022710227
let expected_response : models::NewMarginOrderResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::NewMarginOrderResponse");
1022810228

1022910229
let resp = client.new_margin_order(params).await.expect("Expected a response");

src/derivatives_trading_portfolio_margin/rest_api/models/margin_max_borrow_response.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ use serde::{Deserialize, Serialize};
1818
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
1919
pub struct MarginMaxBorrowResponse {
2020
#[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
21-
pub amount: Option<rust_decimal::Decimal>,
21+
pub amount: Option<String>,
2222
#[serde(rename = "borrowLimit", skip_serializing_if = "Option::is_none")]
23-
pub borrow_limit: Option<i64>,
23+
pub borrow_limit: Option<String>,
2424
}
2525

2626
impl MarginMaxBorrowResponse {

src/derivatives_trading_portfolio_margin/rest_api/models/new_margin_order_response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct NewMarginOrderResponse {
4848
rename = "marginBuyBorrowAmount",
4949
skip_serializing_if = "Option::is_none"
5050
)]
51-
pub margin_buy_borrow_amount: Option<i64>,
51+
pub margin_buy_borrow_amount: Option<String>,
5252
#[serde(
5353
rename = "marginBuyBorrowAsset",
5454
skip_serializing_if = "Option::is_none"

0 commit comments

Comments
 (0)