Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public interface PriceFeed

Known subtypesCachingPriceFeed, CoinGeckoFeed, JsonPriceFeed

A source of prices. CoinGeckoFeed covers most assets, JsonPriceFeed adapts any HTTP API that answers a price in JSON, and CachingPriceFeed keeps answers for a while so a screen that refreshes does not spend a rate limit.

Methods

public abstract Quote getQuote(String base, String quote) throws IOExceptionThe price of base in quote, by ticker (BTC, ETH, USD, EUR); case does not matter.

Method details

getQuote

public abstract Quote getQuote(String base, String quote) throws IOException
The price of base in quote, by ticker (BTC, ETH, USD, EUR); case does not matter.

Throws

IOException
when the source cannot be reached or does not know the pair