Links

eth_getTransactionByBlockNumberAndIndex - Polygon

Returns information about a transaction by block number and transaction index position.
Parameters
  • QUANTITY|TAG - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
  • QUANTITY - the transaction index position.
params: [
'latest', // 668
'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 \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockNumberAndIndex","params":["latest", "0x0"],"id":0}'
URL: https://polygon.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
{
"jsonrpc":"2.0",
"method":"eth_getTransactionByBlockNumberAndIndex",
"params":["latest", "0x0"],
"id":0
}
Result
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"hash": "0xda9e8d53405ac74ea0703f39103aeddfe5cccb5aa8595be63d07eb43a5a90cc8",
"nonce": "0x593f",
"transactionIndex": "0x0",
"from": "0x75767b4d509319ab226fa04777ce15bc11b6189e",
"to": "0x34ba5726d6f13147f0f13b0a705d0f3c10a74866",
"value": "0x0",
"gasPrice": "0x3a35294400",
"gas": "0xdbda",
"maxFeePerGas": null,
"maxPriorityFeePerGas": null,
"input": "0x1249c58b",
"v": "0x1",
"r": "0x5021bfdc87b62b33cce58a269bbb694ed18f93c33c6b3bbaf4dd70938299fa9d",
"s": "0x67e0c554a7c07751f22d363dacb50a08cde1ba176e0705986e157478d50fda9",
"chainId": "0x89",
"accessList": null,
"blockHash": "0x1285ad419f3e9bdd605fe6233a0624f9f7a62edc9e57ba5dee65af3c73afbfd5",
"blockNumber": "0x1d76290"
}
}