Skip to content

Commit 90fed07

Browse files
committed
v4.1.0 release
1 parent 4b09737 commit 90fed07

32 files changed

+867
-53
lines changed

CHANGELOG.md

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

3+
## 4.1.0 - 2024-10-31
4+
5+
### Added
6+
- UM_Futures:
7+
- `GET /fapi/v1/fundingInfo`
8+
- `GET /futures/data/delivery-price`
9+
- `GET /fapi/v1/constituents`
10+
- `GET /fapi/v1/accountConfig`
11+
- `GET /fapi/v1/symbolConfig`
12+
- `GET /fapi/v1/rateLimit/order`
13+
- `GET /fapi/v1/order/asyn`
14+
- `GET /fapi/v1/order/asyn/id`
15+
- `GET /fapi/v1/trade/asyn`
16+
- `GET /fapi/v1/trade/asyn/id`
17+
- `POST /fapi/v1/feeBurn`
18+
- `GET /fapi/v1/feeBurn`
19+
- `GET /fapi/v1/convert/exchangeInfo`
20+
- `POST /fapi/v1/convert/getQuote`
21+
- `POST /fapi/v1/convert/acceptQuote`
22+
- `GET /fapi/v1/convert/orderStatus`
23+
- Websocket Stream `mark_price_all_market`
24+
25+
- CM_Futures:
26+
- `GET /dapi/v1/income/asyn`
27+
- `GET /dapi/v1/constituents`
28+
29+
### Changed
30+
- UM_Futures:
31+
- `GET /fapi/v1/income`: Add parameter `page` for pagination
32+
- `POST /fapi/v1/order`: Add parameters `selfTradePreventionMode`, `priceMatch` and `goodTillDate`
33+
- `POST /fapi/v1/batchOrders`: Add parameters `priceMatch`, `selfTradePreventionMode` and `goodTillDate`
34+
- `GET /fapi/v1/ticker/price`: deprecated, replaced by `GET /fapi/v2/ticker/price`
35+
- `GET /fapi/v2/balance`: deprecated, replaced by `GET /fapi/v3/balance`
36+
- `GET /fapi/v2/account`: deprecated, replaced by `GET /fapi/v3/account`
37+
- `GET /fapi/v2/positionRisk`: deprecated, replaced by `GET /fapi/v3/positionRisk`
38+
39+
- CM_Futures:
40+
- `GET /dapi/v1/income`: Add parameter `page` for pagination
41+
- `POST /dapi/v1/order`: Add parameters `priceMatch` and `selfTradePreventionMode`
42+
43+
- Update Websocket connection exceptions: Add `_handle_exception` method to handle exceptions
44+
45+
### Removed
46+
- CM_Futures:
47+
- `/dapi/v1/pmExchangeInfo`
48+
349
## 4.0.1 - 2024-10-03
450

551
### Removed

binance/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.0.1"
1+
__version__ = "4.1.0"

binance/cm_futures/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, key=None, secret=None, **kwargs):
2424
from binance.cm_futures.market import ticker_24hr_price_change
2525
from binance.cm_futures.market import ticker_price
2626
from binance.cm_futures.market import book_ticker
27+
from binance.cm_futures.market import query_index_price_constituents
2728
from binance.cm_futures.market import open_interest
2829
from binance.cm_futures.market import open_interest_hist
2930
from binance.cm_futures.market import top_long_short_account_ratio
@@ -57,6 +58,7 @@ def __init__(self, key=None, secret=None, **kwargs):
5758
from binance.cm_futures.account import get_position_risk
5859
from binance.cm_futures.account import get_account_trades
5960
from binance.cm_futures.account import get_income_history
61+
from binance.cm_futures.account import get_download_id_transaction_history
6062
from binance.cm_futures.account import leverage_brackets
6163
from binance.cm_futures.account import adl_quantile
6264
from binance.cm_futures.account import force_orders
@@ -66,6 +68,3 @@ def __init__(self, key=None, secret=None, **kwargs):
6668
from binance.cm_futures.data_stream import new_listen_key
6769
from binance.cm_futures.data_stream import renew_listen_key
6870
from binance.cm_futures.data_stream import close_listen_key
69-
70-
# PORTFOLIO MARGIN
71-
from binance.cm_futures.portfolio_margin import pm_exchange_info

