TON — Methods (1/3)
API reference for TON. All methods ->
getAddressInformation
Retrieves basic information about the address: balance, code, data, last_transaction_id.
Parameters
address(string; query; required): an identifier of a target TON account.
Returns
Information about the address specified.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getAddressInformation?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getAddressInformation",
"params": {
"address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"id": "1"
}'
Response example
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"@type": "raw.fullAccountState",
"balance": "6088697",
"code": "te6cckEBAQEAIwAIQgKPRS16Tf10BmtoI2UXclntBXNENb52tf1L1divK3w9aCBrv3Y=",
"data": "te6cckEBAQEARgAAhwCAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAsROplLUCShZxn2kTkyjrdZWWw4ol9ZAosUb+zcNiHf6+xcGRA==",
"last_transaction_id": {
"@type": "internal.transactionId",
"lt": "50630341000001",
"hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw="
},
"block_id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 41748127,
"root_hash": "LUtR/YNt5qJdLeo2AJAPcoTRbhTx1K2c+sMPkRMT8mA=",
"file_hash": "iOOCR19ILPA9vbpJ8KbhsY76Ns03GitAcF2sMWIkRG4="
},
"frozen_hash": "",
"sync_utime": 1730904471,
"@extra": "1730904488.9606094:0:0.8056820862639625",
"state": "active"
}
}
getExtendedAddressInformation
Retrieves extended address info.
Similar to previous one but tries to parse additional information for known contract types. This method is based on tonlib's function getAccountState. For detecting wallets we recommend to use getWalletInformation.
Parameters
address(string; query; required): an identifier of a target TON account.
Returns
Information about the address specified.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getExtendedAddressInformation?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getExtendedAddressInformation",
"params": {
"address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "fullAccountState",
"address": {
"@type": "accountAddress",
"account_address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"balance": "6088697",
"last_transaction_id": {
"@type": "internal.transactionId",
"lt": "50630341000001",
"hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw="
},
"block_id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 41748257,
"root_hash": "BtEIAxrUco9i3qeK0lb3FNnuupSQdwu/b35cn7eNqTg=",
"file_hash": "Ojn6XMPRb8BZ6gJ/ibpWF6V+e+wUh0jh+8UwV+UkIBc="
},
"sync_utime": 1730904823,
"account_state": {
"@type": "raw.accountState",
"code": "te6cckEBAQEAIwAIQgKPRS16Tf10BmtoI2UXclntBXNENb52tf1L1divK3w9aCBrv3Y=",
"data": "te6cckEBAQEARgAAhwCAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAsROplLUCShZxn2kTkyjrdZWWw4ol9ZAosUb+zcNiHf6+xcGRA==",
"frozen_hash": ""
},
"revision": 0,
"@extra": "1730904845.8151195:0:0.1685316976114063"
}
}
getWalletInformation
Retrieves wallet info.
This method parses contract state and currently supports more wallet types than getExtendedAddressInformation: simple wallet, standart wallet, v3 wallet, v4 wallet.
Parameters
address(string; query; required): an identifier of a target TON account.
Returns
Information about the address specified.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getWalletInformation?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getWalletInformation",
"params": {
"address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"wallet": false,
"balance": "6088697",
"account_state": "active",
"wallet_type": null,
"seqno": null,
"last_transaction_id": {
"@type": "internal.transactionId",
"lt": "50630341000001",
"hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw="
}
}
}
getTransactions
Retrieves transactions.
Retrieves transaction history of a given address.
Parameters
address(string; query; required): an identifier of a target TON account.limit(integer; query; default=10, max=100): maximum number of transactions in response.lt(integer; query): logical time of transaction to start with, must be sent withhash.hash(string; query): the hash of transaction to start with, in base64 or hex encoding , must be sent withlt.to_lt(integer; query): logical time of transaction to finish with (to get tx fromlttoto_lt).archival(boolean; query; default=false): by defaultgetTransactionrequest is processed by any available liteserver. Ifarchival=trueonly liteservers with full history are used.
Returns
The transaction history for a specific address.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getTransactions?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getTransactions",
"params": {
"address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": [
{
"@type": "raw.transaction",
"utime": 1730897178,
"data": "te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aakzhF8WbEGQR6TI4r5Y",
"transaction_id": {
"@type": "internal.transactionId",
"lt": "50630341000001",
"hash": "/PZphaovGJ1xCTklvEPzGszPvBaotdzWcon79et+Nvw="
},
"fee": "1640116",
"storage_fee": "5716",
"other_fee": "1634400",
"in_msg": {
"@type": "raw.message",
"source": "EQAAOIgLfMTTvAjkATrYCQrow4DFN10rYXX0XtWl0PvSX5uk",
"destination": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W",
"value": "57320468",
"fwd_fee": "526938",
"ihr_fee": "0",
"created_lt": "50630337000002",
"body_hash": "vt02QoQHP7hw48TBJm8i1YII+Zx8kL/QfNVj79Kmt7w=",
"msg_data": {
"@type": "msg.dataRaw",
"body": "te6cckEBAgEAZgABqA+KfqVUbeTv2XoE7jY5HJgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kAAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfCAwEAGgAAAAAxMDk1MTU4NjicCb0U",
"init_state": ""
},
"message": "D4p+pVRt5O/ZegTuNjkcmAHzNijAFciaXiVi8dGN1XrxElXQWLyLbRMfO9b9ZAfziQAADiIC3zE0\n7wI5AE62AkK6MOAxTddK2F19F7VpdD70l8ID\n"
},
"out_msgs": [
{
"@type": "raw.message",
"source": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W",
"destination": "EQCM7pu2eD2mJQU3hbyqOpnUSVUsWgWY2FnTXGVdU8uU4Ddb",
"value": "55686068",
"fwd_fee": "822940",
"ihr_fee": "0",
"created_lt": "50630341000002",
"body_hash": "Ycyf2S915TpjkcLaOH70Kse87Z1rZrF65nPLm/70Rms=",
"msg_data": {
"@type": "msg.dataRaw",
"body": "te6cckEBAgEAZgABpxeNRRlUbeTv2XoE7jY5HJgAAHEQFvmJp3gRyAJ1sBIV0YcBim66VsLr6L2rS6H3pL8AAA4iAt8xNO8COQBOtgJCujDgMU3XSthdfRe1aXQ+9JfEBwEAGgAAAAAxMDk1MTU4NjhoTgE0",
"init_state": "te6cckEBAwEAbgACATQBAghCAo9FLXpN/XQGa2gjZRdyWe0Fc0Q1vna1/UvV2K8rfD1oAIcAgB8zYowBXIml4lYvHRjdV68RJV0Fi8i20THzvW/WQH84kALETqZS1AkoWcZ9pE5Mo63WVlsOKJfWQKLFG/s3DYh3+vXib6g="
},
"message": "F41FGVRt5O/ZegTuNjkcmAAAcRAW+YmneBHIAnWwEhXRhwGKbrpWwuvovatLofekvwAADiIC3zE0\n7wI5AE62AkK6MOAxTddK2F19F7VpdD70l8QG\n"
}
]
}
]
}
getAddressBalance
Retrieves address balance.
Retrieves balance (in nanotons) of a given address.
Parameters
address(string; query; required): an identifier of a target TON account.
Returns
The balance of a specific address 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/getAddressBalance?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getAddressBalance",
"params": {
"address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": "6088697"
}
getAddressState
Retrieves address state.
Retrieves state of a given address. State can be either unitialized, active, or frozen.
Parameters
address(string; query; required): an identifier of a target TON account.
Returns
Checks whether an address is active, uninitialized, or frozen.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getAddressState?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getAddressState",
"params": {
"address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": "active"
}
packAddress
Packs address.
Convert an address from raw to human-readable format.
Parameters
address(string; query; required): an identifier of a target TON account in raw format. Example:0:83DFD552E63729B472FCBCC8C45EBCC6691702558B68EC7527E1BA403A0F31A8.
Returns
Converts TON addresses to a more readable and standardized output.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/packAddress?address=0%3A83DFD552E63729B472FCBCC8C45EBCC6691702558B68EC7527E1BA403A0F31A8
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "packAddress",
"params": {
"address": "0:83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"
}
unpackAddress
Unpacks address.
Converts an address from human-readable to raw format.
Parameters
address(string; query; required): an identifier of a target TON account in user-friendly form. Example:EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N.
Returns
Converts human-readable addresses into raw format.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/unpackAddress?address=EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "unpackAddress",
"params": {
"address": "EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": "0:83dfd552e63729b472fcbcc8c45ebcc6691702558b68ec7527e1ba403a0f31a8"
}
getTokenData
Retrieves token data.
Retrieves NFT or Jetton information.
Parameters
address(string; query; required): the address of NFT collection/item or Jetton master/wallet smart contract.
Returns
Data about a specific token 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/getTokenData?address=EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getTokenData",
"params": {
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"total_supply": 1229976002510000,
"mintable": true,
"admin_address": "EQBkQP48aUEDg5Y5RRc8SxFHm_C5tNcJDlh3e9pYHC-ZmG2M",
"jetton_content": {
"type": "onchain",
"data": {
"uri": "https://tether.to/usdt-ton.json",
"decimals": "6"
}
},
"jetton_wallet_code": "te6cckEBAQEAIwAIQgKPRS16Tf10BmtoI2UXclntBXNENb52tf1L1divK3w9aCBrv3Y=",
"contract_type": "jetton_master"
}
}
detectAddress
Detects address.
Retrieves all possible address forms.
Parameters
address(string; query; required): an identifier of a target TON account.
Returns
Detects the type and format of a TON address.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/detectAddress?address=EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "detectAddress",
"params": {
"address": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"raw_form": "0:f976e9c96a1d5446ae877dfbbb484a4248e7793e7bb3c62aa0a111ef91237eab",
"bounceable": {
"b64": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN+q19W",
"b64url": "EQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-q19W"
},
"non_bounceable": {
"b64": "UQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN+qwKT",
"b64url": "UQD5dunJah1URq6Hffu7SEpCSOd5PnuzxiqgoRHvkSN-qwKT"
},
"given_type": "friendly_bounceable",
"test_only": false
}
}
getMasterchainInfo
Retrieves masterchain info.
Retrieves up-to-date masterchain state.
Parameters
None.
Returns
Information about the current state of the TON masterchain.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getMasterchainInfo
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getMasterchainInfo",
"params": {},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "blocks.masterchainInfo",
"last": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 41808232,
"root_hash": "OARlTgr+YA5SqBL3SOxIFiTve/E397qeDIshLmZzwNA=",
"file_hash": "ragbYfalWXeldsyZZ2BSBJwqtOLsw6ifLrpyWhnVduo="
},
"state_root_hash": "p/eRavA1zOrMtonVIuhvQ22JhsbgtzUu6bUDUGoPVvg=",
"init": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "0",
"seqno": 0,
"root_hash": "F6OpKZKqvqeFp6CQmFomXNMfMj2EnaUSOXN+Mh+wVWk=",
"file_hash": "XplPz01CXAps5qeSWUtxcyBfdAo5zVb1N979KLSKD24="
},
"@extra": "1731069303.2264078:0:0.6208585424366947"
}
}
getMasterchainBlockSignatures
Retrieves masterchian block signatures.
Retrieves the signatures of a specific masterchain block on the TON blockchain.
Parameters
seqno(integer; query; required): the sequence number of the masterchain block for which to retrieve signatures.
Returns
Detects the type and format of a TON address.
Request example
- REST
- JSON-RPC
curl -X GET https://rpc.ankr.com/premium-http/ton_api_v2/YOUR_ANKR_API_KEY/getMasterchainBlockSignatures?seqno=39064865
curl --location 'https://rpc.ankr.com/ton_api_v2/YOUR_ANKR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "getMasterchainBlockSignatures",
"params": {
"seqno": "39064865"
},
"id": "1"
}'
Response example
{
"ok": true,
"result": {
"@type": "blocks.blockSignatures",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064865,
"root_hash": "AovDThkPXWEPiYOBVzYpQW9Mf/B1DXRVK2jNCEaMuUk=",
"file_hash": "vTGEDDjoVzWCR+Yz/DUAUSMNfIjl7LL/I0ynpAYz4rk="
},
"signatures": [
{
"@type": "blocks.signature",
"node_id_short": "/DM6Q8OqwsiL/lo0h6yryoGLXLBxW9dXXGLfduMkwSQ=",
"signature": "dQStdfk5/FrUiTvJ6uuSaHT8xq5IvIn5Oj9evkP5BExrhMhZ4yAF/S49eP9AmVBCu6k4DHZwlYkoErGrYMsLBw=="
},
{
"@type": "blocks.signature",
"node_id_short": "mwccnaYVl/CYI/QcZEas6hv01zM4BDR9FegiGvuRYYY=",
"signature": "Oo18FpSQB82eyeVJjUAnYPcHtvmI/uO17nWb6rnrp9yvAjJhHMrb386gqcH2eEwIVcveUR9smPOZzNMeEmXyCQ=="
}
],
"@extra": "1731069520.765146:0:0.3486811129074091"
}
}