def parse_ledger_entry(self, item, currency=None):
    id = self.safe_string(item, 'ledger_id')
    account = None
    details = self.safe_value(item, 'details', {})
    referenceId = self.safe_string(details, 'order_id')
    referenceAccount = None
    type = self.parse_ledger_entry_type(self.safe_string(item, 'type'))
    code = self.safe_currency_code(self.safe_string(item, 'currency'), currency)
    amount = self.safe_float(item, 'amount')
    timestamp = self.parse8601(self.safe_string(item, 'timestamp'))
    fee = {'cost': self.safe_float(item, 'fee'), 'currency': code}
    before = None
    after = self.safe_float(item, 'balance')
    status = 'ok'
    marketId = self.safe_string(item, 'instrument_id')
    symbol = None
    if (marketId in self.markets_by_id):
        market = self.markets_by_id[marketId]
        symbol = market['symbol']
    return {'info': item, 'id': id, 'account': account, 'referenceId': referenceId, 'referenceAccount': referenceAccount, 'type': type, 'currency': code, 'symbol': symbol, 'amount': amount, 'before': before, 'after': after, 'status': status, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'fee': fee}
def parse_ledger_entry(self, item, currency=None):
    id = self.safe_string(item, 'ledger_id')
    account = None
    details = self.safe_value(item, 'details', {})
    referenceId = self.safe_string(details, 'order_id')
    referenceAccount = None
    type = self.parse_ledger_entry_type(self.safe_string(item, 'type'))
    code = self.safe_currency_code(self.safe_string(item, 'currency'), currency)
    amount = self.safe_float(item, 'amount')
    timestamp = self.parse8601(self.safe_string(item, 'timestamp'))
    fee = {'cost': self.safe_float(item, 'fee'), 'currency': code}
    before = None
    after = self.safe_float(item, 'balance')
    status = 'ok'
    marketId = self.safe_string(item, 'instrument_id')
    symbol = None
    if (marketId in self.markets_by_id):
        market = self.markets_by_id[marketId]
        symbol = market['symbol']
    return {'info': item, 'id': id, 'account': account, 'referenceId': referenceId, 'referenceAccount': referenceAccount, 'type': type, 'currency': code, 'symbol': symbol, 'amount': amount, 'before': before, 'after': after, 'status': status, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'fee': fee}