private void cmdRefreshRewards_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; zilInfo = EzilAPI.GetZilInfo(); GetStatsAndBalance(); this.Cursor = Cursors.Default; }
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); }
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} "; })); }
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; }