apiTON
HomeExplorerBlog
HomeExplorerBlog
Contact
  1. v2.Address
  • api:TON Documentation
  • v2.Nft
    • Username
      POST
    • Number
      POST
    • Domain
      POST
    • Gift
      POST
    • Item
      POST
    • Items
      POST
  • v2.Rate
    • Fiat rate
      POST
    • Crypto rate
      POST
    • Exchanges rate
      POST
    • Jetton prices
      POST
  • v2.Auth
    • Do
      POST
    • List
      POST
    • Import
      POST
    • Backup
      POST
    • Delete
      POST
    • New
      POST
  • v2.Wallet
    • Send TON
      POST
    • Send Jetton
      POST
    • Send Nft
      POST
  • v2.Address
    • Transactions
      POST
    • Details
      POST
    • Jettons
      POST
    • NFTs
      POST
    • Wallets
      POST
    • Collections
      POST
    • Run get-method
      POST
    • Address labels
      POST
  • v2.NftContract
    • Mint Nft Collection
    • Mint NFT
  • v2.JettonContract
    • Mint
    • Burn
    • Change owner
    • Close Mint
  • v2.Watch
    • Create watch
    • List watches
    • Delete watch
    • Poll events
    • Test watch
  • v2.SiteProxy
    • Site proxy offer
    • Check website and domain
    • Create site proxy order
    • Get site proxy order
    • Verify site proxy order
    • Stop site proxy order
    • List site proxy orders
  • Schemas
    • Schemas
      • Connect Error
      • google.protobuf.Any
      • NftDomainSite
      • ListValue
      • Message
      • NullValue
      • Struct
      • AddressGetMethod
      • FieldsEntry
      • DetailsResponse
      • AddressGetMethodArg
      • google.protobuf.Timestamp
      • DetailsRequest
      • AddressLabel
      • AddressLabelsRequest
      • google.protobuf.Value
      • AddressRunGetMethodRequest
      • AddressLabelsResponse
      • BlockID
      • AddressRunGetMethodResponse
      • BurnRequest
      • AddressStackEntry
      • BurnResponse
      • TransactionsResponse
      • ChangeAdminRequest
      • SiteProxyCheckRequest
      • ChangeAdminResponse
      • SiteProxyCheckResponse
      • CloseMintRequest
      • SiteProxyCreateRequest
      • CloseMintResponse
      • SiteProxyCreateResponse
      • DetailsAddress
      • SiteProxyGetRequest
      • DetailsRequest
      • SiteProxyGetResponse
      • DetailsResponse
      • SiteProxyListRequest
      • DomainRequest
      • SiteProxyListResponse
      • DomainResponse
      • SiteProxyOfferRequest
      • ItemRequest
      • SiteProxyOfferResponse
      • ItemResponse
      • SiteProxyOrder
      • Jetton
      • SiteProxyOwner
      • JettonDetails
      • SiteProxyPay
      • JettonsRequest
      • SiteProxyPayMessage
      • JettonsResponse
      • SiteProxyProblem
      • Message
      • SiteProxyRecord
      • MintCollectionRequest
      • SiteProxyRouteLimits
      • MintCollectionResponse
      • SiteProxyStopRequest
      • MintNftRequest
      • SiteProxyStopResponse
      • MintNftResponse
      • SiteProxyUsage
      • MintRequest
      • SiteProxyVerifyRequest
      • MintResponse
      • SiteProxyVerifyResponse
      • NftItem
      • SiteProxyWebProof
      • NftsRequest
      • NftsResponse
      • NumberRequest
      • NumberResponse
      • RateCryptoRequest
      • RateCryptoResponse
      • ResultEntry
      • RateExchangesRequest
      • RateExchangesResponse
      • ResultEntry
      • RateFiatRequest
      • RateFiatResponse
      • ResultEntry
      • SendJettonRequest
      • SendJettonResponse
      • SendNftRequest
      • SendNftResponse
      • SendRequest
      • SendResponse
      • TeleAuction
      • TeleAuctionConfig
      • TeleAuctionLastBid
      • TeleSale
      • Transaction
      • TransactionsRequest
      • TransactionsResponse
      • UsernameRequest
      • UsernameResponse
      • Version
      • WalletAuth
      • WalletAuth4
      • WalletDetails
      • WalletNewRequest
      • WalletNewResponse
      • WalletsRequest
      • WalletsResponse
      • AddressCollection
      • AddressCollectionsRequest
      • AddressCollectionsResponse
      • AuthBackupRequest
      • AuthDeleteRequest
      • AuthDeleteResponse
      • AuthDoRequest
      • AuthImportRequest
      • AuthJwtResponse
      • AuthListRequest
      • AuthListResponse
      • AuthNewRequest
      • BlockID
      • BurnRequest
      • BurnResponse
      • ChangeAdminRequest
      • ChangeAdminResponse
      • CloseMintRequest
      • CloseMintResponse
      • DetailsAddress
      • DomainRequest
      • DomainResponse
      • GiftAttribute
      • GiftRequest
      • GiftResponse
      • ItemRequest
      • ItemResponse
      • Jetton
      • JettonDetails
      • JettonsRequest
      • JettonsResponse
      • MintCollectionRequest
      • MintCollectionResponse
      • MintNftRequest
      • MintNftResponse
      • MintRequest
      • MintResponse
      • NftItem
      • NftItemsRequest
      • NftsRequest
      • NftsResponse
      • NumberRequest
      • NumberResponse
      • RateCryptoRequest
      • RateCryptoResponse
      • RateExchangesRequest
      • RateExchangesResponse
      • RateFiatRequest
      • RateFiatResponse
      • RateJettonPricesRequest
      • RateJettonPricesResponse
      • SendJettonRequest
      • SendJettonResponse
      • SendNftRequest
      • SendNftResponse
      • SendRequest
      • SendResponse
      • TeleAuction
      • TeleAuctionConfig
      • TeleAuctionLastBid
      • TeleSale
      • Transaction
      • TransactionsRequest
      • UsernameRequest
      • UsernameResponse
      • Version
      • WalletAuth
      • WalletDetails
      • WalletInfo
      • WalletsRequest
      • WalletsResponse
    • WatchCreateRequest
    • WatchCreateResponse
    • WatchDeleteRequest
    • WatchDeleteResponse
    • WatchEvent
    • WatchLimits
    • WatchListRequest
    • WatchListResponse
    • WatchPollRequest
    • WatchPollResponse
    • WatchSubscription
    • WatchTestRequest
    • WatchTestResponse
    • WatchTx
    • WatchWebhook
  1. v2.Address

