# Simulate EVM transactions

Simulate one or more EVM transactions on the chain named in the body and return execution results.

Endpoint: POST /evm/simulations
Version: 2.0.0
Security: Auth

## Security:

  - `Auth` (unknown)
    apiKey in header X-Api-Key scopes: api:simulate:call

## Request fields (application/json):

  - `chain_gid` (string, required)
    Blockchain identifier in [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) format.
Format: `{namespace}:{reference}`
- **namespace**: Ecosystem identifier (3-8 chars, lowercase)
- **reference**: Blockchain identifier within namespace (1-32 chars)

**Examples**:
- `eip155:1`: Ethereum mainnet
- `eip155:56`: BNB Smart Chain mainnet
- `eip155:137`: Polygon mainnet
- `bip122:000000000019d6689c085ae165831e93`: Bitcoin mainnet
- `tron:728126428`: Tron mainnet
    Example: eip155:1

  - `validation` (boolean)
    When true, the simulation checks sender balance, nonce sequence, and
fee consistency the same way a real submission would. When false
(default), missing parameters are filled with permissive defaults
and balance is not checked.

  - `block_state_calls` (array, required)
    Blocks to simulate.

  - `block_state_calls.calls` (array, required)
    Calls in this block, at most 100. The server also applies its gas and byte budgets to the whole request.

  - `block_state_calls.calls.from` (string, required)
    Sender address.
    Example: 0x974caa59e49682cda0ad2bbe82983419a2ecc400

  - `block_state_calls.calls.to` (string, required)
    Recipient address.
    Example: 0xd0930a8fc56fd94038250bb93dbac0e13da4eb99

  - `block_state_calls.calls.value` (string)
    Transfer value in wei (decimal or 0x hex).
    Example: 10000000000000000

  - `block_state_calls.calls.data` (string)
    Call data (hex).
    Example: 0xa9059cbb000000000000000000000000d0930a8fc56fd94038250bb93dbac0e13da4eb99000000000000000000000000000000000000000000000000000000003b9aca00

  - `block_state_calls.calls.nonce` (string)
    Sender nonce (decimal or 0x hex). If omitted, the current nonce is used.
    Example: 1

  - `block_state_calls.calls.gas` (string)
    Positive gas limit (decimal or 0x hex), subject to the simulation gas budget.
    Example: 21000

  - `block_state_calls.calls.gas_price` (string)
    Gas price in wei (decimal or 0x hex). Legacy transactions only. Mutually exclusive with max_fee_per_gas / max_priority_fee_per_gas.
    Example: 1000000000

  - `block_state_calls.calls.max_fee_per_gas` (string)
    Max fee per gas in wei (decimal or 0x hex). EIP-1559 only. Mutually exclusive with gas_price.
    Example: 2000000000

  - `block_state_calls.calls.max_priority_fee_per_gas` (string)
    Priority fee (tip) per gas in wei (decimal or 0x hex). EIP-1559 only. Mutually exclusive with gas_price.
    Example: 1000000000

## Request examples:

  - `Multi-call simulation` (unknown)

  - `Native transfer` (unknown)

  - `Pre-send validation with EIP-1559 fees` (unknown)

## Response 200:

  - `200` (unknown)
    EVM simulation result.

