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

# isBlockhashValid

> Trả về thông tin cho biết blockhash còn hợp lệ hay không.

## Tham số yêu cầu

<ParamField body="blockhash" type="string" required>
  Blockhash cần kiểm tra trạng thái hợp lệ, dưới dạng chuỗi được mã hóa base-58.
</ParamField>

<ParamField body="commitment" type="string">
  Mức cam kết cho yêu cầu.

  * `confirmed`
  * `finalized`
  * `processed`
</ParamField>

<ParamField body="minContextSlot" type="number">
  Slot tối thiểu mà tại đó yêu cầu có thể được đánh giá.
</ParamField>


## OpenAPI

````yaml vi/openapi/rpc-http/isBlockhashValid.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API xác minh tính hợp lệ của giao dịch để kiểm tra xem blockhash Solana đã
    lấy trước đó còn nằm trong khoảng thời gian có thể sử dụng để gửi giao dịch
    mới hay không.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
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:
      tags:
        - RPC
      summary: isBlockhashValid
      description: >
        Xác minh xem một blockhash Solana còn hợp lệ để gửi giao dịch hay không.

        API chuẩn bị giao dịch thiết yếu này cho phép các ứng dụng xác định xem
        một blockhash đã lấy

        trước đó còn nằm trong khoảng thời gian hợp lệ hay không (thường khoảng
        2 phút hoặc 150 khối).

        Mạng sẽ từ chối các giao dịch được tạo bằng blockhash đã hết hạn, vì vậy
        việc kiểm tra

        tính hợp lệ trước khi gửi giúp ngăn ngừa giao dịch thất bại và lỗi hết
        thời gian chờ. Điều này rất quan trọng đối với

        các ứng dụng ví, sàn giao dịch, đơn vị xử lý thanh toán và mọi dịch vụ
        chuẩn bị giao dịch

        trước hoặc cần kiểm tra xem một giao dịch đang chờ xử lý còn có thể được
        gửi hay cần được

        tạo lại bằng blockhash mới để tránh bị từ chối do hết hạn.
      operationId: isBlockhashValid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Phiên bản giao thức JSON-RPC.
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Mã định danh duy nhất cho yêu cầu.
                  example: '45'
                  default: '1'
                method:
                  type: string
                  enum:
                    - isBlockhashValid
                  description: Tên của phương thức RPC cần gọi.
                  example: isBlockhashValid
                  default: isBlockhashValid
                params:
                  type: array
                  description: Các tham số để đánh giá tính hợp lệ của blockhash.
                  default:
                    - J7rBdM6AecPDEZp8aPq5iPSNKVkU5Q76F3oAV4eW5wsW
                    - commitment: processed
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          Blockhash cần kiểm tra trạng thái hợp lệ, dưới dạng
                          chuỗi được mã hóa base-58.
                        example: J7rBdM6AecPDEZp8aPq5iPSNKVkU5Q76F3oAV4eW5wsW
                      - type: object
                        description: Các tùy chọn cấu hình cho yêu cầu.
                        properties:
                          commitment:
                            type: string
                            description: Mức cam kết cho yêu cầu.
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: processed
                          minContextSlot:
                            type: integer
                            description: >-
                              Slot tối thiểu mà tại đó yêu cầu có thể được đánh
                              giá.
                            example: 1000
      responses:
        '200':
          description: Đã đánh giá thành công tính hợp lệ của blockhash.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: Phiên bản giao thức JSON-RPC.
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Mã định danh khớp với yêu cầu.
                    example: '45'
                  result:
                    type: object
                    description: Kết quả về tính hợp lệ của blockhash.
                    properties:
                      context:
                        type: object
                        description: Ngữ cảnh của phản hồi.
                        properties:
                          slot:
                            type: integer
                            description: Slot nơi dữ liệu được truy xuất.
                            example: 2483
                      value:
                        type: boolean
                        description: >-
                          Giá trị Boolean cho biết blockhash này có còn nằm
                          trong khoảng thời gian hợp lệ và có thể được sử dụng
                          trong các giao dịch mới hay không.
                        example: false
              examples:
                default:
                  $ref: '#/components/examples/isBlockhashValidResponse'
        '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
            không đúng định dạng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                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: Unauthorized
                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: Too many requests
                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: Internal error
                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: Service unavailable
                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: Gateway timeout
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  examples:
    isBlockhashValidResponse:
      value:
        jsonrpc: '2.0'
        id: '45'
        result:
          context:
            slot: 2483
          value: false
  schemas:
    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).

````