> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulate a transaction

> Simulates an EVM transaction and returns the expected state changes and gas usage.
Only supports EIP-155 chains.

**Deprecated:** Use the `evaluate-transaction` endpoint instead.




## OpenAPI

````yaml /openapi/client-api.yaml post /clients/me/simulate-transaction
openapi: 3.1.0
info:
  title: Portal Client API
  version: '3.0'
  description: >
    The Portal Client API provides endpoints for managing wallets, building
    transactions,

    and interacting with blockchain networks. All endpoints require
    authentication via a

    Client API Key or Client Session Token (CST) passed as a Bearer token.


    ## Base URL

    `https://api.portalhq.io/api/v3`


    ## Authentication

    Include your Client API Key or Client Session Token as a Bearer token in the

    `Authorization` header of every request.


    ## Chain ID Format

    Chain parameters use either friendly names (e.g. `ethereum`, `solana`) or
    CAIP-2 format

    (e.g. `eip155:1`, `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`). When using
    CAIP-2 format

    in URLs, ensure the colon is URI-encoded (`%3A`).
servers:
  - url: https://api.portalhq.io/api/v3
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Clients
    description: Core client management endpoints
  - name: Wallet
    description: >-
      Read wallet state — balances, NFTs, transaction history, capabilities, and
      transaction details
  - name: Transactions
    description: Build, broadcast, and evaluate blockchain transactions
  - name: Funding
    description: Fund wallets with testnet tokens
  - name: Wallet Shares
    description: Manage signing and backup share pairs
  - name: Delegations
    description: Manage token approvals, revocations, and delegated transfers
  - name: Session Keys
    description: Manage EIP-7702 session keys for smart accounts
  - name: 0x
    description: Token swap endpoints powered by the 0x protocol
  - name: Yield.xyz
    description: Yield opportunities and staking actions powered by Yield.xyz
  - name: Li.Fi
    description: Cross-chain swaps and bridging powered by Li.Fi
  - name: Blockaid
    description: Transaction and address security scanning powered by Blockaid
  - name: Hypernative
    description: >-
      Transaction, address, token, and NFT security scanning powered by
      Hypernative
  - name: Noah
    description: KYC onboarding, payins, and payouts powered by Noah
  - name: Meld
    description: Buy and sell crypto with fiat through aggregated providers powered by Meld
  - name: EIP-7702
    description: EIP-7702 account type detection and authorization management
  - name: Deprecated
    description: >-
      Legacy endpoints scheduled for removal. Use the newer equivalents listed
      in each endpoint's description.
paths:
  /clients/me/simulate-transaction:
    post:
      tags:
        - Deprecated
      summary: Simulate a transaction
      description: >
        Simulates an EVM transaction and returns the expected state changes and
        gas usage.

        Only supports EIP-155 chains.


        **Deprecated:** Use the `evaluate-transaction` endpoint instead.
      operationId: simulateTransaction
      parameters:
        - name: chainId
          in: query
          required: true
          description: >
            Chain ID in CAIP-2 format (EIP-155 only). For example, `eip155:1`
            for

            Ethereum mainnet.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulateTransactionRequest'
            example:
              to: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
              data: 0xa9059cbb000000000000000000000000...
              value: '0x0'
      responses:
        '200':
          description: Transaction simulated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateTransactionResponse'
              examples:
                success:
                  summary: Successful simulation
                  value:
                    changes:
                      - type: transfer
                        from: '0x54968898742c08da211a1cd355447cd1f37f0649'
                        to: '0xdFd8302f44727A6348F702fF7B594f127dE3A902'
                        amount: '10000'
                        token: USDC
                    gasUsed: '65000'
                error:
                  summary: Simulation error
                  value:
                    error:
                      message: execution reverted
        '400':
          description: |
            Validation error. Common causes:
            - Missing or invalid chainId
            - Chain is not EIP-155
            - Missing `to` address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulateTransactionErrorResponse'
              example:
                requestError:
                  message: chainId must be in CAIP-2 format (e.g. eip155:1)
        '401':
          description: Unauthorized - invalid or missing authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: true
components:
  schemas:
    SimulateTransactionRequest:
      type: object
      required:
        - to
      properties:
        to:
          type: string
          description: The target contract or recipient address.
        data:
          type: string
          description: Encoded transaction data (hex string).
        value:
          type: string
          description: Value to send in wei (hex string).
        gas:
          type: string
          description: Gas limit.
        gasPrice:
          type: string
          description: Gas price in wei.
        maxFeePerGas:
          type: string
          description: Maximum fee per gas (EIP-1559).
        maxPriorityFeePerGas:
          type: string
          description: Maximum priority fee per gas (EIP-1559).
    SimulateTransactionResponse:
      type: object
      properties:
        changes:
          type: array
          items:
            type: object
          description: Array of state changes from the simulation.
        gasUsed:
          type: string
          nullable: true
          description: Amount of gas used by the simulation.
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message if the simulation failed.
    SimulateTransactionErrorResponse:
      type: object
      properties:
        requestError:
          type: object
          properties:
            message:
              type: string
              description: Validation error message.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Client API Key or Client Session Token (CST). Pass as a Bearer token in
        the

        Authorization header.

````