def parse_transaction(self, transaction, currency=None):
    txid = None
    address = None
    id = self.safe_string(transaction, 'documentId')
    amount = self.safe_float(transaction, 'amount')
    timestamp = self.safe_integer(transaction, 'date')
    type = self.safe_string_lower(transaction, 'type')
    currencyId = self.safe_string(transaction, 'fixedCurrency')
    feeCost = self.safe_float(transaction, 'fee')
    code = self.safe_currency_code(currencyId, currency)
    if (type == 'withdrawal'):
        txid = self.safe_string(transaction, 'externalKey')
        address = self.safe_string(transaction, 'id')
    elif (type == 'deposit'):
        address = self.safe_string(transaction, 'externalKey')
        txid = self.safe_string(transaction, 'id')
    status = None
    if (type == 'deposit'):
        status = 'ok'
    return {'info': transaction, 'id': id, 'currency': code, 'amount': amount, 'address': address, 'tag': None, 'status': status, 'type': type, 'updated': None, 'txid': txid, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'fee': {'currency': code, 'cost': feeCost}}
def parse_transaction(self, transaction, currency=None):
    txid = None
    address = None
    id = self.safe_string(transaction, 'documentId')
    amount = self.safe_float(transaction, 'amount')
    timestamp = self.safe_integer(transaction, 'date')
    type = self.safe_string_lower(transaction, 'type')
    currencyId = self.safe_string(transaction, 'fixedCurrency')
    feeCost = self.safe_float(transaction, 'fee')
    code = self.safe_currency_code(currencyId, currency)
    if (type == 'withdrawal'):
        txid = self.safe_string(transaction, 'externalKey')
        address = self.safe_string(transaction, 'id')
    elif (type == 'deposit'):
        address = self.safe_string(transaction, 'externalKey')
        txid = self.safe_string(transaction, 'id')
    status = None
    if (type == 'deposit'):
        status = 'ok'
    return {'info': transaction, 'id': id, 'currency': code, 'amount': amount, 'address': address, 'tag': None, 'status': status, 'type': type, 'updated': None, 'txid': txid, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'fee': {'currency': code, 'cost': feeCost}}