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 and event logs.
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"
}
}
transactionHash
(string, required) — The 32-byte hash of the transactionnull
if the transaction is not found or still pending.
Transaction receipt:
transactionHash
— Hash of the transactiontransactionIndex
— Index in the block (hex string)blockHash
— Hash of containing blockblockNumber
— Number of containing block (hex string)from
— Sender addressto
— 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 logsstatus
— Transaction status (0x0
for failure, 0x1
for success)effectiveGasPrice
— Actual gas price paid (hex string)type
— Transaction type (hex string)address
— Contract address that emitted the logtopics
— Array of indexed event parametersdata
— Non-indexed event parametersnull
.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);
}
}
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);
}
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);
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);
Successful response with transaction receipt
The response is of type object
.