From d172bf620bedc14a2d9d6604e4cd709fb22083af Mon Sep 17 00:00:00 2001 From: Dario Moceri Date: Fri, 29 Jan 2021 15:48:38 +0100 Subject: [PATCH] Readded get_public_tickers() (I accidentally removed it) --- bfxapi/rest/bfx_rest.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bfxapi/rest/bfx_rest.py b/bfxapi/rest/bfx_rest.py index 70991b3..0b72c95 100644 --- a/bfxapi/rest/bfx_rest.py +++ b/bfxapi/rest/bfx_rest.py @@ -163,6 +163,19 @@ class BfxRest: ticker = await self.fetch(endpoint) return ticker + async def get_public_tickers(self, symbols): + """ + Get tickers for the given symbols. Tickers shows you the current best bid and ask, + as well as the last trade price. + # Attributes + @param symbols Array: array of symbols i.e [tBTCUSD, tETHUSD] + @return Array [ SYMBOL, BID, BID_SIZE, ASK, ASK_SIZE, DAILY_CHANGE, DAILY_CHANGE_PERC, + LAST_PRICE, VOLUME, HIGH, LOW ] + """ + endpoint = "tickers/?symbols={}".format(','.join(symbols)) + ticker = await self.fetch(endpoint) + return ticker + async def get_public_tickers_history(self, symbols): """ History of recent tickers. @@ -177,7 +190,6 @@ class BfxRest: ticker = await self.fetch(endpoint) return ticker - async def get_derivative_status(self, symbol): """ Gets platform information for derivative symbol.