コード例 #1
0
        public async Task <Block> GetBlockAsync(string headerHash)
        {
            var result = await PostAsync <GetBlockResult>(FullNodeRoutes.GetBlock(ApiUrl), new Dictionary <string, string>()
            {
                ["header_hash"] = headerHash,
            });

            return(result.Block);
        }
コード例 #2
0
        public async Task <Block[]> GetBlocksAsync(int startHeight, int endHeight)
        {
            var result = await PostAsync <GetBlocksResult>(FullNodeRoutes.GetBlocks(ApiUrl), new Dictionary <string, string>()
            {
                ["start"] = $"{startHeight}",
                ["end"]   = $"{endHeight}",
            });

            return(result.Blocks);
        }
コード例 #3
0
        public async Task <BlockchainState> GetBlockchainStateAsync()
        {
            var result = await PostAsync <GetBlockchainStateResult>(FullNodeRoutes.GetBlockchainState(ApiUrl));

            return(result.BlockchainState);
        }