Show / Hide Table of Contents

Class ContractDataExtensions

Extension methods for querying contract data from the mirror node.

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

Methods

| Edit this page View Source

GetContractAsync(MirrorRestClient, EntityId, params IMirrorQueryParameter[])

Retrieves the full contract information from /api/v1/contracts/{id}, including both Bytecode and RuntimeBytecode (which the list endpoint omits). Use TimestampFilter to retrieve the contract's state at a historical consensus instant.

Declaration
public static Task<ContractData?> GetContractAsync(this MirrorRestClient client, EntityId contract, params IMirrorQueryParameter[] filters)
Parameters
Type Name Description
MirrorRestClient client

Mirror Rest Client to use for the request.

EntityId contract

The entityId of the contract to retrieve.

IMirrorQueryParameter[] filters

Additional query parameters. The endpoint supports TimestampFilter.

Returns
Type Description
Task<ContractData>

The contract information, or null if not found.

| Edit this page View Source

GetContractsAsync(MirrorRestClient, params IMirrorQueryParameter[])

Enumerates smart-contract entities across the network from /api/v1/contracts. Use ContractFilter to narrow by contract id (or id range). Newest-first by default; pass Ascending to reverse.

Declaration
public static IAsyncEnumerable<ContractData> GetContractsAsync(this MirrorRestClient client, params IMirrorQueryParameter[] filters)
Parameters
Type Name Description
MirrorRestClient client

Mirror Rest Client to use for the request.

IMirrorQueryParameter[] filters

Additional query filters. The endpoint supports ContractFilter, PageLimit, and OrderBy.

Returns
Type Description
IAsyncEnumerable<ContractData>

An async enumerable of contract records.

Remarks

The list endpoint omits Bytecode and RuntimeBytecode — these come back empty here. Call GetContractAsync(MirrorRestClient, EntityId, params IMirrorQueryParameter[]) on a specific id to retrieve them.

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