Class ContractStateDataExtensions
Extension methods for querying contract state data from the mirror node.
Inherited Members
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class ContractStateDataExtensions
Methods
| Edit this page View SourceGetContractStateAsync(MirrorRestClient, EntityId, BigInteger, IMirrorQueryParameter[], CancellationToken)
Retrieves the value stored at a specific storage slot of a
contract from /api/v1/contracts/{id}/state. The
position is converted internally via
SlotFilter; use TimestampFilter to
read the slot's value at a historical consensus instant.
Declaration
public static Task<ContractStateData?> GetContractStateAsync(this MirrorRestClient client, EntityId contract, BigInteger position, IMirrorQueryParameter[] filters, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | contract | The EntityId of the contract. |
| BigInteger | position | The storage slot position as a 32-byte big-endian integer. |
| IMirrorQueryParameter[] | filters | Additional query parameters. The endpoint supports TimestampFilter, PageLimit, and OrderBy. |
| CancellationToken | cancellationToken | Optional token that cancels the request. |
Returns
| Type | Description |
|---|---|
| Task<ContractStateData> | The slot record at the requested position, or null if the slot has not been written. |