eth_getTransactionByHash
Polygon API - Returns the information about a transaction requested by transaction hash. In the response object, blockHash, blockNumber, and transactionIndex are null when the transaction is pending.

Parameters

DATA, 32 Bytes - hash of a transaction
1
params: [
2
"0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195"
3
]
Copied!

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

Example

​Alchemy Composer​

The Alchemy Composer allows you to make a no-code example request via your browser. Try it out above!

Request

Curl
Postman
1
curl https://polygon-mainnet.g.alchemyapi.io/v2/your-api-key \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d'{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195,"id":0}'
Copied!
1
URL: https://polygon-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getTransactionByHash",
7
"params":["0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195"],
8
"id":0
9
}
Copied!

Result

1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": {
5
"blockHash": "0xb5acef6bbf84c1c0ec7a5009757e3a09ee25ec129b564d11fb976ce75f426c59",
6
"blockNumber": "0xd7b488",
7
"from": "0x7b5fc677cf27a807adf2ebcef72db3b935df6c0a",
8
"gas": "0xb352c",
9
"gasPrice": "0x9502f900",
10
"hash": "0x4ec492e0ba174ddca1324e9867c4e4c10a6eca6a1f77b56a19de875ae869b195",
11
"input": "0x405cec6700000000000000000000000024cf788254bb130bacb6ff519ef875b1d4b0008e000000000000000000000000ab45c5a4b0c941a2f231c04c3f49182e1a25405200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000009502f900000000000000000000000000000000000000000000000000000000000004ffa0000000000000000000000000000000000000000000000000000000000000104f0000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000048000000000000000000000000000000000000000000000000000000000000002a434ee9791000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000010000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000044095ea7b3000000000000000000000000750fd34fbb97abe5492338a3918552291a799ca0000000000000000000000000000000000000000000000000000000002114a0c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000750fd34fbb97abe5492338a3918552291a799ca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000006440993b26000000000000000000000000000000000000000000000000000000002114a0c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005fd8004400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041dc112fa5131cb8f424321830c246c7aec27a5f86968d6eaace1926600716676633ec1f49b2d2eaea0ba7c10d9d97922f13e92002ab2e0610fc17d6ff3e4c60761b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
12
"nonce": "0x3059e",
13
"to": "0xd216153c06e857cd7f72665e0af1d7d82172f494",
14
"transactionIndex": "0x4",
15
"value": "0x0",
16
"type": "0x0",
17
"v": "0x1c",
18
"r": "0x39aeddb2b67676e65e7d6f43fd57c731e17534fcfea0eb40d37be1224a8bb8f0",
19
"s": "0x284defe0787533fc62c637acd2d9e89b2609350c1c26fd4dbb5386242e85a795"
20
}
21
}
Copied!

​

Last modified 27d ago