Esempio n. 1
0
        public static void calculateNewChanges(IFlyMiningEntityDI fDb, SiteContent _siteSelector)
        {
            maintenceRatePerTHsEUR = Settings.maintenceRatePerTHsEUR;
            rateBTCEUR             = Math.Round(Convert.ToDecimal(Wallets.getEURrateNow("BTC").Result), 2);
            maintenceRatePerTHsBTC = maintenceRatePerTHsEUR / rateBTCEUR;
            statisticalData statData = new statisticalData();

            try
            {
                statData       = fDb.statisticalDatas.Single(t => t.Names == "maintenceRatePerTHsBTC");
                statData.Value = maintenceRatePerTHsBTC.ToString();
                statData       = fDb.statisticalDatas.Single(t => t.Names == "BTCRateEUR");
                statData.Value = rateBTCEUR.ToString();
                statData       = fDb.statisticalDatas.Single(t => t.Names == "difficultyRaise");
                statData.Value = WebApi.getDifficulty().Result;
                fDb.SaveChanges();
                CryptoCompareInfo.getCryptoInfo();
            }
            catch (Exception ex)
            {
                Logger.AddLogRecord("Error on dayly Income. StatData:" + Convert.ToString(ex));
            }
            RsContractTable(fDb, _siteSelector);
            IncomeValidation(fDb, _siteSelector);
            exportIncome(fDb, _siteSelector);
        }
Esempio n. 2
0
        static async void calculateFee(IFlyMiningEntityDI fDB)
        {
            var    stringPayload = JsonConvert.DeserializeObject <JToken>(await Wallets.sendAsyncRequest("", "https://bitcoinfees.earn.com/api/v1/fees/recommended").ConfigureAwait(false));
            string result        = stringPayload["hourFee"].ToString();

            try
            {
                statisticalData statData = fDB.statisticalDatas.Single(t => t.Names == "minerFee");
                statData.Value = result;
                fDB.SaveChanges();
            }
            catch (Exception ex)
            {
                Logger.AddLogRecord("calculate Fee|IncomeService:" + Convert.ToString(ex));
            }
        }