Class TokenBalanceDataExtensions
Extension methods for querying token balance data from the mirror node.
Inherited Members
Namespace: Hiero.Mirror
Assembly: Hiero.dll
Syntax
public static class TokenBalanceDataExtensions
Methods
| Edit this page View SourceGetAccountTokenBalanceAsync(MirrorRestClient, EntityId, EntityId, params IMirrorQueryParameter[])
Retrieves the current balance of a specific fungible token
held by an account, via
/api/v1/accounts/{id}/tokens?token.id={token}. The
token argument is pinned internally as a
TokenFilter; callers do not need to supply one.
Declaration
public static Task<long?> GetAccountTokenBalanceAsync(this MirrorRestClient client, EntityId account, EntityId token, params IMirrorQueryParameter[] filters)
Parameters
| Type | Name | Description |
|---|---|---|
| MirrorRestClient | client | Mirror Rest Client to use for the request. |
| EntityId | account | The account whose holding is requested. |
| EntityId | token | The token whose balance is requested. |
| IMirrorQueryParameter[] | filters | Additional query parameters. The underlying endpoint supports PageLimit and OrderBy, though a single-token lookup rarely benefits from either. |
Returns
| Type | Description |
|---|---|
| Task<long?> | The amount of token held by the target account, or null if the token has not been associated. |