Skip to main content

eth_callMany

Executes a list of transaction bundles without creating transactions on the blockchain. This is useful for simulating transactions and reviewing outcomes before submitting them. This method uses 80 credits from your daily balance.

Parameters

  • bundles: [Required] Array of bundles to simulate. Each bundle includes:
    • transactions: Array of call objects using the same fields as eth_call.
    • blockOverride: [Optional] Block header overrides (for example, block number, hash, coinbase, timestamp, difficulty, gas limit, base fee).
  • simulationContext: [Required] Object describing where to simulate:
    • blockNumber: Block number (hex quantity) or a tag (latest, pending, safe, finalized, earliest), or a block hash.
    • transactionIndex: Index within the block to simulate against.
  • stateOverrides: [Optional] Object mapping addresses to overrides (balance, nonce, code, state, stateDiff).
  • timeout: [Optional] Max simulation time in milliseconds. Defaults to 5000.

Returns

A list of bundles. Each bundle returns an array with one result per transaction. Each result contains either:

  • value: The return value when the call succeeds.
  • error: An error object when the call reverts, including code, message, and optional data.

Example

Replace <YOUR-API-KEY> with an API key from your MetaMask Developer dashboard.

Request

curl https://megaeth-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id":1,
"method":"eth_callMany",
"params":[
[
{
"transactions":[
{
"to":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"data":"0x70a08231000000000000000000000000bc0e63965946815d105e7591407704e6e1964e59"
},
{
"to":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"data":"0x313ce567"
}
]
}
],
{
"blockNumber":"latest"
}
]
}'

Response

{
"jsonrpc": "2.0",
"id": 1,
"result": [
[
{
"value": "0x"
}
]
]
}