For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Base — eth (2/2)

API reference for Base. All methods ->

Part 2 of 2: 1 · 2

eth_getTransactionByHash

Retrieves preconfirmed transactions by hash.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • <string> (required): the hash of the transaction to retrieve.

Returns

The transaction object if found (including when present in a Flashblock preconfirmation); null if the transaction is unknown.

Request example

curl -X POST https://rpc.ankr.com/base/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x16175d34cd1f9819ded6c9e1c630d05fd0c9f67a3373bfb26c5283e0f2f1fb25"],
"id": 1
}'

Response example

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"type": "0x7e",
"sourceHash": "0x27da63a8ebe6b50bd7848cacad5b86358e86d31d34ff12023a7941bd70ecef93",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"to": "0x4200000000000000000000000000000000000015",
"mint": "0x0",
"value": "0x0",
"gas": "0xf4240",
"input": "0x098999be000008dd00101c1200000000000000020000000068af095f000000000162811000000000000000000000000000000000000000000000000000000000671d09ca0000000000000000000000000000000000000000000000000000000000000001076c7bd697aeb085221315e39c6748a7e7f1ed7e73961cf883c80452f07c30290000000000000000000000005050f69a9786f081509234f1a7f4684b5e5b76c9000000000000000000000000",
"hash": "0x16175d34cd1f9819ded6c9e1c630d05fd0c9f67a3373bfb26c5283e0f2f1fb25",
"r": "0x0",
"s": "0x0",
"yParity": "0x0",
"v": "0x0",
"blockHash": "0x644a1a48e50bd435aad25937b21deff4de85e2309cc985118a1e3ec793242702",
"blockNumber": "0x212569b",
"transactionIndex": "0x0",
"depositReceiptVersion": "0x1",
"gasPrice": "0x0",
"nonce": "0x212569d"
}
}