> ## 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/getblockbalance | TRON

> TRON API method that returns the balance deltas within a specific block. It shows, per transaction, how account balances changed in that block.

TRON API method that returns the balance deltas within a specific block. It shows, per transaction, how account balances changed in that block.

## Parameters

* `hash` — block hash as a 64‑character hex string.
* `number` — block number. Must match the provided `hash`.
* `visible` — optional boolean. When `true`, addresses are base58; when `false`, hex. Default is `true`.

## Response

* `timestamp` — block timestamp in milliseconds.
* `block_identifier` — object with `hash` and `number`.
* `transaction_balance_trace` — array per transaction with:
  * `transaction_identifier` — transaction hash.
  * `operation` — list with `operation_identifier`, `address`, and `amount` (sun; negative for debits, positive for credits).
  * `type` — contract type (for example, `TransferContract`).
  * `status` — execution status.

## Use case

* Auditing balance changes for a given block.
* Building explorers or analytics that summarize per‑address deltas.
* Reconciling application balances against chain state.

## curl example

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

## get a valid block pair automatically

```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' --data '{}' | 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/getblockbalance' \
  --header 'Content-Type: application/json' \
  --data "{\n  \"hash\": \"$BLOCK_ID\",\n  \"number\": $NUMBER,\n  \"visible\": true\n}"
```

<Info>
  * provide both `hash` (64 hex chars) and `number` that match the same block to avoid errors like `INVALID hex String`, `hash length not equals 32`, or `number and hash do not match`.
  * amounts are in sun (1 TRX = 1,000,000 sun).
</Info>


## OpenAPI

````yaml openapi/tron_node_api/getblockbalance.json post /95e61622bf6a8af293978377718e3b77/wallet/getblockbalance
openapi: 3.0.0
info:
  title: wallet/getblockbalance TRON API
  version: 1.0.0
  description: Get balance changes within a specific block
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/getblockbalance:
    post:
      tags:
        - Blockchain Info
      summary: wallet/getblockbalance
      operationId: getBlockBalance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - hash
                - number
              properties:
                hash:
                  type: string
                  description: Block hash (64 hex chars)
                  pattern: ^[0-9a-fA-F]{64}$
                number:
                  type: integer
                  description: Block number (must match the hash)
                visible:
                  type: boolean
                  default: true
              example:
                hash: >-
                  0000000004986736812cbf15ffbcdd229bd3d76a595db895719867cc2da3a5bd
                number: 77096758
                visible: true
      responses:
        '200':
          description: Block balance changes information
          content:
            application/json:
              schema:
                type: object
                properties:
                  timestamp:
                    type: integer
                  block_identifier:
                    type: object
                    properties:
                      hash:
                        type: string
                      number:
                        type: integer
                  transaction_balance_trace:
                    type: array
                    description: Per-transaction balance deltas within the block
                    items:
                      type: object
                      properties:
                        transaction_identifier:
                          type: string
                        operation:
                          type: array
                          items:
                            type: object
                            properties:
                              operation_identifier:
                                type: integer
                              address:
                                type: string
                              amount:
                                type: integer
                                description: >-
                                  Delta in sun; negative for debits, positive
                                  for credits
                        type:
                          type: string
                        status:
                          type: string

````