public virtual IMiningResult Mining() { MineCar.Validate(); Status = MiningStatus.GetResponding; var response = MineCar.GetResponse(); if (!CheckException(response)) return MiningResultFactory.Create(Status = MiningStatus.ResponseException); var htmlDocument = ConverToHtmlDocument(response); var miningResult = MineCar.Save(htmlDocument); Status = miningResult.Status; return miningResult; }
public MiningStatus GetMiningStatus() { string _url = "/v1/order/mining/difficulty"; JToken _token = base.HttpCall(HttpCallMethod.Get, "GET", _url, true); if (_token == null) { return(null); } MiningStatus _status = new MiningStatus(); _status.Maximum = _token["difficulty"].Value <decimal>(); _status.Current = _token["prediction"].Value <decimal>(); _status.DateTime = DateTimePlus.JSTime2DateTime(_token["update_time"].Value <long>()); return(_status); }
public MiningStatus GetMiningStatus() { string _url = "/v1/mine/limit"; JToken _json = this.HttpCall(HttpCallMethod.Get, "GET", _url, true); if (_json == null) { return(null); } MiningStatus _status = new MiningStatus(); _status.DateTime = DateTime.UtcNow; //question {{ "mined": "0.27800000", "canmine": "99.72200000", "limit": "100.00000000"}} _status.Maximum = _json["limit"].Value <decimal>(); _status.Current = _json["mined"].Value <decimal>(); return(_status); }
public static IMiningResult Create(MiningStatus status, int count = 0) { return new MiningResult() { Status = status, Count = count }; }
public void SetMined() { mine = MiningStatus.Mined; }
public void Reset() { mine = MiningStatus.NotMined; visit = VisitingStatus.NotVisited; }