eth_call
Overview
Executes a read-only call on a contract at a specific block.
Movement-Specific Considerations
- Parallel execution does not affect read-only semantics.
- Use correct
from
/to
/data
fields. Gas is not consumed but gas limits apply to execution.
Parameters
Name | Type | Required | Description |
---|---|---|---|
tx | object | Yes | Call object with from ,to ,gas ,gasPrice ,value ,data |
blockTag | string | Yes | latest or specific block hex |
Returns
Return data as a 0x
-hex string.
Code Examples
cURL
curl -X POST https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_call",
"params":[{"to":"0x0000000000000000000000000000000000000000","data":"0x"},"latest"],
"id": 1
}'
Ethers.js v6
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1');
const data = await provider.send('eth_call', [{
to: '0x0000000000000000000000000000000000000000',
data: '0x'
}, 'latest']);
console.log(data);
Web3.js
import Web3 from 'web3';
const web3 = new Web3('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1');
const data = await web3.eth.call({ to: '0x0000000000000000000000000000000000000000', data: '0x' }, 'latest');
console.log(data);
viem
import { createPublicClient, http } from 'viem';
const movement = {
id: 3073,
name: 'Movement',
nativeCurrency: { name: 'MOVE', symbol: 'MOVE', decimals: 18 },
rpcUrls: { default: { http: ['https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1'] } },
} as const;
const client = createPublicClient({
chain: movement,
transport: http('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1'),
});
const resp = await client.call({
to: '0x0000000000000000000000000000000000000000',
data: '0x',
});
console.log(resp.data);
Move Equivalent
Use POST /v1/view
for Move view functions.
Common Errors
revert
with data: decode error using ABI.invalid opcode
: verify contract and input.