trace_get
Returns a trace at a specific position within a transaction on Hyperliquid.
Archive Node Required
This method requires an archive node. It is not available on full nodes.
Use Cases#
- Specific trace lookup - Get a single trace by its position index
- Internal call inspection - Examine a specific internal call
- Targeted debugging - Investigate particular call depth for perpetual futures trading, onchain order books, and institutional-grade derivatives
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
txHash | DATA | Yes | 32-byte transaction hash |
indices | Array<QUANTITY> | Yes | Trace index positions (e.g., ["0x0"] for the first trace) |
Request#
{
"jsonrpc": "2.0",
"method": "trace_get",
"params": ["0x090cd1f41962604b7efbc2b3c93b536dc7716c8c3487bfe2ba3ff4fe57df0614", ["0x0"]],
"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_get",
"params": ["0x090cd1f41962604b7efbc2b3c93b536dc7716c8c3487bfe2ba3ff4fe57df0614", ["0x0"]],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-hyperliquid-mainnet-evm.n.dwellir.com/YOUR_API_KEY');
const trace = await provider.send('trace_get', [
'0x090cd1f41962604b7efbc2b3c93b536dc7716c8c3487bfe2ba3ff4fe57df0614',
['0x0']
]);
console.log('Trace type:', trace.type);
console.log('From:', trace.action.from);
console.log('To:', trace.action.to);
console.log('Value:', trace.action.value);
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-hyperliquid-mainnet-evm.n.dwellir.com/YOUR_API_KEY'))
trace = w3.provider.make_request('trace_get', [
'0x090cd1f41962604b7efbc2b3c93b536dc7716c8c3487bfe2ba3ff4fe57df0614',
['0x0']
])
result = trace['result']
print(f'Type: {result["type"]}')
print(f'From: {result["action"]["from"]}')
print(f'To: {result["action"]["to"]}')
Related Methods#
trace_transaction- Get all traces for a transactiontrace_block- Get all traces in a block