eth_callAfter

eth_callAfter — execute eth_call after waiting for an account's nonce to reach a target value.

Executes eth_call after waiting for an account's nonce to reach a target value. Useful for simulating a transaction that depends on prior transactions completing — for example, checking the result of a swap after a preceding approval has been confirmed.

Parameters

Pass params as [request, condition, stateOverride, blockOverrides]. Only request and condition are required.

request

Describes the simulated transaction.

Field
Type
Required
Notes

to

Data (20 bytes)

Yes

Target contract address

from

Data (20 bytes)

No

Sender address. Set explicitly when msg.sender matters

input

Data

No

Calldata. MegaETH also accepts data, but prefer input for portability

value

Quantity

No

Wei to send with the call

gas

Quantity

No

Gas limit for the simulation

gasPrice

Quantity

No

Legacy gas price. Cannot be combined with EIP-1559 fee fields

maxFeePerGas

Quantity

No

EIP-1559 max fee. Cannot be combined with gasPrice

maxPriorityFeePerGas

Quantity

No

EIP-1559 priority fee. Cannot be combined with gasPrice

condition

Field
Type
Required
Notes

account

Data (20 bytes)

Yes

Account address whose nonce to monitor

nonce

Quantity

Yes

Target nonce value to wait for

timeout

Number

No

Max wait time in milliseconds. Default: 3000. Max: 60000

stateOverride

Optional. Temporary account-level overrides applied only for this simulation. Keyed by address.

Field
Type
Notes

balance

Quantity

Override the account balance

nonce

Quantity

Override the account nonce

code

Data

Override the account bytecode

state

Object

Replace the entire storage (slot → value). Cannot be combined with stateDiff

stateDiff

Object

Patch individual storage slots. Cannot be combined with state

blockOverrides

Optional. Temporary block-environment overrides applied only for this simulation.

Field
Type
Notes

number

Quantity

Override block.number

time

Quantity

Override block.timestamp

gasLimit

Quantity

Override block.gasLimit

feeRecipient

Data (20 bytes)

Override block.coinbase

baseFeePerGas

Quantity

Override block.baseFee

Returns

Field
Type
Notes

result

Data

Return data from the executed call — same as eth_call

Errors

Code
Cause
Fix

-32000

Timeout: timeout waiting for nonce condition — nonce did not reach the target within the timeout

Increase timeout, or verify the prior transaction was submitted

-32000

InternalError — internal processing error

Retry the request

See also Error reference.

Example

Execute eth_call after waiting for account nonce to reach 5:

Successful response:

Timeout response:

Last updated