def get_current_prices(): all_cryptos = ",".join(Currency.list_codes()) resp = get( url="https://min-api.cryptocompare.com/data/pricemulti", params={"fsyms": all_cryptos, "tsyms": "USD", "api_key": env["PRICE_API_KEY"]}, ) return resp.json()
def get_currencies(): return make_response(jsonify(result=Currency.list_codes()), 200)
def validate_currency(curr): if curr not in Currency.list_codes(): raise ValidationError("Invalid currency")