TriportRPC

getBlock

POSThttps://triport.io/rpc/ton

Returns the serialized body of a TON block identified by its full block ID.

TON mainnetton:rpcfree+; ton_read_rpc_heavy: 15 / 20 / 100 / 250 RPS (free / basic / pro / business; default, unmeasured)

getBlock fetches a serialized block body from a liteserver. The required workchain, shard, and seqno identify the block position; optional root and file hashes can supply the cryptographic identity already obtained from a lookup or masterchain response.

The result contains the resolved block ID and base64-encoded serialized block data. Use getBlockHeader when metadata and proof material are sufficient and the block body is unnecessary. Use lookupBlock first when the full block ID must be resolved from a sequence number, logical time, or Unix time.

Historical availability is a per-liteserver property. Archive routing is best-effort and does not turn the pool into a continuous full-history service.

Parameters

JSON-RPC params is a by-name object.

Params: object (by-name).

workchainintegerrequired
Signed 32-bit workchain ID.
shardstringrequired
Signed 64-bit shard ID encoded as decimal text.
seqnointegerrequired
Non-negative block sequence number.
root_hashstringoptional
Root hash in a base64, base64url, or hexadecimal form accepted by the facade.
file_hashstringoptional
File hash in a base64, base64url, or hexadecimal form accepted by the facade.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC protocol version.
idnumber or stringCorrelates the response with the request.
resultobjectSerialized block result.
result.datastringBase64-encoded serialized block data.
result.idobjectFull cryptographic block ID.
result.id.workchainintegerWorkchain ID.
result.id.shardstringSigned shard ID as decimal text.
result.id.seqnointegerBlock sequence number.
result.id.root_hashstringBlock root hash.
result.id.file_hashstringSerialized block file hash.

The JSON is copied from the accepted live fixture. The fixture sanitizer replaces block-data BoC bytes, so the short data value demonstrates the field shape and encoding, not a reusable block body.

Errors

See TON errors for the shared envelope and retention handling.

CodeMeaningWhen it happens
-32602Invalid paramsA required block coordinate is absent or malformed, or a supplied hash is invalid.
beyond_retentionBlock unavailableThe selected liteserver does not retain the requested block.
-32601Method not foundThe method is outside the published read-only catalog.
401UnauthorizedThe API key is missing or invalid.
429Rate limitedThe ton_read_rpc_heavy budget is exceeded.

Examples

const block = { workchain: -1, shard: "-9223372036854775808", seqno: 90110366 };
const response = await fetch("https://triport.io/rpc/ton", {
  method: "POST",
  headers: { "x-token": process.env.TRIPORT_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ jsonrpc: "2.0", id: "block-body", method: "getBlock", params: block }),
});
const { result } = await response.json();

Notes

  • Pruned liteservers had a measured floor of 86 860 000. Two servers answered a genesis query, but ls-17 had a measured continuity gap; genesis success is not a full-history guarantee.
  • Named parameters are required, and batched responses must be correlated by id rather than array position.
  • No REST gateway, write method, or WebSocket block subscription is published for TON.
  • Related methods: getBlockHeader, lookupBlock, and getShards.