eth
eth_getTransactionByHash
Returns information about a transaction given its hash. This is the primary method for looking up individual transactions.
Returns information about a transaction given its hash. This is the primary method for looking up individual transactions.
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | The transaction hash (32 bytes, hex-encoded with 0x prefix). |
Returns
object -- A transaction object, or null if no transaction is found. The object contains:
| Field | Type | Description |
|---|---|---|
hash | string | The transaction hash. |
nonce | string | Number of transactions sent by the sender prior to this one (hex). |
blockHash | string | Hash of the block containing this transaction. null if pending. |
blockNumber | string | Block number (hex). null if pending. |
transactionIndex | string | Index of the transaction in the block (hex). null if pending. |
from | string | Address of the sender. |
to | string | Address of the receiver. null for contract creation. |
value | string | Value transferred in wei (hex). |
gas | string | Gas limit provided by the sender (hex). |
gasPrice | string | Gas price in wei (hex). For EIP-1559 transactions, this is the effective gas price. |
input | string | The calldata sent with the transaction. |
v | string | ECDSA recovery ID. |
r | string | ECDSA signature r value. |
s | string | ECDSA signature s value. |
type | string | Transaction type (hex). |
maxFeePerGas | string | Maximum fee per gas (EIP-1559 only). |
maxPriorityFeePerGas | string | Maximum priority fee per gas (EIP-1559 only). |
chainId | string | Chain ID (hex). 0x171 for PulseChain. |
Example
Look up a transaction from block 0x100000:
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x01c5a8461d06c2c195035c148af0f871c7679841d86ae5bb98676bb2d8e68dfa"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0x01c5a8461d06c2c195035c148af0f871c7679841d86ae5bb98676bb2d8e68dfa",
"nonce": "0x0",
"blockHash": "0x...",
"blockNumber": "0x100000",
"transactionIndex": "0x0",
"from": "0x68795c4aa09d6f4ed3e5deddf8c2ad3049a601da",
"to": "0xdae787ec66e65c60ad35203800b97b45fcb0f909",
"value": "0x2b81097c919a9e000",
"gas": "0x...",
"gasPrice": "0x...",
"input": "0x...",
"type": "0x0",
"chainId": "0x171",
"v": "0x...",
"r": "0x...",
"s": "0x..."
}
}
TRY IT
Notes
- Returns
nullif no transaction exists with the given hash. - For pending transactions (in the mempool),
blockHash,blockNumber, andtransactionIndexwill benull. - The
inputfield contains the calldata. For simple transfers it is"0x", for contract interactions it contains the ABI-encoded function call. - The
tofield isnullfor contract creation transactions. - Related methods: use
eth_getTransactionReceiptto get the execution result (status, gas used, logs) of a confirmed transaction.
eth_getBlockReceipts
Returns all transaction receipts for a given block. This is more efficient than calling eth_getTransactionReceipt individually for each transaction in a block.
eth_getTransactionReceipt
Returns the receipt of a transaction by its hash. The receipt contains the execution result, including status, gas used, and event logs. Only available for confirmed transactions.
