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

# getCompressedAccount

> Trả về 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="11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3">
  Khóa công khai Solana của tài khoản nén cần truy xuất dữ liệu
</ParamField>

<ParamField body="hash" type="string">
  Mã định danh hàm băm dữ liệu của tài khoản Solana nén nếu không có địa chỉ
</ParamField>


## OpenAPI

````yaml vi/openapi/zk-compression/getCompressedAccount.yaml POST /
openapi: 3.0.3
info:
  title: API nén trạng thái Solana
  description: >
    Trình lập chỉ mục Solana nâng cao dành cho các tài khoản trạng thái nén, sử
    dụng bằng chứng không kiến thức để lưu trữ và truy xuất dữ liệu hiệu quả.

    API này hỗ trợ các thao tác NFT và token tiết kiệm chi phí thông qua công
    nghệ nén trạng thái của Solana,

    giúp giảm chi phí lưu trữ tới 1000 lần so với các tài khoản truyền thống.
  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:
  /:
    summary: getCompressedAccount
    post:
      description: >
        Truy xuất dữ liệu chi tiết của một tài khoản Solana nén bằng công nghệ
        nén trạng thái.

        Điểm cuối này cung cấp quyền truy cập vào khả năng lưu trữ dữ liệu trên
        chuỗi hiệu quả với mức tiết kiệm chi phí lên tới 1000 lần 

        so với các tài khoản Solana thông thường. Truy vấn NFT nén và tài khoản
        token theo địa chỉ hoặc hàm băm 

        để nhận đầy đủ thông tin tài khoản, thông tin chi tiết về quyền sở hữu
        và dữ liệu trên chuỗi.


        Các lợi ích chính:

        - Giảm đáng kể chi phí cho các dự án NFT Solana và tổ chức phát hành
        token

        - Giảm phí lưu trữ cho các ứng dụng có khối lượng lớn

        - Hoàn toàn tương thích với mô hình bảo mật và đồng thuận của Solana

        - Giải pháp có khả năng mở rộng cho các bộ sưu tập NFT và tập hợp token
        lớn

        - Tăng thông lượng cho các thao tác với tài sản nén
      operationId: getCompressedAccount
      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.
                  default: '1'
                method:
                  type: string
                  description: Tên của phương thức cần gọi.
                  enum:
                    - getCompressedAccount
                  default: getCompressedAccount
                params:
                  type: object
                  description: >
                    Các tham số yêu cầu để truy xuất dữ liệu tài khoản nén trên
                    Solana, bao gồm 

                    định danh địa chỉ hoặc hàm băm dữ liệu cho NFT và token nén
                  default:
                    address: null
                    hash: gEF8v1TLb2T9vTaJarFj6kQoSfWNkskMSCJpPJSxZzT
                  properties:
                    address:
                      type: string
                      allOf:
                        - $ref: '#/components/schemas/SerializablePubkey'
                      nullable: true
                      description: >-
                        Khóa công khai Solana của tài khoản nén cần truy xuất dữ
                        liệu
                    hash:
                      type: string
                      allOf:
                        - $ref: '#/components/schemas/Hash'
                      nullable: true
                      description: >-
                        Định danh hàm băm dữ liệu của tài khoản Solana nén nếu
                        không có địa chỉ
                  additionalProperties: false
                  example:
                    address: null
                    hash: gEF8v1TLb2T9vTaJarFj6kQoSfWNkskMSCJpPJSxZzT
        required: true
      responses:
        '200':
          description: Đã truy xuất thành công dữ liệu tài khoản nén từ blockchain Solana
          content:
            application/json:
              schema:
                type: object
                required:
                  - context
                properties:
                  context:
                    $ref: '#/components/schemas/Context'
                  value:
                    $ref: '#/components/schemas/Account'
                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 có
            định dạng sai.
          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: Hết thời gian chờ cổng kết nối - 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 mã hóa base58, dùng
        để nhận dạng tài khoản, chương trình và người dùng.
      default: 11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3
      example: 11111112D1oxKts8YPdTJRG5FzxTNpMtWmq8hkVx3
    Hash:
      type: string
      description: >-
        Hàm băm mật mã 32 byte được biểu diễn dưới dạng chuỗi base58, dùng để
        xác minh tài khoản Solana nén.
      example: 11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP
    Context:
      type: object
      required:
        - slot
      properties:
        slot:
          type: integer
          default: 100
          example: 100
          description: Ngữ cảnh slot blockchain Solana hiện tại cho yêu cầu này
    Account:
      type: object
      required:
        - hash
        - owner
        - lamports
        - tree
        - leafIndex
        - seq
        - slotCreated
      properties:
        address:
          $ref: '#/components/schemas/SerializablePubkey'
          description: Địa chỉ định danh duy nhất của tài khoản Solana nén
        data:
          $ref: '#/components/schemas/AccountData'
          description: Dữ liệu trên chuỗi được lưu trữ trong tài khoản Solana nén
        hash:
          $ref: '#/components/schemas/Hash'
          description: Hàm băm mật mã của dữ liệu tài khoản nén dùng để xác minh
        lamports:
          $ref: '#/components/schemas/UnsignedInteger'
          description: >-
            Số dư SOL do tài khoản nén này nắm giữ, tính bằng lamport (1 SOL =
            1.000.000.000 lamport)
        leafIndex:
          $ref: '#/components/schemas/UnsignedInteger'
          description: Chỉ mục vị trí trong cây Merkle nơi lưu trữ tài khoản nén này
        owner:
          $ref: '#/components/schemas/SerializablePubkey'
          description: >-
            Chương trình Solana sở hữu tài khoản nén này (thường là chương trình
            nén)
        seq:
          $ref: '#/components/schemas/UnsignedInteger'
          description: Số thứ tự dùng để theo dõi các bản cập nhật của tài khoản nén này
        slotCreated:
          $ref: '#/components/schemas/UnsignedInteger'
          description: Slot blockchain Solana tại thời điểm tài khoản nén này được tạo
        tree:
          $ref: '#/components/schemas/SerializablePubkey'
          description: Địa chỉ của cây Merkle nơi lưu trữ tài khoản nén này
      additionalProperties: false
    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: Định danh khớp với yêu cầu.
          example: '1'
    AccountData:
      type: object
      required:
        - discriminator
        - data
        - dataHash
      properties:
        data:
          $ref: '#/components/schemas/Base64String'
        dataHash:
          $ref: '#/components/schemas/Hash'
        discriminator:
          $ref: '#/components/schemas/UnsignedInteger'
      additionalProperties: false
    UnsignedInteger:
      type: integer
      default: 100
      example: 100
      description: >-
        Giá trị số nguyên không âm dùng cho nhiều tham số số khác nhau trong các
        tài khoản Solana nén
    Base64String:
      type: string
      description: Chuỗi được mã hóa base64 đại diện cho dữ liệu tài khoản nén trên Solana.
      default: SGVsbG8sIFdvcmxkIQ==
      example: SGVsbG8sIFdvcmxkIQ==
  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).

````