TriportRPC

getShards

TON / https://triport.io/rpc/ton

Minimum tier: Pro

TON method guide

Last updated:

getShards maps a masterchain sequence number to liteServer.getAllShardsInfo and returns the active shardchain block IDs at that point. Each item is a complete block ID with workchain, shard, sequence, root hash, and file hash.

Use it to discover which shardchain blocks correspond to a masterchain block before fetching their headers or bodies. It differs from getMasterchainInfo, which returns only the current masterchain reference, and from lookupBlock, which resolves one block in a specified workchain and shard.

The masterchain seqno is a JSON number. Every returned shard identifier is rendered as signed decimal text so its 64-bit value remains exact.

Parameters

getShards parameters
NameTypeRequiredDescription
seqnoSeqnoYes

Returns

getShards return value
FieldType
resultarray

Examples

curl https://triport.io/rpc/ton \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getShards","params":["<seqno>"]}'
const res = await fetch("https://triport.io/rpc/ton", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getShards",
  "params": [
    "<seqno>"
  ]
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/rpc/ton",
    headers={"Authorization": "Bearer <api-key>"},
    json={"jsonrpc":"2.0","id":1,"method":"getShards","params":["<seqno>"]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: TON.
  3. Clusters: mainnet.
  4. Credit cost: 5 per call.

FAQ

What does getShards do?
Returns active shardchain block IDs at a masterchain sequence number.
How many credits does getShards cost?
getShards costs 5 credit(s) per call on Triport by default.
Is getShards available over WebSocket?
getShards is an HTTP JSON-RPC method.