Skip to content

Commit c0bc93e

Browse files
authored
1.10.0 release (#123)
1 parent a1260fe commit c0bc93e

24 files changed

+331
-32
lines changed

CHANGELOG.md

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

3+
## 1.10.0 - 2022-01-11
4+
5+
### Added
6+
- New endpoint for Mining:
7+
- `GET /sapi/v1/mining/payment/uid` to get Mining account earning
8+
- New endpoint for BSwap:
9+
- `GET /sapi/v1/bswap/unclaimedRewards` to get unclaimed rewards record
10+
- `POST /sapi/v1/bswap/claimRewards` to claim swap rewards or liquidity rewards
11+
- `GET /sapi/v1/bswap/claimedHistory` to get history of claimed rewards
12+
13+
### Removed
14+
- Transfer types `MAIN_MINING`, `MINING_MAIN`, `MINING_UMFUTURE`, `MARGIN_MINING`, and `MINING_MARGIN` as they are discontinued in Universal Transfer endpoint `POST /sapi/v1/asset/transfer` from January 05, 2022 08:00 AM UTC
15+
316
## 1.9.0 - 2021-12-22
417

518
### Added

binance/__version__.py

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

binance/lib/enums.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,13 @@ class TransferType(AutoName):
1010
MAIN_UMFUTURE = auto()
1111
MAIN_CMFUTURE = auto()
1212
MAIN_MARGIN = auto()
13-
MAIN_MINING = auto()
1413
UMFUTURE_MAIN = auto()
1514
UMFUTURE_MARGIN = auto()
1615
CMFUTURE_MAIN = auto()
1716
CMFUTURE_MARGIN = auto()
1817
MARGIN_MAIN = auto()
1918
MARGIN_UMFUTURE = auto()
2019
MARGIN_CMFUTURE = auto()
21-
MARGIN_MINING = auto()
22-
MINING_MAIN = auto()
23-
MINING_UMFUTURE = auto()
24-
MINING_MARGIN = auto()
2520
ISOLATEDMARGIN_MARGIN = auto()
2621
MARGIN_ISOLATEDMARGIN = auto()
2722
ISOLATEDMARGIN_ISOLATEDMARGIN = auto()

binance/spot/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def __init__(self, key=None, secret=None, **kwargs):
144144
from binance.spot.mining import mining_hashrate_resale_cancellation
145145
from binance.spot.mining import mining_hashrate_resale_list
146146
from binance.spot.mining import mining_hashrate_resale_details
147+
from binance.spot.mining import mining_account_earning
147148

148149
# SUB-ACCOUNT
149150
from binance.spot.sub_account import sub_account_create
@@ -219,6 +220,9 @@ def __init__(self, key=None, secret=None, **kwargs):
219220
from binance.spot.bswap import bswap_pool_configure
220221
from binance.spot.bswap import bswap_add_liquidity_preview
221222
from binance.spot.bswap import bswap_remove_liquidity_preview
223+
from binance.spot.bswap import bswap_unclaimed_rewards
224+
from binance.spot.bswap import bswap_claim_rewards
225+
from binance.spot.bswap import bswap_claimed_rewards
222226

223227
# FIAT
224228
from binance.spot.fiat import fiat_order_history

binance/spot/bswap.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,56 @@ def bswap_remove_liquidity_preview(
277277
**kwargs,
278278
}
279279
return self.sign_request("GET", "/sapi/v1/bswap/removeLiquidityPreview", payload)
280+
281+
282+
def bswap_unclaimed_rewards(self, **kwargs):
283+
"""Get Unclaimed Rewards Record (USER_DATA)
284+
Get unclaimed rewards record.
285+
286+
GET /sapi/v1/bswap/unclaimedRewards
287+
288+
https://binance-docs.github.io/apidocs/spot/en/#get-unclaimed-rewards-record-user_data
289+
290+
Keyword Args:
291+
type (int, optional): 0: Swap rewards,1:Liquidity rewards, default to 0
292+
recvWindow (int, optional): The value cannot be greater than 60000
293+
"""
294+
295+
return self.sign_request("GET", "/sapi/v1/bswap/unclaimedRewards", kwargs)
296+
297+
298+
def bswap_claim_rewards(self, **kwargs):
299+
"""Claim rewards (TRADE)
300+
Claim swap rewards or liquidity rewards
301+
302+
POST /sapi/v1/bswap/claimRewards
303+
304+
https://binance-docs.github.io/apidocs/spot/en/#claim-rewards-trade
305+
306+
Keyword Args:
307+
type (int, optional): 0: Swap rewards,1:Liquidity rewards, default to 0
308+
recvWindow (int, optional): The value cannot be greater than 60000
309+
"""
310+
311+
return self.sign_request("POST", "/sapi/v1/bswap/claimRewards", kwargs)
312+
313+
314+
def bswap_claimed_rewards(self, **kwargs):
315+
"""Get Claimed History (USER_DATA)
316+
Get history of claimed rewards.
317+
318+
GET /sapi/v1/bswap/claimedHistory
319+
320+
https://binance-docs.github.io/apidocs/spot/en/#get-claimed-history-user_data
321+
322+
Keyword Args:
323+
poolId (int, optional)
324+
assetRewards (str, optional)
325+
type (int, optional): 0: Swap rewards,1:Liquidity rewards, default to 0
326+
startTime (int, optional)
327+
endTime (int, optional)
328+
limit (int, optional): default 3, max 100
329+
recvWindow (int, optional): The value cannot be greater than 60000
330+
"""
331+
332+
return self.sign_request("GET", "/sapi/v1/bswap/claimedHistory", kwargs)

binance/spot/margin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,7 @@ def margin_interest_rate_history(self, asset: str, **kwargs):
636636
Keyword Args:
637637
vipLevel (str, optional): Default: user's vip level
638638
startTime (int, optional): Default: 7 days ago.
639-
endTime (int, optional): Default: present. Maximum range: 3 months.
640-
limit (int, optional): Default: 20. Maximum: 100.
639+
endTime (int, optional): Default: present. Maximum range: 1 month.
641640
recvWindow (int, optional): The value cannot be greater than 60000
642641
"""
643642

binance/spot/mining.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from binance.lib.utils import check_required_parameters
2+
from binance.lib.utils import check_required_parameter
23

34

45
def mining_algo_list(self):
@@ -271,3 +272,25 @@ def mining_hashrate_resale_details(self, configId: int, userName: str, **kwargs)
271272
return self.sign_request(
272273
"GET", "/sapi/v1/mining/hash-transfer/profit/details", payload
273274
)
275+
276+
277+
def mining_account_earning(self, algo: str, **kwargs):
278+
"""Mining Account Earning (USER_DATA)
279+
280+
GET /sapi/v1/mining/payment/uid
281+
282+
https://binance-docs.github.io/apidocs/spot/en/#mining-account-earning-user_data
283+
284+
Args:
285+
algo (str): Algorithm(sha256)
286+
Keyword Args:
287+
startDate (int, optional): Millisecond timestamp
288+
endDate (int, optional): Millisecond timestamp
289+
pageIndex (int, optional): Default 1
290+
pageSize (int, optional): Min 10,Max 200
291+
recvWindow (int, optional): The value cannot be greater than 60000
292+
"""
293+
check_required_parameter(algo, "algo")
294+
295+
payload = {"algo": algo, **kwargs}
296+
return self.sign_request("GET", "/sapi/v1/mining/payment/uid", payload)

binance/spot/sub_account.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ def sub_account_universal_transfer(
436436
Keyword Args:
437437
fromEmail (str, optional)
438438
toEmail (str, optional)
439+
clientTranId (str, optional): Must be unique
439440
recvWindow (int, optional): The value cannot be greater than 60000
440441
"""
441442
check_required_parameters(
@@ -473,6 +474,7 @@ def sub_account_universal_transfer_history(self, **kwargs):
473474
Keyword Args:
474475
fromEmail (str, optional)
475476
toEmail (str, optional)
477+
clientTranId (str, optional)
476478
startTime (int, optional)
477479
endTime (int, optional)
478480
page (int, optional)

docs/source/CHANGELOG.rst

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,52 @@
22
Changelog
33
=========
44

5+
1.10.0 - 2022-01-11
6+
-------------------
7+
8+
Added
9+
^^^^^
10+
11+
12+
* New endpoint for Mining:
13+
14+
* ``GET /sapi/v1/mining/payment/uid`` to get Mining account earning
15+
16+
* New endpoint for BSwap:
17+
18+
* ``GET /sapi/v1/bswap/unclaimedRewards`` to get unclaimed rewards record
19+
* ``POST /sapi/v1/bswap/claimRewards`` to claim swap rewards or liquidity rewards
20+
* ``GET /sapi/v1/bswap/claimedHistory`` to get history of claimed rewards
21+
22+
Removed
23+
^^^^^^^
24+
25+
26+
* Transfer types ``MAIN_MINING``\ , ``MINING_MAIN``\ , ``MINING_UMFUTURE``\ , ``MARGIN_MINING``\ , and ``MINING_MARGIN`` as they are discontinued in Universal Transfer endpoint ``POST /sapi/v1/asset/transfer`` from January 05, 2022 08:00 AM UTC
527

628
1.9.0 - 2021-12-22
729
------------------
830

931
Added
1032
^^^^^
33+
34+
1135
* New endpoint for Convert:
12-
* ``GET /sapi/v1/convert/tradeFlow`` to support user query convert trade history records* New endpoint for Rebate:
36+
37+
* ``GET /sapi/v1/convert/tradeFlow`` to support user query convert trade history records
38+
1339
* New endpoint for Rebate:
40+
1441
* ``GET /sapi/v1/rebate/taxQuery`` to support user query spot rebate history records
42+
1543
* New endpoints for Margin:
44+
1645
* ``GET /sapi/v1/margin/crossMarginData`` to get cross margin fee data collection
1746
* ``GET /sapi/v1/margin/isolatedMarginData`` to get isolated margin fee data collection
1847
* ``GET /sapi/v1/margin/isolatedMarginTier`` to get isolated margin tier data collection
48+
1949
* New endpoints for NFT:
50+
2051
* ``GET /sapi/v1/nft/history/transactions`` to get NFT transaction history
2152
* ``GET /sapi/v1/nft/history/deposit`` to get NFT deposit history
2253
* ``GET /sapi/v1/nft/history/withdraw`` to get NFT withdraw history
@@ -27,44 +58,58 @@ Added
2758

2859
Added
2960
^^^^^
61+
62+
3063
* New endpoint for Crypto Loans:
64+
3165
* ``GET /sapi/v1/loan/income`` to query an asset's loan history
66+
3267
* New endpoints for Sub-Account:
68+
3369
* ``POST /sapi/v1/sub-account/subAccountApi/ipRestriction`` to support master account enable and disable IP restriction for a sub-account API Key
3470
* ``POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`` to support master account add IP list for a sub-account API Key
3571
* ``GET /sapi/v1/sub-account/subAccountApi/ipRestriction`` to support master account query IP restriction for a sub-account API Key
3672
* ``DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`` to support master account delete IP list for a sub-account API Key
73+
3774
* New endpoint for Pay:
75+
3876
* ``GET /sapi/v1/pay/transactions`` to support user query Pay trade history
3977

4078
Fixed
4179
^^^^^
42-
* Removed epoch time from util method ``config_logging`` to provide compatibility with Windows OS
80+
81+
82+
* Removed epoch time in util method ``config_logging`` to provide compatibility with Windows OS
4383
* Allow optional parameter for method ``isolated_margin_account_limit``
4484

4585
1.7.0 - 2021-11-04
4686
------------------
4787

4888
Updated
4989
^^^^^^^
90+
91+
5092
* Universal transfer types:
51-
* Added ``MAIN_FUNDING``, ``FUNDING_MAIN``, ``FUNDING_UMFUTURE``, ``UMFUTURE_FUNDING``, ``MARGIN_FUNDING``, ``FUNDING_MARGIN``, ``FUNDING_CMFUTURE`` and ``CMFUTURE_FUNDING`` to support transfer assets among funding account and other accounts
52-
* Deleted ``MAIN_C2C``, ``C2C_MAIN``, ``C2C_UMFUTURE``, ``C2C_MINING``, ``UMFUTURE_C2C``, ``MINING_C2C``, ``MARGIN_C2C``, ``C2C_MARGIN``, ``MAIN_PAY`` and ``PAY_MAIN`` as C2C account, Binance Payment, Binance Card and other business accounts are merged into a Funding account and they'll be discontinued on November 04, 2021 08:00 AM UTC
93+
94+
* Added ``MAIN_FUNDING``\ , ``FUNDING_MAIN``\ , ``FUNDING_UMFUTURE``\ , ``UMFUTURE_FUNDING``\ , ``MARGIN_FUNDING``\ , ``FUNDING_MARGIN``\ , ``FUNDING_CMFUTURE`` and ``CMFUTURE_FUNDING`` to support transfer assets among funding account and other accounts
95+
* Deleted ``MAIN_C2C``\ , ``C2C_MAIN``\ , ``C2C_UMFUTURE``\ , ``C2C_MINING``\ , ``UMFUTURE_C2C``\ , ``MINING_C2C``\ , ``MARGIN_C2C``\ , ``C2C_MARGIN``\ , ``MAIN_PAY`` and ``PAY_MAIN`` as C2C account, Binance Payment, Binance Card and other business accounts are merged into a Funding account and they'll be discontinued on November 04, 2021 08:00 AM UTC
96+
5397
* Util method ``config_logging`` can now provide date time in UTC and epoch time
5498

5599
Added
56100
^^^^^
57-
* New endpoint ``GET api/v3/rateLimit/order`` to display the user's current order count usage for all intervals
58101

59102

103+
* New endpoint ``GET api/v3/rateLimit/order`` to display the user's current order count usage for all intervals
104+
60105
1.6.0 - 2021-09-24
61106
------------------
62107

63108
Added
64109
^^^^^
65110

66-
* Universal transfer types ``MAIN_PAY``, ``PAY_MAIN``, ``ISOLATEDMARGIN_MARGIN``,``MARGIN_ISOLATEDMARGIN``,``ISOLATEDMARGIN_ISOLATEDMARGIN``
67111

112+
* Universal transfer types ``MAIN_PAY``\ , ``PAY_MAIN``\ , ``ISOLATEDMARGIN_MARGIN``\ \ ``MARGIN_ISOLATEDMARGIN``\ \ ``ISOLATEDMARGIN_ISOLATEDMARGIN``
68113
* New endpoints for Margin OCO orders:
69114

70115
* ``POST /sapi/v1/margin/order/oco`` to send new margin OCO order
@@ -85,21 +130,21 @@ Added
85130
* ``GET /sapi/v1/bswap/addLiquidityPreview`` to calculate expected share amount for adding liquidity in single or dual token
86131
* ``GET /sapi/v1/bswap/removeLiquidityPreview`` to calculate expected asset amount of single token redemption or dual token redemption
87132

88-
89133
1.5.0 - 2021-08-17
90134
------------------
91135

92136
Changed
93137
^^^^^^^
94138

139+
95140
* ``GET api/v3/exchangeInfo`` now supports single or multi-symbol query
96141
* ``GET api/v3/myTrades`` has a new optional field ``orderId``
97142

98143
Added
99144
^^^^^
100145

101-
* ``GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`` to query user C2C trade history
102146

147+
* ``GET /sapi/v1/c2c/orderMatch/listUserOrderHistory`` to query user C2C trade history
103148

104149
1.4.0 - 2021-07-30
105150
------------------

docs/source/binance.spot.bswap.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ Add Liquidity Preview (USER_DATA)
4444
Remove Liquidity Preview (USER_DATA)
4545
------------------------------------
4646
.. autofunction:: binance.spot.bswap.bswap_remove_liquidity_preview
47+
48+
Get Unclaimed Rewards Record (USER_DATA)
49+
----------------------------------------
50+
.. autofunction:: binance.spot.bswap_unclaimed_rewards
51+
52+
Claim rewards (TRADE)
53+
---------------------
54+
.. autofunction:: binance.spot.bswap.bswap_claim_rewards
55+
56+
Get Claimed History (USER_DATA)
57+
-------------------------------
58+
.. autofunction:: binance.spot.bswap.bswap_claimed_rewards

docs/source/binance.spot.mining.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ Hashrate Resale List (USER_DATA)
4848
Hashrate Resale Detail (USER_DATA)
4949
----------------------------------
5050
.. autofunction:: binance.spot.mining.mining_hashrate_resale_details
51+
52+
Mining Account Earning (USER_DATA)
53+
----------------------------------
54+
.. autofunction:: binance.spot.mining.mining_account_earning
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python
2+
3+
import logging
4+
from binance.spot import Spot as Client
5+
from binance.lib.utils import config_logging
6+
7+
config_logging(logging, logging.DEBUG)
8+
9+
key = ""
10+
secret = ""
11+
12+
13+
client = Client(key, secret)
14+
logging.info(client.bswap_claim_rewards(type=0))
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python
2+
3+
import logging
4+
from binance.spot import Spot as Client
5+
from binance.lib.utils import config_logging
6+
7+
config_logging(logging, logging.DEBUG)
8+
9+
key = ""
10+
secret = ""
11+
12+
13+
client = Client(key, secret)
14+
logging.info(client.bswap_claimed_rewards(type=0, assetRewards="BNB"))
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python
2+
3+
import logging
4+
from binance.spot import Spot as Client
5+
from binance.lib.utils import config_logging
6+
7+
config_logging(logging, logging.DEBUG)
8+
9+
key = ""
10+
secret = ""
11+
12+
13+
client = Client(key, secret)
14+
logging.info(client.bswap_unclaimed_rewards(type=0))

0 commit comments

Comments
 (0)