Skip to content

Commit 67b8d25

Browse files
authored
Merge #525
2 parents 9ce8b3e + d4296f1 commit 67b8d25

9 files changed

Lines changed: 34 additions & 34 deletions

File tree

clients/derivatives_trading_usds_futures/CHANGELOG.md

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

3+
## 10.0.1 - 2026-04-21
4+
5+
### Changed (2)
6+
7+
#### REST API
8+
9+
- Modified parameter `price` to optional `float` for `modify_order()` (`PUT /fapi/v1/order`)
10+
11+
#### WebSocket API
12+
13+
- Modified parameter `price` to optional `float` for `modify_order()` method (`order.modify`)
14+
315
## 10.0.0 - 2026-04-20
416

517
### Changed (3)

clients/derivatives_trading_usds_futures/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "binance-sdk-derivatives-trading-usds-futures"
3-
version = "10.0.0"
3+
version = "10.0.1"
44
description = "Official Binance Derivatives Trading Usds Futures SDK - A lightweight library that provides a convenient interface to Binance's DerivativesTradingUsdsFutures REST API, WebSocket API and WebSocket Streams."
55
authors = ["Binance"]
66
license = "MIT"

clients/derivatives_trading_usds_futures/src/binance_sdk_derivatives_trading_usds_futures/rest_api/rest_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,7 +2701,7 @@ def modify_order(
27012701
symbol: Union[str, None],
27022702
side: Union[ModifyOrderSideEnum, None],
27032703
quantity: Union[float, None],
2704-
price: Union[float, None],
2704+
price: Optional[float] = None,
27052705
order_id: Optional[int] = None,
27062706
orig_client_order_id: Optional[str] = None,
27072707
price_match: Optional[ModifyOrderPriceMatchEnum] = None,
@@ -2729,7 +2729,7 @@ def modify_order(
27292729
symbol (Union[str, None]):
27302730
side (Union[ModifyOrderSideEnum, None]): `SELL`, `BUY`
27312731
quantity (Union[float, None]): Order quantity, cannot be sent with `closePosition=true`
2732-
price (Union[float, None]):
2732+
price (Optional[float] = None):
27332733
order_id (Optional[int] = None):
27342734
orig_client_order_id (Optional[str] = None):
27352735
price_match (Optional[ModifyOrderPriceMatchEnum] = None): only avaliable for `LIMIT`/`STOP`/`TAKE_PROFIT` order; can be set to `OPPONENT`/ `OPPONENT_5`/ `OPPONENT_10`/ `OPPONENT_20`: /`QUEUE`/ `QUEUE_5`/ `QUEUE_10`/ `QUEUE_20`; Can't be passed together with `price`

clients/derivatives_trading_usds_futures/src/binance_sdk_derivatives_trading_usds_futures/websocket_api/api/trade_api.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ async def modify_order(
169169
symbol: Union[str, None],
170170
side: Union[ModifyOrderSideEnum, None],
171171
quantity: Union[float, None],
172-
price: Union[float, None],
172+
price: Optional[float] = None,
173173
id: Optional[str] = None,
174174
order_id: Optional[int] = None,
175175
orig_client_order_id: Optional[str] = None,
@@ -199,7 +199,7 @@ async def modify_order(
199199
symbol (Union[str, None]):
200200
side (Union[ModifyOrderSideEnum, None]): `SELL`, `BUY`
201201
quantity (Union[float, None]): Order quantity, cannot be sent with `closePosition=true`
202-
price (Union[float, None]):
202+
price (Optional[float] = None):
203203
id (Optional[str] = None): Unique WebSocket request ID.
204204
order_id (Optional[int] = None):
205205
orig_client_order_id (Optional[str] = None):
@@ -226,10 +226,6 @@ async def modify_order(
226226
raise RequiredError(
227227
field="quantity", error_message="Missing required parameter 'quantity'"
228228
)
229-
if price is None:
230-
raise RequiredError(
231-
field="price", error_message="Missing required parameter 'price'"
232-
)
233229

234230
params = {
235231
"symbol": symbol,

clients/derivatives_trading_usds_futures/src/binance_sdk_derivatives_trading_usds_futures/websocket_api/websocket_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ async def modify_order(
449449
symbol: Union[str, None],
450450
side: Union[ModifyOrderSideEnum, None],
451451
quantity: Union[float, None],
452-
price: Union[float, None],
452+
price: Optional[float] = None,
453453
id: Optional[str] = None,
454454
order_id: Optional[int] = None,
455455
orig_client_order_id: Optional[str] = None,
@@ -477,7 +477,7 @@ async def modify_order(
477477
symbol (Union[str, None]):
478478
side (Union[ModifyOrderSideEnum, None]): `SELL`, `BUY`
479479
quantity (Union[float, None]): Order quantity, cannot be sent with `closePosition=true`
480-
price (Union[float, None]):
480+
price (Optional[float] = None):
481481
id (Optional[str] = None): Unique WebSocket request ID.
482482
order_id (Optional[int] = None):
483483
orig_client_order_id (Optional[str] = None):

clients/derivatives_trading_usds_futures/tests/unit/websocket_api/test_trade_api_ws_api.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -702,26 +702,6 @@ async def test_modify_order_missing_required_param_quantity(self):
702702
):
703703
await self.websocket_api.modify_order(**params)
704704

705-
@pytest.mark.asyncio
706-
async def test_modify_order_missing_required_param_price(self):
707-
"""Test that modify_order() raises RequiredError when 'price' is missing."""
708-
709-
params = {
710-
"symbol": "symbol_example",
711-
"side": ModifyOrderSideEnum["BUY"].value,
712-
"quantity": 1.0,
713-
"price": 1.0,
714-
"id": "e9d6b4349871b40611412680b3445fac",
715-
"order_id": 1,
716-
"orig_client_order_id": "1",
717-
"price_match": ModifyOrderPriceMatchEnum["NONE"].value,
718-
"recv_window": 5000,
719-
}
720-
params["price"] = None
721-
722-
with pytest.raises(RequiredError, match="Missing required parameter 'price'"):
723-
await self.websocket_api.modify_order(**params)
724-
725705
@pytest.mark.asyncio
726706
async def test_modify_order_server_error(self):
727707
"""Test that modify_order() raises an error when the server returns an error."""

clients/spot/CHANGELOG.md

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

3+
## 8.2.1 - 2026-04-21
4+
5+
### Changed (1)
6+
7+
- Update `user_data_stream_subscribe_signature()` and `user_data_stream_subscribe()` error checks.
8+
39
## 8.2.0 - 2026-04-20
410

511
### Changed (2)

clients/spot/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "binance-sdk-spot"
3-
version = "8.2.0"
3+
version = "8.2.1"
44
description = "Official Binance Spot SDK - A lightweight library that provides a convenient interface to Binance's Spot REST API, WebSocket API and WebSocket Streams."
55
authors = ["Binance"]
66
license = "MIT"

clients/spot/src/binance_sdk_spot/websocket_api/websocket_api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,8 +3033,11 @@ async def user_data_stream_subscribe(
30333033

30343034
response = await self._userDataStreamApi.user_data_stream_subscribe(id)
30353035
data = response.data()
3036-
if data.get("result") is None or data.get("error") is not None:
3036+
if isinstance(data, dict) and (data.get("result") is None or data.get("error") is not None):
30373037
raise ValueError(data)
3038+
elif data.result is None or getattr(data, "error", None) is not None:
3039+
raise ValueError(data)
3040+
30383041
stream = await RequestStream(
30393042
self,
30403043
data.result.subscription_id,
@@ -3072,8 +3075,11 @@ async def user_data_stream_subscribe_signature(
30723075
id, recv_window
30733076
)
30743077
data = response.data()
3075-
if data.get("result") is None or data.get("error") is not None:
3078+
if isinstance(data, dict) and (data.get("result") is None or data.get("error") is not None):
30763079
raise ValueError(data)
3080+
elif data.result is None or getattr(data, "error", None) is not None:
3081+
raise ValueError(data)
3082+
30773083
stream = await RequestStream(
30783084
self,
30793085
data.result.subscription_id,

0 commit comments

Comments
 (0)