def future_trades(self, symbol, contractType): FUTURE_TRADES_RESOURCE = "/api/v1/future_trades.do" params = '' if symbol: params += '&symbol=' + symbol if params else 'symbol=' + symbol if contractType: params += '&contract_type=' + contractType if params else 'contract_type=' + symbol return httpGet(self.__url, FUTURE_TRADES_RESOURCE, params)
def trades(self, currency_pair=''): TRADES_RESOURCE = "/api/v1/trades.do" params = '' if currency_pair: params = 'symbol=%(symbol)s' % {'symbol': currency_pair} result = httpGet(self.base_url, TRADES_RESOURCE, params) result = universal.Trades(self.__market, currency_pair, result, 2) return result
def depth(self, currency_pair='btc_usdt'): DEPTH_RESOURCE = "/api/v1/depth.do" params = '' if currency_pair: params = 'symbol=%(symbol)s' % {'symbol': currency_pair} result = httpGet(self.base_url, DEPTH_RESOURCE, params) print(result) result = universal.Depth(self.__market, currency_pair, result) return result
def ticker(self, currency_pair='btc_usdt'): TICKER_RESOURCE = "/api/v1/ticker.do" params = '' if currency_pair: params = 'symbol=%(symbol)s' % {'symbol': currency_pair} result = universal.Ticker( self.__market, currency_pair, httpGet(self.base_url, TICKER_RESOURCE, params)) return result
def future_depth(self, symbol, contractType, size): FUTURE_DEPTH_RESOURCE = "/api/v1/future_depth.do" params = '' if symbol: params += '&symbol=' + symbol if params else 'symbol=' + symbol if contractType: params += '&contract_type=' + contractType if params else 'contract_type=' + symbol if size: params += '&size=' + size if params else 'size=' + size return httpGet(self.__url, FUTURE_DEPTH_RESOURCE, params)
def k_line(self, currency_pair, interval='1min', size=None): KLINE_RESOURCE = "/api/v1/kline.do" params = '' if currency_pair: params = 'symbol=%(symbol)s&type=%(interval)s' % { 'symbol': currency_pair, 'interval': interval } result = httpGet(self.base_url, KLINE_RESOURCE, params) result = universal.Klines(self.__market, currency_pair, result) return result
def future_estimated_price(self, symbol): FUTURE_ESTIMATED_PRICE = "/api/v1/future_estimated_price.do" params = '' if symbol: params = 'symbol=' + symbol return httpGet(self.__url, FUTURE_ESTIMATED_PRICE, params)
def exchange_rate(self): EXCHANGE_RATE = "/api/v1/exchange_rate.do" return httpGet(self.__url, EXCHANGE_RATE, '')
def future_index(self, symbol): FUTURE_INDEX = "/api/v1/future_index.do" params = '' if symbol: params = 'symbol=' + symbol return httpGet(self.__url, FUTURE_INDEX, params)
def trades(self, currency_pair=''): TRADES_RESOURCE = "/api/v1/trades.do" params = '' if currency_pair: params = 'symbol=%(symbol)s' % {'symbol': currency_pair} return httpGet(self.base_url, TRADES_RESOURCE, params)
def trades(self, symbol=''): TRADES_RESOURCE = "/api/v1/trades.do" params = '' if symbol: params = 'symbol=%(symbol)s' % {'symbol': symbol} return httpGet(self.__url, TRADES_RESOURCE, params)
def depth(self, symbol=''): DEPTH_RESOURCE = "/api/v1/depth.do" params = '' if symbol: params = 'symbol=%(symbol)s' % {'symbol': symbol} return httpGet(self.__url, DEPTH_RESOURCE, params)
def ticker(self, symbol=''): TICKER_RESOURCE = "/api/v1/ticker.do" params = '' if symbol: params = 'symbol=%(symbol)s' % {'symbol': symbol} return httpGet(self.__url, TICKER_RESOURCE, params)