예제 #1
0
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()
예제 #2
0
def get_currencies():
    return make_response(jsonify(result=Currency.list_codes()), 200)
예제 #3
0
def validate_currency(curr):
    if curr not in Currency.list_codes():
        raise ValidationError("Invalid currency")