curl --request POST \
--url https://fantom-mainnet.core.chainstack.com/4ab982aa70a7baead515ffdb5915df3f \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": [
"0x58e61f99a15aa3cd76162037225287a574d9eda91d2a9d35ff0fcde1cccda4a0"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://fantom-mainnet.core.chainstack.com/4ab982aa70a7baead515ffdb5915df3f \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": [
"0x58e61f99a15aa3cd76162037225287a574d9eda91d2a9d35ff0fcde1cccda4a0"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}hash — the hash identifying a transactionTransaction receipt — the receipt object with:
blockHash — the block hash. Identifies the block in which the transaction was included. This field is null for transactions that have not yet been included in a block.blockNumber — the number of the block in which the transaction was included. This field is null for transactions that have not yet been included in a block.contractAddress — the contract address created by the transaction if it was a contract creation transaction. Otherwise, the value is null.cumulativeGasUsed — the total amount of gas used in the block until this transaction was executed.effectiveGasPrice — the actual value deducted from the sender’s account for this transaction.from — the address of the sender who initiated the transaction.gasUsed — the amount of gas used by this specific transaction alone.logs — an array of log objects this transaction generates, if any. Logs are generated by smart contracts.logsBloom — the bloom filter used by light clients to quickly retrieve logs related to the transaction.status — the success status of the transaction, represented as 1 for success or 0 for failure.to — the recipient’s address of the transaction if it was a transaction to an address. For contract creation transactions, this field is null.transactionHash — the hash that uniquely identifies the transaction.transactionIndex — the index of the transaction within the block.type — the type of the transaction. 0 indicates a regular transfer; 2 indicates a contract creation or smart contract function call.eth_getTransactionReceipt code examplesconst { Web3 } = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);
async function getReceipt(transactionHash) {
const receipt = await web3.eth.getTransactionReceipt(transactionHash)
console.log(receipt)
}
getReceipt("0x658d83eb9395221ffb8c2bf3696b88f61262527b145bd7ffdb7310edb8886e3b")
eth_getTransactionReceipt is to verify a transaction’s status and whether it was successful. This can be especially useful when deploying a contract, as you can use the receipt to confirm that the contract was deployed successfully and has a valid contract address.Was this page helpful?