Skip to content

Commit 56be695

Browse files
authored
feat(docs): describe off-chain calls and mention exit code 11 for getters (#3314)
1 parent 2f488e4 commit 56be695

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

dev-docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Docs
11+
12+
- Described off-chain calls and mention exit code 11 for getters: PR [#3314](https://github.com/tact-lang/tact/pull/3314)
13+
1014
## [1.6.13] - 2025-05-29
1115

1216
### Language features

docs/src/content/docs/book/exit-codes.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ contract DictPic {
374374

375375
### 11: "Unknown" error {#11}
376376

377-
Described in the [TVM][tvm] docs as "Unknown error, may be thrown by user programs," although most commonly used for problems with queuing a message send or problems with [get-methods](https://docs.ton.org/develop/smart-contracts/guidelines/get-methods).
377+
Described in the [TVM][tvm] docs as "Unknown error, may be thrown by user programs," although most commonly used for problems with queuing a message send or problems with [getters](/book/functions#get).
378+
379+
In particular, if you try to send an ill-formed message on-chain or to call a non-existent getter function off-chain, an exit code 11 will be thrown.
378380

379381
```tact
380382
try {

docs/src/content/docs/book/functions.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ contract AntiPositive() {
533533
}
534534
```
535535

536+
### Off-chain calls
537+
538+
You can call getter functions off-chain by using either a [proxy HTTP API](https://docs.ton.org/v3/guidelines/dapps/apis-sdks/ton-http-apis) or a [secure ADNL API](https://docs.ton.org/v3/guidelines/dapps/apis-sdks/ton-adnl-apis) for direct connections to TON nodes. For your convenience, there are many [SDKs for various general-purpose programming languages](https://docs.ton.org/v3/guidelines/dapps/apis-sdks/sdk). And to call getter functions locally, use the Tact-generated [contract wrapper class](/book/debug#wrappers-contract).
539+
540+
Notice that in those APIs and SDKs, getters are often referred to as _get methods_, as they are, in fact, callable methods of contracts that behave somewhat similarly to get methods in many object-oriented programming languages.
541+
542+
If the contract is already deployed to the testnet or the mainnet, some TON Blockchain explorers allow you to call get methods directly from their interface, providing their names and input stack arguments. As with other ways of calling getters, if you try to call a non-existent getter, an [exit code 11](/book/exit-codes#11) will be thrown: `"Unknown" error`.
543+
536544
## `init` — constructor function {#init}
537545

538546
<Badge text="Contract scope" variant="note" size="medium"/><p/>

0 commit comments

Comments
 (0)