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