Skip to content

Commit 8483ceb

Browse files
author
Sam McHardy
committed
Add get_dust_log function
1 parent 71fe660 commit 8483ceb

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

binance/client.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,87 @@ def get_account_status(self, **params):
16611661
raise BinanceWithdrawException(res['msg'])
16621662
return res
16631663

1664+
def get_dust_log(self, **params):
1665+
"""Get log of small amounts exchanged for BNB.
1666+
1667+
https://github.com/binance-exchange/binance-official-api-docs/blob/master/wapi-api.md#dustlog-user_data
1668+
1669+
:param recvWindow: the number of milliseconds the request is valid for
1670+
:type recvWindow: int
1671+
1672+
:returns: API response
1673+
1674+
.. code-block:: python
1675+
1676+
{
1677+
"success": true,
1678+
"results": {
1679+
"total": 2, //Total counts of exchange
1680+
"rows": [
1681+
{
1682+
"transfered_total": "0.00132256", # Total transfered BNB amount for this exchange.
1683+
"service_charge_total": "0.00002699", # Total service charge amount for this exchange.
1684+
"tran_id": 4359321,
1685+
"logs": [ # Details of this exchange.
1686+
{
1687+
"tranId": 4359321,
1688+
"serviceChargeAmount": "0.000009",
1689+
"uid": "10000015",
1690+
"amount": "0.0009",
1691+
"operateTime": "2018-05-03 17:07:04",
1692+
"transferedAmount": "0.000441",
1693+
"fromAsset": "USDT"
1694+
},
1695+
{
1696+
"tranId": 4359321,
1697+
"serviceChargeAmount": "0.00001799",
1698+
"uid": "10000015",
1699+
"amount": "0.0009",
1700+
"operateTime": "2018-05-03 17:07:04",
1701+
"transferedAmount": "0.00088156",
1702+
"fromAsset": "ETH"
1703+
}
1704+
],
1705+
"operate_time": "2018-05-03 17:07:04" //The time of this exchange.
1706+
},
1707+
{
1708+
"transfered_total": "0.00058795",
1709+
"service_charge_total": "0.000012",
1710+
"tran_id": 4357015,
1711+
"logs": [ // Details of this exchange.
1712+
{
1713+
"tranId": 4357015,
1714+
"serviceChargeAmount": "0.00001",
1715+
"uid": "10000015",
1716+
"amount": "0.001",
1717+
"operateTime": "2018-05-02 13:52:24",
1718+
"transferedAmount": "0.00049",
1719+
"fromAsset": "USDT"
1720+
},
1721+
{
1722+
"tranId": 4357015,
1723+
"serviceChargeAmount": "0.000002",
1724+
"uid": "10000015",
1725+
"amount": "0.0001",
1726+
"operateTime": "2018-05-02 13:51:11",
1727+
"transferedAmount": "0.00009795",
1728+
"fromAsset": "ETH"
1729+
}
1730+
],
1731+
"operate_time": "2018-05-02 13:51:11"
1732+
}
1733+
]
1734+
}
1735+
}
1736+
1737+
:raises: BinanceWithdrawException
1738+
1739+
"""
1740+
res = self._request_withdraw_api('get', 'userAssetDribbletLog.html', True, data=params)
1741+
if not res['success']:
1742+
raise BinanceWithdrawException(res['msg'])
1743+
return res
1744+
16641745
# Withdraw Endpoints
16651746

16661747
def withdraw(self, **params):

docs/account.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,10 @@ Account
159159
.. code:: python
160160
161161
trades = client.get_my_trades(symbol='BNBBTC')
162+
163+
`Get dust log <binance.html#binance.client.Client.get_dust_log>`_
164+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
165+
166+
.. code:: python
167+
168+
trades = client.get_dust_log()

0 commit comments

Comments
 (0)