getBlock
https://triport.io/rpc/tonReturns the serialized body of a TON block identified by its full block ID.
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).
workchainintegerrequiredshardstringrequiredseqnointegerrequiredroot_hashstringoptionalfile_hashstringoptionalResponse
Response fields
| Field | Type | Description |
|---|---|---|
jsonrpc | string | JSON-RPC protocol version. |
id | number or string | Correlates the response with the request. |
result | object | Serialized block result. |
result.data | string | Base64-encoded serialized block data. |
result.id | object | Full cryptographic block ID. |
result.id.workchain | integer | Workchain ID. |
result.id.shard | string | Signed shard ID as decimal text. |
result.id.seqno | integer | Block sequence number. |
result.id.root_hash | string | Block root hash. |
result.id.file_hash | string | Serialized 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.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | A required block coordinate is absent or malformed, or a supplied hash is invalid. |
beyond_retention | Block unavailable | The selected liteserver does not retain the requested block. |
-32601 | Method not found | The method is outside the published read-only catalog. |
401 | Unauthorized | The API key is missing or invalid. |
429 | Rate limited | The 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-17had a measured continuity gap; genesis success is not a full-history guarantee. - Named parameters are required, and batched responses must be correlated by
idrather than array position. - No REST gateway, write method, or WebSocket block subscription is published for TON.
- Related methods:
getBlockHeader,lookupBlock, andgetShards.