POSTGet masterchain info

TON Mainnethttps://ton-mainnet.nodit.io/api/v2/getMasterchainInfo
CU10

Returns the current state of the TON masterchain. The last field contains the latest block used for querying current state. The seqno in last is the current block height. Use this endpoint to obtain the latest block reference for other queries.

Request Body
Responses
okbooleanrequired

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

@typestring (enum)required

TonLib type identifier for masterchain state info. Refer to the TonLib type reference for a full list.

lastobjectrequired

The most recent masterchain block.

@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.

state_root_hashstringrequired

SHA-256 Merkle root hash of the entire blockchain state at the latest block.

initobjectrequired

The genesis (first) masterchain block.

@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 POST "https://ton-mainnet.nodit.io/api/v2/getMasterchainInfo" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{}'
Response
Example · 200
{
  "ok": true,
  "result": {
    "@type": "blocks.masterchainInfo",
    "last": {
      "@type": "ton.blockIdExt",
      "workchain": -1,
      "shard": "-9223372036854775808",
      "seqno": 107892792,
      "root_hash": "MlXHUr8FQ2bVsinJpF1bANaBLPpfm0r/ODqJQmMKhDo=",
      "file_hash": "fMYosTjNFrhaT6ApZaTScgCq8Q7O6KIiaH4EmzofPSU="
    },
    "state_root_hash": "a0Mt4f8dJuSaGBWUa3wLD9Byxrnf4VRrAKHeBLfBtQE=",
    "init": {
      "@type": "ton.blockIdExt",
      "workchain": -1,
      "shard": "0",
      "seqno": 0,
      "root_hash": "F6OpKZKqvqeFp6CQmFomXNMfMj2EnaUSOXN+Mh+wVWk=",
      "file_hash": "XplPz01CXAps5qeSWUtxcyBfdAo5zVb1N979KLSKD24="
    }
  },
  "@extra": "1795684344:_:0.002:c"
}