Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add withdrawal endpoint to TradeClient #14

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions bitfinex/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down