Exemple #1
0
 def order_info(self, symbol, order_id):
     order_info_resource = "/api/v1/order_info.do"
     params = {
         'api_key': self.__api_key,
         'symbol': symbol,
         'order_id': order_id
     }
     params['sign'] = build_sign(params, self.__secret_key)
     return http_post(self.__url, order_info_resource, params)
Exemple #2
0
 def batch_trade(self, symbol, trade_type, orders_data):
     batch_trade_resource = "/api/v1/batch_trade.do"
     params = {
         'api_key': self.__api_key,
         'symbol': symbol,
         'type': trade_type,
         'orders_data': orders_data
     }
     params['sign'] = build_sign(params, self.__secret_key)
     return http_post(self.__url, batch_trade_resource, params)
Exemple #3
0
 def order_history(self, symbol, status, current_page, page_length):
     order_history_resource = "/api/v1/order_history.do"
     params = {
         'api_key': self.__api_key,
         'symbol': symbol,
         'status': status,
         'current_page': current_page,
         'page_length': page_length
     }
     params['sign'] = build_sign(params, self.__secret_key)
     return http_post(self.__url, order_history_resource, params)
Exemple #4
0
    def trade(self, symbol, trade_type, price='', amount=''):
        trade_resource = "/api/v1/trade.do"
        params = {
            'api_key': self.__api_key,
            'symbol': symbol,
            'type': trade_type
        }
        if price:
            params['price'] = price
        if amount:
            params['amount'] = amount

        params['sign'] = build_sign(params, self.__secret_key)
        return http_post(self.__url, trade_resource, params)
Exemple #5
0
 def user_info(self):
     userinfo_resource = "/api/v1/userinfo.do"
     params = dict()
     params['api_key'] = self.__api_key
     params['sign'] = build_sign(params, self.__secret_key)
     return http_post(self.__url, userinfo_resource, params)