---
updatedAt: 2026-09-08T10:21:01.000Z
agentTools:
  projectIndex: https://cn.developers.tron.network/llms.txt
---

# GetBlockBalance

获取一个区块中的所有余额变动操作。（注意：目前该接口数据仅可通过以下官方节点查询：13.228.119.63、18.139.193.235、18.141.79.38、18.139.248.26）

## 相关资源

* [GetAccountBalance](https://cn.developers.tron.network/reference/getaccountbalance) —— 按账户而非按区块查询余额变动
* [GetBlock](https://cn.developers.tron.network/reference/getblock-1) —— 查询区块完整内容（含交易）
* [区块](https://cn.developers.tron.network/docs/block) —— 区块结构与复合区块 ID

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "全节点 HTTP API",
    "version": "4.8.0"
  },
  "servers": [
    {
      "url": "https://api.shasta.trongrid.io",
      "description": "Shasta 测试网"
    },
    {
      "url": "https://nile.trongrid.io",
      "description": "Nile 测试网"
    },
    {
      "url": "https://api.trongrid.io",
      "description": "TRON 主网（真实资产）"
    }
  ],
  "components": {
    "schemas": {
      "NodeHttpBusinessError": {
        "title": "错误信息",
        "type": "object",
        "description": "请求处理发生异常时，java-tron 可能随 HTTP 200 返回此格式；具体错误信息位于 `Error` 字段。",
        "required": [
          "Error"
        ],
        "properties": {
          "Error": {
            "type": "string",
            "description": "java-tron 返回的错误信息。"
          }
        },
        "examples": [
          {
            "Error": "Invalid request parameters."
          }
        ],
        "additionalProperties": false
      },
      "TransactionBalanceTrace": {
        "type": "object",
        "description": "交易余额变化追踪，由 getblockbalance 按交易返回。",
        "properties": {
          "transaction_identifier": {
            "type": "string"
          },
          "operation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Operation"
            }
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "Operation": {
        "type": "object",
        "description": "交易内部的余额操作。",
        "properties": {
          "operation_identifier": {
            "type": "integer",
            "format": "int64"
          },
          "address": {
            "type": "string"
          },
          "amount": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Timestamp": {
        "type": "int64",
        "description": "时间戳。（单位：毫秒）"
      }
    }
  },
  "security": [
    {}
  ],
  "paths": {
    "/wallet/getblockbalance": {
      "post": {
        "summary": "GetBlockBalance",
        "description": "获取区块中所有余额变更操作。（注意：目前仅可通过以下官方节点查询此接口数据：13.228.119.63、18.139.193.235、18.141.79.38、18.139.248.26）",
        "operationId": "getblockbalance",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hash": {
                    "type": "string",
                    "default": "",
                    "description": "区块哈希（ID）。示例：`0000000003dba95c7f05cedf1ba32cd64b6baa082a7870f533b4451703e432ab`"
                  },
                  "number": {
                    "type": "integer",
                    "default": "",
                    "format": "int32",
                    "description": "区块编号。区块哈希与区块编号必须一致，指向同一区块。示例：`64727388`"
                  },
                  "visible": {
                    "type": "boolean",
                    "description": "可选。设置为 `true` 时地址以 Base58 格式返回；设置为 `false` 时以 hex 格式返回。（默认：`false`）",
                    "default": ""
                  }
                },
                "required": [
                  "hash",
                  "number"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "请求正常完成时，响应体为接口返回结果；请求处理发生异常时，HTTP 状态仍可能为 200，此时仅返回包含 `Error` 字段的错误信息。",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "返回结果",
                      "not": {
                        "type": "object",
                        "required": [
                          "Error"
                        ]
                      },
                      "type": "object",
                      "properties": {
                        "timestamp": {
                          "$ref": "#/components/schemas/Timestamp",
                          "format": "int64"
                        },
                        "block_identifier": {
                          "type": "object",
                          "properties": {
                            "hash": {
                              "type": "string",
                              "description": "区块哈希。"
                            },
                            "number": {
                              "type": "integer",
                              "format": "int64",
                              "description": "区块编号。"
                            }
                          }
                        },
                        "transaction_balance_trace": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TransactionBalanceTrace"
                          },
                          "description": "包含余额变更的交易信息列表。"
                        },
                        "transaction_identifier": {
                          "type": "string",
                          "description": "交易 ID（哈希）。"
                        },
                        "operation": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Operation"
                          },
                          "description": "本交易中的余额变更操作列表，包括发送方扣减、接收方增加以及资源手续费销毁（带宽/能量）。每个条目包含 `operation_identifier`（索引）、`address`（受影响地址）和 `amount`（余额变动量）。"
                        },
                        "type": {
                          "type": "string",
                          "description": "交易类型。"
                        },
                        "status": {
                          "type": "string",
                          "description": "交易执行结果状态。"
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/NodeHttpBusinessError"
                    }
                  ]
                },
                "examples": {
                  "Result": {
                    "value": "{\n    \"block_identifier\": {\n        \"hash\": \"000000000000dc2a3731e28a75b49ac1379bcc425afc95f6ab3916689fbb0189\",\n        \"number\": 56362\n    },\n    \"timestamp\": 1530060672000,\n    \"transaction_balance_trace\": [\n        {\n            \"transaction_identifier\": \"e6cabb1833cd1f795eed39d8dd7689eaa70e5bb217611766c74c7aa9feea80df\",\n            \"operation\": [\n                {\n                    \"operation_identifier\": 0,\n                    \"address\": \"TPttBLmFuykRi83y9HxDoEWxTQw6CCcQ4p\",\n                    \"amount\": -100000\n                },\n                {\n                    \"operation_identifier\": 1,\n                    \"address\": \"TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy\",\n                    \"amount\": 100000\n                },\n                {\n                    \"operation_identifier\": 2,\n                    \"address\": \"TPttBLmFuykRi83y9HxDoEWxTQw6CCcQ4p\",\n                    \"amount\": -10000000\n                },\n                {\n                    \"operation_identifier\": 3,\n                    \"address\": \"TMrysg7DbwR1M8xqhpaPdVCHCuWFhw7uk1\",\n                    \"amount\": 10000000\n                }\n            ],\n            \"type\": \"TransferContract\",\n            \"status\": \"SUCCESS\"\n        }\n    ]\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```