TriportRPC

debug_getRawBlock

POSThttps://api.triport.io/v1/eth

Returns the RLP-encoded bytes of an entire Ethereum block, identified by block number or block hash.

Ethereumeth_debugPro — 5 RPS · Business — 15 RPS

debug_getRawBlock returns the raw, RLP-encoded serialization of a full block — header plus the body (transactions and uncles) — exactly as it is stored and gossiped on the wire. The result is a single 0x-prefixed hex string.

Use this when you need the canonical byte representation of a block rather than the decoded JSON object that eth_getBlockByNumber returns: for example to recompute the block hash locally, to re-import a block into another client, or to verify block contents against an independent encoder.

This is a debug-namespace method and is available on the Pro tier and above. It is rate limited per tier (5 RPS on Pro, 15 RPS on Business) with a short burst allowance; there is no daily quota.

Parameters

A single positional parameter.

blockstringrequired
The block to encode, given as a 0x-prefixed hex block number, a block tag (latest, earliest, safe, finalized, pending), or a 0x-prefixed 32-byte block hash.

Response

Response fields

FieldTypeDescription
resultstringThe 0x-prefixed, RLP-encoded bytes of the full block (header + transactions + uncles).

Errors

CodeMeaningWhen it happens
-32002tier_insufficientYour API key's tier is below Pro; this debug-namespace method is not enabled for it.
-32003rate_limitedYou exceeded your tier's request rate (5 RPS on Pro, 15 RPS on Business) including burst. Retry after a short back-off.

See the shared error envelope reference for the full error object shape and handling guidance.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/eth", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "debug_getRawBlock",
    params: ["0x10D4F"],
  }),
});


const { result } = await res.json();
console.log(result); // "0xf90211a0..."

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const rawBlock: string = await triport.eth.request("debug_getRawBlock", [
  "0x10D4F",
]);

Python (triport-sdk)

import os
from triport import Triport


triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])


raw_block = triport.eth.request("debug_getRawBlock", ["0x10D4F"])
print(raw_block)  # "0xf90211a0..."

Notes