eth_getTransactionByHash - Optimism RPC Method
Retrieve transaction details by hash on Optimism. Essential for L2 builders, DeFi developers, and teams launching Superchain-compatible apps tracking transactions on the heart of the Superchain powering 60%+ of Ethereum L2 transactions with $6B+ TVL.
Returns the information about a transaction by transaction hash on Optimism.
Why Optimism? Build on the heart of the Superchain powering 60%+ of Ethereum L2 transactions with $6B+ TVL with OP Stack modularity, Superchain interoperability, 17M+ daily transactions across 33 chains, and 20% of tokens for public goods.
Use Cases
The eth_getTransactionByHash method is essential for:
- Transaction tracking - Get details of pending or confirmed transactions
- Payment verification - Verify transaction parameters
- Debugging - Analyze transaction data for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients
- Block explorers - Display transaction information
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32602 | Invalid params | Invalid transaction hash format |
Related Methods
eth_getTransactionReceipt- Get transaction receipteth_sendRawTransaction- Send transaction
eth_sendRawTransaction
Submit signed transactions to Optimism. Essential for broadcasting transactions for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients.
eth_getTransactionReceipt
Get transaction receipt with status and logs on Optimism. Essential for verifying transaction execution for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients.