Execute contract calls, estimate gas, and simulate transactions
This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.
Methods for executing contract calls and transaction simulations.
eth_call
Execute a read-only contract call without creating a transaction.
import { Address } from '@tevm/voltaire/Address';import { Hex } from '@tevm/voltaire/Hex';const result = await provider.eth_call({ from: Address('0x742d35Cc6634C0532925a3b844Bc454e4438f44e'), to: Address('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'), data: Hex('0x70a08231000000000000000000000000742d35cc6634c0532925a3b844bc454e4438f44e') // balanceOf(address)}, 'latest');if (!result.error) { console.log('Balance:', result.result);}// Response<Hex>