TriportRPC

runSmcMethod

TON / https://triport.io/rpc/ton

Minimum tier: Pro

TON method guide

Last updated:

runSmcMethod exposes liteServer.runSmcMethod with an optional response-field mode. Address, method, stack, and historical sequence retain the TON Center v2 JSON conventions and are converted into TL and BoC values by the facade.

The result requires a VM exit_code and output stack. Depending on the selected response mode and liteserver response, it can also include the block ID, gas used, and last transaction ID.

Use this method when explicit mode control is necessary. For the ordinary compatibility path without an exposed mode bitmask, use runGetMethod. Both methods are read-only; no message is sent to the chain.

Parameters

runSmcMethod parameters
NameTypeRequiredDescription
addressTonAddressYes
methodobjectYes
stackLegacyStackYes
seqnoSeqnoNo
modeintegerNo

Returns

runSmcMethod return value
FieldType
resultRunMethodResult

Examples

curl https://triport.io/rpc/ton \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"runSmcMethod","params":["<address>","<method>","<stack>","<seqno>","<mode>"]}'
const res = await fetch("https://triport.io/rpc/ton", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "id": 1,
  "method": "runSmcMethod",
  "params": [
    "<address>",
    "<method>",
    "<stack>",
    "<seqno>",
    "<mode>"
  ]
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/rpc/ton",
    headers={"Authorization": "Bearer <api-key>"},
    json={"jsonrpc":"2.0","id":1,"method":"runSmcMethod","params":["<address>","<method>","<stack>","<seqno>","<mode>"]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: TON.
  3. Clusters: mainnet.
  4. Credit cost: 5 per call.

FAQ

What does runSmcMethod do?
Executes a read-only liteserver smart-contract method with an explicit mode.
How many credits does runSmcMethod cost?
runSmcMethod costs 5 credit(s) per call on Triport by default.
Is runSmcMethod available over WebSocket?
runSmcMethod is an HTTP JSON-RPC method.