Show / Hide Table of Contents

Class AccountBalanceDataExtensions

Extension methods for querying account balance data from the mirror node.

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

Methods

| Edit this page View Source

GetTokenHoldersSnapshotAsync(MirrorRestClient, EntityId, ConsensusTimeStamp, params IMirrorQueryParameter[])

Retrieves a snapshot of token holders for a given token at (or just before) the specified consensus timestamp.

Declaration
public static IAsyncEnumerable<AccountBalanceData> GetTokenHoldersSnapshotAsync(this MirrorRestClient client, EntityId token, ConsensusTimeStamp asOf, params IMirrorQueryParameter[] filters)
Parameters
Type Name Description
MirrorRestClient client

Mirror Rest Client to use for the request.

EntityId token

The Token ID whose holder snapshot is being fetched.

ConsensusTimeStamp asOf

The consensus timestamp defining the snapshot instant. Translated internally to the timestamp=lte:{asOf} query parameter.

IMirrorQueryParameter[] filters

Additional query parameters (paging, account/key predicates) to refine the request. Do not pass another timestamp filter — asOf already supplies it.

Returns
Type Description
IAsyncEnumerable<AccountBalanceData>

An enumerable of account/balance pairs from the chosen snapshot, including possibly zero balance values indicating a token association without a balance.

Remarks

This endpoint (/api/v1/tokens/{id}/balances) reads from the mirror node's balance-file snapshot, which is produced roughly every fifteen minutes — not from real-time balance state. Results may therefore lag the ledger by up to that window. For that reason the asOf timestamp is required: callers must consciously pick the snapshot instant rather than silently receiving "whatever the mirror node had last."

If you need a live per-account token balance, call GetAccountTokenBalanceAsync(MirrorRestClient, EntityId, EntityId, params IMirrorQueryParameter[]) instead — that method hits the fresher /api/v1/accounts/{id}/tokens surface.

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