Run get-method

POST
/v2.Address/RunGetMethod
Runs one get-method of a smart contract on a TON liteserver — by name or numeric id, with typed arguments — and returns the TVM exit code and the result stack. Any method id may be called: the liteserver bounds every call at 300 000 gas, and nothing persists (a get-method runs on a copy of the state).
Request. address — the contract: raw (0: + 64 hex digits), EQ… or UQ…, mainnet, workchain 0 or −1; not a .ton name (resolve one with Nft/Domain first). method — the name as declared in the contract (seqno, get_wallet_address, getPoolStateAndConfiguration), or method_id — the numeric id (−262144…262143; Details with get_methods: true lists the ids a code declares): exactly one of the two. stack — up to 16 arguments {type, value} in the order of the method's signature, the first parameter first (apiton puts the last one on top of the TVM stack, as toncenter's API does).
typevaluePassed as
intsigned decimal ("-1", "1000000000") or hex "0x…" / "-0x…", 257-bit rangean integer
addressany address form (as address above)a slice holding the standard address — what get_wallet_address(owner) takes
cella BOC, standard or URL-safe base64, padded or not; one root, ≤ 256 cells, no exotic cellsa cell
slicea BOC as for cella slice over the whole root cell
textUTF-8, ≤ 127 bytesa slice of those bytes (dnsresolve's domain)
null""null
A value is at most 8192 characters, and a tuple cannot be passed as an argument. The arguments serialized must stay under 16 KiB, and the whole request under 64 KiB.
Response.
FieldMeaning
addressthe contract, UQ…
method_idthe id that ran (computed from method when a name was sent)
exit_codeTVM exit code: 0 / 1 = success (0 is absent from the JSON). A non-zero code is an answer (HTTP 200), not an error: e.g. 11 no such method (FunC contracts), 2 stack underflow (an argument is missing), 7 type check (an argument of the wrong type), −14 out of gas (the stack then holds the gas used, about 300 000)
stackthe result stack, first returned value first; on a non-zero exit code what the VM left (usually the exception's argument). Each entry: type — int · cell · slice · builder · null · nan · tuple; value — int: decimal (up to 257 bits), cell / builder: the cell as a BOC (standard base64), slice: its remaining bits and references as a one-root BOC, "" for null, nan and tuple; items — a tuple's values in order; address — slice only: the UQ… form when the slice is exactly one standard address
stack_bocthe whole result stack as TL-B VmStack, a BOC in standard base64, serialized again by apiton from the liteserver's answer. Complete even when stack is truncated
truncatedstack was shortened: more than 256 values (tuple items counted) or tuples nested deeper than 8; stack_boc has everything
mc_seqnothe masterchain block the method ran on, about 10 s behind the chain (up to 45 s when nodes lag); two consecutive calls are not guaranteed to be in chain order — compare mc_seqno
Identical calls (the same contract in any address form, the same method by name or id, the same arguments) within 15 s share one answer, non-zero exit codes and not_found included; errors are never kept. Compared with toncenter's runGetMethod: no gas_used (the liteserver protocol does not return it), no tuple arguments, and a continuation in the result is an error.
Limits. One request like every RPC, plus two limits of its own, the same on every plan: a share of 2 calls/s per key or IP (burst 4, cache hits included), and apiton's budget of chain calls for the whole server — a call that cannot get its turn within a second gets unavailable: get-method capacity is busy, retry shortly (apiton's liteserver capacity, not your quota: retry after a moment).
Errors (Connect JSON envelope {"code":…,"message":…})
CodeWhen
invalid_argument (400)both or neither of method / method_id; a bad name; an address that does not parse, is a testnet form or a .ton name; a bad argument, named by its position (argument 2: not a BOC, argument 1: integer out of the 257-bit range); arguments too large
failed_precondition (400)request rules (more than 16 arguments, a value over 8192 characters, an unknown type, method_id out of range); result stack too large (over 256 KiB); a continuation in the result stack; check request parameters for any other final liteserver error
not_found (404)no contract at this address (not deployed, uninitialized or frozen)
resource_exhausted (429)the plan's limits, or the get-method share of 2/s per key or IP
unavailable (503)TON liteservers are rate-limiting / out of sync / unavailable, retry shortly; get-method capacity is busy, retry shortly; get-method calls are disabled
deadline_exceeded (504)get-method call timed out (10 s)

Request

Body Params application/json

Example
{
    "address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
    "method": "get_wallet_address",
    "stack": [
        {
            "type": "address",
            "value": "UQCdqXGvONLwOr3zCNX5FjapflorB6ZsOdcdfLrjsDLt3AF4"
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://app.apiton.org/v2.Address/RunGetMethod' \
--header 'Content-Type: application/json' \
--data '{
    "address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
    "method": "get_wallet_address",
    "stack": [
        {
            "type": "address",
            "value": "UQCdqXGvONLwOr3zCNX5FjapflorB6ZsOdcdfLrjsDLt3AF4"
        }
    ]
}'

Responses

🟢200OK
application/json
Bodyapplication/json

Examples
{
    "address": "UQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_p0p",
    "method_id": 103289,
    "stack": [
        {
            "type": "slice",
            "value": "te6ccgEBAQEAJAAAQ4AYgOWvYJVpigmaRHv7yFkAb41TJOWmxJXYWX/lzlYgW7A=",
            "address": "UQDEBy17BKtMUEzSI9_eQsgDfGqZJy02JK7Cy_8ucrEC3SVv"
        }
    ],
    "stack_boc": "te6ccgEBAwEAMgACDwAAAQQAELAgAQIAAABDgBiA5a9glWmKCZpEe/vIWQBvjVMk5abEldhZf+XOViBbsA==",
    "mc_seqno": 103602295
}
🔴500Server Error
Previous
Collections
Next
Address labels
Built with