Exemple #1
0
 private void cmdRefreshRewards_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     zilInfo     = EzilAPI.GetZilInfo();
     GetStatsAndBalance();
     this.Cursor = Cursors.Default;
 }
Exemple #2
0
        private List <EzilReward> GetEzilStats()
        {
            try
            {
                List <EzilReward> ezilRewards = new List <EzilReward>();
                int page = 1;
                do
                {
                    var rewards = EzilAPI.GetRewards(ezilWallet, page++, 999, "eth");
                    ezilRewards.AddRange(rewards /*.Where(r => r.coin.Equals("eth"))*/);
                } while (ezilRewards.Min(c => c.created_at) >= DateTime.UtcNow.AddDays(-1));

                var rewards24 = ezilRewards.Where(r => r.created_at >= DateTime.UtcNow.AddDays(-1)).ToList();

                page = 1;
                ezilRewards.Clear();
                do
                {
                    var rewards = EzilAPI.GetRewards(ezilWallet, page++, 999, "zil");
                    ezilRewards.AddRange(rewards /*.Where(r => r.coin.Equals("eth"))*/);
                } while (ezilRewards.Min(c => c.created_at) >= DateTime.UtcNow.AddDays(-1));
                rewards24.AddRange(ezilRewards.Where(r => r.created_at >= DateTime.UtcNow.AddDays(-1)).ToList());

                return(rewards24);
            }
            catch (Exception ex)
            {
                if (ex is AggregateException)
                {
                    throw new Exception($"Cannot retrieve Ezil Wallet details. Make sure that your wallet addresses are correct.{Environment.NewLine}{ex.InnerException.Message}");
                }
                throw new Exception($"Cannot retrieve Ezil Wallet details. Make sure that your wallet addresses are correct.{Environment.NewLine}{ex.Message}");
            }
        }
Exemple #3
0
        private void zilTimer_Tick(object sender, EventArgs e)
        {
            if (zilInfo.next_pow_time <= DateTime.UtcNow || ((int)(zilInfo.next_pow_time - DateTime.UtcNow).TotalMinutes % 15) == 0)
            {
                zilInfo = EzilAPI.GetZilInfo();
            }

            var zilPowTime = (zilInfo.next_pow_time - DateTime.UtcNow);

            lblNextZil.Invoke(new MethodInvoker(() =>
            {
                lblNextZil.Text = $"Next ZIL round in: {zilPowTime.Hours}:{zilPowTime.Minutes:00}:{zilPowTime.Seconds:00} ";
            }));
        }
Exemple #4
0
 private EzilBalance GetBalances()
 {
     try
     {
         var balances = EzilAPI.GetBalances(ezilWallet);
         return(balances);
     }
     catch (Exception ex)
     {
         if (ex is AggregateException)
         {
             throw new Exception($"Cannot retrieve Ezil Wallet balance. Make sure that your wallet addresses are correct.{Environment.NewLine}{ex.InnerException.Message}");
         }
         throw new Exception($"Cannot retrieve Ezil Wallet balance. Make sure that your wallet addresses are correct.{Environment.NewLine}{ex.Message}");
     }
 }
Exemple #5
0
 private List <EzilStats> GetHistory(Wallet ezilWallet, int timeFrame)
 {
     try
     {
         var ezilStats = EzilAPI.GetHistoricalStats(ezilWallet, timeFrame);
         return(ezilStats);
     }
     catch (Exception ex)
     {
         if (ex is AggregateException)
         {
             throw new Exception($"Cannot retrieve Ezil history. Make sure that your wallet addresses are correct.{Environment.NewLine}{ex.InnerException.Message}");
         }
         throw new Exception($"Cannot retrieve Ezil history. Make sure that your wallet addresses are correct.{Environment.NewLine}{ex.Message}");
     }
 }
Exemple #6
0
        private void frmMain_Shown(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LoadConfig();

            var workerStats = GetWorkerStats(machines);
            var workersInfo = GetWorkersInfo(workerStats, true);

            zilInfo = EzilAPI.GetZilInfo();

            if (workersInfo != null && workersInfo.Count > 0)
            {
                DisplayWorkerGraph(workerStats[workerTree.SelectedNode.Text], workersInfo[0].MinHash, workersInfo[0].MaxHash);
            }

            GetStatsAndBalance();
            zilTimer.Start();
            this.Cursor = Cursors.Default;
        }
Exemple #7
0
        private EzilCurrentStats GetCurrentStats()
        {
            var ezilCurrentStats = EzilAPI.GetCurrentStats(ezilWallet);

            return(ezilCurrentStats);
        }