Search in sources :

Example 1 with CoinMarketCapCurrency

use of org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency in project XChange by knowm.

the class CoinMarketCapMarketDataService method getCurrencies.

public List<Currency> getCurrencies() {
    List<Currency> currencies = new ArrayList<>();
    List<CoinMarketCapCurrency> cmcCurrencies = getCoinMarketCapCurrencies();
    for (CoinMarketCapCurrency cmcCurrency : cmcCurrencies) {
        currencies.add(cmcCurrency.getCurrency());
    }
    return currencies;
}
Also used : CoinMarketCapCurrency(org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency) CoinMarketCapCurrency(org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency) Currency(org.knowm.xchange.currency.Currency) ArrayList(java.util.ArrayList)

Example 2 with CoinMarketCapCurrency

use of org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency in project XChange by knowm.

the class CoinMarketCapMarketDataService method getCoinMarketCapCurrencies.

@Override
public List<CoinMarketCapCurrency> getCoinMarketCapCurrencies() {
    Collection<CoinMarketCapTicker> tickers = this.tickers.values();
    List<CoinMarketCapCurrency> currencies = new ArrayList<>();
    for (CoinMarketCapTicker ticker : tickers) currencies.add(ticker.getBaseCurrency());
    return currencies;
}
Also used : CoinMarketCapCurrency(org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency) CoinMarketCapTicker(org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapTicker) ArrayList(java.util.ArrayList)

Example 3 with CoinMarketCapCurrency

use of org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency in project XChange by knowm.

the class CoinMarketCapMarketDataServiceRaw method getCoinMarketCapCurrencies.

/**
 * Unauthenticated resource that returns currencies supported on CoinMarketCap.
 *
 * @return A list of currency names and their corresponding ISO code.
 * @throws IOException
 */
public List<CoinMarketCapCurrency> getCoinMarketCapCurrencies() throws IOException {
    List<CoinMarketCapTicker> tickers = getCoinMarketCapTickers();
    List<CoinMarketCapCurrency> currencies = new ArrayList<>();
    for (CoinMarketCapTicker ticker : tickers) currencies.add(ticker.getBaseCurrency());
    return currencies;
}
Also used : CoinMarketCapCurrency(org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency) CoinMarketCapTicker(org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapTicker) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)3 CoinMarketCapCurrency (org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapCurrency)3 CoinMarketCapTicker (org.knowm.xchange.coinmarketcap.deprecated.v2.dto.marketdata.CoinMarketCapTicker)2 Currency (org.knowm.xchange.currency.Currency)1