The back-end websocket server for wowlet.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
802 B

# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2020, The Monero Project.
# Copyright (c) 2020,
class WebsocketParse:
async def parser(cmd: str, data=None):
if cmd == "txFiatHistory":
return await WebsocketParse.txFiatHistory(data)
async def txFiatHistory(data=None):
if not data or not isinstance(data, dict):
if "year" not in data or not isinstance(data['year'], int):
if "month" in data and not isinstance(data['month'], int):
year = data.get('year')
month = data.get('month')
from wowlet_backend.tasks.historical_prices import HistoricalPriceTask
return await HistoricalPriceTask.get(year, month)