eth_getTransactionReceipt - BSC
Example code for the eth_getTransactionReceipt JSON RPC method. Сomplete guide on how to use eth_getTransactionReceipt JSON RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request Example
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": ["0xcaf9dc7f41315007d9a3644196aacc2b033efabc7ca4dd6dc3b8f2597247df35"],
"id": "getblock.io"
}'const axios = require('axios');
const url = 'https://go.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
method: 'eth_getTransactionReceipt',
params: ['0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b'],
id: 'getblock.io'
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => {
const receipt = response.data.result;
console.log('Status:', receipt.status === '0x1' ? 'Success' : 'Failed');
console.log('Gas Used:', parseInt(receipt.gasUsed, 16));
})
.catch(error => console.error(error));Response Example
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"blockHash": "0x5cd602c9365e1f343cfeb50d7ab71f8b38efd397fa4b41c42fb54772b5ec5416",
"blockNumber": "0x4a883f0",
"contractAddress": null,
"cumulativeGasUsed": "0x8bd8",
"effectiveGasPrice": "0x0",
"from": "0x9fb20230831d9051c67cc2527d7bf0ea51e5412e",
"gasUsed": "0x8bd8",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x4848489f0b2bedd788c696e2d79b6b69d7484848",
"transactionHash": "0xcaf9dc7f41315007d9a3644196aacc2b033efabc7ca4dd6dc3b8f2597247df35",
"transactionIndex": "0x0",
"type": "0x0"
}
}Response Parameters
Field
Type
Description
Use Cases
Error Handling
SDK Integration
Last updated
Was this helpful?