From 58f938e0fec1b1eae906f98c6a0100e8590455b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20A=C5=BEna?= Date: Tue, 29 Aug 2017 11:16:07 +0300 Subject: [PATCH] Add withdrawal endpoint to TradeClient --- bitfinex/client.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/bitfinex/client.py b/bitfinex/client.py index 2a47d7d..2cbb7ea 100644 --- a/bitfinex/client.py +++ b/bitfinex/client.py @@ -339,6 +339,34 @@ def history(self, currency, since=0, until=9999999999, limit=500, wallet='exchan return json_resp + def withdraw(self, amount, address, withdraw_type="bitcoin", + walletselected="deposit", **kwargs): + """ + View you balance ledger entries + :param amount: Amount to withdraw. + :param address: Destination address for withdrawal. + :param withdraw_type: can be one of the following ['bitcoin', + 'litecoin', 'ethereum', 'ethereumc', 'mastercoin', 'zcash', + 'monero', 'wire', 'dash', 'ripple', 'eos']. + :param walletselected: The wallet to withdraw from, can be “trading”, + “exchange”, or “deposit”. + :param kwargs: any other parameter + from https://docs.bitfinex.com/v1/reference#rest-auth-withdrawal + """ + payload = { + "request": "/v1/withdraw", + "nonce": self._nonce, + "amount": amount, + "address": address, + "withdraw_type": withdraw_type, + "walletselected": walletselected + } + payload.update(kwargs) + signed_payload = self._sign_payload(payload) + r = requests.post(self.URL + "/withdraw", headers=signed_payload, verify=True) + json_resp = r.json() + + return json_resp class Client: