curl --request POST \
--url https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/runGetMethod \
--header 'Content-Type: application/json' \
--data '{
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"method": "get_wallet_address",
"stack": [
[
"tvm.Slice",
"te6cckEBAQEAJAAAQ4AbUzrTQYTUv8s/I9ds2TSZgRjyrgl2S2LKcZMEFcxj6PARy3rF"
]
]
}'
{
"exit_code": 123,
"stack": [
[
"<string>"
]
],
"gas_used": 123
}
curl --request POST \
--url https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/runGetMethod \
--header 'Content-Type: application/json' \
--data '{
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"method": "get_wallet_address",
"stack": [
[
"tvm.Slice",
"te6cckEBAQEAJAAAQ4AbUzrTQYTUv8s/I9ds2TSZgRjyrgl2S2LKcZMEFcxj6PARy3rF"
]
]
}'
{
"exit_code": 123,
"stack": [
[
"<string>"
]
],
"gas_used": 123
}
runGetMethod
method executes a get method on a smart contract in the TON blockchain. This method allows you to retrieve data from smart contracts without modifying their state.
address
(string, required) — The address of the smart contract to interact with. Example: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
.method
(string, required) — The name of the get method to execute. Example: get_wallet_address
.stack
(array, optional) — An array of arguments to pass to the method, if any. Default is an empty array.seqno
(int, optional) — the Masterchain seqno. You can get the Masterchain seqno with getMasterchainInfo | TON v2.curl -X POST \
'https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/jsonRPC' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "runGetMethod",
"params": {
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"method": "get_wallet_address",
"stack": [
[
"tvm.Slice",
"te6cckEBAQEAJAAAQ4AbUzrTQYTUv8s/I9ds2TSZgRjyrgl2S2LKcZMEFcxj6PARy3rF"
]
],
"seqno": 45792554
}
}'
exit_code
(integer) — The exit code of the method execution. A value of 0 typically indicates successful execution.
stack
(array of objects) — The resulting stack after method execution. Each object in the array represents a stack item and contains:
type
(string) — The type of the stack item.value
(string) — The value of the stack item.gas_used
(integer) — The amount of gas used for the execution.
runGetMethod
method in TON is for applications or services that need to interact with smart contracts to retrieve data. This method can be used to:
get_jetton_data
method:
curl -X 'POST' \
'https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/runGetMethod' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"method": "get_jetton_data",
"stack": []}'
The result of executing the get method
The response is of type object
.
Was this page helpful?