Class AccountDataExtensions
Extension methods for querying account data from the mirror node.
Inherited Members
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class AccountDataExtensions
Methods
| Edit this page View SourceGetAccountAsync(MirrorRestClient, EntityId, params IMirrorQueryParameter[])
Retrieves information about a single account from
/api/v1/accounts/{id}. Use TimestampFilter
to retrieve the account's state at a historical consensus
instant; otherwise returns the current state. The server's inline
transaction list is suppressed on the wire (bandwidth
optimization, since AccountData does not carry it).
Declaration
public static Task<AccountData?> GetAccountAsync(this MirrorRestClient client, EntityId account, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | account | The id of the account to retrieve. |
| IMirrorQueryParameter[] | filters | Additional query parameters. The endpoint meaningfully supports
TimestampFilter for historical state lookup; other
parameters the server accepts on this endpoint
( |
Returns
| Type | Description |
|---|---|
| Task<AccountData> | An account information object, or null if not found. |
Remarks
For the account's transaction listing, call
GetTransactionsAsync(AccountFilter.Is(account)).
GetAccountAsync(MirrorRestClient, EntityId, CancellationToken, params IMirrorQueryParameter[])
Retrieves information about a single account from
/api/v1/accounts/{id}. Use TimestampFilter
to retrieve the account's state at a historical consensus
instant; otherwise returns the current state. The server's inline
transaction list is suppressed on the wire (bandwidth
optimization, since AccountData does not carry it).
Declaration
public static Task<AccountData?> GetAccountAsync(this MirrorRestClient client, EntityId account, CancellationToken cancellationToken, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | account | The id of the account to retrieve. |
| CancellationToken | cancellationToken | Token that cancels the request. |
| IMirrorQueryParameter[] | filters | Additional query parameters. The endpoint meaningfully supports
TimestampFilter for historical state lookup; other
parameters the server accepts on this endpoint
( |
Returns
| Type | Description |
|---|---|
| Task<AccountData> | An account information object, or null if not found. |
Remarks
For the account's transaction listing, call
GetTransactionsAsync(AccountFilter.Is(account)).
GetAccountBalanceAsync(MirrorRestClient, EntityId, params IMirrorQueryParameter[])
Retrieves the hbar balance, in tinybars, of an account or a
contract (contracts are accounts on the mirror node) from
/api/v1/accounts/{id}. Use TimestampFilter
to retrieve the balance at a historical consensus instant;
otherwise returns the current balance.
Declaration
public static Task<long?> GetAccountBalanceAsync(this MirrorRestClient client, EntityId account, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | account | The id of the account or contract. |
| IMirrorQueryParameter[] | filters | Additional query parameters; TimestampFilter selects a historical balance. |
Returns
| Type | Description |
|---|---|
| Task<long?> | The balance in tinybars, or null if the mirror node does not know the account or reports no balance for it. |
Remarks
This replaces the consensus node balance query, which public
Hedera networks removed in July 2026; consensus nodes now answer
it with BUSY.
The mirror node trails consensus by a few seconds. To observe the effect of a transaction just submitted, wait until the mirror node's latest consensus timestamp (GetLatestConsensusTimestampAsync(MirrorRestClient, CancellationToken)) reaches the transaction's consensus timestamp before reading.
For token balances, use GetAccountTokenBalanceAsync(MirrorRestClient, EntityId, EntityId, CancellationToken, params IMirrorQueryParameter[]) for a single token or GetAccountTokenHoldingsAsync(MirrorRestClient, EntityId, CancellationToken, params IMirrorQueryParameter[]) for all of an account's holdings.
GetAccountBalanceAsync(MirrorRestClient, EntityId, CancellationToken, params IMirrorQueryParameter[])
Retrieves the hbar balance, in tinybars, of an account or a
contract (contracts are accounts on the mirror node) from
/api/v1/accounts/{id}. Use TimestampFilter
to retrieve the balance at a historical consensus instant;
otherwise returns the current balance.
Declaration
public static Task<long?> GetAccountBalanceAsync(this MirrorRestClient client, EntityId account, CancellationToken cancellationToken, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | account | The id of the account or contract. |
| CancellationToken | cancellationToken | Token that cancels the request. |
| IMirrorQueryParameter[] | filters | Additional query parameters; TimestampFilter selects a historical balance. |
Returns
| Type | Description |
|---|---|
| Task<long?> | The balance in tinybars, or null if the mirror node does not know the account or reports no balance for it. |
Remarks
This replaces the consensus node balance query, which public
Hedera networks removed in July 2026; consensus nodes now answer
it with BUSY.
The mirror node trails consensus by a few seconds. To observe the effect of a transaction just submitted, wait until the mirror node's latest consensus timestamp (GetLatestConsensusTimestampAsync(MirrorRestClient, CancellationToken)) reaches the transaction's consensus timestamp before reading.
For token balances, use GetAccountTokenBalanceAsync(MirrorRestClient, EntityId, EntityId, CancellationToken, params IMirrorQueryParameter[]) for a single token or GetAccountTokenHoldingsAsync(MirrorRestClient, EntityId, CancellationToken, params IMirrorQueryParameter[]) for all of an account's holdings.
GetAccountsAsync(MirrorRestClient, params IMirrorQueryParameter[])
Enumerates accounts across the network. Use AccountFilter to narrow by id, AccountPublicKeyFilter to narrow by root public key, AccountBalanceFilter to narrow by tinybar balance threshold, or BalanceProjectionFilter to control whether the balance subtree is included in each record.
Declaration
public static IAsyncEnumerable<AccountData> GetAccountsAsync(this MirrorRestClient client, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| IMirrorQueryParameter[] | filters | Additional query parameters. The endpoint supports AccountFilter, AccountPublicKeyFilter, AccountBalanceFilter, BalanceProjectionFilter, PageLimit, and OrderBy. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<AccountData> | An async enumerable of account records. |
GetAccountsAsync(MirrorRestClient, CancellationToken, params IMirrorQueryParameter[])
Enumerates accounts across the network. Use AccountFilter to narrow by id, AccountPublicKeyFilter to narrow by root public key, AccountBalanceFilter to narrow by tinybar balance threshold, or BalanceProjectionFilter to control whether the balance subtree is included in each record.
Declaration
public static IAsyncEnumerable<AccountData> GetAccountsAsync(this MirrorRestClient client, CancellationToken cancellationToken, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| CancellationToken | cancellationToken | Token that cancels the enumeration, including a page request in
flight. |
| IMirrorQueryParameter[] | filters | Additional query parameters. The endpoint supports AccountFilter, AccountPublicKeyFilter, AccountBalanceFilter, BalanceProjectionFilter, PageLimit, and OrderBy. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<AccountData> | An async enumerable of account records. |