post https://api.infstones.com/bsc/mainnet/
Returns information about a transaction by block number and transaction index position.
Parameters
Object Name | Required | Type | Detail |
---|---|---|---|
BLOCK PARAMETER | ✅ | String | A hex code of an integer that represents the block number, "latest", "earliest" , "pending" , or hash of a block. The hash of a block is an object specified as: {"blockHash": "\<hash_value>"} . Learn more here. |
TRANSACTION INDEX POSITION | ✅ | String | A hex code of an integer that represents the position of a transaction in the block |
"params": [
"0xfb8fbe",
"0x0"
]
Result
A transaction object, or null
if no transaction was found.
Result Fields
Key | Type | Detail |
---|---|---|
blockHash | String | Hash of the block where this transaction was in. null if the transaction is pending. |
blockNumber | String | A hex code of an integer that represents the block number where this transaction was in. null if the transaction is pending. |
from | String | Address the transaction is sent from. |
gas | String | A hex code of an integer that represents the gas provided by the sender. |
gasPrice | String | A hex code of an integer that represents the gas price provided by the sender in Wei. |
hash | String | Hash of the transaction. |
input | String | The data send along with the transaction. |
nonce | String | A hex code of an integer that represents the number of transactions made by the sender prior to this one. |
r | String | ECDSA signature r. |
s | String | ECDSA signature s. |
to | String | Address the transaction is directed to. null if it's a contract creation transaction. |
transactionIndex | String | A hex code of an integer that represents the transactions index position in the block. null if the transaction is pending. |
v | String | ECDSA recovery id. |
value | String | Value transferred in Wei. |
Example
Request
curl <your-endpoint> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params": ["0xfb8fbe","0x0"],"id":1}'
Return
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"blockHash": "0xef0c14940f208ee5d2928d4a46828e29e40bc0cfe260fe65f5c98f957e844730",
"blockNumber": "0xfb8fbe",
"from": "0x6259d6f5e29a9023341a9f2ff13ef189a8865ae9",
"gas": "0x34503",
"gasPrice": "0x1cbcb113206",
"hash": "0x2a032638e61f1c229783dab7f35ddf0bcf78a0fed8b67668cf81a991a47e1f9c",
"input": "0xe72f160e0208640212783e862fd1fd8287ccd70ba4ff885c1300ad7832b1a2290000000000034503000000000004eaece8880dd232f80000000000007d479423f22e05c200038e8d0000000000000de0b6b3a7640000000000afa587d51a936000000000000000000000000000000000624338b51f400000009e14fa3fcb1e3ccccccccc000000000000000000000000ee0c4d2a7778aa0e6dd08441c5179f1dcb7e3eba0000000000000000000000007a2bd6f3004d15064cf66454cecf878e264124370e",
"nonce": "0x17494",
"r": "0x388feb21a00881d5510979e0af36106261e504d257899a89b37c8f97a6d016f7",
"s": "0x479077edfe970a6cbdf206003d85ab2b462451e83cc97a162996585cb8d03f71",
"to": "0x0000000000dba7f30ba877d1d66e5324858b1278",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x94",
"value": "0x0"
}
}