/// <summary> /// Asynchronously gets a range of blocks by range. /// </summary> /// /// <param name="req">The range paramters.</param> /// /// <returns>Returns an <see cref="Task{ArkBlockList}"/> type.</returns> /// public async Task <ArkBlockList> GetBlocksAsync(ArkBlockRequest req) { try { _logger.Info(string.Format("Getting blocks with filter <<{0}>>", req.ToQuery())); var response = await _networkApi.ActivePeer.MakeRequest(ArkStaticStrings.ArkHttpMethods.GET, string.Format(ArkStaticStrings.ArkApiPaths.Block.GET_ALL + "{0}", req.ToQuery())).ConfigureAwait(false); return(JsonConvert.DeserializeObject <ArkBlockList>(response)); } catch (Exception e) { _logger.Error(e.ToString()); throw e; } }
public async static Task <ArkBlockList> GetBlocksAsync(ArkBlockRequest req) { var response = await NetworkApi.Instance.ActivePeer.MakeRequest(ArkStaticStrings.ArkHttpMethods.GET, string.Format(ArkStaticStrings.ArkApiPaths.Block.GET_ALL + "{0}", req.ToQuery())); return(JsonConvert.DeserializeObject <ArkBlockList>(response)); }