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

# Simulate transaction

> Runs a transaction (base64 wire format) through RPC `simulateTransaction` without broadcasting it: signatures are not verified and the recent blockhash is replaced, so an unsigned transaction simulates too. Returns the outcome, program logs, compute units and the requested accounts (at most 32) as they were just before (`before`, read at its own slot) and as the simulation left them (`after`, at the simulation's `slot`), decoded where the node can (jsonParsed). `after` is null when the simulation failed; an account the transaction did not load appears in `after` unchanged. A wallet compares the two to preview a dApp's transaction. A malformed transaction answers 400.



## OpenAPI

````yaml https://nexus.gerowallet.io/v3/api-docs post /api/sol/txs/simulate
openapi: 3.1.0
info:
  title: Nexus API
  description: >-
    Multi-chain blockchain data API for Cardano, Bitcoin, Solana, and Midnight.


    ## Blockchains & Networks

    Endpoints are grouped by **blockchain**. Pick the target **network** with
    the

    `network` query parameter. A network is an environment *within* a
    blockchain,

    not a separate endpoint family.


    - **Cardano**: `CARDANO_MAINNET`, `CARDANO_PREPROD`, `CARDANO_PREVIEW`

    - **Bitcoin**: `BITCOIN_MAINNET`, `BITCOIN_TESTNET4`

    - **Solana**: `SOLANA_MAINNET`, `SOLANA_DEVNET`

    - **Midnight**: `MIDNIGHT_MAINNET`, `MIDNIGHT_PREPROD`, `MIDNIGHT_PREVIEW`,
      `MIDNIGHT_STAGENET` (deprecated, removed no earlier than 2026-12-08)

    These are the values published on each operation's `network` schema, and
    what

    generated clients send. A kebab-case alias (`cardano-mainnet`) is also
    accepted,

    and matching is case-insensitive — see the note on the parameter itself.


    ### Key scope: one chain, one network

    Each API key is scoped to **one chain and one network**, fixed at creation
    time.

    A `CARDANO_MAINNET` key cannot query `CARDANO_PREPROD`, and it cannot query

    Bitcoin or Midnight at all. Create one key per chain and network under the
    same

    account. Sending a `network` value that does not match the key returns

    **400 Network Mismatch**; omit the parameter and the request runs against
    the

    key's own network.


    What is uniform across chains is the integration surface, not the
    credential:

    one account, one base URL, one auth header, one docs site.


    ## Authentication

    Send your API key in the `X-Api-Key` header. This is the credential for

    programmatic access (create one in the dashboard; keys start with `nxs_`).

    `Authorization: Bearer <token>` is only for JWT **session** tokens issued by

    `/api/auth/login` (browser/mobile apps), not for API keys.


    ## Add-ons

    Capability is gated separately from network scope. Market data, wallet
    analytics,

    transaction building, MCP, and IPFS are paid add-ons; those endpoints return

    **402 Payment Required** on a key whose plan does not carry the matching
    add-on,

    even when the chain and network match.
  contact:
    name: Nexus Team
    url: https://nexus.gerowallet.io/support
    email: nexus@gerowallet.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://nexus.gerowallet.io
    description: API Server
security:
  - apiKeyAuth: []
  - bearerAuth: []
tags:
  - name: Cardano · Blocks
    description: Cardano Block API
  - name: Cardano · Policy
    description: Cardano Policy API
  - name: IPFS
    description: IPFS Content Resolution API
  - name: Bitcoin · Ordinals
    description: Ordinals + runes metadata (ord indexer)
  - name: Solana · Addresses
    description: Solana address balances, tokens and history
  - name: Partner
    description: Aggregator revenue share for partner key holders
  - name: Cardano · Metadata
    description: Label-scoped transaction metadata API
  - name: Cardano · Assets
    description: Token Registry Metadata
  - name: Cardano · Transactions
    description: Cardano Transactions API
  - name: Midnight · Transactions
    description: Midnight-specific transaction endpoints (unshielded UTXOs)
  - name: Bitcoin · Mempool
    description: Bitcoin mempool snapshot
  - name: Midnight · DUST
    description: DUST registration + generation status
  - name: Cardano · Stake Pools
    description: >-
      Cardano stake pool information including registrations, retirements, and
      pool metadata
  - name: Cardano · Network
    description: Cardano Network API - Query static network / genesis parameters
  - name: Cardano · RealFi
    description: >-
      RealFi Earn (USDr / sUSDr) read API. Wallet-keyed reads take a bech32
      address; Nexus derives the key hashes RealFi matches on. Networks without
      a RealFi deployment answer 502 rather than guessing.
  - name: Cardano · Addresses
    description: Cardano Address API
  - name: Bitcoin · Addresses
    description: >-
      Bitcoin address-keyed queries: stats / balance / UTxOs via electrs;
      ordinals via ord
  - name: Bitcoin · Transactions
    description: Bitcoin transaction lookup and submission
  - name: Solana · Chain
    description: Solana chain tip
  - name: Cardano · Governance
    description: >-
      Cardano on-chain governance: DReps, governance actions + votes,
      constitutional committee, constitution
  - name: Cardano · DReps
    description: >-
      Cardano delegate representatives (DReps): voting power, status, metadata,
      delegators
  - name: Cardano · Transaction Builder
    description: >-
      Cardano transaction building API. Builds unsigned transactions server-side
      for client-side signing and submission. Network can be specified in the
      request body or as a query parameter. Body takes precedence over query
      parameter.
  - name: Cardano · Assets
    description: Cardano Asset API
  - name: Solana · Transactions
    description: Solana transaction detail and submission
  - name: Cardano · Accounts
    description: Cardano Account API
  - name: Bitcoin · Fees
    description: Bitcoin fee-rate estimates by confirmation block target
  - name: Solana · Accounts
    description: Solana account state by address
  - name: Bitcoin · Blocks
    description: Bitcoin block lookup
  - name: Cardano · Handles
    description: ADA Handle resolution
  - name: Cardano Market Data
    description: Endpoints from cardano-market-data
  - name: Solana · Fees
    description: Solana fee estimates
  - name: Midnight · Indexer
    description: Transparent proxy to the Midnight GraphQL indexer
  - name: Cardano · Scripts
    description: Cardano script & datum API
  - name: Cardano · Epochs
    description: Cardano Epoch API - Query protocol parameters and epoch information
  - name: Bitcoin · Chain
    description: Bitcoin chain-tip and sync state
paths:
  /api/sol/txs/simulate:
    post:
      tags:
        - Solana · Transactions
      summary: Simulate transaction
      description: >-
        Runs a transaction (base64 wire format) through RPC
        `simulateTransaction` without broadcasting it: signatures are not
        verified and the recent blockhash is replaced, so an unsigned
        transaction simulates too. Returns the outcome, program logs, compute
        units and the requested accounts (at most 32) as they were just before
        (`before`, read at its own slot) and as the simulation left them
        (`after`, at the simulation's `slot`), decoded where the node can
        (jsonParsed). `after` is null when the simulation failed; an account the
        transaction did not load appears in `after` unchanged. A wallet compares
        the two to preview a dApp's transaction. A malformed transaction answers
        400.
      operationId: simulate
      parameters:
        - name: network
          in: query
          required: false
          schema:
            type: string
            description: >-
              Accepts either the value listed here (`CARDANO_MAINNET`) or its
              kebab-case alias (`cardano-mainnet`); matching is
              case-insensitive. Omit it and the network is taken from the API
              key. A value that disagrees with the key's own network returns 400
              Network Mismatch.
            enum:
              - CARDANO_MAINNET
              - CARDANO_PREPROD
              - CARDANO_PREVIEW
              - MIDNIGHT_MAINNET
              - MIDNIGHT_PREPROD
              - MIDNIGHT_PREVIEW
              - MIDNIGHT_STAGENET
              - BITCOIN_MAINNET
              - BITCOIN_TESTNET4
              - SOLANA_MAINNET
              - SOLANA_DEVNET
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SolanaTxSimulateRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SolanaSimulationDto'
components:
  schemas:
    SolanaTxSimulateRequest:
      type: object
      properties:
        transaction:
          type: string
          description: >-
            Wire-format transaction, base64 (at most 1232 bytes decoded).
            Signatures are not checked, so an unsigned transaction (zeroed
            signatures) simulates too
          minLength: 1
        accounts:
          type: array
          description: Accounts to report before and after the simulation, at most 32
          items:
            type: string
            example: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
            minLength: 1
          maxItems: 32
          minItems: 0
      required:
        - transaction
    SolanaSimulationDto:
      type: object
      description: >-
        Simulation of a transaction: outcome, logs and the requested accounts
        before and after
      properties:
        slot:
          type: integer
          format: int64
          description: Slot the simulation ran at
          example: 312345679
        success:
          type: boolean
        err:
          $ref: '#/components/schemas/JsonNode'
          type: 'null'
          description: The runtime error when success is false, as returned by RPC
        logs:
          type:
            - array
            - 'null'
          description: Program log lines (the node truncates long logs)
          items:
            type: string
        unitsConsumed:
          type:
            - integer
            - 'null'
          format: int64
          description: Compute units the transaction consumed
        before:
          $ref: '#/components/schemas/SolanaAccountsDto'
          description: >-
            The requested accounts as they were before the simulation (read just
            before it)
        after:
          type:
            - array
            - 'null'
          description: >-
            The requested accounts as the simulation left them (at `slot`), in
            the order requested. Null when the simulation failed. An account the
            transaction did not load is given as it was before (unchanged); a
            closed account appears with 0 lamports
          items:
            $ref: '#/components/schemas/SolanaAccountDto'
    JsonNode: {}
    SolanaAccountsDto:
      type: object
      description: >-
        Accounts read together at one slot (commitment: confirmed), in the order
        requested
      properties:
        slot:
          type: integer
          format: int64
          description: Slot the accounts were read at
          example: 312345678
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/SolanaAccountDto'
    SolanaAccountDto:
      type: object
      description: >-
        A Solana account: owner program, balance and, when the node can decode
        it, its parsed data
      properties:
        address:
          type: string
          description: Base58 address
          example: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
        exists:
          type: boolean
          description: >-
            False when the account does not exist (all other fields are then
            null)
        lamports:
          type:
            - integer
            - 'null'
          format: int64
          description: Balance in lamports
          example: 2039280
        owner:
          type:
            - string
            - 'null'
          description: Owner program (base58)
          example: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
        executable:
          type:
            - boolean
            - 'null'
          description: Whether the account is an executable program
        space:
          type:
            - integer
            - 'null'
          format: int64
          description: Data length in bytes
        program:
          type:
            - string
            - 'null'
          description: >-
            Parsing program name as the node reports it, e.g. spl-token,
            address-lookup-table
        parsed:
          $ref: '#/components/schemas/JsonNode'
          type: 'null'
          description: >-
            Decoded data as the node reports it ({type, info}); null when it
            cannot decode the account
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: >-
        ### API key (programmatic access — recommended)

        Send your API key in the `X-Api-Key` header. Keys start with `nxs_` and
        are

        created in the dashboard (or via **POST /api/keys** with a session JWT).


        Each key is scoped to **one chain and one network** (for example

        `CARDANO_MAINNET`), fixed at creation time. It cannot query a different
        network

        on the same chain, and it cannot query a different chain at all. A
        mismatched

        `network` parameter returns **400 Network Mismatch**. Create one key per
        chain

        and network under the same account.


        This is the credential most integrations should use.
      name: X-Api-Key
      in: header
    bearerAuth:
      type: http
      description: >-
        ### JWT session token (browser / mobile apps)

        A short-lived JWT issued by `/api/auth/login` or `/api/auth/device`,
        sent as

        `Authorization: Bearer <token>`. This is the **session** credential for
        the web

        dashboard and mobile apps, not for server-to-server API access.


        For programmatic API access use an **API key** in the `X-Api-Key` header

        instead — do **not** put an `nxs_` API key in this Bearer field.
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.