curl --request POST \
--url https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v3/runGetMethod \
--header 'Content-Type: application/json' \
--data '{
"address": "EQBSzBN6cnxDwDjn_IQXqgU8OJXUMcol9pxyL-yLkpKzYs9U",
"method": "seqno",
"stack": [
{
"type": "num",
"value": "0x12a"
}
]
}'
{
"exitCode": 123,
"gasUsed": 123,
"stack": [
{
"type": "<string>",
"value": "<string>"
}
]
}
Executes a get method on a smart contract in the TON blockchain
curl --request POST \
--url https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v3/runGetMethod \
--header 'Content-Type: application/json' \
--data '{
"address": "EQBSzBN6cnxDwDjn_IQXqgU8OJXUMcol9pxyL-yLkpKzYs9U",
"method": "seqno",
"stack": [
{
"type": "num",
"value": "0x12a"
}
]
}'
{
"exitCode": 123,
"gasUsed": 123,
"stack": [
{
"type": "<string>",
"value": "<string>"
}
]
}
runGetMethod
endpoint allows you to execute a get method on a smart contract in the TON blockchain. This is useful for retrieving data from smart contracts without modifying their state.
address
(string, required) — The address of the smart contract to interact with.method
(string, required) — The name of the get method to execute on the smart contract.stack
(array, optional) — An array of stack items to pass as parameters to the method. Each item is an object with:
type
(string) — The type of the stack item (e.g., “num”, “cell”, “slice”).value
(string) — The value of the stack item.exitCode
(integer) — The exit code of the method execution. 0 typically indicates success.gasUsed
(integer) — The amount of gas used for the execution.stack
(array) — The resulting stack after method execution. Each item is an object with:
type
(string) — The type of the stack item.value
(string) — The value of the stack item.runGetMethod
endpoint is crucial for interacting with smart contracts on the TON blockchain:
runGetMethod
endpoint:Successful response
The response is of type object
.
Was this page helpful?