> ## 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

> Возвращает баланс сжатой учетной записи с указанным адресом или хешем.

## Параметры запроса

<ParamField body="address" type="string" default="11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP">
  Публичный ключ Solana в виде строки base58.
</ParamField>

<ParamField body="hash" type="string">
  32-байтовый хеш в виде строки base58.
</ParamField>


## OpenAPI

````yaml ru/openapi/zk-compression/getCompressedBalance.yaml POST /
openapi: 3.0.3
info:
  title: photon-indexer
  description: Индексатор Solana для универсального сжатия
  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: Конечная точка RPC основной сети
  - url: https://devnet.helius-rpc.com
    description: Конечная точка RPC сети разработки
security: []
paths:
  /:
    post:
      description: Получает баланс сжатой учетной записи
      operationId: getCompressedBalance
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: Версия протокола JSON-RPC.
                  enum:
                    - '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Идентификатор запроса.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  description: Имя вызываемого метода.
                  enum:
                    - getCompressedBalance
                  default: getCompressedBalance
                params:
                  type: object
                  description: Запрос данных сжатой учетной записи
                  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: Баланс сжатой учетной записи успешно получен из блокчейна 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: >-
            Неверный запрос — недопустимые параметры или некорректный формат
            запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Недопустимые параметры
                id: '1'
        '401':
          description: Не авторизовано — недействительный или отсутствующий ключ API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Не авторизовано
                id: '1'
        '429':
          description: Слишком много запросов — превышен лимит запросов.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Слишком много запросов
                id: '1'
        '500':
          description: Внутренняя ошибка сервера — на сервере произошла ошибка.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Внутренняя ошибка
                id: '1'
        '503':
          description: Сервис недоступен — сервис временно недоступен.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Сервис недоступен
                id: '1'
        '504':
          description: Истекло время ожидания шлюза — превышено время ожидания запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Истекло время ожидания шлюза
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    SerializablePubkey:
      type: string
      description: Открытый ключ Solana, представленный строкой в формате base58.
      default: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    Hash:
      type: string
      description: 32-байтовый хеш, представленный строкой в формате 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: Версия протокола JSON-RPC.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Код ошибки.
              example: -32602
            message:
              type: string
              description: Сообщение об ошибке.
            data:
              type: object
              description: Дополнительные данные об ошибке.
        id:
          type: string
          description: Идентификатор, соответствующий запросу.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Ваш ключ API Helius. Его можно бесплатно получить на [панели
        управления](https://dashboard.helius.dev/api-keys).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.