Optimism
Optimism
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Optimism
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
eth_getTransactionByHash returns the full transaction object for a given hash on OP Mainnet — sender, recipient, value in ETH wei, gas fields, calldata, and signature — or its pending state if it has not yet been included. It is the standard way to look up a transaction once you have its hash. OP Mainnet is an OP Stack optimistic rollup (Bedrock) settling to Ethereum L1, with gas paid in ETH and ~2s blocks, so a submitted transaction usually moves from pending to mined quickly. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
blockNumber is non-null.input calldata to identify which contract function was invoked — for example a Velodrome swap or a Synthetix call.from address and value to verify an incoming ETH payment.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | transactionHash | string (hex) | Oui | The hash of the transaction to retrieve. |
| Type | Description |
|---|---|
| object | null | Transaction object containing: hash, nonce, blockHash, blockNumber, transactionIndex, from, to (null for contract creation), value (hex wei), gas, gasPrice / maxFeePerGas / maxPriorityFeePerGas, input, type, accessList (type-1/2), chainId, v, r, s. Returns null if not found or still pending (blockHa |
Try it live in the Optimism playground.
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Transaction hash is malformed or not 32 bytes. |
status field for the actual execution outcome.blockHash, blockNumber, and transactionIndex all null; do not treat those nulls as "not found".null outright, so null-check the result before reading any field.Paramètres
0x-prefixed 32-byte transaction hash