@hiero-ledger/sdk
    Preparing search index...

    Class MirrorNodeAccountBalanceQuery

    Mirror-node REST replacement for the deprecated AccountBalanceQuery.

    Reads the HBAR balance from GET /api/v1/balances?account.id={id} through the client's shared HTTP transport. Pure HTTP: no query payment, no node rotation, no gRPC, so this class deliberately does not extend Query. Retry, backoff and timeouts follow the client's MirrorNodeHttpRetryPolicy (see Client.setMirrorNodeHttpConfig).

    setAccountId accepts everything the mirror node resolves: shard.realm.num, an EVM address, a public key alias, or a contract ID. An AccountId carrying an aliasKey or an evmAddress is sent in the form the mirror node understands (base32 alias / bare EVM address) rather than AccountId.toString().

    Only the HBAR balance is returned (see MirrorNodeAccountBalance).

    An account the mirror node does not know returns an empty result rather than a 404; the SDK maps that to a MirrorNodeStatusError carrying Status.InvalidAccountId, the status AccountBalanceQuery reported. An account that exists holding nothing returns "balance": 0, so a real zero is never mistaken for a missing account.

    Eventual consistency: the mirror node trails the network by a few seconds, and the lag covers the account's existence as well as its balance. A just-created account transiently fails with INVALID_ACCOUNT_ID, so retry rather than treat the first failure as final.

    A deleted account reads as a zero balance: the balances endpoint does not expose the deleted flag, so unlike AccountBalanceQuery this query cannot report ACCOUNT_DELETED. Use /accounts/{id} if that matters.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    Methods