curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_replayTransaction",
"params": [
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
[
"trace"
]
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"trace": [
{
"action": {
"from": "0x...",
"to": "0x...",
"value": "0x0",
"gas": "0x...",
"input": "0x...",
"callType": "call"
},
"result": {
"gasUsed": "0x5208",
"output": "0x"
},
"traceAddress": [],
"type": "call"
}
]
}
}
Replays a specific transaction and returns trace information. This method provides detailed execution traces for a single transaction by replaying its execution.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_replayTransaction",
"params": [
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
[
"trace"
]
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"trace": [
{
"action": {
"from": "0x...",
"to": "0x...",
"value": "0x0",
"gas": "0x...",
"input": "0x...",
"callType": "call"
},
"result": {
"gasUsed": "0x5208",
"output": "0x"
},
"traceAddress": [],
"type": "call"
}
]
}
}
trace_replayTransaction
JSON-RPC method replays a specific transaction and returns trace information. This method provides detailed execution traces for a single transaction by replaying its execution, making it essential for transaction debugging, analysis, and forensic investigation.
"trace"
: Basic execution trace information"vmTrace"
: Virtual machine execution trace"stateDiff"
: State differences caused by the transactiontrace
— Array of trace objects containing execution details// Replay a specific transaction with tracing
const replayTransaction = async (txHash, 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_replayTransaction',
params: [txHash, traceTypes],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Example usage
const txHash = '0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31';
replayTransaction(txHash).then(result => {
console.log('Transaction replay result:');
if (result.trace) {
result.trace.forEach((trace, index) => {
console.log(`Trace ${index + 1}:`);
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_replayTransaction",
"params": [
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
["trace"]
],
"id": 1
}' \
https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
trace_replayTransaction
method is essential for applications that need to:
Successful response with trace data
The response is of type object
.