curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_rawTransaction",
"params": [
"0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89",
[
"trace"
]
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0x...",
"to": "0x...",
"value": "0x...",
"gas": "0x...",
"input": "0x",
"callType": "call"
},
"result": {
"gasUsed": "0x5208",
"output": "0x"
},
"traceAddress": [],
"type": "call"
}
]
}
Executes a raw transaction and returns trace information. This method simulates the execution of a raw transaction and provides detailed execution traces.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_rawTransaction",
"params": [
"0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89",
[
"trace"
]
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0x...",
"to": "0x...",
"value": "0x...",
"gas": "0x...",
"input": "0x",
"callType": "call"
},
"result": {
"gasUsed": "0x5208",
"output": "0x"
},
"traceAddress": [],
"type": "call"
}
]
}
trace_rawTransaction
JSON-RPC method executes a raw transaction and returns trace information. This method simulates the execution of a raw transaction and provides detailed execution traces, making it useful for analyzing pre-signed transactions and testing transaction execution without broadcasting.
"trace"
: Basic execution trace information"vmTrace"
: Virtual machine execution trace"stateDiff"
: State differences caused by the transactionaction
— Details about the call actionresult
— Execution resulttraceAddress
— Address path within call hierarchytype
— Type of trace (call, create, suicide, etc.)// Execute a raw transaction with tracing
const traceRawTransaction = async (rawTx, traceTypes = ['trace']) => {
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_rawTransaction',
params: [rawTx, traceTypes],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Example usage
const rawTx = '0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89';
traceRawTransaction(rawTx).then(traces => {
console.log('Raw transaction trace:');
traces.forEach(trace => {
console.log(`Type: ${trace.type}`);
console.log(`Gas used: ${parseInt(trace.result.gasUsed, 16)}`);
});
});
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_rawTransaction",
"params": [
"0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89",
["trace"]
],
"id": 1
}' \
https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
trace_rawTransaction
method is essential for applications that need to:
Successful response with trace data
The response is of type object
.