eth_getRawTransactionByBlockHashAndIndex - Robinhood

eth_getRawTransactionByBlockHashAndIndex. Returns the raw (RLP-encoded) transaction at a given block hash and index.

eth_getRawTransactionByBlockHashAndIndex - robinhood [Value: 20CU]
Returns the RLP-encoded bytes of the transaction at a given index within a block identified by its hash
Use cases

Use cases

  • Export raw transaction bytes for every transaction in a block by hash
  • Re-broadcast a specific transaction without re-deriving its encoding
  • Cross-check a transaction's bytes against its position in the block
Constraints

Constraints

  • Returns null if the block or the transaction index does not exist
  • Requires an archive node for blocks other than recent ones
  • Transaction indices are zero-based
Get started
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://lb.drpc.live/robinhood/{API-KEY} \
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"eth_getRawTransactionByBlockHashAndIndex",
    "params":["0x105b451ea332730fe2d316d983b9a406b6d4a022ee6e83e02bcae17a94f8c87b", "0x0"],
    "id":1,
    "jsonrpc":"2.0"}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xf86c0185012a05f200825208940599d52c37544c07605f470e5e20c1b266de858889021dfc23e5c290008025a084ce48a415a40d664f87a6a05e8ec8e2fd2f07a68b06d3f20d999d7e8c7b12dfa0464c6e93bfa8e779ecd48284cf47d2d797dc611bbc6dbd7ab8f57ccba039acec"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
blockHashstring
The hash of the block containing the transaction.
transactionIndexstring
The transaction's position within the block, as a hex string.

Response

200
The RLP-encoded transaction, as a hexadecimal string, or null if not found

Response params

object
idinteger
jsonrpcstring
resultstring
The RLP-encoded transaction as a hexadecimal string, or null if not found.