Start adding history client

small_kucoin_fixes
jaredgoldman 2023-02-28 12:56:12 -05:00
parent 5fdec8012d
commit c96d4387c5
1 changed files with 7 additions and 6 deletions

View File

@ -53,6 +53,10 @@ class Client:
# else:
# self._key_id = None
# self._key_secret = None
async def request(self, action: Literal["POST", "GET", "PUT", "DELETE"], route: str, api_v: str = 'v2'):
api_url = f"https://api.kucoin.com/api/{api_v}{route}"
res = await asks.request(action, api_url)
return res.json()['data']
async def symbol_info(
self,
@ -68,12 +72,6 @@ class Client:
syms = {item['name']: item for item in entries}
return syms
async def request(self, action: Literal["POST", "GET", "PUT", "DELETE"], route: str):
api_url = f"https://api.kucoin.com/api/v2{route}"
res = await asks.request(action, api_url)
return res.json()['data']
async def cache_symbols(
self,
@ -135,3 +133,6 @@ async def stream_quotes(
loglevel,
task_status,
)
async def open_history_client():