コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }