For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

TON — Methods (2/3)

API reference for TON. All methods ->

Part 2 of 3: 1 · 2 · 3

getShardBlockProof

Retrieves shard block proof.

Retrieves the proof of a specific shard block on the TON blockchain.

Parameters


  • workchain (integer; query; required): the block workchain ID. Example: -1 for the masterchain.
  • shard (integer; query; required): the block shard ID. Example: -9223372036854775808 for the masterchain.
  • seqno (integer; query; required): the sequence number of the masterchain block for which to retrieve signatures.
  • from_seqno (integer; query): the sequence number of the masterchain block starting from which the proof is required. If not specified latest masterchain block is used.

Returns

The proof of a specific shard block on the TON blockchain.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getShardBlockProof?workchain=-1&shard=-9223372036854775808&seqno=39064985

Response example

{
"ok": true,
"result": {
"@type": "blocks.shardBlockProof",
"from": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 41808549,
"root_hash": "s7xGa9Mp3ly90+p6CEyQ2jQgC4lhFktWBC99VCNalhA=",
"file_hash": "otXbmchM7gVDOnMo99RcezYGKv7XOICChVs15K5mFu8="
},
"mc_id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064985,
"root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=",
"file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M="
},
"links": [],
"mc_proof": [
{
"@type": "blocks.blockLinkBack",
"to_key_block": false,
"from": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 41808549,
"root_hash": "s7xGa9Mp3ly90+p6CEyQ2jQgC4lhFktWBC99VCNalhA=",
"file_hash": "otXbmchM7gVDOnMo99RcezYGKv7XOICChVs15K5mFu8="
},
"to": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064985,
"root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=",
"file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M="
},
"dest_proof": "te6ccgECBwEAAUcACUYD8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/sAFgEkEBHvVar///8RAgMEBQGgm8ephwAAAAAEAQJUFZkAAAABAP////8AAAAAAAAAAGaXMXwAACt6kiZ7gAAAK3qSJnuEhbCm0wAI8i0CVBWVAlQU...",
"proof": "te6ccgECCQEAAfoACUYDs7xGa9Mp3ly90+p6CEyQ2jQgC4lhFktWBC99VCNalhAAFQEkEBHvVar///8RAgMEBQGgm8ephwAAAAAEAQJ98qUAAAABAP////8AAAAAAAAAAGcuCMYAAC4bdxckQAAALht3FyRELyM3uwAJjQ4CffKhAn2ug8QAAAAJAAAAAAAAAe4GKEgBAXr54c8Gc+eWcHETEHYK/CztB+T1ieXVEoBn1572ldkCAAMqigRpFcGq8hDStc521CzfSTiXxjfhoWUP1kP/q+8wjF6fkv4hVokx69NGJUjnOO8UvPQC/j...",
"state_proof": "te6ccgECcAEADIkACUYD/iFWiTHr00YlSOc47xS89AL+P4rCuq4G0iP3ZgTHMsABbwEkW5Ajr+L///8RAP////8AAAAAAAAAAAJ98qUAAAABZy4IxgAALht3FyREAn3yoWACAwQFKEgBAUUKG6HVTbjHrjXJoRaa4m9/CZLcQ8jQHvlvDAcBD2rwAAEoSAEB0du2kTZcVh2Ne1F8P0D7eOk45xNyeq8QG794Zq98TmQBbiIzAAAAAAAAAAD//////////4HBuempBkmw+CgGByRVzCaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqsI4MhMW7ZfvfggJCgsoSAEBpafSQFfYZDslJ3CdmGzaOEatyz7dwy0o7CH2nhfbqu8AAShIAQFH1daNUVAp9rX2NNYO0AXdnjuS9fglxh8OI1KoLN2vrAAlKEgBATJfFYvXj+BzkWTrjA8QIG3vJcXD/xs..."
}
],
"@extra": "1731070166.2531776:0:0.6464551742790462"
}
}

getConsensusBlock

Retrieves consensus block.

Retrieves the consensus block and its update timestamp.

Parameters

None.

Returns

Information about the latest consensus block on the TON blockchain.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getConsensusBlock

Response example

{
"ok": true,
"result": {
"consensus_block": 41808671,
"timestamp": 1731070487.261679
}
}

lookupBlock

looks up block.

Retrieves detailed information about a specific block in the TON blockchain.

Parameters


  • workchain (integer; query; required): the block workchain ID. Example: -1 for the masterchain.
  • shard (integer; query; required): the block shard ID. Example: -9223372036854775808 for the masterchain.
  • seqno (integer; query; required): the sequence number of the block. Example: 39064985.
  • lt (integer; query): the block's logical time.
  • unixtime (integer; query): the block's unix time.

Returns

Detailed information about a specific block on the TON blockchain.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/lookupBlock?workchain=-1&shard=-9223372036854775808&seqno=39064985

Response example

{
"ok": true,
"result": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064985,
"root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=",
"file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M=",
"@extra": "1731070853.2663236:0:0.3731994442759804"
}
}

shards

Retrieves shards information.

Parameters


  • seqno (integer; query; required): the sequence number of the masterchain block. Example: 39064985.

Returns

Information about shards for a specific masterchain block on the TON blockchain.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/shards?seqno=39064985

Response example

{
"ok": true,
"result": {
"@type": "blocks.shards",
"shards": [
{
"@type": "ton.blockIdExt",
"workchain": 0,
"shard": "4611686018427387904",
"seqno": 44599306,
"root_hash": "c5B0hqpAddUbvNiSf3gjdzRf3CwZwI6Sf0wQsWwOGsA=",
"file_hash": "ZtTs6ODJrgoBSIs5df5ldHaiamLOpsFT2uSV+5VzFn8="
},
{
"@type": "ton.blockIdExt",
"workchain": 0,
"shard": "-4611686018427387904",
"seqno": 44599315,
"root_hash": "uf8DTtjRw5hQc1tBi/gD3sCNcFrAjnKeIuPPIUjR3h0=",
"file_hash": "s0afHo/ReFDI8s6e2+6BjpSRpJjN6ST1DfY1Ke2fMm4="
}
],
"@extra": "1731071058.0157397:0:0.09471235795206101"
}
}

getBlockTransactions

Retrieves transactions of a given block.

Parameters


  • workchain (integer; query; required): the block workchain ID. Example: -1 for the masterchain.
  • shard (integer; query; required): the block shard ID. Example: -9223372036854775808 for the masterchain.
  • seqno (integer; query; required): the sequence number of the block. Example: 39064985.
  • root_hash (string; query): the root hash of the block for which to request transactions.
  • file_hash (string; query): the file hash associated with the block.
  • after_lt (integer; query): the logical time (LT) marker after which to retrieve transactions.
  • after_hash (string; query): the hash of the last transaction from which to continue fetching additional transactions.
  • count (integer; query; default=40): max number of transactions to return.

Returns

Transactions from a specific block on the TON blockchain.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactions?workchain=-1&shard=-9223372036854775808&seqno=39064985

Response example

{
"ok": true,
"result": {
"@type": "blocks.transactions",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064985,
"root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=",
"file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M="
},
"req_count": 40,
"incomplete": false,
"transactions": [
{
"@type": "blocks.shortTxId",
"mode": 135,
"account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
"lt": "47805438000001",
"hash": "oWXZAgtiaqG69JC90PhKUCu/czgLghQVqQGAhxIetMY="
},
{
"@type": "blocks.shortTxId",
"mode": 135,
"account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
"lt": "47805438000002",
"hash": "gG/fp7ukb3YHhcqRqhARG24xuNncdgc7dT4aSWLhRCI="
},
{
"@type": "blocks.shortTxId",
"mode": 135,
"account": "-1:5555555555555555555555555555555555555555555555555555555555555555",
"lt": "47805438000003",
"hash": "6p8ROuJ33hA6l7SrfhiXG1XB8YUNEnm05IElYQQCDek="
}
],
"@extra": "1731071592.980471:0:0.13996576074060574"
}
}

getBlockTransactionsExt

Retrieves block transactions extended info.

Parameters


  • workchain (integer; query; required): the block workchain ID. Example: -1 for the masterchain.
  • shard (integer; query; required): the block shard ID. Example: -9223372036854775808 for the masterchain.
  • seqno (integer; query; required): the sequence number of the block. Example: 39064985.
  • root_hash (string; query): the root hash of the block for which to request transactions.
  • file_hash (string; query): the file hash associated with the block.
  • after_lt (integer; query): the logical time (LT) marker after which to retrieve transactions.
  • after_hash (string; query): the hash of the last transaction from which to continue fetching additional transactions.
  • count (integer; query; default=40): max number of transactions to return.

Returns

Detailed information about transactions from a specific block on the TON blockchain.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactionsExt?workchain=-1&shard=-9223372036854775808&seqno=39064985

Response example

