Polygon API Documentation
eth_getTransactionByBlockHashAndIndex JOSN-RPC Method
The eth_getTransactionByBlockHashAndIndex
returns information about a transaction by block hash and transaction index position.
Parameters
-
blockHash
- String - The block hash. -
index
- An integer of the transaction index position encoded as a hexadecimal
Returns
-
blockHash
- 32 Bytes - The hash of the block including this transaction. Null when it's pending. -
blockNumber
- The number of the block including this transaction. Null when it's pending. -
from
- The address of the sender. -
gas
- The gas provided by the sender. -
gasPrice
- The gas price provided by the sender in wei. -
maxFeePerGas
- The maximum fee per gas set in the transaction. -
maxPriorityFeePerGas
- The maximum priority gas fee set in the transaction. -
hash
- The hash of the transaction. -
input
- The data sent along with the transaction. -
nonce
- The number of transactions made by the sender before this one. -
to
- The address of the receiver. null when it's a contract creation transaction. -
transactionIndex
- The index position of the transaction in the block. Null when it's pending. -
value
- The value transferred in wei encoded as hexadecimal. -
type
- The transaction type. -
accesslist
- A list of addresses and storage keys that the transaction plans to access. -
chainId
- The chain id of the transaction, if any. -
v
[optional] - ECDSA recovery ID. -
r
- The R field of the signature. -
s
- The S field of the signature
Need RPC API keys?
Get 12.5M archival requests for free today.
Request
POST https://<network>.chainnodes.org/YOUR-API-KEY
Example
- HTTPS POST Request with a JSON RPC call in the body
- Replace YOUR-API-KEY with the API key from your CHAINNODES.ORG Dashboard
- You can use a different supported network by replacing
polygon-mainnet
curl https://polygon-mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params": ["0x0cafdcf900c288608cb9ea1f68e759b796b2b1d5987adcba7af8206eb2e54392", "0x0"],"id":1}'
Body
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x0cafdcf900c288608cb9ea1f68e759b796b2b1d5987adcba7af8206eb2e54392",
"blockNumber": "0x102d424",
"from": "0xdd8ef55055e01d39cb87571bd38c43ab9b5903a5",
"gas": "0x49d1e",
"gasPrice": "0x4d50a3d2b",
"maxPriorityFeePerGas": "0x0",
"maxFeePerGas": "0x4d50a3d2b",
"hash": "0x7b28f7de21587af6f66aff09325303e0ee9cc83795afad3f9d9ec57e64ba85e7",
"input": "0x0002060102d424000000000089992abd057c32020788e6a0c2ddd26feeb64f039a2c41296fcb3f56400000000000005c374576c935474b1468c7f075faff820000000000000007fc811e959f8f6c480000000000005c3beed82d45b7ce5e18e9bc234d008201000001f400000000000000000000003d816489b9000000234d8692bd79a02ada5136c7861f74cf",
"nonce": "0x78ae",
"to": "0xf8b721bff6bf7095a0e10791ce8f998baa254fd0",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x2",
"accessList": [],
"chainId": "0x1",
"v": "0x0",
"r": "0x1cd8bbd8470430cccf86a590e3a3f001846e34597a2010137bb1e563cb93d35c",
"s": "0x78cc29e2c9ad5778bcc7c84805309d7fc28def5c2ff6b727f32e4cfb3b07f205"
}
}
💡 Confusing?
Ask our experienced blockchain developers in Telegram
JSON-RPC PolygonAPI Documentation by CHAINNODES is based on Erigon node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or reth