Skip to main content

eth_getTransactionByHash

Returns the information about a transaction by transaction hash on Moonbeam.

Why Moonbeam? Build on the cross-chain connected EVM platform on Polkadot with $65M+ TVL and 100+ projects with full EVM compatibility on Polkadot, native XCM cross-chain messaging, 10K+ TPS, 24% staking APR, and $0.015 transaction costs.

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, multi-chain dApps, and Ethereum-to-Polkadot bridging via XCM, Axelar, LayerZero, and Wormhole
  • Block explorers - Display transaction information

Parameters#

ParameterTypeRequiredDescription
transactionHashDATAYes32-byte transaction hash

Request#

{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [""],
"id": 1
}

Returns#

FieldTypeDescription
hashDATATransaction hash
fromDATASender address
toDATARecipient address
valueQUANTITYValue in wei
gasQUANTITYGas provided
gasPriceQUANTITYGas price in wei
inputDATATransaction input data
nonceQUANTITYSender's nonce
blockHashDATABlock hash (null if pending)
blockNumberQUANTITYBlock number (null if pending)

Code Examples#

curl -X POST https://api-moonbeam.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [""],
"id": 1
}'

Error Handling#

Error CodeMessageDescription
-32602Invalid paramsInvalid transaction hash format