示例#1
0
 private void cmdRefreshRewards_Click(object sender, EventArgs e)
 {
     this.Cursor = Cursors.WaitCursor;
     zilInfo     = EzilAPI.GetZilInfo();
     GetStatsAndBalance();
     this.Cursor = Cursors.Default;
 }
示例#2
0
        public static ZilInfo GetZilInfo()
        {
            ZilInfo zilinfo = null;

            using (HttpClient httpClient = new HttpClient())
            {
                var request  = $"https://xxx.ezil.me/blockchain_stats";
                var response = httpClient.GetStringAsync(new Uri(request)).Result;
                zilinfo = JsonConvert.DeserializeObject <ZilInfo>(response);
            }

            return(zilinfo);
        }
示例#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} ";
            }));
        }
示例#4
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;
        }