/// <summary> /// Gets The Node Staking Information /// </summary> public async Task <GetStakingInfoResponse> GetStakingInfo() { try { GetStakingInfoResponse response = await base.SendGet <GetStakingInfoResponse>("api/Staking/getstakinginfo"); Guard.Null(response, nameof(response), "'api/Staking/getstakinginfo' API Response Was Null!"); return(response); } catch (Exception ex) { Logger.Fatal($"An Error '{ex.Message}' Occured When Getting Staking Info!", ex); throw; } //end of try-catch } //end of public async Task<GetStakingInfoResponse> GetStakingInfo()
/// <summary> /// Refreshes Staking Information /// </summary> public async void UpdateStakingInformation() { GetStakingInfoResponse stakingInfo = await _RestClient.GetStakingInfo(); if (stakingInfo == null) { Logger.Error($"Node '{Name}' ({Address}:{Port}), An Error Occured When Getting Staking Information!"); } else { NetworkDifficulty = stakingInfo.difficulty; IsStaking = stakingInfo.staking; NetworkStakingWeight = stakingInfo.netStakeWeight; NodeStakingWeight = stakingInfo.weight.ParseAPIAmount(); ExpectedStakingTimeMins = (stakingInfo.expectedTime / 60);//time is in seconds }//end of if (stakingInfo == null) }//end of public async void UpdateStakingInformation()