runGetMethod - Ton

runGetMethod. Executes a specified GET method against the TON blockchain and returns the result, allowing users to retrieve information or data based on their request.

runGetMethod - ton [Value: 100CU]
Processes incoming JSON-RPC requests, facilitating communication between clients and the TON blockchain by executing the requested operations and returning the appropriate responses.
Use cases

Use cases

  • Run a specific method on a TON smart contract
  • Retrieve data from contract state
  • Test contract functions without executing a transaction
Constraints

Constraints

  • Requires a valid method and contract address
  • Only supports existing contract methods
  • Dependent on node synchronization
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
     --url ' https://ton.drpc.org/rest/runGetMethod' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-api-key: t-66a730ccccfd17001c479705-2f597d14ad7543f289a03418' \
     --data '{
         "address": "0:abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef",
         "method": "getBalance",
         "stack": [
             ["num", 3],
             ["cell", "te6cckEBAQEAAjz+9wAAMABBBIAgAAZL0AAdBGdZnYDAAUGdD59VAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAABAcAA=="],
             ["slice", "ABCD1234"]
         ]
     }'
Copy
Response
200
{
    "status": "success",
    "data": {
        "result": [
            "0x00000000000000000000000000000001"
        ]
    }
}
Copy

Request params

Parametersobject
object
addressstring
The contract address where the method will be executed.
methodstring
The name or identifier of the method to be executed on the contract.
stackarray
A nested array representing stack elements for the method call.

Response

200

Response params

object
statusstring
Indicates the success or failure status of the method execution.
dataobject
Contains the result data of the executed method.
resultarray
An array containing the result(s) returned by the executed method.