binance/cm_futures/account.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def new_order(self, symbol: str, side: str, type: str, **kwargs):
6464
:parameter callbackRate: optional float. Use with TRAILING_STOP_MARKET orders, min 0.1, max 5 where 1 for 1%.
6565
:parameter workingType: optional string. stopPrice triggered by: "MARK_PRICE", "CONTRACT_PRICE". Default "CONTRACT_PRICE".
6666
:parameter priceProtect: optional string. "TRUE" or "FALSE", default "FALSE". Use with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders.
67-
:parameter newOrderRespType: optional float. "ACK" or "RESULT", default "ACK".
67+
:parameter newOrderRespType: optional string. "ACK" or "RESULT", default "ACK".
68+
:parameter priceMatch: optional string. 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.
69+
:parameter selfTradePreventionMode: optional string. "NONE":No STP /"EXPIRE_TAKER":expire taker order when STP triggers/"EXPIRE_MAKER":expire taker order when STP triggers/"EXPIRE_BOTH":expire both orders when STP triggers; default "NONE".
6870
:parameter recvWindow: optional int
6971
|
7072
"""
@@ -88,7 +90,7 @@ def modify_order(
8890
| **Modify Order (TRADE)**
8991
| *Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue.*
9092
91-
:API endpoint: ``POST /dapi/v1/order``
93+
:API endpoint: ``PUT /dapi/v1/order``
9294
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
9395
9496
:parameter symbol: string
@@ -673,6 +675,7 @@ def get_income_history(self, **kwargs):
673675
:parameter incomeType: optional string; "TRANSFER", "WELCOME_BONUS", "REALIZED_PNL", "FUNDING_FEE", "COMMISSION" and "INSURANCE_CLEAR"
674676
:parameter startTime: optional string; timestamp in ms to get funding from INCLUSIVE.
675677
:parameter endTime: optional string; timestamp in ms to get funding from INCLUSIVE.
678+
:parameter page: optional int
676679
:parameter limit: optional int; default 50, max 100
677680
:parameter recvWindow: optional int
678681
@@ -688,6 +691,31 @@ def get_income_history(self, **kwargs):
688691
return self.sign_request("GET", url_path, params)
689692

690693

694+
def get_download_id_transaction_history(self, startTime: int, endTime: int, **kwargs):
695+
"""
696+
|
697+
| **Get Download Id For Futures Transaction History (USER_DATA)**
698+
| *Get download ID transaction history.*
699+
| *Request Limitation is 5 times per month, shared by front end download page and rest api*
700+
| *The time between startTime and endTime can not be longer than 1 year*
701+
702+
:API endpoint: ``GET /dapi/v1/income/asyn``
703+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Download-Id-For-Futures-Transaction-History
704+
705+
:parameter startTime: int
706+
:parameter endTime: int
707+
:parameter recvWindow: optional int
708+
|
709+
"""
710+
711+
check_required_parameter(startTime, "startTime")
712+
check_required_parameter(endTime, "endTime")
713+
url_path = "/dapi/v1/income/asyn"
714+
params = {"startTime": startTime, "endTime": endTime, **kwargs}
715+
716+
return self.sign_request("GET", url_path, params)
717+
718+
691719
def leverage_brackets(self, symbol: str = None, pair: str = None, **kwargs):
692720
"""
693721
|

binance/cm_futures/market.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,23 @@ def book_ticker(self, symbol: str = None, pair: str = None):
352352
return self.query("/dapi/v1/ticker/bookTicker", params)
353353

354354

355+
def query_index_price_constituents(self, symbol: str):
356+
"""
357+
|
358+
| **Query Index Price Constituents**
359+
360+
:API endpoint: ``GET /dapi/v1/constituents``
361+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Constituents
362+
363+
:parameter symbol: string; symbol underlying e.g BTCUSD
364+
|
365+
"""
366+
367+
check_required_parameter(symbol, "symbol")
368+
params = {"symbol": symbol}
369+
return self.query("/dapi/v1/constituents", params)
370+
371+
355372
def open_interest(self, symbol: str):
356373
"""
357374
|

binance/cm_futures/portfolio_margin.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

binance/um_futures/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ def __init__(self, key=None, secret=None, **kwargs):
2121
from binance.um_futures.market import mark_price_klines
2222
from binance.um_futures.market import mark_price
2323
from binance.um_futures.market import funding_rate
24+
from binance.um_futures.market import funding_info
2425
from binance.um_futures.market import ticker_24hr_price_change
2526
from binance.um_futures.market import ticker_price
2627
from binance.um_futures.market import book_ticker
28+
from binance.um_futures.market import quarterly_contract_settlement_price
2729
from binance.um_futures.market import open_interest
2830
from binance.um_futures.market import open_interest_hist
2931
from binance.um_futures.market import top_long_short_position_ratio
@@ -33,6 +35,7 @@ def __init__(self, key=None, secret=None, **kwargs):
3335
from binance.um_futures.market import blvt_kline
3436
from binance.um_futures.market import index_info
3537
from binance.um_futures.market import asset_Index
38+
from binance.um_futures.market import index_price_constituents
3639

3740
# ACCOUNT(including orders and trades)
3841
from binance.um_futures.account import change_position_mode
@@ -65,8 +68,23 @@ def __init__(self, key=None, secret=None, **kwargs):
6568
from binance.um_futures.account import force_orders
6669
from binance.um_futures.account import api_trading_status
6770
from binance.um_futures.account import commission_rate
71+
from binance.um_futures.account import futures_account_configuration
72+
from binance.um_futures.account import symbol_configuration
73+
from binance.um_futures.account import query_user_rate_limit
6874
from binance.um_futures.account import download_transactions_asyn
6975
from binance.um_futures.account import aysnc_download_info
76+
from binance.um_futures.account import download_order_asyn
77+
from binance.um_futures.account import async_download_order_id
78+
from binance.um_futures.account import download_trade_asyn
79+
from binance.um_futures.account import async_download_trade_id
80+
from binance.um_futures.account import toggle_bnb_burn
81+
from binance.um_futures.account import get_bnb_burn
82+
83+
# CONVERT
84+
from binance.um_futures.convert import list_all_convert_pairs
85+
from binance.um_futures.convert import send_quote_request
86+
from binance.um_futures.convert import accept_offered_quote
87+
from binance.um_futures.convert import order_status
7088

7189
# STREAMS
7290
from binance.um_futures.data_stream import new_listen_key

0 commit comments

Comments
 (0)