Skip to main content
POST
/
clients
/
me
/
simulate-transaction
Simulate a transaction
curl --request POST \
  --url https://api.portalhq.io/api/v3/clients/me/simulate-transaction \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "data": "0xa9059cbb000000000000000000000000...",
  "value": "0x0"
}
'
{
  "changes": [
    {
      "type": "transfer",
      "from": "0x54968898742c08da211a1cd355447cd1f37f0649",
      "to": "0xdFd8302f44727A6348F702fF7B594f127dE3A902",
      "amount": "10000",
      "token": "USDC"
    }
  ],
  "gasUsed": "65000"
}

Authorizations

Authorization
string
header
required

Client API Key or Client Session Token (CST). Pass as a Bearer token in the Authorization header.

Query Parameters

chainId
string
required

Chain ID in CAIP-2 format (EIP-155 only). For example, eip155:1 for Ethereum mainnet.

Body

application/json
to
string
required

The target contract or recipient address.

data
string

Encoded transaction data (hex string).

value
string

Value to send in wei (hex string).

gas
string

Gas limit.

gasPrice
string

Gas price in wei.

maxFeePerGas
string

Maximum fee per gas (EIP-1559).

maxPriorityFeePerGas
string

Maximum priority fee per gas (EIP-1559).

Response

Transaction simulated successfully

changes
object[]

Array of state changes from the simulation.

gasUsed
string | null

Amount of gas used by the simulation.

error
object