From 2637d10055ceeef011ad086397ef4386f72d87bb Mon Sep 17 00:00:00 2001 From: Alexis Carrara Date: Thu, 28 Mar 2019 17:33:57 +0100 Subject: [PATCH] change crypto_withdraw signature : add 2 parameters destination_tag and no_destination_tag to stick to coinbase pro API signature. --- cbpro/authenticated_client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cbpro/authenticated_client.py b/cbpro/authenticated_client.py index 0c2dc32..710c415 100644 --- a/cbpro/authenticated_client.py +++ b/cbpro/authenticated_client.py @@ -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): """ 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:: @@ -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))