Skip to content

Commit abb7305

Browse files
committed
v4.0.1 release
1 parent 395cfe1 commit abb7305

File tree

17 files changed

+184
-204
lines changed

17 files changed

+184
-204
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ["3.7", "3.8", "3.9", "3.10"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12"]
1919

2020
steps:
2121
- uses: actions/checkout@v2

CHANGELOG.md

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

3+
## 4.0.1 - 2024-10-03
4+
5+
### Removed
6+
- UM_Futures:
7+
- `GET /v1/pmExchangeInfo`
8+
39
## 4.0.0 - 2023-08-08
410

511
### Changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Python version](https://img.shields.io/pypi/pyversions/binance-futures-connector)](https://www.python.org/downloads/)
33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44

5-
This is a lightweight library that works as a connector to [Binance Futures public API](https://binance-docs.github.io/apidocs/futures/en/)
5+
This is a lightweight library that works as a connector to [Binance Futures public API](https://developers.binance.com/docs/derivatives/Introduction)
66

77
- Supported APIs:
88
- USDT-M Futures `/fapi/*`
@@ -179,8 +179,8 @@ There are 2 types of error returned from the library:
179179
### Connector v4
180180

181181
WebSocket can be established through the following connections:
182-
- USD-M WebSocket Stream (`https://binance-docs.github.io/apidocs/futures/en/#websocket-market-streams`)
183-
- COIN-M WebSocket Stream (`https://binance-docs.github.io/apidocs/delivery/en/#websocket-market-streams`)
182+
- USD-M WebSocket Stream (`https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Connect`)
183+
- COIN-M WebSocket Stream (`https://developers.binance.com/docs/derivatives/coin-margined-futures/websocket-market-streams/Connect`)
184184

185185
```python
186186
# WebSocket Stream Client

binance/__version__.py

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

binance/cm_futures/account.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def change_position_mode(self, dualSidePosition: str, **kwargs):
99
| *Change user's position mode (Hedge Mode or One-way Mode) on EVERY symbol*
1010
1111
:API endpoint: ``POST /dapi/v1/positionSide/dual``
12-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#change-position-mode-trade
12+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Position-Mode
1313
1414
:parameter dualSidePosition: string
1515
:parameter recvWindow: optional int
@@ -29,7 +29,7 @@ def get_position_mode(self, **kwargs):
2929
| *Get user's position mode (Hedge Mode or One-way Mode) on EVERY symbol*
3030
3131
:API endpoint: ``GET /dapi/v1/positionSide/dual``
32-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#get-current-position-mode-user_data
32+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Current-Position-Mode
3333
3434
:parameter recvWindow: optional int
3535
|
@@ -47,7 +47,7 @@ def new_order(self, symbol: str, side: str, type: str, **kwargs):
4747
| *Send a new order*
4848
4949
:API endpoint: ``POST /dapi/v1/order``
50-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#new-order-trade
50+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
5151
5252
:parameter symbol: string
5353
:parameter side: string
@@ -89,7 +89,7 @@ def modify_order(
8989
| *Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue.*
9090
9191
:API endpoint: ``POST /dapi/v1/order``
92-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#modify-order-trade
92+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
9393
9494
:parameter symbol: string
9595
:parameter side: string
@@ -135,7 +135,7 @@ def new_batch_order(self, batchOrders: list):
135135
| *Post a new batch order*
136136
137137
:API endpoint: ``POST /dapi/v1/batchOrders``
138-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#place-multiple-orders-trade
138+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
139139
140140
:parameter batchOrders: list
141141
:parameter recvWindow: optional int
@@ -162,7 +162,7 @@ def modify_batch_order(self, batchOrders: list):
162162
| *Post a new batch order*
163163
164164
:API endpoint: ``PUT /dapi/v1/batchOrders``
165-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#modify-multiple-orders-trade
165+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Multiple-Orders
166166
167167
:parameter batchOrders: list
168168
:parameter recvWindow: optional int
@@ -191,7 +191,7 @@ def order_modify_history(
191191
| *Get order modification history*
192192
193193
:API endpoint: ``GET /dapi/v1/orderAmendment``
194-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#get-order-modify-history-user_data
194+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Order-Modify-History
195195
196196
:parameter symbol: string
197197
:parameter orderId: optional int
@@ -231,7 +231,7 @@ def query_order(
231231
| *Query a order*
232232
233233
:API endpoint: ``GET /dapi/v1/order``
234-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#query-order-user_data
234+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
235235
236236
:parameter symbol: string
237237
:parameter orderId: optional string
@@ -268,7 +268,7 @@ def cancel_order(
268268
| *Cancel an active order.*
269269
270270
:API endpoint: ``DELETE /dapi/v1/order``
271-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#cancel-order-trade
271+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
272272
273273
:parameter symbol: string
274274
:parameter orderId: optional string
@@ -303,7 +303,7 @@ def cancel_open_orders(self, symbol: str, **kwargs):
303303
| **Cancel All Open Orders (TRADE)**
304304
305305
:API endpoint: ``DELETE /dapi/v1/allOpenOrders``
306-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#cancel-all-open-orders-trade
306+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-All-Open-Orders
307307
308308
:parameter symbol: string
309309
:parameter recvWindow: optional int, the value cannot be greater than 60000
@@ -325,7 +325,7 @@ def cancel_batch_order(
325325
| *Cancel a new batch order*
326326
327327
:API endpoint: ``DELETE /dapi/v1/batchOrders``
328-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade
328+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
329329
330330
:parameter symbol: string
331331
:parameter orderIdList: int list, max length 10 e.g. [1234567,2345678]
@@ -367,7 +367,7 @@ def countdown_cancel_order(self, symbol: str, countdownTime: int, **kwargs):
367367
| *Cancel all open orders of the specified symbol at the end of the specified countdown.*
368368
369369
:API endpoint: ``POST /dapi/v1/countdownCancelAll``
370-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#auto-cancel-all-open-orders-trade
370+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Auto-Cancel-All-Open-Orders
371371
372372
:parameter symbol: string
373373
:parameter countdownTime: int list, countdown time, 1000 for 1 second. 0 to cancel the timer
@@ -400,7 +400,7 @@ def get_open_orders(
400400
| *Get all open orders on a symbol.*
401401
402402
:API endpoint: ``GET /dapi/v1/openOrder``
403-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#query-current-open-order-user_data
403+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
404404
405405
:parameter symbol: string
406406
:parameter orderId: optional string
@@ -440,7 +440,7 @@ def get_orders(self, **kwargs):
440440
| *If the symbol is not sent, orders for all symbols will be returned in an array.*
441441
442442
:API endpoint: ``GET /dapi/v1/openOrders``
443-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#current-all-open-orders-user_data
443+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
444444
445445
:parameter symbol: string
446446
:parameter recvWindow: optional int, the value cannot be greater than 60000
@@ -460,7 +460,7 @@ def get_all_orders(self, **kwargs):
460460
| *Get all account orders; active, canceled, or filled.*
461461
462462
:API endpoint: ``GET /dapi/v1/allOrders``
463-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
463+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
464464
465465
:parameter symbol: string
466466
:parameter orderId: optional int
@@ -484,7 +484,7 @@ def balance(self, **kwargs):
484484
| *Get current account balance*
485485
486486
:API endpoint: ``GET /dapi/v1/balance``
487-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#futures-account-balance-user_data
487+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance
488488
489489
:parameter recvWindow: optional int
490490
|
@@ -501,7 +501,7 @@ def account(self, **kwargs):
501501
| *Get current account information*
502502
503503
:API endpoint: ``GET /dapi/v1/account``
504-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
504+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
505505
506506
:parameter recvWindow: optional int
507507
@@ -523,7 +523,7 @@ def change_leverage(self, symbol: str, leverage: int, **kwargs):
523523
| *For Hedge Mode, LONG and SHORT positions of one symbol use the same initial leverage and share a total notional value.*
524524
525525
:API endpoint: ``POST /dapi/v1/leverage``
526-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#change-initial-leverage-trade
526+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Initial-Leverage
527527
528528
:parameter symbol: string
529529
:parameter leverage: int; target initial leverage: int from 1 to 125
@@ -545,7 +545,7 @@ def change_margin_type(self, symbol: str, marginType: str, **kwargs):
545545
| *With ISOLATED margin type, margins of the LONG and SHORT positions are isolated from each other.*
546546
547547
:API endpoint: ``POST /dapi/v1/marginType``
548-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#change-margin-type-trade
548+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Margin-Type
549549
550550
:parameter symbol: string
551551
:parameter leverage: string; ISOLATED, CROSSED
@@ -567,7 +567,7 @@ def modify_isolated_position_margin(
567567
| **Modify Isolated Position Margin (TRADE)**
568568
569569
:API endpoint: ``POST /dapi/v1/positionMargin``
570-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#modify-isolated-position-margin-trade
570+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
571571
572572
:parameter symbol: string
573573
:parameter amount: float
@@ -590,7 +590,7 @@ def get_position_margin_history(self, symbol: str, **kwargs):
590590
| *Get position margin history on a symbol.*
591591
592592
:API endpoint: ``GET /dapi/v1/positionMargin/history``
593-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#get-position-margin-change-history-trade
593+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Position-Margin-Change-History
594594
595595
:parameter symbol: string
596596
:parameter type: optional int; 1: Add position margin,2: Reduce position margin
@@ -615,7 +615,7 @@ def get_position_risk(self, **kwargs):
615615
| *Get current position information.*
616616
617617
:API endpoint: ``GET /dapi/v1/positionRisk``
618-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#position-information-user_data
618+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
619619
620620
:parameter symbol: string
621621
:parameter recvWindow: optional int
@@ -635,7 +635,7 @@ def get_account_trades(self, **kwargs):
635635
| *Get trades for a specific account and symbol.*
636636
637637
:API endpoint: ``GET /dapi/v1/userTrades``
638-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#account-trade-list-user_data
638+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
639639
640640
:parameter symbol: optional string
641641
:parameter pair: optional string
@@ -667,7 +667,7 @@ def get_income_history(self, **kwargs):
667667
| *Get trades for a specific account and symbol.*
668668
669669
:API endpoint: ``GET /dapi/v1/income``
670-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#get-income-history-user_data
670+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
671671
672672
:parameter symbol: optional string
673673
:parameter incomeType: optional string; "TRANSFER", "WELCOME_BONUS", "REALIZED_PNL", "FUNDING_FEE", "COMMISSION" and "INSURANCE_CLEAR"
@@ -695,10 +695,10 @@ def leverage_brackets(self, symbol: str = None, pair: str = None, **kwargs):
695695
| *Get notional and leverage bracket.*
696696
697697
:API endpoint: ``GET /dapi/v1/leverageBracket``
698-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#notional-bracket-for-pair-user_data
698+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Pair
699699
700700
:API endpoint: ``GET /dapi/v2/leverageBracket``
701-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#notional-bracket-for-pair-user_data-2
701+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
702702
703703
:parameter symbol: optional string
704704
:parameter pair: optional string
@@ -729,7 +729,7 @@ def adl_quantile(self, **kwargs):
729729
| *Get Position ADL Quantile Estimation*
730730
731731
:API endpoint: ``GET /dapi/v1/adlQuantile``
732-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#position-adl-quantile-estimation-user_data
732+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-ADL-Quantile-Estimation
733733
734734
:parameter symbol: optional string
735735
:parameter recvWindow: optional int
@@ -757,7 +757,7 @@ def force_orders(self, **kwargs):
757757
| *Get User's Force Orders*
758758
759759
:API endpoint: ``GET /dapi/v1/forceOrders``
760-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#user-39-s-force-orders-user_data
760+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Users-Force-Orders
761761
762762
:parameter symbol: optional string
763763
:parameter autoCloseType: optional string; "LIQUIDATION" for liquidation orders, "ADL" for ADL orders.
@@ -785,7 +785,7 @@ def commission_rate(self, symbol: str, **kwargs):
785785
| *Get commission rate of symbol*
786786
787787
:API endpoint: ``GET /dapi/v1/commissionRate``
788-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#user-commission-rate-user_data
788+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
789789
790790
:parameter symbol: optional string
791791
:parameter recvWindow: optional int

binance/cm_futures/data_stream.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def new_listen_key(self):
77
| **Create a ListenKey (USER_STREAM)**
88
99
:API endpoint: ``POST /dapi/v1/listenKey``
10-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#start-user-data-stream-user_stream
10+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Start-User-Data-Stream
1111
|
1212
"""
1313

@@ -20,7 +20,7 @@ def renew_listen_key(self, listenKey: str):
2020
| **Ping/Keep-alive a ListenKey (USER_STREAM)**
2121
2222
:API endpoint: ``PUT /dapi/v1/listenKey``
23-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#keepalive-user-data-stream-user_stream
23+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Keepalive-User-Data-Stream
2424
2525
:parameter listenKey: string
2626
|
@@ -37,7 +37,7 @@ def close_listen_key(self, listenKey: str):
3737
| **Close a ListenKey (USER_STREAM)**
3838
3939
:API endpoint: ``DELETE /dapi/v1/listenKey``
40-
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#close-user-data-stream-user_stream
40+
:API doc: https://developers.binance.com/docs/derivatives/coin-margined-futures/user-data-streams/Close-User-Data-Stream
4141
4242
:parameter listenKey: string
4343
|

0 commit comments

Comments
 (0)