curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [
"0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0",
"nonce": "0x1",
"blockHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"blockNumber": "0x9d0c37",
"transactionIndex": "0x0",
"from": "0xFC1286EeddF81d6955eDAd5C8D99B8Aa32F3D2AA",
"to": "0x5555555555555555555555555555555555555555",
"value": "0xde0b6b3a7640000",
"gas": "0x5208",
"gasPrice": "0x3b9aca00",
"input": "0x",
"v": "0x1c",
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"type": "0x0"
}
}
Returns transaction information by its hash.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [
"0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0",
"nonce": "0x1",
"blockHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"blockNumber": "0x9d0c37",
"transactionIndex": "0x0",
"from": "0xFC1286EeddF81d6955eDAd5C8D99B8Aa32F3D2AA",
"to": "0x5555555555555555555555555555555555555555",
"value": "0xde0b6b3a7640000",
"gas": "0x5208",
"gasPrice": "0x3b9aca00",
"input": "0x",
"v": "0x1c",
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"type": "0x0"
}
}
transactionHash
(string, required) — The 32-byte hash of the transactionnull
if the transaction is not found.
Transaction object:
hash
— Transaction hashnonce
— Transaction nonce (hex string)blockHash
— Hash of containing block (null if pending)blockNumber
— Number of containing block (null if pending)transactionIndex
— Index in block (null if pending)from
— Sender addressto
— Receiver address (null for contract creation)value
— Value transferred in wei (hex string)gas
— Gas limit (hex string)gasPrice
— Gas price in wei (hex string)input
— Transaction datav
, r
, s
— ECDSA signature componentstype
— Transaction type (0x0 for legacy, 0x2 for EIP-1559)const getTransaction = 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_getTransactionByHash',
params: [txHash],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Usage
const transaction = await getTransaction('0x33c3321b162edac1fdbb53af2962b2940c07e334a4f5ff758f1d5ef1235e55d0');
if (transaction) {
console.log('Transaction found:');
console.log('From:', transaction.from);
console.log('To:', transaction.to);
console.log('Value:', parseInt(transaction.value, 16) / 1e18, 'ETH');
console.log('Gas Price:', parseInt(transaction.gasPrice, 16) / 1e9, 'Gwei');
console.log('Status:', transaction.blockHash ? 'Confirmed' : 'Pending');
} else {
console.log('Transaction not found');
}
const checkTransactionStatus = async (txHash) => {
const tx = await getTransaction(txHash);
if (!tx) {
return 'not_found';
}
if (tx.blockHash) {
return 'confirmed';
} else {
return 'pending';
}
};
// Wait for confirmation
const waitForConfirmation = async (txHash, maxAttempts = 60) => {
for (let i = 0; i < maxAttempts; i++) {
const status = await checkTransactionStatus(txHash);
if (status === 'confirmed') {
return true;
} else if (status === 'not_found') {
return false;
}
// Wait 1 second before next check
await new Promise(resolve => setTimeout(resolve, 1000));
}
return false; // Timeout
};
Successful response with transaction information
The response is of type object
.