Skip to main content

eth_call

Executes a new message call immediately without creating a transaction on the blockchain.

Params

  1. Transaction: Object. A standard Ethereum transaction object containing the following fields:
    1. to: string. The destination address of the message.
    2. data: string (optional). Either a byte string containing the associated data of the message, or in the case of a contract-creation transaction, the initialisation code.
    3. value: string (optional). The value transferred for the transaction in wei, encoded as a hex string.
  2. BlockNumber: string (optional). The block number to get the gas estimate at. If omitted, the latest block is used.

Result

Returns a Promise that resolves with the return value of the executed contract method.

Example

const result = await provider.request({
method: 'eth_call',
params: [
{
to: '0x...',
data: '0x...'
},
'latest'
]
});
console.log(result); // ['0x...']