Ejemplo n.º 1
0
        static Dictionary <string, string> GetPricesBatch()
        {
            HttpLib restLib = new HttpLib();

            restLib.AddHeader("User-Agent", "GDAXBotter");
            Task <IEnumerable <string> > prices = restLib.GetStringsBatch(URL_FOR("ETH"), URL_FOR("BTC"), URL_FOR("LTC"));

            prices.Wait();
            string[] priceArray = prices.Result.ToArray();
            Dictionary <string, string> result = new Dictionary <string, string>();

            result["ETH"] = priceArray[0];
            result["BTC"] = priceArray[1];
            result["LTC"] = priceArray[2];
            return(result);
        }
Ejemplo n.º 2
0
        static Dictionary <string, string> GetPrices()
        {
            HttpLib restLib = new HttpLib();

            restLib.AddHeader("User-Agent", "GDAXBotter");
            Task <string> ethPricePromise = restLib.GetString(URL_FOR("ETH"));
            Task <string> ltcPricePromise = restLib.GetString(URL_FOR("LTC"));
            Task <string> btcPricePromise = restLib.GetString(URL_FOR("BTC"));

            ethPricePromise.Wait();
            ltcPricePromise.Wait();
            btcPricePromise.Wait();
            Dictionary <string, string> result = new Dictionary <string, string>();

            result["ETH"] = ethPricePromise.Result;
            result["BTC"] = btcPricePromise.Result;
            result["LTC"] = ltcPricePromise.Result;
            return(result);
        }