curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": [
"latest",
[
"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 all transactions in a block and returns trace information for each transaction. This method provides detailed execution traces for all transactions in a specific block.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": [
"latest",
[
"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_replayBlockTransactions
JSON-RPC method replays all transactions in a block and returns trace information for each transaction. This method provides detailed execution traces for all transactions in a specific block by replaying their execution, making it essential for comprehensive block analysis.
"trace"
: Basic execution trace information"vmTrace"
: Virtual machine execution trace"stateDiff"
: State differences caused by transactions// Replay all transactions in a block with tracing
const replayBlockTransactions = async (blockIdentifier, 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_replayBlockTransactions',
params: [blockIdentifier, traceTypes],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Example usage
replayBlockTransactions('latest').then(results => {
console.log(`Replayed ${results.length} transactions`);
results.forEach((result, index) => {
console.log(`Transaction ${index + 1}:`);
if (result.trace) {
result.trace.forEach(trace => {
console.log(` Gas used: ${parseInt(trace.result.gasUsed, 16)}`);
});
}
});
});
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": [
"latest",
["trace"]
],
"id": 1
}' \
https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
trace_replayBlockTransactions
method is essential for applications that need to:
Successful response with trace data for all transactions
The response is of type object
.