Skip to content

Commit 77853db

Browse files
authored
Merge pull request #414 from binance/release_clients_2025_08_22
2 parents 22572a6 + 86f3fde commit 77853db

File tree

320 files changed

+14691
-9360
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

320 files changed

+14691
-9360
lines changed

clients/algo/CHANGELOG.md

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

3+
## 1.3.0 - 2025-08-22
4+
5+
### Changed (1)
6+
7+
- Standardized type hints for required parameters by replacing `default = None` annotations with `Union[..., None]`
8+
39
## 1.2.0 - 2025-08-07
410

511
### Changed (1)

clients/algo/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "binance-sdk-algo"
3-
version = "1.2.0"
3+
version = "1.3.0"
44
description = "Official Binance Algo SDK - A lightweight library that provides a convenient interface to Binance's Algo REST API"
55
authors = ["Binance"]
66
license = "MIT"
@@ -20,7 +20,7 @@ black = "^25.1.0"
2020
ruff = "^0.12.0"
2121
pycryptodome = "^3.17"
2222
aiohttp = "^3.9"
23-
binance-common = "1.2.0"
23+
binance-common = "2.0.0"
2424
pytest = { version = ">=6.2.5", optional = true }
2525

2626
[tool.poetry.extras]

clients/algo/src/binance_sdk_algo/rest_api/api/future_algo_api.py

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Do not edit the class manually.
99
"""
1010

11-
from typing import Optional
11+
from typing import Optional, Union
1212
from requests import Session
1313
from binance_common.configuration import ConfigurationRestAPI
1414
from binance_common.errors import RequiredError
@@ -39,7 +39,7 @@ def __init__(
3939

4040
def cancel_algo_order_future_algo(
4141
self,
42-
algo_id: int = None,
42+
algo_id: Union[int, None],
4343
recv_window: Optional[int] = None,
4444
) -> ApiResponse[CancelAlgoOrderFutureAlgoResponse]:
4545
"""
@@ -55,8 +55,8 @@ def cancel_algo_order_future_algo(
5555
Weight: 1
5656
5757
Args:
58-
algo_id (int): eg. 14511
59-
recv_window (Optional[int]):
58+
algo_id (Union[int, None]): eg. 14511
59+
recv_window (Optional[int] = None):
6060
6161
Returns:
6262
ApiResponse[CancelAlgoOrderFutureAlgoResponse]
@@ -102,7 +102,7 @@ def query_current_algo_open_orders_future_algo(
102102
Weight: 1
103103
104104
Args:
105-
recv_window (Optional[int]):
105+
recv_window (Optional[int] = None):
106106
107107
Returns:
108108
ApiResponse[QueryCurrentAlgoOpenOrdersFutureAlgoResponse]
@@ -149,13 +149,13 @@ def query_historical_algo_orders_future_algo(
149149
Weight: 1
150150
151151
Args:
152-
symbol (Optional[str]): Trading symbol eg. BTCUSDT
153-
side (Optional[str]): BUY or SELL
154-
start_time (Optional[int]): in milliseconds eg.1641522717552
155-
end_time (Optional[int]): in milliseconds eg.1641522526562
156-
page (Optional[int]): Default is 1
157-
page_size (Optional[int]): MIN 1, MAX 100; Default 100
158-
recv_window (Optional[int]):
152+
symbol (Optional[str] = None): Trading symbol eg. BTCUSDT
153+
side (Optional[str] = None): BUY or SELL
154+
start_time (Optional[int] = None): in milliseconds eg.1641522717552
155+
end_time (Optional[int] = None): in milliseconds eg.1641522526562
156+
page (Optional[int] = None): Default is 1
157+
page_size (Optional[int] = None): MIN 1, MAX 100; Default 100
158+
recv_window (Optional[int] = None):
159159
160160
Returns:
161161
ApiResponse[QueryHistoricalAlgoOrdersFutureAlgoResponse]
@@ -189,7 +189,7 @@ def query_historical_algo_orders_future_algo(
189189

190190
def query_sub_orders_future_algo(
191191
self,
192-
algo_id: int = None,
192+
algo_id: Union[int, None],
193193
page: Optional[int] = None,
194194
page_size: Optional[int] = None,
195195
recv_window: Optional[int] = None,
@@ -207,10 +207,10 @@ def query_sub_orders_future_algo(
207207
Weight: 1
208208
209209
Args:
210-
algo_id (int): eg. 14511
211-
page (Optional[int]): Default is 1
212-
page_size (Optional[int]): MIN 1, MAX 100; Default 100
213-
recv_window (Optional[int]):
210+
algo_id (Union[int, None]): eg. 14511
211+
page (Optional[int] = None): Default is 1
212+
page_size (Optional[int] = None): MIN 1, MAX 100; Default 100
213+
recv_window (Optional[int] = None):
214214
215215
Returns:
216216
ApiResponse[QuerySubOrdersFutureAlgoResponse]
@@ -246,10 +246,10 @@ def query_sub_orders_future_algo(
246246

247247
def time_weighted_average_price_future_algo(
248248
self,
249-
symbol: str = None,
250-
side: str = None,
251-
quantity: float = None,
252-
duration: int = None,
249+
symbol: Union[str, None],
250+
side: Union[str, None],
251+
quantity: Union[float, None],
252+
duration: Union[int, None],
253253
position_side: Optional[str] = None,
254254
client_algo_id: Optional[str] = None,
255255
reduce_only: Optional[bool] = None,
@@ -277,15 +277,15 @@ def time_weighted_average_price_future_algo(
277277
Weight: 3000
278278
279279
Args:
280-
symbol (str): Trading symbol eg. BTCUSDT
281-
side (str): Trading side ( BUY or SELL )
282-
quantity (float): Quantity of base asset; Maximum notional per order is 200k, 2mm or 10mm, depending on symbol. Please reduce your size if you order is above the maximum notional per order.
283-
duration (int): Duration for TWAP orders in seconds. [300, 86400]
284-
position_side (Optional[str]): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
285-
client_algo_id (Optional[str]): A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
286-
reduce_only (Optional[bool]): "true" or "false". Default "false"; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
287-
limit_price (Optional[float]): Limit price of the order; If it is not sent, will place order by market price by default
288-
recv_window (Optional[int]):
280+
symbol (Union[str, None]): Trading symbol eg. BTCUSDT
281+
side (Union[str, None]): Trading side ( BUY or SELL )
282+
quantity (Union[float, None]): Quantity of base asset; Maximum notional per order is 200k, 2mm or 10mm, depending on symbol. Please reduce your size if you order is above the maximum notional per order.
283+
duration (Union[int, None]): Duration for TWAP orders in seconds. [300, 86400]
284+
position_side (Optional[str] = None): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
285+
client_algo_id (Optional[str] = None): A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
286+
reduce_only (Optional[bool] = None): "true" or "false". Default "false"; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
287+
limit_price (Optional[float] = None): Limit price of the order; If it is not sent, will place order by market price by default
288+
recv_window (Optional[int] = None):
289289
290290
Returns:
291291
ApiResponse[TimeWeightedAveragePriceFutureAlgoResponse]
@@ -338,10 +338,10 @@ def time_weighted_average_price_future_algo(
338338

339339
def volume_participation_future_algo(
340340
self,
341-
symbol: str = None,
342-
side: str = None,
343-
quantity: float = None,
344-
urgency: str = None,
341+
symbol: Union[str, None],
342+
side: Union[str, None],
343+
quantity: Union[float, None],
344+
urgency: Union[str, None],
345345
position_side: Optional[str] = None,
346346
client_algo_id: Optional[str] = None,
347347
reduce_only: Optional[bool] = None,
@@ -366,15 +366,15 @@ def volume_participation_future_algo(
366366
Weight: 300
367367
368368
Args:
369-
symbol (str): Trading symbol eg. BTCUSDT
370-
side (str): Trading side ( BUY or SELL )
371-
quantity (float): Quantity of base asset; Maximum notional per order is 200k, 2mm or 10mm, depending on symbol. Please reduce your size if you order is above the maximum notional per order.
372-
urgency (str): Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH
373-
position_side (Optional[str]): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
374-
client_algo_id (Optional[str]): A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
375-
reduce_only (Optional[bool]): "true" or "false". Default "false"; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
376-
limit_price (Optional[float]): Limit price of the order; If it is not sent, will place order by market price by default
377-
recv_window (Optional[int]):
369+
symbol (Union[str, None]): Trading symbol eg. BTCUSDT
370+
side (Union[str, None]): Trading side ( BUY or SELL )
371+
quantity (Union[float, None]): Quantity of base asset; Maximum notional per order is 200k, 2mm or 10mm, depending on symbol. Please reduce your size if you order is above the maximum notional per order.
372+
urgency (Union[str, None]): Represent the relative speed of the current execution; ENUM: LOW, MEDIUM, HIGH
373+
position_side (Optional[str] = None): Default `BOTH` for One-way Mode ; `LONG` or `SHORT` for Hedge Mode. It must be sent in Hedge Mode.
374+
client_algo_id (Optional[str] = None): A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
375+
reduce_only (Optional[bool] = None): "true" or "false". Default "false"; Cannot be sent in Hedge Mode; Cannot be sent when you open a position
376+
limit_price (Optional[float] = None): Limit price of the order; If it is not sent, will place order by market price by default
377+
recv_window (Optional[int] = None):
378378
379379
Returns:
380380
ApiResponse[VolumeParticipationFutureAlgoResponse]

clients/algo/src/binance_sdk_algo/rest_api/api/spot_algo_api.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Do not edit the class manually.
99
"""
1010

11-
from typing import Optional
11+
from typing import Optional, Union
1212
from requests import Session
1313
from binance_common.configuration import ConfigurationRestAPI
1414
from binance_common.errors import RequiredError
@@ -38,7 +38,7 @@ def __init__(
3838

3939
def cancel_algo_order_spot_algo(
4040
self,
41-
algo_id: int = None,
41+
algo_id: Union[int, None],
4242
recv_window: Optional[int] = None,
4343
) -> ApiResponse[CancelAlgoOrderSpotAlgoResponse]:
4444
"""
@@ -51,8 +51,8 @@ def cancel_algo_order_spot_algo(
5151
Weight: 1
5252
5353
Args:
54-
algo_id (int): eg. 14511
55-
recv_window (Optional[int]):
54+
algo_id (Union[int, None]): eg. 14511
55+
recv_window (Optional[int] = None):
5656
5757
Returns:
5858
ApiResponse[CancelAlgoOrderSpotAlgoResponse]
@@ -95,7 +95,7 @@ def query_current_algo_open_orders_spot_algo(
9595
Weight: 1
9696
9797
Args:
98-
recv_window (Optional[int]):
98+
recv_window (Optional[int] = None):
9999
100100
Returns:
101101
ApiResponse[QueryCurrentAlgoOpenOrdersSpotAlgoResponse]
@@ -139,13 +139,13 @@ def query_historical_algo_orders_spot_algo(
139139
Weight: 1
140140
141141
Args:
142-
symbol (Optional[str]): Trading symbol eg. BTCUSDT
143-
side (Optional[str]): BUY or SELL
144-
start_time (Optional[int]): in milliseconds eg.1641522717552
145-
end_time (Optional[int]): in milliseconds eg.1641522526562
146-
page (Optional[int]): Default is 1
147-
page_size (Optional[int]): MIN 1, MAX 100; Default 100
148-
recv_window (Optional[int]):
142+
symbol (Optional[str] = None): Trading symbol eg. BTCUSDT
143+
side (Optional[str] = None): BUY or SELL
144+
start_time (Optional[int] = None): in milliseconds eg.1641522717552
145+
end_time (Optional[int] = None): in milliseconds eg.1641522526562
146+
page (Optional[int] = None): Default is 1
147+
page_size (Optional[int] = None): MIN 1, MAX 100; Default 100
148+
recv_window (Optional[int] = None):
149149
150150
Returns:
151151
ApiResponse[QueryHistoricalAlgoOrdersSpotAlgoResponse]
@@ -179,7 +179,7 @@ def query_historical_algo_orders_spot_algo(
179179

180180
def query_sub_orders_spot_algo(
181181
self,
182-
algo_id: int = None,
182+
algo_id: Union[int, None],
183183
page: Optional[int] = None,
184184
page_size: Optional[int] = None,
185185
recv_window: Optional[int] = None,
@@ -194,10 +194,10 @@ def query_sub_orders_spot_algo(
194194
Weight: 1
195195
196196
Args:
197-
algo_id (int): eg. 14511
198-
page (Optional[int]): Default is 1
199-
page_size (Optional[int]): MIN 1, MAX 100; Default 100
200-
recv_window (Optional[int]):
197+
algo_id (Union[int, None]): eg. 14511
198+
page (Optional[int] = None): Default is 1
199+
page_size (Optional[int] = None): MIN 1, MAX 100; Default 100
200+
recv_window (Optional[int] = None):
201201
202202
Returns:
203203
ApiResponse[QuerySubOrdersSpotAlgoResponse]
@@ -233,10 +233,10 @@ def query_sub_orders_spot_algo(
233233

234234
def time_weighted_average_price_spot_algo(
235235
self,
236-
symbol: str = None,
237-
side: str = None,
238-
quantity: float = None,
239-
duration: int = None,
236+
symbol: Union[str, None],
237+
side: Union[str, None],
238+
quantity: Union[float, None],
239+
duration: Union[int, None],
240240
client_algo_id: Optional[str] = None,
241241
limit_price: Optional[float] = None,
242242
) -> ApiResponse[TimeWeightedAveragePriceSpotAlgoResponse]:
@@ -252,12 +252,12 @@ def time_weighted_average_price_spot_algo(
252252
Weight: 3000
253253
254254
Args:
255-
symbol (str): Trading symbol eg. BTCUSDT
256-
side (str): Trading side ( BUY or SELL )
257-
quantity (float): Quantity of base asset; Maximum notional per order is 200k, 2mm or 10mm, depending on symbol. Please reduce your size if you order is above the maximum notional per order.
258-
duration (int): Duration for TWAP orders in seconds. [300, 86400]
259-
client_algo_id (Optional[str]): A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
260-
limit_price (Optional[float]): Limit price of the order; If it is not sent, will place order by market price by default
255+
symbol (Union[str, None]): Trading symbol eg. BTCUSDT
256+
side (Union[str, None]): Trading side ( BUY or SELL )
257+
quantity (Union[float, None]): Quantity of base asset; Maximum notional per order is 200k, 2mm or 10mm, depending on symbol. Please reduce your size if you order is above the maximum notional per order.
258+
duration (Union[int, None]): Duration for TWAP orders in seconds. [300, 86400]
259+
client_algo_id (Optional[str] = None): A unique id among Algo orders (length should be 32 characters), If it is not sent, we will give default value
260+
limit_price (Optional[float] = None): Limit price of the order; If it is not sent, will place order by market price by default
261261
262262
Returns:
263263
ApiResponse[TimeWeightedAveragePriceSpotAlgoResponse]

0 commit comments

Comments
 (0)