def parse_order(self, order, market=None):
    timestamp = None
    if ('lastModificationTime' in order):
        timestamp = self.safe_string(order, 'lastModificationTime')
        if (timestamp is not None):
            if (timestamp.find('T') >= 0):
                timestamp = self.parse8601(timestamp)
            else:
                timestamp = self.safe_integer(order, 'lastModificationTime')
    trades = None
    status = self.parse_order_status(self.safe_string_2(order, 'status', 'orderStatus'))
    symbol = None
    if (market is None):
        marketId = self.safe_string(order, 'currencyPair')
        marketId = self.safe_string(order, 'symbol', marketId)
        if (marketId in self.markets_by_id):
            market = self.markets_by_id[marketId]
    type = self.safe_string_lower(order, 'type')
    side = None
    if (type is not None):
        orderType = type.split('_')
        type = orderType[0]
        side = orderType[1]
    price = self.safe_float(order, 'price')
    remaining = self.safe_float(order, 'remainingQuantity')
    remaining = self.safe_float(order, 'remaining_quantity', remaining)
    amount = self.safe_float(order, 'quantity', remaining)
    filled = None
    if (remaining is not None):
        filled = (amount - remaining)
    cost = None
    if ((filled is not None) and (price is not None)):
        cost = (filled * price)
    feeRate = self.safe_float(order, 'commission_rate')
    feeCost = None
    if ((cost is not None) and (feeRate is not None)):
        feeCost = (cost * feeRate)
    feeCurrency = None
    if (market is not None):
        symbol = market['symbol']
        feeCurrency = market['quote']
    return {'info': order, 'id': order['id'], 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'lastTradeTimestamp': None, 'status': status, 'symbol': symbol, 'type': type, 'side': side, 'price': price, 'amount': amount, 'cost': cost, 'filled': filled, 'remaining': remaining, 'trades': trades, 'fee': {'cost': feeCost, 'currency': feeCurrency, 'rate': feeRate}}
def parse_order(self, order, market=None):
    timestamp = None
    if ('lastModificationTime' in order):
        timestamp = self.safe_string(order, 'lastModificationTime')
        if (timestamp is not None):
            if (timestamp.find('T') >= 0):
                timestamp = self.parse8601(timestamp)
            else:
                timestamp = self.safe_integer(order, 'lastModificationTime')
    trades = None
    status = self.parse_order_status(self.safe_string_2(order, 'status', 'orderStatus'))
    symbol = None
    if (market is None):
        marketId = self.safe_string(order, 'currencyPair')
        marketId = self.safe_string(order, 'symbol', marketId)
        if (marketId in self.markets_by_id):
            market = self.markets_by_id[marketId]
    type = self.safe_string_lower(order, 'type')
    side = None
    if (type is not None):
        orderType = type.split('_')
        type = orderType[0]
        side = orderType[1]
    price = self.safe_float(order, 'price')
    remaining = self.safe_float(order, 'remainingQuantity')
    remaining = self.safe_float(order, 'remaining_quantity', remaining)
    amount = self.safe_float(order, 'quantity', remaining)
    filled = None
    if (remaining is not None):
        filled = (amount - remaining)
    cost = None
    if ((filled is not None) and (price is not None)):
        cost = (filled * price)
    feeRate = self.safe_float(order, 'commission_rate')
    feeCost = None
    if ((cost is not None) and (feeRate is not None)):
        feeCost = (cost * feeRate)
    feeCurrency = None
    if (market is not None):
        symbol = market['symbol']
        feeCurrency = market['quote']
    return {'info': order, 'id': order['id'], 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'lastTradeTimestamp': None, 'status': status, 'symbol': symbol, 'type': type, 'side': side, 'price': price, 'amount': amount, 'cost': cost, 'filled': filled, 'remaining': remaining, 'trades': trades, 'fee': {'cost': feeCost, 'currency': feeCurrency, 'rate': feeRate}}