def fetch_order(self, id, symbol=None, params={}):
    if (symbol is None):
        raise ArgumentsRequired((self.id + ' fetchOrder() requires a symbol argument'))
    self.load_markets()
    market = self.market(symbol)
    defaultType = self.safe_string_2(self.options, 'fetchOrder', 'defaultType', market['type'])
    type = self.safe_string(params, 'type', defaultType)
    if (type is None):
        raise ArgumentsRequired((self.id + " fetchOrder() requires a type parameter(one of 'spot', 'margin', 'futures', 'swap')."))
    instrumentId = ('InstrumentId' if (market['futures'] or market['swap']) else '')
    method = ((type + 'GetOrders') + instrumentId)
    request = {'instrument_id': market['id']}
    clientOid = self.safe_string(params, 'client_oid')
    if (clientOid is not None):
        method += 'ClientOid'
        request['client_oid'] = clientOid
    else:
        method += 'OrderId'
        request['order_id'] = id
    query = self.omit(params, 'type')
    response = getattr(self, method)(self.extend(request, query))
    return self.parse_order(response)
def fetch_order(self, id, symbol=None, params={}):
    if (symbol is None):
        raise ArgumentsRequired((self.id + ' fetchOrder() requires a symbol argument'))
    self.load_markets()
    market = self.market(symbol)
    defaultType = self.safe_string_2(self.options, 'fetchOrder', 'defaultType', market['type'])
    type = self.safe_string(params, 'type', defaultType)
    if (type is None):
        raise ArgumentsRequired((self.id + " fetchOrder() requires a type parameter(one of 'spot', 'margin', 'futures', 'swap')."))
    instrumentId = ('InstrumentId' if (market['futures'] or market['swap']) else )
    method = ((type + 'GetOrders') + instrumentId)
    request = {'instrument_id': market['id']}
    clientOid = self.safe_string(params, 'client_oid')
    if (clientOid is not None):
        method += 'ClientOid'
        request['client_oid'] = clientOid
    else:
        method += 'OrderId'
        request['order_id'] = id
    query = self.omit(params, 'type')
    response = getattr(self, method)(self.extend(request, query))
    return self.parse_order(response)