Returns information about a transaction by block number and transaction index position.
Supported on Klaytn (mainnet) only.
Parameters
Request
Type | Description |
---|---|
QUANTITY | TAG | Integer or hexadecimal block number, or the string "earliest" , "latest" or "pending" |
QUANTITY | The transaction index position. |
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest"
and "latest"
are available.
Result
API Endpoint
The format of a Klaytn API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/klaytn/
Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/klaytn/
Example
// Request
curl https://open-platform.nodereal.io/{{apiKey}}/klaytn/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"klay_getTransactionByBlockNumberAndIndex","params":["0x27", "0x0"],"id":1}'
// Result
{
"jsonrpc":"2.0",
"id":1,
"result":{
"blockHash":"0x0591ceb74102fc4ed54b66d27e869224d481e9f44170b25ed4a5654675043198",
"blockNumber":"0x27",
"from":"0xe02837b9d671e0848e599c374416f383f8910e45",
"gas":"0xf4240",
"gasPrice":"0x5d21dba00",
"hash":"0x451cafae98d61b7458b5cef54402830941432278184453e3ca490eb687317e68",
"input":"0x",
"nonce":"0x1",
"senderTxHash":"0x451cafae98d61b7458b5cef54402830941432278184453e3ca490eb687317e68",
"signatures":[
{
"V":"0xfea",
"R":"0x1924d0f36e05d368a37b8130b85067f21f0ea1d35b87bf137216cdc3c844c762",
"S":"0x31d61be4d5cf677e60ad0fa0214e75c3167509c8d8905d7c6f85979b5f32eead"
}
],
"to":"0x44d827f98430784c8e3401748d8ba92c43df4546",
"transactionIndex":"0x0",
"type":"TxTypeLegacyTransaction",
"typeInt":0,
"value":"0xde0b6b3a7640000"
}
}