Skip to content

Commit d30576a

Browse files
authored
added and fixed endpoints (#53)
* added and fixed endpoints * added release date
1 parent 8c29981 commit d30576a

File tree

10 files changed

+72
-5
lines changed

10 files changed

+72
-5
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Changelog
22

3-
### 3.1.2 - 2022-08-23
3+
## 3.2.0 - 2022-08-29
4+
5+
### Add
6+
#### UM Futures
7+
- New endpoint `GET /fapi/v1/pmExchangeInfo` to get current Portfolio Margin exchange trading rules.
8+
#### CM Futures
9+
- New endpoint `GET /dapi/v1/pmExchangeInfo` to get current Portfolio Margin exchange trading rules.
10+
11+
### Update
12+
#### UM Futures
13+
- `symbol` is no longer a required parameter in `GET /fapi/v1/premiumIndex`
14+
15+
## 3.1.2 - 2022-08-23
416

517
### Update
618
- Fix encoding issue of parameters in `DELETE /fapi/v1/batchOrders`

binance/__version__.py

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

binance/cm_futures/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ def __init__(self, key=None, secret=None, **kwargs):
6666
from binance.cm_futures.data_stream import new_listen_key
6767
from binance.cm_futures.data_stream import renew_listen_key
6868
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
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def pm_exchange_info(self, symbol: str = None):
2+
"""
3+
|
4+
| **Portfolio Margin Exchange Information**
5+
| *Current Portfolio Margin exchange trading rules.*
6+
7+
:API endpoint: ``GET /dapi/v1/pmExchangeInfo``
8+
:API doc: https://binance-docs.github.io/apidocs/delivery/en/#portfolio-margin-exchange-information
9+
10+
:parameter symbol: string; the trading pair.
11+
|
12+
"""
13+
14+
params = {"symbol": symbol}
15+
return self.query("/dapi/v1/pmExchangeInfo", params)

binance/um_futures/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ def __init__(self, key=None, secret=None, **kwargs):
7171
from binance.um_futures.data_stream import new_listen_key
7272
from binance.um_futures.data_stream import renew_listen_key
7373
from binance.um_futures.data_stream import close_listen_key
74+
75+
# PORTFOLIO MARGIN
76+
from binance.um_futures.portfolio_margin import pm_exchange_info

binance/um_futures/market.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def mark_price_klines(self, symbol: str, interval: str, **kwargs):
221221
return self.query("/fapi/v1/markPriceKlines", params)
222222

223223

224-
def mark_price(self, symbol: str):
224+
def mark_price(self, symbol: str = None):
225225
"""
226226
|
227227
| **Mark Price and Funding Rate**
@@ -233,7 +233,6 @@ def mark_price(self, symbol: str):
233233
|
234234
"""
235235

236-
check_required_parameter(symbol, "symbol")
237236
params = {
238237
"symbol": symbol,
239238
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def pm_exchange_info(self, symbol: str = None):
2+
"""
3+
|
4+
| **Portfolio Margin Exchange Information**
5+
| *Current Portfolio Margin exchange trading rules.*
6+
7+
:API endpoint: ``GET /fapi/v1/pmExchangeInfo``
8+
:API doc: https://binance-docs.github.io/apidocs/futures/en/#portfolio-margin-endpoints
9+
10+
:parameter symbol: string; the trading pair.
11+
|
12+
"""
13+
14+
params = {"symbol": symbol}
15+
return self.query("/fapi/v1/pmExchangeInfo", params)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
import logging
3+
from binance.cm_futures import CMFutures
4+
from binance.lib.utils import config_logging
5+
6+
config_logging(logging, logging.DEBUG)
7+
8+
cm_futures_client = CMFutures()
9+
10+
logging.info(cm_futures_client.pm_exchange_info())

examples/um_futures/market/mark_price.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
um_futures_client = UMFutures()
99

10-
logging.info(um_futures_client.mark_price("BTCUSDT"))
10+
logging.info(um_futures_client.mark_price())
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
import logging
3+
from binance.um_futures import UMFutures
4+
from binance.lib.utils import config_logging
5+
6+
config_logging(logging, logging.DEBUG)
7+
8+
um_futures_client = UMFutures()
9+
10+
logging.info(um_futures_client.pm_exchange_info())

0 commit comments

Comments
 (0)