> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# runGetMethod | TON v2

> The runGetMethod method executes a get method on a smart contract in the TON blockchain. Available on TON v2 via Chainstack JSON-RPC nodes.

The `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.

> [!NOTE]
>
> There's no difference between a full node an archive node in data availability or pricing. All data is always available and all node requests are consumed as 1 request unit.

## Request Body

* `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](https://docs.chainstack.com/reference/ton-getmasterchaininfo-v2.md).

## JSON-RPC

```shell shell theme={"system"}
curl -X POST \
  'https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/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
    }
  }'
```

## Response

* `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.

## Use case

A possible use case for the `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:

1. Fetch the current state or data from a smart contract.
2. Implement read operations for decentralized applications (dApps).
3. Query token balances, metadata, or other contract-specific information.
4. Debug or test smart contract functionality without modifying the blockchain state.

Here's another with a `get_jetton_data` method:

```shell shell theme={"system"}
curl -X 'POST' \
  'https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/runGetMethod' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
  "method": "get_jetton_data",
  "stack": []}'
```


## OpenAPI

````yaml openapi/ton_node_api/v2/runGetMethod.json POST /runGetMethod
openapi: 3.0.0
info:
  title: runGetMethod example
  version: 1.0.0
  description: >-
    This is an API example for runGetMethod, a method to execute a get method on
    a smart contract in the TON blockchain.
servers:
  - url: >-
      https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2
security: []
paths:
  /runGetMethod:
    post:
      tags:
        - TON Operations
      summary: runGetMethod
      operationId: runGetMethod
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: The address of the smart contract
                  default: EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
                method:
                  type: string
                  description: The name of the get method to execute
                  default: get_wallet_address
                stack:
                  type: array
                  description: The stack of parameters for the method
                  items:
                    type: array
                    items:
                      type: string
                  default:
                    - - tvm.Slice
                      - >-
                        te6cckEBAQEAJAAAQ4AbUzrTQYTUv8s/I9ds2TSZgRjyrgl2S2LKcZMEFcxj6PARy3rF
      responses:
        '200':
          description: The result of executing the get method
          content:
            application/json:
              schema:
                type: object
                properties:
                  exit_code:
                    type: integer
                    description: The exit code of the method execution
                  stack:
                    type: array
                    description: The resulting stack after method execution
                    items:
                      type: array
                      items:
                        type: string
                  gas_used:
                    type: integer
                    description: The amount of gas used for the execution

````