Show / Hide Table of Contents

Class BlockDataExtensions

Extension methods for querying block data from the mirror node.

Inheritance
object
BlockDataExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class BlockDataExtensions

Methods

| Edit this page View Source

GetBlockAsync(MirrorRestClient, long)

Retrieves block information given the block number ID

Declaration
public static Task<BlockData?> GetBlockAsync(this MirrorRestClient client, long blockNumber)
Parameters
Type Name Description
MirrorRestClient client

Mirror Rest Client to use for the request.

long blockNumber

Block Number

Returns
Type Description
Task<BlockData>

Information for the block, or null if not found.

| Edit this page View Source

GetBlockAsync(MirrorRestClient, ReadOnlyMemory<byte>)

Retrieves block information given the block hash.

Declaration
public static Task<BlockData?> GetBlockAsync(this MirrorRestClient client, ReadOnlyMemory<byte> blockhash)
Parameters
Type Name Description
MirrorRestClient client

Mirror Rest Client to use for the request.

ReadOnlyMemory<byte> blockhash

The EVM Block Hash for the block to search for.

Returns
Type Description
Task<BlockData>

Information for the block, or null if not found.

| Edit this page View Source

GetLatestBlockAsync(MirrorRestClient)

Retrieves the latest block known to the remote mirror node.

Declaration
public static Task<BlockData?> GetLatestBlockAsync(this MirrorRestClient client)
Parameters
Type Name Description
MirrorRestClient client

Mirror Rest Client to use for the request.

Returns
Type Description
Task<BlockData>

Block information for the latest known block, or null if there was an error.

| Edit this page View Source

GetLatestBlockBeforeConsensusAsync(MirrorRestClient, ConsensusTimeStamp)

Retrieves the latest known block before the given consensus timestamp.

Declaration
public static Task<BlockData?> GetLatestBlockBeforeConsensusAsync(this MirrorRestClient client, ConsensusTimeStamp consensus)
Parameters
Type Name Description
MirrorRestClient client

Mirror Rest Client to use for the request.

ConsensusTimeStamp consensus

The consensus timestamp

Returns
Type Description
Task<BlockData>

Block info for the latest block before the given timestamp

  • Edit this page
  • View Source
In this article
Back to top .NET Client Library for Hiero Network and Hedera Hashgraph