public async Task EndToEnd()
        {
            var creds = CredsHelper.GetCoinMarketCapToken();

            var client = new coinmarketcap.CoinMarketCapClient(creds);

            core.Shared.Adapters.Cryptos.Listings listings = await client.Get();

            Assert.NotNull(listings);

            listings.TryGet("BTC", out var btc);

            Assert.True(btc.Value.Amount > 0);
        }
Beispiel #2
0
        public static bool TryGet(this Listings listings, string token, out Price?price)
        {
            price = null;

            var data = listings.Data.SingleOrDefault(d => d.Symbol == token);

            if (data != null)
            {
                price = new Price(data.Quote.Usd.Price);
                return(true);
            }

            return(false);
        }