> ## 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">
  true이면, 트랜잭션 서명을 검증합니다.
</ParamField>

<ParamField body="replaceRecentBlockhash" type="boolean">
  true이면, 최근 블록 해시를 가장 최신 것으로 대체합니다.
</ParamField>

<ParamField body="minContextSlot" type="number">
  사전 점검 트랜잭션 검사를 수행할 최소 슬롯.
</ParamField>

<ParamField body="innerInstructions" type="boolean">
  true이면, 응답에 내부 명령을 포함합니다.
</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 ko/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: 메인넷 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: 잘못된 요청 - 잘못된 요청 매개변수 또는 형식이 잘못된 요청입니다.
          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 키입니다. [대시보드](https://dashboard.helius.dev/api-keys)에서 무료로
        받을 수 있습니다.

````