Run Get-Method
Run get method of smart contract. Stack supports only num, cell and slice types:
[
{
"type": "num",
"value": "0x12a"
},
{
"type": "cell",
"value": "te6..." // base64 encoded boc with cell
},
{
"type": "slice",
"value": "te6..." // base64 encoded boc with slice
}
]
POST
/
api
/
v3
/
runGetMethod
Run Get-Method
curl --request POST \
--url https://toncenter.com/api/v3/runGetMethod \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"method": "<string>",
"stack": [
{
"type": "<string>",
"value": "<unknown>"
}
]
}
'import requests
url = "https://toncenter.com/api/v3/runGetMethod"
payload = {
"address": "<string>",
"method": "<string>",
"stack": [
{
"type": "<string>",
"value": "<unknown>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address: '<string>',
method: '<string>',
stack: [{type: '<string>', value: '<unknown>'}]
})
};
fetch('https://toncenter.com/api/v3/runGetMethod', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://toncenter.com/api/v3/runGetMethod",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '<string>',
'method' => '<string>',
'stack' => [
[
'type' => '<string>',
'value' => '<unknown>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://toncenter.com/api/v3/runGetMethod"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"method\": \"<string>\",\n \"stack\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://toncenter.com/api/v3/runGetMethod")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"method\": \"<string>\",\n \"stack\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toncenter.com/api/v3/runGetMethod")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"<string>\",\n \"method\": \"<string>\",\n \"stack\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"address": "<string>",
"method": "<string>",
"stack": [
{
"type": "<string>",
"value": "<unknown>"
}
]
}{
"code": 123,
"error": "<string>"
}Was this page helpful?
Previous
Get Wallet InformationGet wallet smart contract information. The following wallets are supported: `v1r1`, `v1r2`, `v1r3`, `v2r1`, `v2r2`, `v3r1`, `v3r2`, `v4r1`, `v4r2`, `v5beta`, `v5r1`. In case the account is not a wallet error code 409 is returned.
Next
⌘I
Run Get-Method
curl --request POST \
--url https://toncenter.com/api/v3/runGetMethod \
--header 'Content-Type: application/json' \
--data '
{
"address": "<string>",
"method": "<string>",
"stack": [
{
"type": "<string>",
"value": "<unknown>"
}
]
}
'import requests
url = "https://toncenter.com/api/v3/runGetMethod"
payload = {
"address": "<string>",
"method": "<string>",
"stack": [
{
"type": "<string>",
"value": "<unknown>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address: '<string>',
method: '<string>',
stack: [{type: '<string>', value: '<unknown>'}]
})
};
fetch('https://toncenter.com/api/v3/runGetMethod', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://toncenter.com/api/v3/runGetMethod",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '<string>',
'method' => '<string>',
'stack' => [
[
'type' => '<string>',
'value' => '<unknown>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://toncenter.com/api/v3/runGetMethod"
payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"method\": \"<string>\",\n \"stack\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://toncenter.com/api/v3/runGetMethod")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"method\": \"<string>\",\n \"stack\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toncenter.com/api/v3/runGetMethod")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"<string>\",\n \"method\": \"<string>\",\n \"stack\": [\n {\n \"type\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"address": "<string>",
"method": "<string>",
"stack": [
{
"type": "<string>",
"value": "<unknown>"
}
]
}{
"code": 123,
"error": "<string>"
}