Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 2.15 KB

File metadata and controls

65 lines (47 loc) · 2.15 KB

Withdraw Endpoints

Make sure you enable Withdrawal permissions for your API Key to use this call.

You must have withdrawn to the address through the website and approved the withdrawal via email before you can withdraw using the API.

Raises a BinanceWithdrawException if the withdraw fails.

from binance.exceptions import BinanceAPIException, BinanceWithdrawException
try:
    # name parameter will be set to the asset value by the client if not passed
    result = client.withdraw(
        asset='ETH',
        address='<eth_address>',
        amount=100)
except BinanceAPIException as e:
    print(e)
except BinanceWithdrawException as e:
    print(e)
else:
    print("Success")

# passing a name parameter
result = client.withdraw(
    asset='ETH',
    address='<eth_address>',
    amount=100,
    name='Withdraw')

# if the coin requires a extra tag or name such as XRP or XMR then pass an `addressTag` parameter.
result = client.withdraw(
    asset='XRP',
    address='<xrp_address>',
    addressTag='<xrp_address_tag>',
    amount=10000)
deposits = client.get_deposit_history()
btc_deposits = client.get_deposit_history(asset='BTC')
withdraws = client.get_withdraw_history()
btc_withdraws = client.get_withdraw_history(asset='BTC')
address = client.get_deposit_address(asset='BTC')