Class BlockDataExtensions
Extension methods for querying block data from the mirror node.
Inherited Members
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class BlockDataExtensions
Methods
| Edit this page View SourceGetBlockAsync(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. |
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. |
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. |
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 |