def get_coin_trade(self, part, coin): coin_trade_resource = "/Api_Market/getCoinTrade" params = { 'part': part, 'coin': coin } return http_post(self.__url, coin_trade_resource, params)
def order_info(self, symbol, trust_id): """ :param symbol: :param trust_id: :return: status : 【状态 0:未成交 1:部分成交 2:全部成交 3:撤销委托】 """ order_info_resource = "/Api_Order/orderInfo" params = {'symbol': symbol,'trust_id': trust_id} params['sign'] = build_my_sign(params, self.__apikey, self.__secretkey) params['api_key'] = self.__apikey return http_post(self.__url, order_info_resource, params)
def coin_trust(self, symbol, type, price, number): cointrust_resource = "/Api_Order/coinTrust" params = { 'symbol': symbol, 'type': type } if price: params['price'] = price if number: params['number'] = number params['sign'] = build_my_sign(params, self.__apikey, self.__secretkey) params['api_key'] = self.__apikey return http_post(self.__url, cointrust_resource, params)
def depth(self, symbol): depth_source = '/Api_Order/depth' params = {'symbol': symbol} return http_post(self.__url, depth_source, params)
def user_balance(self): user_balance_resource = '/Api_User/userBalance' params = {} params['sign'] = build_my_sign(params, self.__apikey, self.__secretkey) params['api_key'] = self.__apikey return http_post(self.__url, user_balance_resource, params)
def trade_list(self, symbol, type): trade_list_resource = '/Api_Order/tradeList' params = {'symbol': symbol, 'type': type} params['sign'] = build_my_sign(params, self.__apikey, self.__secretkey) params['api_key'] = self.__apikey return http_post(self.__url, trade_list_resource, params)
def cancel(self, symbol, order_id): cancel_source = "/Api_Order/cancel" params = {'symbol': symbol, 'order_id': order_id} params['sign'] = build_my_sign(params, self.__apikey, self.__secretkey) params['api_key'] = self.__apikey return http_post(self.__url, cancel_source, params)