Skip to main content

eth_getTransactionByHash

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

Why Moonriver? Build on the Moonbeam canary network on Kusama for real-world testing of EVM dApps with Moonbeam code ships here first, full EVM compatibility on Kusama, 80% fee burn mechanism, and XCM cross-chain messaging.

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 production-grade dApp testing, early feature deployment, and Kusama-based EVM applications
  • 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  \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [""],
"id": 1
}'

Error Handling#

Error CodeMessageDescription
-32602Invalid paramsInvalid transaction hash format