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

# getLatestBlockhash

> 新しいトランザクションを構築するために必要な最新のSolanaブロックハッシュを返します。ブロックハッシュは約150スロット後に期限切れになります — 署名直前に取得して、インクルージョンウィンドウを最大化します。

## リクエストパラメータ

<ParamField body="commitment" type="string">
  リクエストのコミットメントレベル。

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

<ParamField body="minContextSlot" type="number">
  リクエストが評価されることができる最小スロット。
</ParamField>


## OpenAPI

````yaml ja/openapi/rpc-http/getLatestBlockhash.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: ブロックチェーン取引の作成と署名に必要な最新の有効なブロックハッシュを取得するためのSolanaトランザクション準備API。
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: メインネットRPCエンドポイント
  - url: https://devnet.helius-rpc.com
    description: Devnet RPCエンドポイント
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getLatestBlockhash
      description: >-
        Solanaブロックチェーンからの最新の有効なブロックハッシュを取得し、トランザクション作成に必須です。この基本的なAPIは、現在のブロックハッシュとその有効期間を提供し、あらゆるSolanaトランザクションを構築する際に必要なコンポーネントです。ブロックハッシュは、直近の状態の参照とリプレイ保護メカニズムの両方として機能します。すべてのトランザクションは、ネットワークによって有効と見なされるために最近のブロックハッシュを含める必要があります。ウォレットプロバイダ、DApps、ならびにトランザクションをSolanaブロックチェーンに送信するあらゆるサービスにとって非常に重要です。
      operationId: getLatestBlockhash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
              properties:
                jsonrpc:
                  type: string
                  description: JSON-RPCプロトコルのバージョン。
                  enum:
                    - '2.0'
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: リクエストの一意の識別子。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  description: 起動するRPCメソッドの名前。
                  enum:
                    - getLatestBlockhash
                  example: getLatestBlockhash
                  default: getLatestBlockhash
                params:
                  type: array
                  description: リクエストのオプションの設定オブジェクト。
                  items:
                    type: object
                    properties:
                      commitment:
                        type: string
                        description: リクエストのコミットメントレベル。
                        enum:
                          - confirmed
                          - finalized
                          - processed
                        example: processed
                      minContextSlot:
                        type: integer
                        description: リクエストが評価される最小スロット。
                        example: 1000
      responses:
        '200':
          description: 最新のブロックハッシュ情報を正常に取得しました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPCプロトコルのバージョン。
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: リクエストに一致する識別子。
                    example: '1'
                  result:
                    type: object
                    description: ブロックハッシュ情報を含むRpcResponse。
                    properties:
                      context:
                        type: object
                        description: 応答のコンテキスト。
                        properties:
                          slot:
                            type: integer
                            description: データが取得されたスロット。
                            example: 2792
                      value:
                        type: object
                        description: ブロックハッシュとその有効性の詳細。
                        properties:
                          blockhash:
                            type: string
                            description: >-
                              トランザクション作成に必要なベース58文字列としてエンコードされた最新のSolanaブロックハッシュ。
                            example: EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N
                          lastValidBlockHeight:
                            type: integer
                            description: このブロックハッシュがトランザクションで受け入れられるSolanaの最後のブロック高さ。
                            example: 3090
        '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:
    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: あなたのHelius APIキー。ダッシュボードで無料で取得できます。

````