{
"ok": true,
"result": {
"@type": "blocks.transactionsExt",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064985,
"root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=",
"file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M="
},
"req_count": 40,
"incomplete": false,
"transactions": [
{
"@type": "raw.transaction",
"address": {
"@type": "accountAddress",
"account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"
},
"utime": 1721184636,
"data": "te6cckECBgEAASwAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAAArepIme4GscsDwDDBgx9i/DeB5aFmy2vrV8aOK0rP/cq/8TPKZcwAAK3qSFzlCZpcxfAABQIAQIDAAEgAIJy8I5H0zoxilm4IYvCWq+YZvggOAzax3zPCIkpOOBNG8wO3imDKvL7ljWwH4GPI4A1OWEW8XeiXiwJjU86+K4vmQIFIDAkBAUAoEMBkBCwdgAAAAAAAAAAAIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvAAAAAAAAAAAAAAAABLUUtpEnlC4z33SeGHxRhIq/htUa7i3D8ghbwxhQTn44ES774TA==",
"transaction_id": {
"@type": "internal.transactionId",
"lt": "47805438000001",
"hash": "oWXZAgtiaqG69JC90PhKUCu/czgLghQVqQGAhxIetMY="
},
"fee": "0",
"storage_fee": "0",
"other_fee": "0",
"out_msgs": [],
"account": "-1:3333333333333333333333333333333333333333333333333333333333333333"
},
{
"@type": "raw.transaction",
"address": {
"@type": "accountAddress",
"account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"
},
"utime": 1721184636,
"data": "te6cckECBwEAAYoAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAAArepIme4KhZdkCC2Jqobr0kL3Q+EpQK79zOAuCFBWpAYCHEh60xgAAK3qSJnuBZpcxfAABQIAQIDAQGgBACCcg7eKYMq8vuWNbAfgY8jgDU5YRbxd6JeLAmNTzr4ri+ZpP0ft+83iz9Yc0BgMlvUwWg3jAnIjmISfn+TgvvOiOICDwQJLVTvQJgRBQYAq2n+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE/zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzS1U70CAAAAFb1JEz3AM0uYvhAAKBCr3AQsHYAAAAAAAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbwAAAAAAAAAAAAAAAAS1FLaRJ5QuM990nhh8UYSKv4bVGu4tw/IIW8MYUE5+OBOSEDw0=",
"transaction_id": {
"@type": "internal.transactionId",
"lt": "47805438000002",
"hash": "gG/fp7ukb3YHhcqRqhARG24xuNncdgc7dT4aSWLhRCI="
},
"fee": "0",
"storage_fee": "0",
"other_fee": "0",
"in_msg": {
"@type": "raw.message",
"source": {
"@type": "accountAddress",
"account_address": "Ef8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAU"
},
"destination": {
"@type": "accountAddress",
"account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"
},
"value": "3042163970",
"fwd_fee": "0",
"ihr_fee": "0",
"created_lt": "47805438000000",
"body_hash": "lqKW0iTyhcZ77pPDD4owkVfw2qNdxbh+QQt4YwoJz8c=",
"msg_data": {
"@type": "msg.dataRaw",
"body": "te6cckEBAQEAAgAAAEysuc0=",
"init_state": ""
}
},
"out_msgs": [],
"account": "-1:3333333333333333333333333333333333333333333333333333333333333333"
},
{
"@type": "raw.transaction",
"address": {
"@type": "accountAddress",
"account_address": "Ef9VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVbxn"
},
"utime": 1721184636,
"data": "te6cckECBgEAASwAA691VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAAArepIme4OECgCvSheQctVrVPqeBE/WfbkG6v5cpslm2if1ScBQRgAAK3qSFzlDZpcxfAABQIAQIDAAEgAIJyQ/ThOpAPm9H/T3ILcT7NCWm9UnbAgiq5qKeHYGOf36hhkadzn9gB0z9C3sKgAmTwI1mVw0NYAp/yY+U2+xU+aAIFMDAkBAUAoEGCkBCwdgAAAAAAAAAAAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvAAAAAAAAAAAAAAAABLUUtpEnlC4z33SeGHxRhIq/htUa7i3D8ghbwxhQTn44ECXKhng==",
"transaction_id": {
"@type": "internal.transactionId",
"lt": "47805438000003",
"hash": "6p8ROuJ33hA6l7SrfhiXG1XB8YUNEnm05IElYQQCDek="
},
"fee": "0",
"storage_fee": "0",
"other_fee": "0",
"out_msgs": [],
"account": "-1:5555555555555555555555555555555555555555555555555555555555555555"
}
],
"@extra": "1731071979.505911:1:0.010321268558367347"
}
}

getBlockHeader

Retrieves block header.

Retrieves metadata of a given block.

