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

# simulateTransaction

> Solana トランザクションをシミュレートして、ネットワークに送信せずにログ、演算ユニット使用量、アカウント変更をプレビューします。手数料の見積もり、不具合の検出、署名前のデバッグに使用されます。

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

<ParamField body="transaction" type="string" required>
  エンコードされた文字列（base58 または base64）としての署名済みトランザクション。
</ParamField>

<ParamField body="encoding" type="string">
  トランザクションデータ用のエンコーディング。

  * `base58`
  * `base64`
</ParamField>

<ParamField body="skipPreflight" type="boolean">
  プレフライト トランザクションチェックをスキップします。
</ParamField>

<ParamField body="preflightCommitment" type="string">
  プレフライト用のコミットメントレベル。

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

<ParamField body="sigVerify" type="boolean">
  真の場合、トランザクション署名を検証します。
</ParamField>

<ParamField body="replaceRecentBlockhash" type="boolean">
  真の場合、トランザクションの最近のブロックハッシュを最新のものに置き換えます。
</ParamField>

<ParamField body="minContextSlot" type="number">
  プレフライト トランザクションチェックを実行する最小スロット。
</ParamField>

<ParamField body="innerInstructions" type="boolean">
  真の場合、レスポンスに内部命令を含めます。
</ParamField>

<ParamField body="accounts" type="object" />

<ParamField body="accounts.addresses" type="array">
  base-58 エンコードされた文字列として返すアカウントの配列。
</ParamField>

<ParamField body="accounts.encoding" type="string">
  返されるアカウントデータのエンコーディング形式。

  * `base64`
  * `base58`
  * `base64+zstd`
  * `jsonParsed`
</ParamField>


## OpenAPI

````yaml ja/openapi/rpc-http/simulateTransaction.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    Solanaネットワークにコミットする前にブロックチェーントランザクションをテストおよびデバッグするための高度な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: Mainnet RPCエンドポイント
  - url: https://devnet.helius-rpc.com
    description: Devnet RPCエンドポイント
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: simulateTransaction
      description: >-
        Solanaトランザクションをブロックチェーン上で実行せずにシミュレートします。この強力なデバッグツールにより、開発者はトランザクションの実行をテストし、プログラムの動作を検証し、計算ユニットの消費を見積もり、エラーを検出し、アカウントの状態変化を予測できます。Solanaアプリケーション開発、スマートコントラクトテスト、トランザクション最適化に不可欠です。
      operationId: simulateTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: JSON-RPCプロトコルのバージョン。
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: リクエストの一意の識別子。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - simulateTransaction
                  description: 呼び出すRPCメソッドの名前。
                  example: simulateTransaction
                  default: simulateTransaction
                params:
                  type: array
                  description: トランザクションをシミュレートするためのパラメータ。
                  default:
                    - >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=
                    - encoding: base64
                  items:
                    oneOf:
                      - type: string
                        description: 署名済みトランザクション（base58またはbase64でエンコードされた文字列）。
                        example: >-
                          AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=
                      - type: object
                        description: シミュレーション用の設定オブジェクト。
                        properties:
                          encoding:
                            type: string
                            description: トランザクションデータのエンコーディング。
                            enum:
                              - base58
                              - base64
                            example: base64
                          skipPreflight:
                            type: boolean
                            description: プリフライトトランザクションチェックをスキップします。
                            example: false
                          preflightCommitment:
                            type: string
                            description: プリフライト用のコミットメントレベル。
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
                          sigVerify:
                            type: boolean
                            description: 署名を確認する場合はtrue。
                            example: false
                          replaceRecentBlockhash:
                            type: boolean
                            description: トランザクションの最近のブロックハッシュを最新のものと置き換える場合はtrue。
                            example: false
                          minContextSlot:
                            type: integer
                            description: プリフライトトランザクションチェックを行うための最小スロット。
                            example: 1000
                          innerInstructions:
                            type: boolean
                            description: レスポンスに内部命令を含める場合はtrue。
                            example: false
                          accounts:
                            type: object
                            properties:
                              addresses:
                                type: array
                                description: base-58エンコードされた文字列として返すアカウントの配列。
                                items:
                                  type: string
                                  example: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                              encoding:
                                type: string
                                description: 返されるアカウントデータのエンコーディング形式。
                                enum:
                                  - base64
                                  - base58
                                  - base64+zstd
                                  - jsonParsed
                                example: base64
      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:
                          apiVersion:
                            type: string
                            description: RPCノードのAPIバージョン。
                            example: 2.3.3
                          slot:
                            type: integer
                            description: データが取得されたスロット。
                            example: 393226680
                      value:
                        type: object
                        description: シミュレーションされたトランザクション結果の詳細。
                        properties:
                          accounts:
                            type:
                              - array
                              - 'null'
                            items:
                              type: object
                              description: トランザクションに関連するアカウントの詳細。
                              example:
                                lamports: 5000
                                owner: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
                          err:
                            type:
                              - object
                              - 'null'
                            description: トランザクションが失敗した場合のエラー（成功した場合はnull）。
                            example: null
                          innerInstructions:
                            type:
                              - array
                              - 'null'
                            description: トランザクション中に実行された内部命令。
                            example: null
                          loadedAccountsDataSize:
                            type:
                              - integer
                              - 'null'
                            description: シミュレーション中にロードされたすべてのアカウントデータの合計サイズ（バイト単位）。
                            example: 413
                          logs:
                            type:
                              - array
                              - 'null'
                            items:
                              type: string
                            description: トランザクションシミュレーションからのプログラム実行ログ。
                            example:
                              - >-
                                Program
                                TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                                invoke [1]
                              - 'Program log: Instruction: Transfer'
                              - >-
                                Program
                                TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                                consumed 1714 of 200000 compute units
                              - >-
                                Program
                                TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                                success
                          replacementBlockhash:
                            type:
                              - object
                              - 'null'
                            description: replaceRecentBlockhashが有効な場合の置換ブロックハッシュ情報。
                            properties:
                              blockhash:
                                type: string
                                description: 置換ブロックハッシュ。
                                example: 6oFLsE7kmgJx9PjR4R63VRNtpAVJ648gCTr3nq5Hihit
                              lastValidBlockHeight:
                                type: integer
                                description: 置換ブロックハッシュの最終有効ブロック高さ。
                                example: 381186895
                          returnData:
                            type:
                              - object
                              - 'null'
                            properties:
                              programId:
                                type: string
                                example: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri
                              data:
                                type: array
                                items:
                                  type: string
                                example:
                                  - Kg==
                                  - base64
                            description: トランザクションから返されたデータ（ある場合）。
                            example: null
                          unitsConsumed:
                            type:
                              - integer
                              - 'null'
                            description: シミュレーション中に消費された計算単位の合計。
                            example: 1714
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  context:
                    apiVersion: 2.3.3
                    slot: 393226680
                  value:
                    accounts: null
                    err: null
                    innerInstructions: null
                    loadedAccountsDataSize: 413
                    logs:
                      - >-
                        Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                        invoke [1]
                      - 'Program log: Instruction: Transfer'
                      - >-
                        Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                        consumed 1714 of 200000 compute units
                      - >-
                        Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
                        success
                    replacementBlockhash:
                      blockhash: 6oFLsE7kmgJx9PjR4R63VRNtpAVJ648gCTr3nq5Hihit
                      lastValidBlockHeight: 381186895
                    returnData: null
                    unitsConsumed: 1714
        '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キーまたは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)で無料で取得できます。

````