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

# getCompressedBalance

> Trả về số dư của tài khoản nén có địa chỉ hoặc hàm băm đã cho.

## Tham số yêu cầu

<ParamField body="address" type="string" default="11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP">
  Khóa công khai Solana được biểu diễn dưới dạng chuỗi base58.
</ParamField>

<ParamField body="hash" type="string">
  Hàm băm 32 byte được biểu diễn dưới dạng chuỗi base58.
</ParamField>


## OpenAPI

````yaml vi/openapi/zk-compression/getCompressedBalance.yaml POST /
openapi: 3.0.3
info:
  title: photon-indexer
  description: Trình lập chỉ mục Solana cho mục đích nén chung
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.50.0
servers:
  - url: https://mainnet.helius-rpc.com
    description: Điểm cuối RPC Mainnet
  - url: https://devnet.helius-rpc.com
    description: Điểm cuối RPC Devnet
security: []
paths:
  /:
    post:
      description: Truy xuất số dư tài khoản nén
      operationId: getCompressedBalance
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: Phiên bản của giao thức JSON-RPC.
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: ID dùng để nhận dạng yêu cầu.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  description: Tên của phương thức cần gọi.
                  enum:
                    - getCompressedBalance
                  default: getCompressedBalance
                params:
                  type: object
                  description: Yêu cầu dữ liệu tài khoản nén
                  default:
                    address: null
                    hash: '11111111111111111111111111111111'
                  properties:
                    address:
                      type: string
                      allOf:
                        - $ref: '#/components/schemas/SerializablePubkey'
                      nullable: true
                    hash:
                      type: string
                      allOf:
                        - $ref: '#/components/schemas/Hash'
                      nullable: true
                  additionalProperties: false
                  example:
                    address: null
                    hash: '11111111111111111111111111111111'
        required: true
      responses:
        '200':
          description: Đã truy xuất thành công số dư tài khoản nén từ blockchain Solana
          content:
            application/json:
              schema:
                type: object
                required:
                  - context
                  - value
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/UnsignedInteger'
                additionalProperties: false
        '400':
          description: >-
            Yêu cầu không hợp lệ - Tham số yêu cầu không hợp lệ hoặc yêu cầu sai
            định dạng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Tham số không hợp lệ
                id: '1'
        '401':
          description: Không được phép - Khóa API không hợp lệ hoặc bị thiếu.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Không được phép
                id: '1'
        '429':
          description: Quá nhiều yêu cầu - Đã vượt quá giới hạn tốc độ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Quá nhiều yêu cầu
                id: '1'
        '500':
          description: Lỗi máy chủ nội bộ - Đã xảy ra lỗi trên máy chủ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Lỗi nội bộ
                id: '1'
        '503':
          description: Dịch vụ không khả dụng - Dịch vụ tạm thời không khả dụng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Dịch vụ không khả dụng
                id: '1'
        '504':
          description: Cổng kết nối hết thời gian chờ - Yêu cầu đã hết thời gian chờ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Cổng kết nối hết thời gian chờ
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    SerializablePubkey:
      type: string
      description: Khóa công khai Solana được biểu diễn dưới dạng chuỗi base58.
      default: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    Hash:
      type: string
      description: Hàm băm 32 byte được biểu diễn dưới dạng chuỗi base58.
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
    UnsignedInteger:
      type: integer
      default: 100
      example: 100
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: Phiên bản giao thức JSON-RPC.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Mã lỗi.
              example: -32602
            message:
              type: string
              description: Thông báo lỗi.
            data:
              type: object
              description: Dữ liệu bổ sung về lỗi.
        id:
          type: string
          description: Mã định danh khớp với yêu cầu.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Khóa API Helius của bạn. Bạn có thể nhận khóa miễn phí trong [bảng điều
        khiển](https://dashboard.helius.dev/api-keys).

````