def withdraw(self, code, amount, address, tag=None, params={}):
    self.check_address(address)
    self.load_markets()
    currency = self.currency(code)
    if tag:
        address = ((address + ':') + tag)
    fee = self.safe_string(params, 'fee')
    if (fee is None):
        raise ArgumentsRequired((self.id + " withdraw() requires a `fee` string parameter, network transaction fee must be ≥ 0. Withdrawals to OKCoin or OKEx are fee-free, please set '0'. Withdrawing to external digital asset address requires network transaction fee."))
    request = {'currency': currency['id'], 'to_address': address, 'destination': '4', 'amount': self.number_to_string(amount), 'fee': fee}
    if ('password' in params):
        request['trade_pwd'] = params['password']
    elif ('trade_pwd' in params):
        request['trade_pwd'] = params['trade_pwd']
    elif self.password:
        request['trade_pwd'] = self.password
    query = self.omit(params, ['fee', 'password', 'trade_pwd'])
    if (not ('trade_pwd' in request)):
        raise ExchangeError((self.id + ' withdraw() requires self.password set on the exchange instance or a password / trade_pwd parameter'))
    response = self.accountPostWithdrawal(self.extend(request, query))
    return {'info': response, 'id': self.safe_string(response, 'withdrawal_id')}
def withdraw(self, code, amount, address, tag=None, params={}):
    self.check_address(address)
    self.load_markets()
    currency = self.currency(code)
    if tag:
        address = ((address + ':') + tag)
    fee = self.safe_string(params, 'fee')
    if (fee is None):
        raise ArgumentsRequired((self.id + " withdraw() requires a `fee` string parameter, network transaction fee must be ≥ 0. Withdrawals to OKCoin or OKEx are fee-free, please set '0'. Withdrawing to external digital asset address requires network transaction fee."))
    request = {'currency': currency['id'], 'to_address': address, 'destination': '4', 'amount': self.number_to_string(amount), 'fee': fee}
    if ('password' in params):
        request['trade_pwd'] = params['password']
    elif ('trade_pwd' in params):
        request['trade_pwd'] = params['trade_pwd']
    elif self.password:
        request['trade_pwd'] = self.password
    query = self.omit(params, ['fee', 'password', 'trade_pwd'])
    if (not ('trade_pwd' in request)):
        raise ExchangeError((self.id + ' withdraw() requires self.password set on the exchange instance or a password / trade_pwd parameter'))
    response = self.accountPostWithdrawal(self.extend(request, query))
    return {'info': response, 'id': self.safe_string(response, 'withdrawal_id')}