POST
/
evm
trace_rawTransaction
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"
    }
  ]
}
The 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.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  1. Raw transaction data (string, required): Raw transaction in hexadecimal format
  2. Trace types (array, required): Array of trace types to include in response

Trace types

  • "trace": Basic execution trace information
  • "vmTrace": Virtual machine execution trace
  • "stateDiff": State differences caused by the transaction

Response

The method returns an array of trace objects containing detailed execution information.

Response structure

Trace objects:
  • action — Details about the call action
  • result — Execution result
  • traceAddress — Address path within call hierarchy
  • type — Type of trace (call, create, suicide, etc.)

Usage example

Basic implementation

// 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)}`);
  });
});

Example request

Shell
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

Use cases

The trace_rawTransaction method is essential for applications that need to:
  • Pre-signed transaction analysis: Analyze transactions before broadcasting
  • Offline transaction testing: Test transaction execution offline
  • Transaction debugging: Debug transaction execution issues
  • Security analysis: Analyze transaction security and potential vulnerabilities
  • Gas estimation: Get accurate gas estimates for raw transactions
  • Development tools: Build transaction analysis and debugging tools
  • Wallet applications: Provide transaction previews in wallet interfaces
  • Compliance checking: Verify regulatory compliance before broadcasting
  • Educational tools: Create educational content about transaction execution
  • Research platforms: Support academic and commercial blockchain research
This method provides comprehensive analysis of raw transactions before execution on the Hyperliquid EVM platform.

Body

application/json

Response

200 - application/json

Successful response with trace data

The response is of type object.