GETGet shards

TON Mainnethttps://ton-mainnet.nodit.io/api/v2/getShards
CU20

Returns the active shardchain block identifiers at a given masterchain block height. Each shard processes a subset of accounts in parallel. The response shows how the basechain is currently partitioned and which block each shard is at.

Query Parameters
seqnointeger (int32)required

Seqno of masterchain block

Responses
okbooleanrequired

Returns true if the request succeeded; otherwise false. See the error field for details.

@typestring (enum)required

TonLib type identifier for shard listing responses. Refer to the TonLib type reference for a full list.

shardsobject[]required

Array of active shard block identifiers. Each entry contains workchain (integer), shard ID (string), seqno (integer), root_hash (base64/hex), and file_hash (base64/hex).

@typestring (enum)required

TonLib type identifier for full block identifiers. Refer to the TonLib type reference for a full list.

workchainintegerrequired

Workchain ID: -1 for masterchain, 0 for basechain.

shardstringrequired

Shard identifier as a signed 64-bit integer string. Masterchain uses -9223372036854775808.

seqnointegerrequired

Block sequence number within its workchain and shard. For the masterchain (workchain -1), this equals the global block height. For basechain shards (workchain 0), this is the sequence number local to that specific shard, not a global height.

root_hashstringrequired

Root hash of the block. Together with file_hash, uniquely identifies a block.

file_hashstringrequired

Hash of the serialized block file. Together with root_hash, uniquely identifies a block.

@extrastring

Optional request ID that can be passed in the request and received back in the response. Useful for matching async responses.

X-API-KEY
Request
cURL
curl -X GET "https://ton-mainnet.nodit.io/api/v2/getShards?seqno=107892772" \
  -H "X-API-KEY: {YOUR_API_KEY}"
Response
Example · 200
{
  "ok": true,
  "result": {
    "@type": "blocks.shards",
    "shards": [
      {
        "@type": "ton.blockIdExt",
        "workchain": 0,
        "shard": "-9223372036854775808",
        "seqno": 112794113,
        "root_hash": "7oWzAvaZmId7sAc6MlML5ClF17FiP3fcGRLRaq3o87g=",
        "file_hash": "pC8Wh0FYB5izJ2Wr5OFrvTaqPnmBjaoXtRhWOiweXFI="
      }
    ]
  },
  "@extra": "1795684351:_:0.002:c"
}