eth_getTransactionByBlockNumberAndIndex - SEI
Example code for the eth_getTransactionByBlockNumberAndIndex JSON-RPC method. Complete guide on how to use eth_getTransactionByBlockNumberAndIndex JSON-RPC in GetBlock Web3 documentation
Parameters
Parameter
Type
Description
Request
curl --location 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": ["latest", "0x0"],
"id": "getblock.io"
}'import axios from 'axios';
const url = 'https://go.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
method: 'eth_getTransactionByBlockNumberAndIndex',
params: ["latest", "0x0"],
id: 'getblock.io'
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"hash": "0x88df01...",
"blockNumber": "0x4B8F2A1",
"from": "0x742d35Cc...",
"to": "0x123456...",
"value": "0x9184e72a"
}
}Response Parameters
Field
Type
Description
Use Case
Error Handling
Error Code
Message
Description
Web3 Integration
Last updated
Was this helpful?