POST
/
evm
eth_getTransactionReceipt
curl --request POST \
  --url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",
  "params": [
    "0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0"
  ],
  "id": 1
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "transactionHash": "0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0",
    "transactionIndex": "0x0",
    "blockHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
    "blockNumber": "0x9d0c37",
    "from": "0xFC1286EeddF81d6955eDAd5C8D99B8Aa32F3D2AA",
    "to": "0x5555555555555555555555555555555555555555",
    "gasUsed": "0x5208",
    "cumulativeGasUsed": "0x5208",
    "contractAddress": null,
    "logs": [],
    "status": "0x1",
    "effectiveGasPrice": "0x3b9aca00",
    "type": "0x0"
  }
}
Returns the receipt of a transaction by its hash, containing execution results, gas usage, event logs, and transaction status. Use this to verify transaction execution and extract contract events.
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

  • transactionHash (string, required) — The 32-byte hash of the transaction

Returns

Returns a transaction receipt object, or null if the transaction is not found or still pending. Transaction receipt:
  • transactionHash — Hash of the transaction
  • transactionIndex — Index in the block (hex string)
  • blockHash — Hash of containing block
  • blockNumber — Number of containing block (hex string)
  • from — Sender address
  • to — Receiver address (null for contract creation)
  • gasUsed — Actual gas used (hex string)
  • cumulativeGasUsed — Total gas used in block up to this transaction (hex string)
  • contractAddress — Created contract address (null if not contract creation)
  • logs — Array of event logs
  • status — Transaction status (0x0 for failure, 0x1 for success)
  • effectiveGasPrice — Actual gas price paid (hex string)
  • type — Transaction type (hex string)
Log object:
  • address — Contract address that emitted the log
  • topics — Array of indexed event parameters
  • data — Non-indexed event parameters
Transaction receipts are only available for mined transactions. Pending transactions return null.

JavaScript example

const getTransactionReceipt = async (txHash) => {
  const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_API_KEY/evm', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'eth_getTransactionReceipt',
      params: [txHash],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Check transaction status
const checkTransactionStatus = async (txHash) => {
  const receipt = await getTransactionReceipt(txHash);
  
  if (!receipt) {
    return 'pending';
  }
  
  return receipt.status === '0x1' ? 'success' : 'failed';
};

// Usage
const txHash = '0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0';
const receipt = await getTransactionReceipt(txHash);

if (receipt) {
  console.log('Transaction status:', receipt.status === '0x1' ? 'Success' : 'Failed');
  console.log('Gas used:', parseInt(receipt.gasUsed, 16));
  console.log('Events:', receipt.logs.length);
  
  if (receipt.contractAddress) {
    console.log('Contract deployed at:', receipt.contractAddress);
  }
}

Wait for confirmation

const waitForConfirmation = async (txHash, maxAttempts = 60) => {
  for (let i = 0; i < maxAttempts; i++) {
    const receipt = await getTransactionReceipt(txHash);
    
    if (receipt) {
      if (receipt.status !== '0x1') {
        throw new Error(`Transaction failed: ${txHash}`);
      }
      return receipt;
    }
    
    // Wait 1 second before next check
    await new Promise(resolve => setTimeout(resolve, 1000));
  }
  
  throw new Error('Transaction not confirmed within timeout');
};

// Usage
try {
  const receipt = await waitForConfirmation(txHash);
  console.log('Transaction confirmed successfully');
} catch (error) {
  console.error('Transaction failed or timed out:', error.message);
}

Extract events

const extractEvents = (receipt, eventSignature) => {
  return receipt.logs.filter(log => log.topics[0] === eventSignature);
};

// Extract Transfer events (ERC-20)
const transferSignature = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
const transferEvents = extractEvents(receipt, transferSignature);

// Decode Transfer event
const decodeTransfer = (log) => ({
  from: '0x' + log.topics[1].slice(26),
  to: '0x' + log.topics[2].slice(26),
  value: parseInt(log.data, 16)
});

const transfers = transferEvents.map(decodeTransfer);
console.log('Transfers:', transfers);

Gas analysis

const analyzeGas = (receipt) => {
  const gasUsed = parseInt(receipt.gasUsed, 16);
  const gasPrice = parseInt(receipt.effectiveGasPrice, 16);
  const cost = gasUsed * gasPrice;
  
  return {
    gasUsed,
    gasPrice: gasPrice / 1e9, // Convert to Gwei
    costWei: cost,
    costEth: cost / 1e18
  };
};

const gasAnalysis = analyzeGas(receipt);
console.log('Gas analysis:', gasAnalysis);

Use cases

  • Transaction verification — Confirm transaction execution and success status
  • Event extraction — Process smart contract events and logs
  • Gas analysis — Analyze transaction costs and gas usage
  • Contract deployment — Verify contract creation and get addresses
  • Wallet applications — Display transaction results to users
  • DeFi protocols — Monitor protocol events and state changes

Body

application/json

Response

200 - application/json

Successful response with transaction receipt

The response is of type object.