Parameters


  • workchain (integer; query; required): the block workchain ID. Example: -1 for the masterchain.
  • shard (integer; query; required): the block shard ID. Example: -9223372036854775808 for the masterchain.
  • seqno (integer; query; required): the sequence number of the block. Example: 39064985.
  • root_hash (string; query): the root hash of the block for which to request transactions.
  • file_hash (string; query): the file hash associated with the block.

Returns

Detailed metadata about a block, including its identifiers, state flags, and timing information.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockHeader?workchain=-1&shard=-9223372036854775808&seqno=39064985

Response example

{
"ok": true,
"result": {
"@type": "blocks.header",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064985,
"root_hash": "8txd0JPm3PHUMknZMybwYD8WlGT+nqOQjJ3pqmd22/s=",
"file_hash": "jVToDU7mOXsUoHRntkmE6/hbA1AgrFMMeFcqlnwv75M="
},
"global_id": -239,
"version": 0,
"flags": 1,
"after_merge": false,
"after_split": false,
"before_split": false,
"want_merge": true,
"want_split": false,
"validator_list_hash_short": -2052020525,
"catchain_seqno": 586285,
"min_ref_mc_seqno": 39064981,
"is_key_block": false,
"prev_key_block_seqno": 39064828,
"start_lt": "47805438000000",
"end_lt": "47805438000004",
"gen_utime": 1721184636,
"vert_seqno": 1,
"prev_blocks": [
{
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064984,
"root_hash": "2IPv7Ob6GLJAUa6mnyLRWgiZPumAMtf9I4rKJ4CYA7U=",
"file_hash": "MlowUE4mRqGoS7aKMmXROnpBDTL35jpZDZDrd+oDtBc="
}
],
"@extra": "1731074187.3699944:0:0.9581414160490025"
}
}

getOutMsgQueueSizes

Retrieves messages queue sizes.

Retrieves info with current sizes of messages queues by shards.

Parameters

None.

Returns

Information about the size of message queues associated with a specified block or shard.

Request example

curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getOutMsgQueueSizes

Response example

{
"ok": true,
"result": {
"@type": "blocks.outMsgQueueSizes",
"shards": [
{
"@type": "blocks.outMsgQueueSize",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 41810136,
"root_hash": "PfkJ9d9Y7C+YuemqU1EZuJHVAYLsW8DarhUvT4vZV9U=",
"file_hash": "QimWa2jewflBa8R91i8+2/3+FGTGggOe0ObOrxnch8c="
},
"size": 1
},
{
"@type": "blocks.outMsgQueueSize",
"id": {
"@type": "ton.blockIdExt",
"workchain": 0,
"shard": "2305843009213693952",
"seqno": 46979192,
"root_hash": "XWJreLPIZ6hvembivVKNjL7DCB/Zha5eJrMIMLsawGo=",
"file_hash": "voQ0q1oAGFF6GkiV0I7UUQ3fubnxoeKQ/D7AuFHCJ9U="
},
"size": 128
},
{
"@type": "blocks.outMsgQueueSize",
"id": {
"@type": "ton.blockIdExt",
"workchain": 0,
"shard": "6917529027641081856",
"seqno": 46992152,
"root_hash": "xtxBOJrfNB9E3DMI3X3a1Ydt+/39LF+zJ3O5QQ0JmpE=",
"file_hash": "hfgU2iDQaZ0vt9hNbcevGWbaWbrQeL9VFjGWqX2XGXY="
},
"size": 175
},
{
"@type": "blocks.outMsgQueueSize",
"id": {
"@type": "ton.blockIdExt",
"workchain": 0,
"shard": "-6917529027641081856",
"seqno": 46753006,
"root_hash": "RZGjpslMKh9r4X/6j/RSNubR3MGFWo2T+II59CG4FpU=",
"file_hash": "Qskhx4BuIiXKyQKZaL+ZKndM76cI4+4F+Z6RhDF2HFU="
},
"size": 117
},
{
"@type": "blocks.outMsgQueueSize",
"id": {
"@type": "ton.blockIdExt",
"workchain": 0,
"shard": "-2305843009213693952",
"seqno": 46951966,
"root_hash": "CbJl2xiawT0B9iJIgQv6+xllWdRD92kFp83ajojbSdo=",
"file_hash": "U5A22AXfIQAkeFVZT1yvyoIcREK/vDR8QHBlV9RcI30="
},
"size": 113
}
],
"ext_msg_queue_size_limit": 8000,
"@extra": "1731074512.3481815:16:0.07293629857925221"
}
}