def parse_order(self, order, market=None):
    id = self.safe_string(order, 'orderId')
    timestamp = self.safe_integer(order, 'created')
    marketId = self.safe_string(order, 'market')
    market = self.safe_market(marketId, market, '-')
    symbol = market['symbol']
    status = self.parse_order_status(self.safe_string(order, 'status'))
    side = self.safe_string(order, 'side')
    type = self.safe_string(order, 'orderType')
    price = self.safe_string(order, 'price')
    amount = self.safe_string(order, 'amount')
    remaining = self.safe_string(order, 'amountRemaining')
    filled = self.safe_string(order, 'filledAmount')
    cost = self.safe_string(order, 'filledAmountQuote')
    fee = None
    feeCost = self.safe_number(order, 'feePaid')
    if (feeCost is not None):
        feeCurrencyId = self.safe_string(order, 'feeCurrency')
        feeCurrencyCode = self.safe_currency_code(feeCurrencyId)
        fee = {'cost': feeCost, 'currency': feeCurrencyCode}
    rawTrades = self.safe_value(order, 'fills', [])
    timeInForce = self.safe_string(order, 'timeInForce')
    postOnly = self.safe_value(order, 'postOnly')
    stopPrice = self.safe_number(order, 'triggerPrice')
    return self.safe_order({'info': order, 'id': id, 'clientOrderId': None, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'lastTradeTimestamp': None, 'symbol': symbol, 'type': type, 'timeInForce': timeInForce, 'postOnly': postOnly, 'side': side, 'price': price, 'stopPrice': stopPrice, 'amount': amount, 'cost': cost, 'average': None, 'filled': filled, 'remaining': remaining, 'status': status, 'fee': fee, 'trades': rawTrades}, market)
def parse_order(self, order, market=None):
    id = self.safe_string(order, 'orderId')
    timestamp = self.safe_integer(order, 'created')
    marketId = self.safe_string(order, 'market')
    market = self.safe_market(marketId, market, '-')
    symbol = market['symbol']
    status = self.parse_order_status(self.safe_string(order, 'status'))
    side = self.safe_string(order, 'side')
    type = self.safe_string(order, 'orderType')
    price = self.safe_string(order, 'price')
    amount = self.safe_string(order, 'amount')
    remaining = self.safe_string(order, 'amountRemaining')
    filled = self.safe_string(order, 'filledAmount')
    cost = self.safe_string(order, 'filledAmountQuote')
    fee = None
    feeCost = self.safe_number(order, 'feePaid')
    if (feeCost is not None):
        feeCurrencyId = self.safe_string(order, 'feeCurrency')
        feeCurrencyCode = self.safe_currency_code(feeCurrencyId)
        fee = {'cost': feeCost, 'currency': feeCurrencyCode}
    rawTrades = self.safe_value(order, 'fills', [])
    timeInForce = self.safe_string(order, 'timeInForce')
    postOnly = self.safe_value(order, 'postOnly')
    stopPrice = self.safe_number(order, 'triggerPrice')
    return self.safe_order({'info': order, 'id': id, 'clientOrderId': None, 'timestamp': timestamp, 'datetime': self.iso8601(timestamp), 'lastTradeTimestamp': None, 'symbol': symbol, 'type': type, 'timeInForce': timeInForce, 'postOnly': postOnly, 'side': side, 'price': price, 'stopPrice': stopPrice, 'amount': amount, 'cost': cost, 'average': None, 'filled': filled, 'remaining': remaining, 'status': status, 'fee': fee, 'trades': rawTrades}, market)