Overview
Every object returned by API v2 includes an@type field that identifies the object’s structure. These values originate from two sources:
- TonLib types (e.g.
raw.fullAccountState,tvm.cell) come from the TonLib TL schema, the type definition language used by the C++ library powering this API. - Extended types (prefixed with
ext.) are added by TON Center to provide parsed, developer-friendly representations not available in the base TonLib schema.
@type field acts as a discriminator: when a response can return different object shapes, the @type value indicates which fields to expect. This pattern is useful for type-safe deserialization in statically typed languages.
TL primitive types
The TL schema maps to JSON types as follows:| TL type | JSON type | Notes |
|---|---|---|
int32 | number | 32-bit signed integer |
int53 | number | 53-bit signed integer (safe for JavaScript Number) |
int64 | string | 64-bit signed integer as decimal string (exceeds JS safe range) |
int256 | string | 256-bit integer as decimal or hex string |
bytes | string | Binary data, base64-encoded |
string | string | UTF-8 text |
Bool | boolean | true or false |
vector<T> | array | Ordered list of elements of type T |
Account state
When querying account information, theaccount_state field uses @type to indicate which kind of contract is deployed. The TL schema defines these as variants of AccountState:
@type value | API schema | TL fields |
|---|---|---|
raw.accountState | AccountStateRaw | code, data, frozen_hash |
wallet.v3.accountState | AccountStateWalletV3 | wallet_id, seqno |
wallet.v4.accountState | AccountStateWalletV4 | wallet_id, seqno |
wallet.highload.v1.accountState | AccountStateWalletHighloadV1 | wallet_id, seqno |
wallet.highload.v2.accountState | AccountStateWalletHighloadV2 | wallet_id |
dns.accountState | AccountStateDns | wallet_id |
rwallet.accountState | AccountStateRWallet | wallet_id, seqno, unlocked_balance, config |
pchan.accountState | AccountStatePChan | config, state, description |
uninited.accountState | AccountStateUninited | frozen_hash |
Account information
Full account queries return one of these top-level types:@type value | API schema | Description |
|---|---|---|
raw.fullAccountState | AddressInformation | Raw state with balance, code, data, and frozen hash |
fullAccountState | ExtendedAddressInformation | Parsed state with identified contract type |
ext.accounts.walletInformation | WalletInformation | Wallet-specific: type, seqno, wallet_id (TON Center extension) |
Address types
@type value | API schema | TL fields |
|---|---|---|
accountAddress | AccountAddress | account_address |
addr_std | SmcAddr | workchain, id |
Block identifiers
@type value | API schema | TL fields |
|---|---|---|
ton.blockIdExt | TonBlockIdExt | workchain, shard, seqno, root_hash, file_hash |
Block data
These types are returned by block query endpoints. The TL definitions:@type value | API schema | Description |
|---|---|---|
blocks.masterchainInfo | MasterchainInfo | Latest and genesis block references |
blocks.shards | Shards | Active shard block identifiers |
blocks.header | BlockHeader | Block metadata, merge/split flags, timing |
blocks.transactions | BlockTransactions | Short transaction IDs within a block |
blocks.transactionsExt | BlockTransactionsExt | Full transactions within a block |
blocks.shortTxId | ShortTxId | Compact reference: account, lt, hash |
blocks.blockSignatures | MasterchainBlockSignatures | Validator signatures for a block |
blocks.signature | BlockSignature | Single validator signature |
blocks.shardBlockProof | ShardBlockProof | Merkle proof chain to masterchain |
blocks.shardBlockLink | ShardBlockLink | Single link in a proof chain |
blocks.blockLinkBack | BlockLinkBack | Backward proof link between blocks |
blocks.outMsgQueueSize | OutMsgQueueSize | Per-shard queue size |
blocks.outMsgQueueSizes | OutMsgQueueSizes | Queue sizes across all shards |
ext.blocks.consensusBlock | ConsensusBlock | Latest finalized block (TON Center extension) |
Transactions and messages
@type value | API schema | Description |
|---|---|---|
raw.transaction | TransactionStd | Raw transaction with messages and fees |
raw.transactions | TransactionsStd | Paginated transaction list with cursor |
raw.message | MessageStd | Raw message with sender, recipient, value |
raw.extMessageInfo | ExtMessageInfo | External message hash after broadcast |
internal.transactionId | InternalTransactionId | Transaction reference: lt + hash |
ext.transaction | Transaction | Transaction with decoded comments (TON Center extension) |
ext.message | Message | Message with decoded text comments (TON Center extension) |
Message body types
Themsg_data field on messages uses @type to indicate how to interpret the body:
@type value | API schema | Description |
|---|---|---|
msg.dataRaw | MsgDataRaw | Raw binary body + optional init state |
msg.dataText | MsgDataText | Plain text comment (base64-encoded UTF-8) |
msg.dataEncryptedText | MsgDataEncryptedText | Encrypted message body |
msg.dataDecryptedText | MsgDataDecryptedText | Decrypted message body |
TVM types
Used as input and output for smart contract get methods (runGetMethod, runGetMethodStd).
Stack entries
Each stack entry wraps a value with a type tag:@type value | API schema | Value field |
|---|---|---|
tvm.stackEntryNumber | TvmStackEntryNumber | number (decimal string via tvm.numberDecimal) |
tvm.stackEntryCell | TvmStackEntryCell | cell (base64 BoC via tvm.cell) |
tvm.stackEntrySlice | TvmStackEntrySlice | slice (base64 BoC via tvm.slice) |
tvm.stackEntryTuple | TvmStackEntryTuple | tuple (nested stack entries) |
tvm.stackEntryList | TvmStackEntryList | list (nested stack entries) |
tvm.stackEntryUnsupported | TvmStackEntryUnsupported | No value (type not representable) |
Value types
@type value | API schema | TL fields |
|---|---|---|
tvm.cell | TvmCell | bytes (base64 BoC) |
tvm.slice | TvmSlice | bytes (base64 BoC) |
tvm.numberDecimal | TvmNumberDecimal | number (decimal string) |
tvm.tuple | TvmTuple | elements (stack entries) |
tvm.list | TvmList | elements (stack entries) |
Get method result
@type value | API schema | TL fields |
|---|---|---|
smc.runResult | RunGetMethodResult | gas_used, stack, exit_code |
smc.runResult | RunGetMethodStdResult | Same fields, typed stack entries |
Fees
@type value | API schema | TL fields |
|---|---|---|
fees | Fees | in_fwd_fee, storage_fee, gas_fee, fwd_fee |
query.fees | QueryFees | source_fees, destination_fees |
Configuration
@type value | API schema | TL fields |
|---|---|---|
configInfo | ConfigInfo | config (TVM cell with parameters) |
Libraries
@type value | API schema | TL fields |
|---|---|---|
smc.libraryEntry | LibraryEntry | hash, data |
smc.libraryResult | LibraryResult | result (entries) |
Token types (TON Center extensions)
These types are not in the base TonLib TL schema. They are added by TON Center to provide parsed Jetton and NFT data via thegetTokenData endpoint.
@type value | API schema | Description |
|---|---|---|
ext.tokens.jettonMasterData | JettonMasterData | Jetton master: total supply, admin, metadata |
ext.tokens.jettonWalletData | JettonWalletData | Jetton wallet: balance, owner, master reference |
ext.tokens.nftCollectionData | NftCollectionData | NFT collection: item count, owner, metadata |
ext.tokens.nftItemData | NftItemData | NFT item: index, owner, collection reference |
DNS record types
DNS entries use@type to indicate the record type stored at a domain:
@type value | API schema | TL fields |
|---|---|---|
dns_next_resolver | DnsRecordNextResolver | resolver (address) |
dns_smc_address | DnsRecordSmcAddress | smc_address (address) |
dns_adnl_address | DnsRecordAdnlAddress | adnl_address |
dns_storage_address | DnsRecordStorageAddress | bag_id (int256) |
Payment channel types
@type value | API schema | Description |
|---|---|---|
pchan.config | PChanConfig | Channel parties, timeouts, ID |
pchan.stateInit | PChanStateInit | Initialization phase (signing) |
pchan.stateClose | PChanStateClose | Closing phase (signing) |
pchan.statePayout | PChanStatePayout | Payout phase (final balances) |
Restricted wallet types
@type value | API schema | TL fields |
|---|---|---|
rwallet.config | RWalletConfig | start_at, limits |
rwallet.limit | RWalletLimit | seconds, value |
Utility types
TON Center extensions.@type value | API schema | Description |
|---|---|---|
ext.utils.detectedAddress | DetectAddress | Address in all encoding formats |
ext.utils.detectedAddressVariant | DetectAddressBase64Variant | Base64 and URL-safe base64 pair |
ext.utils.detectedHash | DetectHash | Hash in hex, base64, URL-safe |
extraCurrency | ExtraCurrencyBalance | Non-TON currency ID and balance |
ok | ResultOk | Success with no return data |
Reference
For background on the TL-B format used across the TON ecosystem, see the TL-B overview. Types prefixed withext. are TON Center extensions not present in the upstream TL schema.