public string?GetBlockRawByNumber(string blockTag) { var blockNumber = GetBlockNumberByTag(blockTag); if (blockNumber == null) { return(null); } Block?block = _blockManager.GetByHeight((ulong)blockNumber); if (block == null) { return(null); } return(Web3DataFormatUtils.Web3BlockRaw(block)); }
public JArray GetBlockRawByNumberBatch(List <string> blockTagList) { JArray blockRawList = new JArray { }; foreach (var blockTag in blockTagList) { var blockNumber = GetBlockNumberByTag(blockTag); if (blockNumber == null) { return(null); } Block?block = _blockManager.GetByHeight((ulong)blockNumber); if (block != null) { blockRawList.Add(Web3DataFormatUtils.Web3BlockRaw(block)); } } return(blockRawList); }