runGetMethod — TON JSON-RPC

Status: Available

Executes a read-only smart-contract getter using TON Center v2 JSON conventions.

POSThttps://triport.io/rpc/ton
Network
TON mainnet
Scope
ton:rpc
Auth
x-token: $TRIPORT_API_KEY
Rate limit
free+; ton_read_rpc_heavy: 15 / 20 / 100 / 250 RPS sustained · short burst 30 / 40 / 200 / 500 (free / basic / pro / business; default, unmeasured); Burst capacity

Endpoint and plans: TON RPC endpoint.

Liteserver call over ADNL: liteServer.runSmcMethod. See lite_api.tl (checked 2026-10-25).

runGetMethod executes a read-only getter against a TON smart contract. The facade accepts a raw or user-friendly address, a method name or numeric method ID, and the legacy TON Center v2 stack representation.

The facade serializes the stack into the BoC form required by the binary protocol, then returns the VM exit code and output stack. The schema can also include the evaluated block, gas used, and last transaction ID.

Use this compatibility-oriented method for ordinary contract getters. Use runSmcMethod when the caller must explicitly control the liteserver response mode. Neither method submits a message or mutates contract state.

Parameters

JSON-RPC params is a by-name object.

Params: object (by-name).

addressstringrequired
TON contract address in raw or user-friendly form.
methodstring or integerrequired
Getter name or signed 64-bit numeric method ID.
stackarrayrequired
Legacy stack entries supplied as two-item pairs.
seqnointegeroptional
Non-negative masterchain sequence number for a historical state read.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC protocol version.
idnumber or stringCorrelates the response with the request.
resultobjectSmart-contract getter result.
result.exit_codeintegerVM exit code returned by the liteserver.
result.stackarrayGetter output in the legacy stack representation.
result.block_idobjectOptional block at which execution was evaluated.
result.gas_usedintegerOptional gas-used value.
result.last_transaction_idobjectOptional last transaction logical time and hash.

The response is copied from the accepted live fixture. The example's exit_code is preserved exactly and is not rewritten into a success claim.

Errors

See TON errors for the shared envelope and retention handling.

CodeMeaningWhen it happens
-32602Invalid paramsAddress, method, stack, or historical sequence is missing or malformed.
beyond_retentionState unavailableContract state at the requested seqno is outside the selected server's window.
-32601Method not foundThe JSON-RPC method is outside the published read-only catalog.
401UnauthorizedThe API key is missing or invalid.
429Rate limitedThe ton_read_rpc_heavy budget is exceeded.

Examples

const params = {
  address: "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
  method: "seqno",
  stack: [],
};
const response = await fetch("https://triport.io/rpc/ton", {
  method: "POST",
  headers: { "x-token": process.env.TRIPORT_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ jsonrpc: "2.0", id: "getter", method: "runGetMethod", params }),
});
const { result } = await response.json();

Notes

  • Inspect exit_code and output stack; transport success does not determine getter semantics.

  • Historical execution is retention-sensitive. Pruned liteservers had a floor of 86 860 000; two nodes answered from genesis, while one measured server had a gap.

  • Named params and response matching by id apply to JSON-RPC batches.

  • sendBoc and all writes are absent. There is no REST gateway or WebSocket contract surface.

  • Related methods: runSmcMethod and getAddressInformation.

  • TON RPC endpoint and plans.