curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
},
[
"trace"
],
"latest"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"value": "0xde0b6b3a7640000",
"gas": "0x76c0",
"input": "0x",
"callType": "call"
},
"result": {
"gasUsed": "0x5208",
"output": "0x"
},
"traceAddress": [],
"type": "call"
}
]
}
Executes a call and returns trace information using OpenEthereum-style tracing. This method simulates a transaction and provides detailed execution traces without committing changes to the blockchain.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
},
[
"trace"
],
"latest"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"value": "0xde0b6b3a7640000",
"gas": "0x76c0",
"input": "0x",
"callType": "call"
},
"result": {
"gasUsed": "0x5208",
"output": "0x"
},
"traceAddress": [],
"type": "call"
}
]
}
trace_call
JSON-RPC method executes a call and returns trace information using OpenEthereum-style tracing. This method simulates a transaction and provides detailed execution traces without committing changes to the blockchain, making it ideal for transaction analysis, debugging, and testing before actual execution.
from
(string, optional): Address the transaction is sent fromto
(string, required): Address the transaction is directed togas
(string, optional): Gas provided for transaction executiongasPrice
(string, optional): Gas price for the transactionvalue
(string, optional): Value sent with the transactiondata
(string, optional): Hash of the method signature and encoded parameters"trace"
: Basic execution trace information"vmTrace"
: Virtual machine execution trace"stateDiff"
: State differences caused by the transactionaction
— Details about the call action (from, to, value, gas, input, callType)result
— Execution result (gasUsed, output)traceAddress
— Address path within the call hierarchytype
— Type of trace (call, create, suicide, etc.)// Execute a traced call
const traceCall = async (callObject, traceTypes = ['trace'], blockParam = 'latest') => {
const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_ENDPOINT/evm', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'trace_call',
params: [callObject, traceTypes, blockParam],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Analyze contract interaction
const analyzeContractCall = async () => {
const callObject = {
from: '0x69835D480110e4919B7899f465aAB101e21c8A87',
to: '0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5',
gas: '0x76c0',
gasPrice: '0x9184e72a000',
value: '0xde0b6b3a7640000',
data: '0x'
};
const traces = await traceCall(callObject);
console.log('Execution Trace Analysis:');
traces.forEach((trace, index) => {
console.log(`Trace ${index + 1}:`);
console.log(` Type: ${trace.type}`);
console.log(` From: ${trace.action.from}`);
console.log(` To: ${trace.action.to}`);
console.log(` Gas Used: ${parseInt(trace.result.gasUsed, 16)}`);
console.log(` Call Type: ${trace.action.callType}`);
});
return traces;
};
// Usage
analyzeContractCall().then(traces => {
console.log('Analysis completed');
});
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
},
["trace"],
"latest"
],
"id": 1
}' \
https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
trace_call
method is essential for applications that need to:
Successful response with trace data
The response is of type object
.
Was this page helpful?