## Response 200 fields (application/json):

  - `items` (array, required)
    List of simulated transaction results, one per input call in submission order.

  - `items.chain_gid` (string, required)
    Blockchain identifier in [CAIP-2](https://chainagnostic.org/CAIPs/caip-2) format.
Format: `{namespace}:{reference}`
- **namespace**: Ecosystem identifier (3-8 chars, lowercase)
- **reference**: Blockchain identifier within namespace (1-32 chars)

**Examples**:
- `eip155:1`: Ethereum mainnet
- `eip155:56`: BNB Smart Chain mainnet
- `eip155:137`: Polygon mainnet
- `bip122:000000000019d6689c085ae165831e93`: Bitcoin mainnet
- `tron:728126428`: Tron mainnet
    Example: eip155:1

  - `items.txid` (string, required)
    Native transaction id of the chain (hash for EVM and Tron, txid for Bitcoin).
    Example: 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

  - `items.created_at` (string, required)
    Point in time in RFC 3339 format.
    Example: 2024-01-15T10:30:00Z

  - `items.activity` (array, required)
    Predicted balance changes for involved addresses.

  - `items.activity.address` (string, required)
    Blockchain address in the native format of its chain, as carried by transaction data.
The bound is wider than `AddressValue` and there is no character restriction, because a
transaction payload can name an address the project never imported.
    Example: 0x742d35cc6634c0532925a3b8d1e1d78d8E15e5c4

  - `items.activity.asset_gid` (string, required)
    Global asset identifier in [CAIP-19](https://chainagnostic.org/CAIPs/caip-19) format.
Format: `{chain_gid}/{asset_path}`
**Examples**:
- `eip155:1/slip44:60`: ETH on Ethereum
- `eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7`: USDT on Ethereum
- `eip155:56/erc20:0x55d398326f99059fF775485246999027B3197955`: USDT on BNB Smart Chain
- `tron:728126428/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t`: USDT on Tron
- `eip155:137/erc20:0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174`: USDC on Polygon
    Example: eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7

  - `items.activity.direction` (string, required)
    Direction of the asset movement relative to the tracked address.
    Enum: "in", "out"

  - `items.activity.delta` (object, required)
    Signed balance change in base units, plus a human-readable value
when we know the token's decimals.

  - `items.activity.delta.base` (string, required)
    Signed amount in the smallest asset unit.

  - `items.activity.delta.formatted` (string)
    Human-readable signed amount.

  - `items.activity.entry_kind` (string, required)
    Movement classification. Known values include `native_transfer`, `token_transfer`,
`network_fee`, `stake`, `stake_withdrawal`, `utxo_spend`, and `utxo_create`. Additional
values may be returned; display unfamiliar values as generic movements.

  - `items.details` (object, required)
    EVM part of a transaction.
When `is_success` is false, every interaction event in `events` has the outcome `reverted`.
    Example: {"family":"evm","events":[{"event_index":0,"kind":"transfer","asset_gid":"eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7","amount":{"base":"1000000","formatted":"1.0"},"operation":"transfer…

  - `items.details.family` (string, required)
    Chain family of the transaction, the discriminator of `TransactionDetails`.
    Enum: "evm"

  - `items.details.events` (array, required)
    Decoded events of the transaction, ordered by `event_index`.

  - `items.details.events.event_index` (integer, required)
    Zero-based index within its container, bounded to the signed 64-bit range.
Unique only within the transaction version that names it; consumers preserve the integer exactly.
    Example: 0

  - `items.details.events.kind` (string, required)
    Event kind, the discriminator of `EVMTransactionEvent`.
    Enum: "transfer", "approval", "interaction", "contract_creation"

  - `items.details.events.amount` (object, required)
    Asset amount in base units, plus a human-readable value when we know
the token's decimals.
    Example: {"base":"1000000000","formatted":"1.0"}

  - `items.details.events.amount.base` (string, required)
    Amount in the smallest asset unit.

  - `items.details.events.amount.formatted` (string)
    Human-readable amount.

  - `items.details.events.operation` (string, required)
    Kind of movement the transfer records.
    Enum: "transfer", "mint", "burn"

  - `items.details.events.outcome` (string, required)
    Result in the recorded execution, including ancestor rollback; independent of chain reorganization.
    Enum: "succeeded", "reverted"

  - `items.details.is_success` (boolean, required)
    Whether the transaction executed without reverting.

  - `items.details.block` (object, required)
    Block that carries the transaction.
    Example: {"block_hash":"0x9f1c2a3b4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f708192a3b4c5d6e7f8","block_height":18500000}

  - `items.details.block.block_hash` (string, required)
    Native block hash in the format of the selected family; not a transaction identifier.
    Example: 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

  - `items.details.gas_used` (integer, required)
    Actual transaction receipt gasUsed; not a fee, gas limit or cumulative block gas.

  - `items.error` (object)
    Error details for a failed simulation.
    Example: {"code":-32000,"message":"execution reverted","data":"0x"}

  - `items.error.code` (integer, required)
    Error code from the EVM execution.
    Example: -32000

  - `items.error.message` (string, required)
    Human-readable error message.
    Example: execution reverted

  - `items.error.data` (string)
    Raw revert data (hex-encoded) for detailed error decoding.
    Example: 0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001a4e6f7420656e6f75676820746f6b656e2062616c616e636500000000000000

  - `references` (object, required)
    Related objects included in the response, keyed by ID.
    Example: {"tokens":{"eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7":{"gid":"eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7","symbol":"USDT","name":"Tether USD","decimals":6}},"blockchain…

  - `references.tokens` (object)
    Map of tokens indexed by their CAIP-19 Asset GID.

  - `references.blockchains` (object)
    Map of blockchains indexed by their CAIP-2 Chain GID.

  - `references.addresses` (object)
    Map of tracked addresses to labels. Presence in this map means the address is tracked.

## Response 400:

  - `400` (unknown)
    Bad request (e.g., missing or invalid fields). Invalid text may be reported as address.label_invalid, address.meta_invalid, public_key.label_invalid, invoice.comment_invalid, invoice.metadata_invalid.

## Response 400 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

  - `fields` (array)
    List of invalid fields in the request.

  - `fields.name` (string, required)
    The name of the invalid field.
    Example: max_len

  - `fields.reason` (string, required)
    Why this field is invalid.
    Example: 32

## Response 401:

  - `401` (unknown)
    Missing or invalid authentication credentials.

## Response 401 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response 403:

  - `403` (unknown)
    Insufficient permissions.

## Response 403 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response 404:

  - `404` (unknown)
    Requested resource does not exist.

## Response 404 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response 422:

  - `422` (unknown)
    Request preconditions were not met.

## Response 422 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

  - `fields` (array)
    List of fields that failed precondition validation.

  - `fields.name` (string, required)
    The name of the field that failed validation.
    Example: status

  - `fields.reason` (string, required)
    Why the precondition failed for this field.
    Example: Cannot transition from archived to active state

## Response 429:

  - `429` (unknown)
    Capacity or action cooldown exceeded.

## Response 429 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response 502:

  - `502` (unknown)
    Invalid upstream response or integration failure.

## Response 502 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response 503:

  - `503` (unknown)
    The operation is temporarily unavailable. Please try again later.

## Response 503 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response 504:

  - `504` (unknown)
    Shared request deadline exhausted.

## Response 504 fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response default:

  - `default` (unknown)
    Unexpected error.

## Response default fields (application/problem+json):

  - `type` (string, required)
    A URI that identifies the error type.
    Example: https://docs.vilna.io/apis/errors#internal-error

  - `title` (string, required)
    A short summary of the error type.
Use `detail` for information specific to this occurrence.
    Example: Bad Request

  - `status` (integer, required)
    The HTTP status code for this error.
Matches the status code of the HTTP response.
    Example: 400

  - `detail` (string)
    A human-readable explanation of what went wrong in this specific case.
May be localized.
    Example: The address is already assigned to another invoice

  - `instance` (string)
    A URI that identifies this specific error occurrence.
Include this value when contacting support.
    Example: /traces/0123456789abcdef0123456789abcdef

  - `code` (string, required)
    Stable machine-readable error code for programmatic error handling. Unlike the HTTP `status` or free-form `detail`, this code is guaranteed not to change between versions for a given error condition, so it is safe to branch on in client code. Defaults to `unspecified` when the server has not assigned a specific code.
    Example: blockchain.not_found

## Response 400 examples:

  - `The request body contains malformed JSON` (unknown)

## Response 401 examples:

  - `The API service refused authentication` (unknown)

## Response 403 examples:

  - `The API key lacks the required permission` (unknown)

## Response 404 examples:

  - `The address does not exist in this project` (unknown)

  - `The invoice does not exist in this project` (unknown)

## Response 422 examples:

  - `A confirmed invoice cannot be cancelled` (unknown)

## Response 503 examples:

  - `The operation cannot be completed at present` (unknown)

