From 67680c25c06bd9af032ceeef0c54d3b2acf54064 Mon Sep 17 00:00:00 2001 From: Sam McHardy Date: Thu, 29 Mar 2018 16:45:03 +1100 Subject: [PATCH] Add endpoint to get withdrawal fees --- binance/client.py | 22 ++++++++++++++++++++++ docs/withdraw.rst | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/binance/client.py b/binance/client.py index b49e43837..f815eddbf 100644 --- a/binance/client.py +++ b/binance/client.py @@ -1728,6 +1728,28 @@ def get_deposit_address(self, **params): """ return self._request_withdraw_api('get', 'depositAddress.html', True, data=params) + def get_withdraw_fee(self, **params): + """Fetch the withdrawal fee for an asset + + :param asset: required + :type asset: str + :param recvWindow: the number of milliseconds the request is valid for + :type recvWindow: int + + :returns: API response + + .. code-block:: python + + { + "withdrawFee": "0.0005", + "success": true + } + + :raises: BinanceRequestException, BinanceAPIException + + """ + return self._request_withdraw_api('get', 'withdrawFee.html', True, data=params) + # User Stream Endpoints def stream_get_listen_key(self): diff --git a/docs/withdraw.rst b/docs/withdraw.rst index 8bec21ef0..ac23d27ee 100644 --- a/docs/withdraw.rst +++ b/docs/withdraw.rst @@ -63,3 +63,10 @@ Raises a `BinanceWithdrawException `_ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code:: python + + address = client.get_withdraw_fee(asset='BTC')