TON — Methods (2/3)
API reference for TON. All methods ->
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:-1for the masterchain.shard(integer; query; required): the block shard ID. Example:-9223372036854775808for the masterchain.seqno(integer; query; required): the sequence number of the block to prove. Only recent blocks, roughly the last two days, are available: take a current value fromgetMasterchainInfo.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
- REST
- JSON-RPC
curl -X GET 'https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getShardBlockProof?workchain=-1&shard=-9223372036854775808&seqno=98732447'
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getShardBlockProof",
"params": {
"workchain": -1,
"shard": -9223372036854775808,
"seqno": 98732447
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "blocks.shardBlockProof",
"from": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732614,
"root_hash": "qiBM+XtCc1ZnmxV17gQ+cMFTg4WZ8K3z4uTxND4+4ZA=",
"file_hash": "EVT3vTJs8Mxy2CjfmkX+c61fkGDGEgBIvihXEY1Yarg="
},
"mc_id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732447,
"root_hash": "WTt9vI9Wo3kaDZJeoLM7Z0tEw1fFAj9qJi47AXZIv4w=",
"file_hash": "jR/WQSrZh/IugxyMTNVCZ3sPAHFob17XUN49VWhbXX0="
},
"links": [],
"mc_proof": [
{
"@type": "blocks.blockLinkBack",
"to_key_block": false,
"from": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732614,
"root_hash": "qiBM+XtCc1ZnmxV17gQ+cMFTg4WZ8K3z4uTxND4+4ZA=",
"file_hash": "EVT3vTJs8Mxy2CjfmkX+c61fkGDGEgBIvihXEY1Yarg="
},
"to": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732447,
"root_hash": "WTt9vI9Wo3kaDZJeoLM7Z0tEw1fFAj9qJi47AXZIv4w=",
"file_hash": "jR/WQSrZh/IugxyMTNVCZ3sPAHFob17XUN49VWhbXX0="
},
"dest_proof": "te6ccgECBwEAAUcACUYDWTt9vI9Wo3kaDZJeoLM7Z0tEw1fFAj9qJi47AXZIv4wAFQEkEBHvVar///8RAgMEBQGgm8ephwAAAAAEAQXiiZ8AAAABAP////8AAAAAAAAAAGrN8XYAAGO8cTBrAAAAY7xxMGsEmYJYkQANSn8F4omcBeD/NMQAAAAQAAAAAAAAA+4GKEgB...",
"proof": "te6ccgECCQEAAfoACUYDqiBM+XtCc1ZnmxV17gQ+cMFTg4WZ8K3z4uTxND4+4ZAAFQEkEBHvVar///8RAgMEBQGgm8ephwAAAAAEAQXiikYAAAABAP////8AAAAAAAAAAGrN8bsAAGO8e4AwQAAAY7x7gDBEmYJYkQANSn8F4opCBeD/NMQAAAAQAAAAAAAAA+4GKEgB...",
"state_proof": "te6ccgECZgEAC7wACUYDY6rNFcKn5SBj3u/oDMz7eTz0EXR+CutrrRlgcKffMnMCBgEkW5Ajr+L///8RAP////8AAAAAAAAAAAXiikYAAAABas3xuwAAY7x7gDBEBeKKQmACAwQFKEgBATzgNT6zek2oykDk9UV51IBiDfdqiMHGdjcbKvu6FT/3AAEoSAEBtFEaN8Wo..."
}
],
"@extra": "1791881670.254444:0:0.6414735854347045"
}
}
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
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getConsensusBlock
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getConsensusBlock",
"params": {},
"id": "1"
}'
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:-1for the masterchain.shard(integer; query; required): the block shard ID. Example:-9223372036854775808for the masterchain.seqno(integer; query; required): the sequence number of the block. Example:98732447. Only recent blocks, roughly the last two days, are available: take a current value fromgetMasterchainInfo.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
- REST
- JSON-RPC
curl -X GET 'https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/lookupBlock?workchain=-1&shard=-9223372036854775808&seqno=98732447'
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "lookupBlock",
"params": {
"workchain": -1,
"shard": -9223372036854775808,
"seqno": 98732447
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732447,
"root_hash": "WTt9vI9Wo3kaDZJeoLM7Z0tEw1fFAj9qJi47AXZIv4w=",
"file_hash": "jR/WQSrZh/IugxyMTNVCZ3sPAHFob17XUN49VWhbXX0=",
"@extra": "1791881673.8192403:0:0.47155318453357586"
}
}
shards
Retrieves shards information.
Parameters
seqno(integer; query; required): the sequence number of the masterchain block. Example:98732447. Only recent blocks, roughly the last two days, are available: take a current value fromgetMasterchainInfo.
Returns
Information about shards for a specific masterchain block on the TON blockchain.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/shards?seqno=98732447
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "shards",
"params": {
"seqno": "98732447"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "blocks.shards",
"shards": [
{
"@type": "ton.blockIdExt",
"workchain": 0,
"shard": "-9223372036854775808",
"seqno": 103303188,
"root_hash": "3baE9XRy0Xd4nRCJWNzqlhvji8hoGqxuCiDdSUjfwAI=",
"file_hash": "Qr9nPoakta0cfkovAP8Vp6yNPoMlIpdnaHJpkMf3Et0="
}
],
"@extra": "1791881677.4160109:0:0.28024393518203716"
}
}
getBlockTransactions
Retrieves transactions of a given block.
Parameters
workchain(integer; query; required): the block workchain ID. Example:-1for the masterchain.shard(integer; query; required): the block shard ID. Example:-9223372036854775808for the masterchain.seqno(integer; query; required): the sequence number of the block. Example:98732447. Only recent blocks, roughly the last two days, are available: take a current value fromgetMasterchainInfo.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
- REST
- JSON-RPC
curl -X GET 'https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactions?workchain=-1&shard=-9223372036854775808&seqno=98732447'
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getBlockTransactions",
"params": {
"workchain": -1,
"shard": -9223372036854775808,
"seqno": 98732447
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "blocks.transactions",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732447,
"root_hash": "WTt9vI9Wo3kaDZJeoLM7Z0tEw1fFAj9qJi47AXZIv4w=",
"file_hash": "jR/WQSrZh/IugxyMTNVCZ3sPAHFob17XUN49VWhbXX0="
},
"req_count": 40,
"incomplete": false,
"transactions": [
{
"@type": "blocks.shortTxId",
"mode": 135,
"account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
"lt": "109661004000001",
"hash": "X8Hju1Ww2EKq78wvY3qOu319EL/BzwOeSbiwiuSBpx8="
},
{
"@type": "blocks.shortTxId",
"mode": 135,
"account": "-1:3333333333333333333333333333333333333333333333333333333333333333",
"lt": "109661004000002",
"hash": "FAhwiyjnArZPr/lrYRaq+TtPjla09PX5FIxcFVkEmx0="
},
{
"@type": "blocks.shortTxId",
"mode": 135,
"account": "-1:5555555555555555555555555555555555555555555555555555555555555555",
"lt": "109661004000003",
"hash": "3AGtog/WPNVsOOi+GB45s0GZoTC8etUnGR3OOpOToJY="
}
],
"@extra": "1791881680.9200764:0:0.8267172202347784"
}
}
getBlockTransactionsExt
Retrieves block transactions extended info.
Parameters
workchain(integer; query; required): the block workchain ID. Example:-1for the masterchain.shard(integer; query; required): the block shard ID. Example:-9223372036854775808for the masterchain.seqno(integer; query; required): the sequence number of the block. Example:98732447. Only recent blocks, roughly the last two days, are available: take a current value fromgetMasterchainInfo.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
- REST
- JSON-RPC
curl -X GET 'https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockTransactionsExt?workchain=-1&shard=-9223372036854775808&seqno=98732447'
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getBlockTransactionsExt",
"params": {
"workchain": -1,
"shard": -9223372036854775808,
"seqno": 98732447
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "blocks.transactionsExt",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732447,
"root_hash": "WTt9vI9Wo3kaDZJeoLM7Z0tEw1fFAj9qJi47AXZIv4w=",
"file_hash": "jR/WQSrZh/IugxyMTNVCZ3sPAHFob17XUN49VWhbXX0="
},
"req_count": 40,
"incomplete": false,
"transactions": [
{
"@type": "raw.transaction",
"address": {
"@type": "accountAddress",
"account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"
},
"utime": 1791881590,
"data": "te6cckECBgEAASwAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAABjvHEwawE8lyJw+ojAHd4xdVMmi+c4Ovwe1xuyunhCC1b9jMmQ/AAAY7xxISjCas3xdgABQIAQIDAAEgAIJyndCKPht68KTCNOPWBG3MXx2MtL5uJpxhWKREXD1isA1yCr55EpVU...",
"transaction_id": {
"@type": "internal.transactionId",
"lt": "109661004000001",
"hash": "X8Hju1Ww2EKq78wvY3qOu319EL/BzwOeSbiwiuSBpx8="
},
"fee": "0",
"storage_fee": "0",
"other_fee": "0",
"out_msgs": [],
"account": "-1:3333333333333333333333333333333333333333333333333333333333333333"
},
{
"@type": "raw.transaction",
"address": {
"@type": "accountAddress",
"account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"
},
"utime": 1791881590,
"data": "te6cckECBwEAAYoAA69zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzAABjvHEwawJfweO7VbDYQqrvzC9jeo67fX0Qv8HPA55JuLCK5IGnHwAAY7xxMGsBas3xdgABQIAQIDAQGgBACCcnIKvnkSlVQu7ntt9K3zNQ0jxulWScXh6QtuOHUk9LZbet9tCd3n...",
"transaction_id": {
"@type": "internal.transactionId",
"lt": "109661004000002",
"hash": "FAhwiyjnArZPr/lrYRaq+TtPjla09PX5FIxcFVkEmx0="
},
"fee": "0",
"storage_fee": "0",
"other_fee": "0",
"in_msg": {
"@type": "raw.message",
"hash": "sQcUfau27oa1pJBM6yPz07bOc8zbUTSAif1sxeV69H0=",
"source": {
"@type": "accountAddress",
"account_address": "Ef8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAU"
},
"destination": {
"@type": "accountAddress",
"account_address": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF"
},
"value": "2708260847",
"extra_currencies": [],
"fwd_fee": "0",
"ihr_fee": "0",
"created_lt": "109661004000000",
"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": 1791881590,
"data": "te6cckECBgEAASwAA691VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVAABjvHEwawMU/4bhCnH+ympXWXjEOLEQK/GpF7MUDMxWcrC+/nCbWAAAY7xxISjDas3xdgABQIAQIDAAEgAIJyFXIJ+B9H5NSTdjiTPUpw5kulyWdWHIFJOd5IUzzkzf7lS7qrrT7R...",
"transaction_id": {
"@type": "internal.transactionId",
"lt": "109661004000003",
"hash": "3AGtog/WPNVsOOi+GB45s0GZoTC8etUnGR3OOpOToJY="
},
"fee": "0",
"storage_fee": "0",
"other_fee": "0",
"out_msgs": [],
"account": "-1:5555555555555555555555555555555555555555555555555555555555555555"
}
],
"@extra": "1791881684.3867226:0:0.26997506176767794"
}
}
getBlockHeader
Retrieves block header.
Retrieves metadata of a given block.
Parameters
workchain(integer; query; required): the block workchain ID. Example:-1for the masterchain.shard(integer; query; required): the block shard ID. Example:-9223372036854775808for the masterchain.seqno(integer; query; required): the sequence number of the block. Example:98732447. Only recent blocks, roughly the last two days, are available: take a current value fromgetMasterchainInfo.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
- REST
- JSON-RPC
curl -X GET 'https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getBlockHeader?workchain=-1&shard=-9223372036854775808&seqno=98732447'
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getBlockHeader",
"params": {
"workchain": -1,
"shard": -9223372036854775808,
"seqno": 98732447
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "blocks.header",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732447,
"root_hash": "WTt9vI9Wo3kaDZJeoLM7Z0tEw1fFAj9qJi47AXZIv4w=",
"file_hash": "jR/WQSrZh/IugxyMTNVCZ3sPAHFob17XUN49VWhbXX0="
},
"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": -1719510895,
"catchain_seqno": 871039,
"min_ref_mc_seqno": 98732444,
"is_key_block": false,
"prev_key_block_seqno": 98631476,
"start_lt": "109661004000000",
"end_lt": "109661004000004",
"gen_utime": 1791881590,
"vert_seqno": 1,
"prev_blocks": [
{
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 98732446,
"root_hash": "C1LgHvRLzYz12wNc1Fm40zFnhbJSvy4J8ActiWY/i0k=",
"file_hash": "nuezptiGfdZ3mTglvC2dNPJDqX4daJdGUjcb1Cp4kpU="
}
],
"@extra": "1791881687.835637:0:0.3111287780014509"
}
}
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
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getOutMsgQueueSizes
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getOutMsgQueueSizes",
"params": {},
"id": "1"
}'
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"
}
}