GETGet blocks

TON Mainnethttps://ton-mainnet.nodit.io/api/v3/blocks
CU40

Return blocks that match the specified filters.

Query Parameters
workchaininteger (int32)

Workchain of the block.

shardstring

Shard ID of the block. Provide this parameter with workchain. Example: 8000000000000000.

seqnointeger (int32)

Sequence number of the block. Provide this parameter with workchain and shard.

root_hashstring

Root hash of the block.

file_hashstring

File hash of the block.

mc_seqnointeger (int32)

Masterchain block sequence number.

start_utimeinteger (int32)

Query blocks with a generation timestamp at or after the specified timestamp.

end_utimeinteger (int32)

Query blocks with a generation timestamp at or before the specified timestamp.

start_ltinteger (int64)

Query blocks where lt is at or above the specified value.

end_ltinteger (int64)

Query blocks where lt is at or below the specified value.

limitinteger (int32)

Limit the number of rows to return. Use with offset to batch requests.

offsetinteger (int32)

Skip the first N rows. Use with limit to batch requests.

sortstring (enum)

Sort blocks by generation timestamp.

Responses
after_mergeboolean

Returns true if this block was created immediately after a shard merge; otherwise false.

after_splitboolean

Returns true if this block was created immediately after a shard split; otherwise false.

before_splitboolean

Returns true if this shard will split after this block; otherwise false.

created_bystring

256-bit public key of the validator that created this block, base64 encoded.

end_ltstring

Logical time (lt) at the end of this block, as a decimal string. All transactions in this block have lt between start_lt and end_lt.

Example: 0

file_hashstring

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

flagsinteger

Bit flags from the block header. Bit 0 indicates that the header includes the software version (gen_software) of the validator that generated the block.

gen_catchain_seqnointeger

Catchain sequence number of the validator session that generated this block.

gen_utimestring

Unix timestamp in seconds when this block was generated, as a decimal string.

Example: 0

global_idinteger

Global network ID (-239 for mainnet, -3 for testnet).

key_blockboolean

Returns true if this is a key block containing validator set changes or config updates; otherwise false.

master_ref_seqnointeger

Sequence number (seqno) of the masterchain block that this shard block references. 0 for masterchain blocks.

masterchain_block_refobject

Identifier (workchain, shard, seqno) of the masterchain block in which this block was committed. For a masterchain block, it refers to the block itself.

seqnointeger

Block sequence number within its workchain and shard.

shardstring

Shard identifier as a hexadecimal string, for example 8000000000000000.

Example: 0

workchaininteger

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

min_ref_mc_seqnointeger

Minimum masterchain block seqno referenced by this block.

prev_blocksobject[]

Array of previous block identifiers (workchain, shard, seqno). Usually contains one entry, but two after a shard merge.

seqnointeger

Block sequence number within its workchain and shard.

shardstring

Shard identifier as a hexadecimal string, for example 8000000000000000.

Example: 0

workchaininteger

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

prev_key_block_seqnointeger

Sequence number of the previous key block.

rand_seedstring

256-bit random seed of this block, base64 encoded.

root_hashstring

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

seqnointeger

Block sequence number within its workchain and shard.

shardstring

Shard identifier as a 64-bit value in hexadecimal. The masterchain uses 8000000000000000.

Example: 0

start_ltstring

Logical time (lt) at the start of this block, as a decimal string.

Example: 0

tx_countinteger

Number of transactions included in this block.

validator_list_hash_shortinteger

Short hash of the validator set active during this block.

versioninteger

Block format version number.

vert_seqnointeger

Vertical sequence number of the block, which is the number of vertical (hard fork) blocks that precede it.

vert_seqno_incrboolean

Returns true if this block increments the vertical sequence number, meaning it is a vertical (hard fork) block; otherwise false.

want_mergeboolean

Returns true if validators have signaled a preference to merge this shard; otherwise false.

want_splitboolean

Returns true if validators have signaled a preference to split this shard; otherwise false.

workchaininteger

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

X-API-KEY
Request
cURL
curl -X GET "https://ton-mainnet.nodit.io/api/v3/blocks?workchain=-1&limit=1&offset=0&sort=desc" \
  -H "X-API-KEY: {YOUR_API_KEY}"
Response
Example · 200
{
  "blocks": [
    {
      "workchain": -1,
      "shard": "8000000000000000",
      "seqno": 107892964,
      "root_hash": "S2I7nqdAnbvLir4uACy39lJWHVJRdGkf08PNIE3/hcw=",
      "file_hash": "IWo4a8Havw10VPppjWDcLQSUic4xNxjI59+ZxnEcYYc=",
      "global_id": -239,
      "version": 0,
      "after_merge": false,
      "before_split": false,
      "after_split": false,
      "want_merge": true,
      "want_split": false,
      "key_block": false,
      "vert_seqno_incr": false,
      "flags": 1,
      "gen_utime": "1795684413",
      "start_lt": "119175516000000",
      "end_lt": "119175516000004",
      "validator_list_hash_short": 1934141625,
      "gen_catchain_seqno": 886372,
      "min_ref_mc_seqno": 107892961,
      "prev_key_block_seqno": 107801649,
      "vert_seqno": 1,
      "master_ref_seqno": 0,
      "rand_seed": "Z5cYNfRzQrGGB6mFfYhPF3HCWBLnm5OjZvHEahrCgIc=",
      "created_by": "JrvZxcuCFt7ENwImLd5ra0q7o1PBqwkK5d8DMZvnjSo=",
      "tx_count": 3,
      "masterchain_block_ref": {
        "workchain": -1,
        "shard": "8000000000000000",
        "seqno": 107892964
      },
      "prev_blocks": [
        {
          "workchain": -1,
          "shard": "8000000000000000",
          "seqno": 107892963
        }
      ]
    }
  ]
}