eth_getTransactionByBlockHashAndIndex - Polygon
Returns information about a transaction by block hash and transaction index position.
Parameters
DATA, 32 Bytes - hash of a block.
QUANTITY - integer of the transaction index position.
params: [
'0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923',
'0x0' // 0
]
Returns
Object - A transaction object, or null when no transaction was found:
  • blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending.
  • blockNumber: QUANTITY - block number where this transaction was in. null when it's pending.
  • from: DATA, 20 Bytes - address of the sender.
  • gas: QUANTITY - gas provided by the sender.
  • gasPrice: QUANTITY - gas price provided by the sender in Wei.
  • hash: DATA, 32 Bytes - hash of the transaction.
  • input: DATA - the data send along with the transaction.
  • nonce: QUANTITY - the number of transactions made by the sender prior to this one.
  • to: DATA, 20 Bytes - address of the receiver. null when it's a contract creation transaction.
  • transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending.
  • value: QUANTITY - value transferred in Wei.
  • v: QUANTITY - ECDSA recovery id
  • r: DATA, 32 Bytes - ECDSA signature r
  • s: DATA, 32 Bytes - ECDSA signature s
Request example
Curl
Postman
curl https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923", "0x0"],"id":0}'
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body:
{
"jsonrpc":"2.0",
"method":"eth_getTransactionByBlockHashAndIndex",
"params":["0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923", "0x0"],
"id":0
}
Result
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"hash": "0x925820c384c6fc3a25e7a20a278a74f7b7b553c86d19ca83e1fd058b2a321e92",
"nonce": "0x140ce",
"transactionIndex": "0x0",
"from": "0xf89d7b9c864f589bbf53a82105107622b35eaa40",
"to": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"value": "0x0",
"gasPrice": "0x45d964b800",
"gas": "0x15f90",
"maxFeePerGas": null,
"maxPriorityFeePerGas": null,
"input": "0xa9059cbb000000000000000000000000066d141687540d1dcade71d1cee04110af504b3200000000000000000000000000000000000000000000000000000000000f4240",
"v": "0x135",
"r": "0x2afc3d8c451406c572c2d36f1608b6eabde6a6f5f61f3b560da78f87994e4dd1",
"s": "0x938aef2c3bf18db3c131b8733a30fdff4183a9dbcfc20c8397200ff083567c",
"chainId": null,
"accessList": null,
"blockHash": "0xacc1dbcf67e80f1898c55a7093cf12f6425c29d9bf6481044587443166e6b923",
"blockNumber": "0x1d765ac"
}
}
Copy link