src/fnpb/util/currency_converter.py
def _get_btc_rate(fiat: str) -> Decimal:
    """Uses the Coin Desk API to retrieve the BTC rate in a given fiat currency.

    Args:
        fiat: The fiat currency ticker; can be USD, GBP or EUR.
    Returns:
        The BTC rate in the fiat currency supplied.
    """
    response = requests.get("https://api.coindesk.com/v1/bpi/currentprice.json")
    data = response.json()
    rate = Decimal(data["bpi"][fiat]["rate"].replace(",", ""))
    return rate
Uses the Coin Desk API to retrieve the BTC rate in a given fiat currency.

    Args:
        fiat: The fiat currency ticker; can be USD, GBP or EUR.
    Returns:
        The BTC rate in the fiat currency supplied.
    
Uses the Coin Desk API to retrieve the BTC rate in a given fiat currency.
Uses the Coin Desk API to retrieve the BTC rate in a given fiat currency .
def _get_btc_rate(fiat: str) -> Decimal:
    response = requests.get("https://api.coindesk.com/v1/bpi/currentprice.json")
    data = response.json()
    rate = Decimal(data["bpi"][fiat]["rate"].replace(",", ""))
    return rate
def _get_btc_rate ( fiat : str ) -> Decimal : response = requests . get ( "https://api.coindesk.com/v1/bpi/currentprice.json" ) data = response . json ( ) rate = Decimal ( data [ "bpi" ] [ fiat ] [ "rate" ] . replace ( "," , "" ) ) return rate
Uses the Coin Desk API to retrieve the BTC rate in a given fiat currency.
Uses the Coin Desk API to retrieve the BTC rate in a given fiat currency .
"""Uses the Coin Desk API to retrieve the BTC rate in a given fiat currency.

    Args:
        fiat: The fiat currency ticker; can be USD, GBP or EUR.
    Returns:
        The BTC rate in the fiat currency supplied.
    """
The BTC rate in the fiat currency supplied.
The BTC rate in the fiat currency supplied .
fiat
str
The fiat currency ticker; can be USD, GBP or EUR.
The fiat currency ticker ; can be USD GBP or EUR .