Ejemplo n.º 1
0
 def getOrderInfo(self, orderId):
     params = {"method": "order_info"}
     params['coin_type'] = self.coinType
     params['id'] = orderId
     extra = {}
     res = send2api(params, extra)
     if res and "code" not in res:
         order_info = Order()
         order_info.order_id = res['id']
         order_info.status = res['status']
         order_info.price = float(res['order_price'])
         order_info.deal_amount = float(res['processed_amount'])
         order_info.avg_price = float(res['processed_price'])
         return order_info
     return None
Ejemplo n.º 2
0
    def getOrderInfo(self, orderId):
        ORDER_INFO_RESOURCE = "/api/v1/order_info.do"
        params = {
            'api_key': APIKEY,
            'symbol': self.symbol,
            'order_id': orderId
        }
        params['sign'] = buildMySign(params, SECRETKEY)
        res = httpPost(URL, ORDER_INFO_RESOURCE, params)

        if res and res['result']:
            order_info = Order()
            order_info.order_id = res["orders"][0]["order_id"]
            order_info.price = res["orders"][0]["price"]
            order_info.avg_price = res["orders"][0]['avg_price']
            order_info.deal_amount = res["orders"][0]['deal_amount']
            order_info.status = res["orders"][0]["status"]
            return order_info
        return None