Skip to content

Commit 3a79298

Browse files
authored
v3.1.0 release (#32)
1 parent 96ce1d6 commit 3a79298

File tree

9 files changed

+101
-3
lines changed

9 files changed

+101
-3
lines changed

CHANGELOG.md

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

3+
## 3.1.0 - 2022-06-02
4+
5+
### Add
6+
7+
- New endpoint `GET /fapi/v1/income/asyn` to get Download Id For Futures Transaction History
8+
- New endpoint `GET /fapi/v1/income/asyn/id` to get Futures Transaction History Download Link by Id
9+
10+
311
## 3.0.0 - 2022-05-26
412

513
- Refactor the connector

binance/__version__.py

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

binance/um_futures/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def __init__(self, key=None, secret=None, **kwargs):
6464
from binance.um_futures.account import force_orders
6565
from binance.um_futures.account import api_trading_status
6666
from binance.um_futures.account import commission_rate
67+
from binance.um_futures.account import download_transactions_asyn
68+
from binance.um_futures.account import aysnc_download_info
6769

6870
# STREAMS
6971
from binance.um_futures.data_stream import new_listen_key

binance/um_futures/account.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,3 +780,45 @@ def commission_rate(self, symbol: str, **kwargs):
780780
params = {"symbol": symbol, **kwargs}
781781

782782
return self.sign_request("GET", url_path, params)
783+
784+
785+
def download_transactions_asyn(self, startTime: int, endTime: int, **kwargs):
786+
"""
787+
|
788+
| **Get Download Id For Futures Transaction History (USER_DATA)**
789+
790+
:API endpoint: ``GET /fapi/v1/income/asyn``
791+
:API doc: https://binance-docs.github.io/apidocs/futures/en/#get-download-id-for-futures-transaction-history-user_data
792+
793+
:parameter startTime: int
794+
:parameter endTime: int
795+
:parameter recvWindow: optional int
796+
|
797+
"""
798+
799+
check_required_parameter(startTime, "startTime")
800+
check_required_parameter(endTime, "endTime")
801+
url_path = "/fapi/v1/income/asyn"
802+
params = {"startTime": startTime, "endTime": endTime, **kwargs}
803+
804+
return self.sign_request("GET", url_path, params)
805+
806+
807+
def aysnc_download_info(self, downloadId: str, **kwargs):
808+
"""
809+
|
810+
| **Get Futures Transaction History Download Link by Id (USER_DATA)**
811+
812+
:API endpoint: ``GET /fapi/v1/income/asyn/id``
813+
:API doc: https://binance-docs.github.io/apidocs/futures/en/#get-futures-transaction-history-download-link-by-id-user_data
814+
815+
:parameter downloadId: string
816+
:parameter recvWindow: optional int
817+
|
818+
"""
819+
820+
check_required_parameter(downloadId, "downloadId")
821+
url_path = "/fapi/v1/income/asyn/id"
822+
params = {"downloadId": downloadId, **kwargs}
823+
824+
return self.sign_request("GET", url_path, params)

binance/websocket/.DS_Store

-8 KB
Binary file not shown.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
import logging
3+
from binance.um_futures import UMFutures
4+
from binance.lib.utils import config_logging
5+
from binance.error import ClientError
6+
7+
config_logging(logging, logging.DEBUG)
8+
9+
key = ""
10+
secret = ""
11+
12+
um_futures_client = UMFutures(key=key, secret=secret)
13+
14+
try:
15+
response = um_futures_client.aysnc_download_info(downloadId="1")
16+
logging.info(response)
17+
except ClientError as error:
18+
logging.error(
19+
"Found error. status: {}, error code: {}, error message: {}".format(
20+
error.status_code, error.error_code, error.error_message
21+
)
22+
)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
import logging
3+
from binance.um_futures import UMFutures
4+
from binance.lib.utils import config_logging
5+
from binance.error import ClientError
6+
7+
config_logging(logging, logging.DEBUG)
8+
9+
key = ""
10+
secret = ""
11+
12+
um_futures_client = UMFutures(key=key, secret=secret)
13+
14+
try:
15+
response = um_futures_client.download_transactions_asyn(
16+
startTime=1641102712000, endTime=1651470712000
17+
)
18+
logging.info(response)
19+
except ClientError as error:
20+
logging.error(
21+
"Found error. status: {}, error code: {}, error message: {}".format(
22+
error.status_code, error.error_code, error.error_message
23+
)
24+
)

examples/websocket/.DS_Store

-6 KB
Binary file not shown.

examples/websocket/um_futures/user_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import time
44
import logging
55
from binance.lib.utils import config_logging
6-
from binance.cm_futures import CMFutures
6+
from binance.um_futures import UMFutures
77
from binance.websocket.um_futures.websocket_client import UMFuturesWebsocketClient
88

99
config_logging(logging, logging.DEBUG)
@@ -14,7 +14,7 @@ def message_handler(message):
1414

1515

1616
api_key = ""
17-
client = CMFutures(api_key)
17+
client = UMFutures(api_key)
1818
response = client.new_listen_key()
1919

2020
logging.info("Listen key : {}".format(response["listenKey"]))

0 commit comments

Comments
 (0)