def withdraw(self, code, amount, address, tag=None, params={}):
    (tag, params) = self.handle_withdraw_tag_and_params(tag, params)
    self.check_address(address)
    self.load_markets()
    methods = {'BTC': 'Bitcoin', 'ETH': 'Ether', 'XRP': 'Ripple', 'BCH': 'Bcash', 'LTC': 'Litecoin'}
    currency = self.currency(code)
    method = (methods[code] if (code in methods) else None)
    if (method is None):
        raise ExchangeError(((self.id + ' not valid withdraw coin: ') + code))
    request = {'amount': amount, 'address': address, 'destination_tag': tag}
    classMethod = (('privatePost' + method) + 'Withdrawal')
    response = getattr(self, classMethod)(self.extend(request, params))
    payload = self.safe_value(response, 'payload', [])
    first = self.safe_value(payload, 0)
    return self.parse_transaction(first, currency)
def withdraw(self, code, amount, address, tag=None, params={}):
    (tag, params) = self.handle_withdraw_tag_and_params(tag, params)
    self.check_address(address)
    self.load_markets()
    methods = {'BTC': 'Bitcoin', 'ETH': 'Ether', 'XRP': 'Ripple', 'BCH': 'Bcash', 'LTC': 'Litecoin'}
    currency = self.currency(code)
    method = (methods[code] if (code in methods) else None)
    if (method is None):
        raise ExchangeError(((self.id + ' not valid withdraw coin: ') + code))
    request = {'amount': amount, 'address': address, 'destination_tag': tag}
    classMethod = (('privatePost' + method) + 'Withdrawal')
    response = getattr(self, classMethod)(self.extend(request, params))
    payload = self.safe_value(response, 'payload', [])
    first = self.safe_value(payload, 0)
    return self.parse_transaction(first, currency)