Class AccountBalanceDataExtensions
Extension methods for querying account balance data from the mirror node.
Inherited Members
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class AccountBalanceDataExtensions
Methods
| Edit this page View SourceGetTokenHoldersSnapshotAsync(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 |
| IMirrorQueryParameter[] | filters | Additional query parameters (paging, account/key predicates) to
refine the request. Do not pass another |
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.