> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# wallet/getaccountbalance | TRON

> TRON API method that retrieves the TRX balance and related balance information for a specific account. Use it on TRON via Chainstack.

TRON API method that retrieves the TRX balance and related balance information for a specific account. This method provides comprehensive balance data including available balance, frozen balance, and delegated resources.

## Parameters

* `account_identifier.address` — the account address to query. Use base58 with `visible: true`, or hex with `visible: false`.
* `block_identifier` — required object specifying the block to query. Provide both the 32‑byte `hash` (64 hex chars) and the matching `number`.
* `visible` — optional boolean for address format. Default is `false` (hex).

## Response

* `balance` — available TRX balance (in sun, where 1 TRX = 1,000,000 sun)
* `frozen` — array of frozen balance information
  * `frozen_balance` — amount of TRX frozen
  * `expire_time` — expiration timestamp for frozen balance
* `delegated_frozenV2` — delegated frozen balance information for v2 staking
* `undelegated_frozenV2` — undelegated frozen balance information for v2 staking

## Use case

The `wallet/getaccountbalance` method is used for:

* Checking available TRX balance for transactions and transfers.
* Monitoring frozen balance and staking information.
* Analyzing delegated resource allocations.
* Managing account liquidity and resource planning.

## curl examples

Get current balance with a base58 address (at a specific block):

```shell Shell theme={"system"}
curl --request POST \
  --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
  --header 'Content-Type: application/json' \
  --data '{
    "account_identifier": { "address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g" },
    "block_identifier": { "hash": "0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd", "number": 77096758 },
    "visible": true
  }'
```

Get balance at a specific block using a hex address:

```shell Shell theme={"system"}
curl --request POST \
  --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
  --header 'Content-Type: application/json' \
  --data '{
    "account_identifier": { "address": "41608f8da72479edc7dd921e4c30bb7e7cddbe722e" },
    "block_identifier": { "hash": "0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd", "number": 77096758 },
    "visible": false
  }'
```

<Info>
  * avoid `INVALID hex String` by providing a real 32‑byte block hash (64 hex chars).
  * avoid `account_identifier is null` by passing `account_identifier: { address: ... }` rather than a top‑level `address`.
  * avoid `block_identifier null` and `hash length not equals 32` by always including `block_identifier.hash` with 64 hex chars, and `block_identifier.number` that matches the same block.

  ### find a valid block hash

  Use [`wallet/getnowblock`](/reference/tron-getnowblock) to fetch the latest block and copy the `blockID` field as the `block_identifier.hash` value.

  ```shell Shell theme={"system"}
  curl --request POST \
    --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getnowblock' \
    --header 'Content-Type: application/json'
  ```

  Alternatively, get a specific block with [`wallet/getblockbynum`](/reference/tron-getblockbynum) and use its `blockID`.

  ## working example (auto picks latest block)

  Run this to fetch the latest `blockID`, resolve its block `number`, and immediately query the balance at that block.

  ```shell Shell theme={"system"}
  # requires jq
  BLOCK_ID=$(curl -s -X POST \
    'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getnowblock' \
    -H 'Content-Type: application/json' | jq -r '.blockID')
  NUMBER=$(curl -s -X POST \
    'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getblockbyid' \
    -H 'Content-Type: application/json' \
    --data "{\"value\": \"$BLOCK_ID\"}" | jq -r '.block_header.raw_data.number')

  curl --request POST \
    --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
    --header 'Content-Type: application/json' \
    --data "{\n  \"account_identifier\": { \"address\": \"41608f8da72479edc7dd921e4c30bb7e7cddbe722e\" },\n  \"block_identifier\": { \"hash\": \"$BLOCK_ID\", \"number\": $NUMBER },\n  \"visible\": false\n}"
  ```

  If `jq` is not available, use Python instead:

  ```shell Shell theme={"system"}
  BLOCK_ID=$(curl -s -X POST \
    'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getnowblock' \
    -H 'Content-Type: application/json' | python3 -c 'import sys,json; print(json.load(sys.stdin)["blockID"])')
  NUMBER=$(curl -s -X POST \
    'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getblockbyid' \
    -H 'Content-Type: application/json' \
    --data "{\"value\": \"$BLOCK_ID\"}" | python3 -c 'import sys,json; print(json.load(sys.stdin)["block_header"]["raw_data"]["number"])')

  curl --request POST \
    --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance' \
    --header 'Content-Type: application/json' \
    --data "{\n  \"account_identifier\": { \"address\": \"41608f8da72479edc7dd921e4c30bb7e7cddbe722e\" },\n  \"block_identifier\": { \"hash\": \"$BLOCK_ID\", \"number\": $NUMBER },\n  \"visible\": false\n}"
  ```
</Info>


## OpenAPI

````yaml openapi/tron_node_api/getaccountbalance.json post /95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance
openapi: 3.0.0
info:
  title: wallet/getaccountbalance TRON API
  version: 1.0.0
  description: Get account balance and frozen balance information
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/getaccountbalance:
    post:
      tags:
        - Account Information
      summary: wallet/getaccountbalance
      operationId: getAccountBalance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - account_identifier
                - block_identifier
              properties:
                account_identifier:
                  type: object
                  required:
                    - address
                  properties:
                    address:
                      type: string
                      description: >-
                        Account address. Use hex when `visible` is false, or
                        base58 when `visible` is true.
                      default: 41608f8da72479edc7dd921e4c30bb7e7cddbe722e
                block_identifier:
                  type: object
                  properties:
                    hash:
                      type: string
                      description: Optional 32-byte block hash as 64 hex characters.
                      pattern: ^[0-9a-fA-F]{64}$
                    number:
                      type: integer
                  required:
                    - hash
                    - number
                  description: >-
                    Block to query the balance at. Provide both the 32-byte
                    block hash (64 hex chars) and its number; the node validates
                    they match.
                visible:
                  type: boolean
                  default: false
              example:
                account_identifier:
                  address: 41608f8da72479edc7dd921e4c30bb7e7cddbe722e
                block_identifier:
                  hash: >-
                    0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd
                  number: 77096758
                visible: false
      responses:
        '200':
          description: Account balance information
          content:
            application/json:
              schema:
                type: object
                properties:
                  balance:
                    type: integer
                    description: Available TRX balance in sun
                  frozen:
                    type: array
                    description: Frozen balance information
                    items:
                      type: object
                      properties:
                        frozen_balance:
                          type: integer
                        expire_time:
                          type: integer
                  delegated_frozenV2:
                    type: array
                    description: Delegated frozen balance v2
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        frozen_balance:
                          type: integer
                  undelegated_frozenV2:
                    type: array
                    description: Undelegated frozen balance v2
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        unfreeze_amount:
                          type: integer
                        unfreeze_expire_time:
                          type: integer

````