Esempio n. 1
0
        internal async void DisplayAssetInfo(string asset)
        {
            const string url = "https://s2.coinmarketcap.com/static/img/coins/32x32/";

            if (cmc_listing == null)
            {
                cmc_listing = await CoinMarketCapApiClient.GetListingsAsync();
            }
            var listing = cmc_listing.FirstOrDefault(x => asset.Equals(x.symbol, StringComparison.CurrentCultureIgnoreCase));

            if (listing != null)
            {
                label5.Text = listing.name;
                var client = new RestSharp.RestClient(url);
                var req    = new RestSharp.RestRequest($"{listing.id}.png", RestSharp.Method.GET);
                var resp   = await client.ExecuteTaskAsync(req);

                image1.Pixbuf = new Gdk.Pixbuf(resp.RawBytes);
            }
            else
            {
                label5.Text   = asset;
                image1.Pixbuf = null;
            }
        }
Esempio n. 2
0
 public CryptocurrencyEndpointTests()
 {
     this.client = new CoinMarketCapApiClient("61663324-40cb-43c7-9c0f-9528051771eb");
 }
Esempio n. 3
0
 public CryptocurrencyController(CoinMarketCapApiClient api)
 {
     this.api = api;
 }