TriportRPC

lookupBlock

POSThttps://triport.io/rpc/ton

Resolves one TON block by sequence number, logical time, or Unix time.

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

lookupBlock finds a block within a specified workchain and shard. Select the target by exactly one of block sequence number, logical time, or Unix time. The result is the complete cryptographic block ID.

Use it when a caller has a position or time but still needs root_hash and file_hash before calling getBlock or getBlockHeader. It differs from getMasterchainInfo, which returns only the current masterchain reference.

Historical resolution follows the selected liteserver's retention window. A missing old block is surfaced as a retention boundary rather than a fabricated empty result.

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.
seqnointegeroptional
Non-negative block sequence number selector.
ltstringoptional
Unsigned logical-time selector encoded as decimal text.
unixtimeintegeroptional
Non-negative Unix-time selector.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC protocol version.
idnumber or stringCorrelates the response with the request.
resultobjectFull cryptographic block ID.
result.workchainintegerWorkchain ID.
result.shardstringSigned shard ID as decimal text.
result.seqnointegerResolved block sequence number.
result.root_hashstringResolved block root hash.
result.file_hashstringResolved serialized-block file hash.

The response is copied from the accepted live fixture.

Errors

See TON errors for the shared envelope and retention handling.

CodeMeaningWhen it happens
-32602Invalid paramsCoordinates are malformed, or zero or multiple selectors are supplied.
beyond_retentionBlock unavailableThe selected liteserver does not retain the requested historical 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 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: "lookup",
    method: "lookupBlock",
    params: { workchain: -1, shard: "-9223372036854775808", seqno: 90094747 },
  }),
});
const { result: blockId } = await response.json();

Notes

  • Selector exclusivity is part of the method contract: send exactly one of seqno, lt, and unixtime.
  • Pruned servers had a measured floor of 86 860 000. Two nodes answered from genesis, but ls-17 had a measured gap, so archive routing is best-effort.
  • Named params and batch response correlation by id are required.
  • No REST gateway or WebSocket block subscription is published for TON.
  • Related methods: getBlock, getBlockHeader, and getMasterchainInfo.