debug_traceCall
Traces the execution of a call, returning detailed information about the execution path.
Parameters
See Ethereum JSON-RPC spec for parameters of debug_traceCall
.
Examples
- cURL
- Ethers.js v6
- Viem
- web3.py
curl -X POST https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"to": "0x742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d",
"data": "0x70a08231000000000000000000000000742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d"
},
"latest",
{"tracer": "callTracer"}
],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider(
'https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'
);
// Trace a call
const callObject = {
to: '0x742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d',
data: '0x70a08231000000000000000000000000742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d'
};
const result = await provider.send('debug_traceCall', [
callObject,
'latest',
{ tracer: 'callTracer' }
]);
console.log(result);
import { createPublicClient, http, defineChain } from 'viem';
const chiliz = defineChain({
id: 88888,
name: 'Chiliz',
nativeCurrency: {
decimals: 18,
name: 'CHZ',
symbol: 'CHZ',
},
rpcUrls: {
default: {
http: ['https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'],
},
},
blockExplorers: {
default: { name: 'ChilizScan', url: 'https://chiliscan.com' },
},
});
const client = createPublicClient({
chain: chiliz,
transport: http('https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'),
});
// Trace a call
const result = await client.request({
method: 'debug_traceCall',
params: [
{
to: '0x742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d',
data: '0x70a08231000000000000000000000000742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d'
},
'latest',
{ tracer: 'callTracer' }
],
});
from web3 import Web3
w3 = Web3(Web3.HTTPProvider(
'https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'
))
# Trace a call
call_object = {
'to': '0x742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d',
'data': '0x70a08231000000000000000000000000742d35Cc6639C0532fEb01040FF4B8d2ba3C7c4d'
}
result = w3.manager.request_blocking('debug_traceCall', [
call_object,
'latest',
{'tracer': 'callTracer'}
])
print(result)
Response
Returns detailed trace information about the call execution. Common error responses:
{"code": -32700, "message": "Parse error"}
- Invalid JSON{"code": -32602, "message": "Invalid params"}
- Invalid parameters{"code": -32603, "message": "Internal error"}
- Server error