Skip to content
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
11 changes: 9 additions & 2 deletions cbpro/authenticated_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,13 +870,16 @@ def coinbase_withdraw(self, amount, currency, coinbase_account_id):
return self._send_message('post', '/withdrawals/coinbase-account',
data=json.dumps(params))

def crypto_withdraw(self, amount, currency, crypto_address):
def crypto_withdraw(self, amount, currency, crypto_address, destination_tag, no_destination_tag=True):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a default argument for destination_tag as well, for currencies that do not support them.

""" Withdraw funds to a crypto address.

Args:
amount (Decimal): The amount to withdraw
currency (str): The type of currency (eg. 'BTC')
crypto_address (str): Crypto address to withdraw to.
destination_tag (str): A destination tag for currencies that support one (XRP and XLM for now)
no_destination_tag (bool): A boolean flag to opt out of using a destination tag for currencies that support
one. This is required when not providing a destination tag.

Returns:
dict: Withdraw details. Example::
Expand All @@ -887,9 +890,13 @@ def crypto_withdraw(self, amount, currency, crypto_address):
}

"""

params = {'amount': amount,
'currency': currency,
'crypto_address': crypto_address}
'crypto_address': crypto_address,
'destination_tag': destination_tag,
'no_destination_tag': no_destination_tag
}
return self._send_message('post', '/withdrawals/crypto',
data=json.dumps(params))

Expand Down