trace_call
Traces a call without creating a transaction on Hyperliquid, returning the trace output.
Archive Node Required
This method requires an archive node. It is not available on full nodes.
Use Cases#
- Call simulation - Preview internal calls before sending a transaction
- Contract interaction analysis - Understand how contracts interact
- Gas estimation - Analyze gas usage patterns for perpetual futures trading, onchain order books, and institutional-grade derivatives
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
callObject | Object | Yes | Transaction call object (from, to, gas, value, data) |
traceTypes | Array | Yes | Trace types: ["trace"], ["vmTrace"], ["stateDiff"], or combinations |
blockNumber | QUANTITY|TAG | No | Block number or tag (default: latest) |
Request#
{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{
"to": "0x30e54c9bc205e19d693d53c0b0be92299d4191ea",
"data": "0x70a0823100000000000000000000000030e54c9bc205e19d693d53c0b0be92299d4191ea"
},
["trace"],
"latest"
],
"id": 1
}
Code Examples#
- cURL
- JavaScript
- Python
curl -X POST https://api-hyperliquid-mainnet-evm.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_call",
"params": [
{"to": "0x30e54c9bc205e19d693d53c0b0be92299d4191ea", "data": "0x70a0823100000000000000000000000030e54c9bc205e19d693d53c0b0be92299d4191ea"},
["trace"],
"latest"
],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-hyperliquid-mainnet-evm.n.dwellir.com/YOUR_API_KEY');
const result = await provider.send('trace_call', [
{
to: '0x30e54c9bc205e19d693d53c0b0be92299d4191ea',
data: '0x70a0823100000000000000000000000030e54c9bc205e19d693d53c0b0be92299d4191ea'
},
['trace'],
'latest'
]);
console.log('Trace output:', result.trace);
console.log('VM trace:', result.vmTrace);
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-hyperliquid-mainnet-evm.n.dwellir.com/YOUR_API_KEY'))
result = w3.provider.make_request('trace_call', [
{
'to': '0x30e54c9bc205e19d693d53c0b0be92299d4191ea',
'data': '0x70a0823100000000000000000000000030e54c9bc205e19d693d53c0b0be92299d4191ea'
},
['trace'],
'latest'
])
print(f'Trace: {result["result"]["trace"]}')
Related Methods#
trace_filter- Filter traces by criteriaeth_call- Execute call without tracetrace_transaction- Trace a specific transaction