runSmcMethod
TON / https://triport.io/rpc/ton
Minimum tier: Pro
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
| Name | Type | Required | Description |
|---|---|---|---|
| address | TonAddress | Yes | |
| method | object | Yes | |
| stack | LegacyStack | Yes | |
| seqno | Seqno | No | |
| mode | integer | No |
Returns
| Field | Type |
|---|---|
| result | RunMethodResult |
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
- Transport: HTTP (JSON-RPC).
- Chain: TON.
- Clusters: mainnet.
- 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.