Show / Hide Table of Contents

Class ContractStateDataExtensions

Extension methods for querying contract state data from the mirror node.

Inheritance
object
ContractStateDataExtensions
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 ContractStateDataExtensions

Methods

| Edit this page View Source

GetContractStateAsync(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.

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