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

# getFeeForMessage

> 特定のメッセージに対してネットワークが請求する手数料を取得します。

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

<ParamField body="transaction" type="string" required>
  正確な手数料を計算するためのBase-64エンコードされたシリアライズされたSolanaトランザクションメッセージ。
</ParamField>

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

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

<ParamField body="minContextSlot" type="number">
  リクエストを評価するための最小スロット。
</ParamField>


## OpenAPI

````yaml ja/openapi/rpc-http/getFeeForMessage.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: getFeeForMessage
      description: >-
        特定のシリアライズされたSolanaメッセージに対するトランザクション手数料を正確に計算します。この手数料見積もりAPIは、実際のトランザクションメッセージ構造に基づいて正確なSOL料金計算を提供し、一般的な手数料見積もりよりも正確な結果を提供します。事前にシリアライズされたメッセージ内の正確な操作を分析することで、請求される正確なラマートコストを判断します。正確な手数料見積もりが必要なウォレットアプリケーション、引き出し手数料を計算する取引所、トランザクション予算を計画するDApp、正確なコスト計算を必要とする支払い処理業者、およびSolanaネットワークへのトランザクション送信前に正確な手数料を知る必要があるすべてのアプリケーションに不可欠です。
      operationId: getFeeForMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              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:
                    - getFeeForMessage
                  example: getFeeForMessage
                  default: getFeeForMessage
                params:
                  type: array
                  description: メソッドのパラメータ。
                  default:
                    - >-
                      AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          正確な料金を計算するためのBase-64エンコードされたシリアライズされたSolanaトランザクションメッセージ。
                        example: >-
                          AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA
                      - type: object
                        description: オプションのパラメータを含む構成オブジェクト。
                        properties:
                          commitment:
                            type: string
                            description: リクエストのコミットメントレベル。
                            enum:
                              - confirmed
                              - finalized
                            example: finalized
                          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: メッセージの料金情報。
                    properties:
                      context:
                        type: object
                        description: レスポンスのコンテキスト。
                        properties:
                          slot:
                            type: integer
                            description: 料金が計算されたスロット。
                            example: 5068
                      value:
                        type: integer
                        nullable: true
                        description: >-
                          ネットワーク上でこの特定のメッセージを処理するために必要なラマート単位(1 SOL =
                          1,000,000,000ラマーツ)での正確なトランザクション料金。
                        example: 5000
        '400':
          description: Bad Request - 無効なリクエストパラメータまたは形式が正しくありません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Unauthorized - 無効または欠落しているAPIキー。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Too Many Requests - レート制限を超えました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Internal Server Error - サーバーでエラーが発生しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Service Unavailable - サービスは一時的に利用できません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Gateway Timeout - リクエストがタイムアウトしました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway timeout
                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キーを入力してください。[ダッシュボード](https://dashboard.helius.dev/api-keys)で無料で取得できます。

````