# TON

### /getbalance

Get the balance or number of the given token in the requested public address.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getbalance`

#### Query Parameters

| Name                                      | Type   | Description                                                                          |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                       | String | Remote procedural call URL                                                           |
| chainId<mark style="color:red;">\*</mark> | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| address<mark style="color:red;">\*</mark> | String | The public address to get the balance of.                                            |
| tokenAddress                              | String | The address of token to get the balance of.                                          |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/chain/getbalance/?address=UQAxmMo2wxu_yQTySoV7u7-Con2csmcBloW0CrflBCQEr-7R&chainId=1100
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "balance": "496234820"
    }
}
```

{% endtab %}
{% endtabs %}

### /getblock

Get details of a block.

<mark style="color:blue;">`GET`</mark> `https://historicallp.api.expand.network/chain/getblock`

#### Query Parameters

| Name                                          | Type   | Description                                                                          |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                           | String | Remote procedural call URL.                                                          |
| chainId<mark style="color:red;">\*</mark>     | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                                   | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| blockNumber<mark style="color:red;">\*</mark> | String | The block(sequence) number.                                                          |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://historicallp.api.expand.network/chain/getblock?blockNumber=37530079&chainId=1100
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": {
    "shards": [
      {
        "workchain": -1,
        "seqno": 37530079,
        "shard": "-9223372036854775808",
        "rootHash": "lzfewtlwNxzWAM2zwXXDDTwdQLopMh+gbVTTSWn84+M=",
        "fileHash": "gbj4ltNQ/I+uzMKdda6HjAzEEV338aNN6OSRSyN+TNo=",
        "transactions": [
          {
            "account": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF",
            "lt": "46117591000001",
            "hex": "cc351b1a06dbb2786081e46c20ae374dea3e3d8069020a5caaef085adcfb40b2",
            "transactionHash": "zDUbGgbbsnhggeRsIK43Teo+PYBpAgpcqu8IWtz7QLI="
          },
          {
            "account": "Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF",
            "lt": "46117591000002",
            "hex": "5044b5c128f592b20a74d2d35e90de7ba12eadc13333bb5d51d3a2265494ce36",
            "transactionHash": "UES1wSj1krIKdNLTXpDee6EurcEzM7tdUdOiJlSUzjY="
          },
          {
            "account": "Ef9VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVbxn",
            "lt": "46117591000003",
            "hex": "a434d5bb171a630afa7e1c6556ffb3d5f2325b4ea17d2dd46c9aca77ddac036b",
            "transactionHash": "pDTVuxcaYwr6fhxlVv+z1fIyW06hfS3UbJrKd92sA2s="
          }
        ]
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### /getgasprice

Get the current gas price from the network.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getgasprice`

#### Query Parameters

| Name                                      | Type   | Description                                                                          |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                       | String | Remote procedural call URL.                                                          |
| chainId<mark style="color:red;">\*</mark> | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/chain/getgasprice?chainId=1100
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "gasPrice": "3308000"
    }
}
```

{% endtab %}
{% endtabs %}

### /gettransaction

Get details of a transaction.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/gettransaction`

#### Query Parameters

| Name                                              | Type   | Description                                                                          |
| ------------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                               | String | Remote procedural call URL.                                                          |
| chainId<mark style="color:red;">\*</mark>         | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                                       | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| transactionHash<mark style="color:red;">\*</mark> | String | The transaction(digest) hash.                                                        |
| address<mark style="color:red;">\*</mark>         | String | Sender's public address.                                                             |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/chain/gettransaction?chainId=1100&transactionHash=whPbUe52HoCgrmkd9n1DpEmPC00rt5IqMb0NxdsjJec&address=UQAxmMo2wxu_yQTySoV7u7-Con2csmcBloW0CrflBCQEr-7R
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "@type": "raw.transaction",
        "address": {
            "@type": "accountAddress",
            "account_address": "EQAxmMo2wxu_yQTySoV7u7-Con2csmcBloW0CrflBCQEr7MU"
        },
        "utime": 1707378056,
        "data": "te6cckECBwEAAaQAA7VzGYyjbDG7/JBPJKhXu7v4KifZyyZwGWhbQKt+UEJASvAAAoc6sapEOtKW9AAdZAcbY46vM/ezW4lAeTLXpAsgL2TzT+x1uW2wAAKHIDIuADZcSFiAABRh5/1oAQIDAQGgBACCcmg71vLS+ZR3K7oq8Ku7shAhrC5E1x4q4buP3YBxyUZiyJ9ah8PG0skx0/zqz2Am0tDouaGuy3fgOaxRurkruAsCFwyINMjD0JAYYePjEQUGANVIAPFLwHy4w4LZWhR+6u+SLQ0K7iJqOaEEMnHS76yXRXljAAxmMo2wxu/yQTySoV7u7+Con2csmcBloW0CrflBCQErzD0JAAYUWGAAAFDnVjVIhMuJCxAAAAAANDSQMzk3tpA0Mrawtzo0QACcQHvoD6AAAAAAAAAAAB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFvAAAAAAAAAAAAAAAABLUUtpEnlC4z33SeGHxRhIq/htUa7i3D8ghbwxhQTn44E/NZboQ==",
        "transaction_id": {
            "@type": "internal.transactionId",
            "lt": "44477257000003",
            "hash": "HgLzLs1zrDiXTIEyLZG9LiKDoMVI/tfDZkn/8C0fA6A="
        },
        "fee": "999403",
        "storage_fee": "8403",
        "other_fee": "991000",
        "in_msg": {
            "@type": "raw.message",
            "source": "EQB4peA-XGHBbK0KP3V3yRaGhXcRNRzQghk46XfWS6K8sZn4",
            "destination": "EQAxmMo2wxu_yQTySoV7u7-Con2csmcBloW0CrflBCQEr7MU",
            "value": "1000000",
            "fwd_fee": "666672",
            "ihr_fee": "0",
            "created_lt": "44477257000002",
            "body_hash": "ZZQlYDzGKugPE21+I1c4bkJeaSpQoXGEHT4g6dEyJTE=",
            "msg_data": {
                "@type": "msg.dataText",
                "text": "aGkgZnJvbSBoZW1hbnRo"
            },
            "message": "Hello from expand.network"
        },
        "out_msgs": []
    }
}
```

{% endtab %}
{% endtabs %}

### **/getusertransactions**

Get the historical transaction details for a specific user address.&#x20;

<mark style="color:blue;">`GET`</mark> `https://historicallp.api.expand.network/chain/getusertransactions`

#### Query Parameters

| Name                                      | Type   | Description                                                                          |
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                       | String | Remote procedural call URL.                                                          |
| chainId                                   | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| address<mark style="color:red;">\*</mark> | String | The public address of the user.                                                      |
| limit                                     | String | <p>Maximum number of transactions in response. <br>Maximum: 5</p>                    |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://historicallp.api.expand.network/chain/getusertransactions?address=UQBmgNkHklxoS8WMjirAAuOkNNBZboTDWrjWORNA1Xv9EmRx&chainId=1100
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": {
    "transactions": [
      {
        "@type": "raw.transaction",
        "address": {
          "@type": "accountAddress",
          "account_address": "EQBmgNkHklxoS8WMjirAAuOkNNBZboTDWrjWORNA1Xv9Ejm0"
        },
        "utime": 1714125058,
        "data": "te6cckECDAEAAwsAA7V2aA2QeSXGhLxYyOKsAC46Q00FluhMNauNY5E0DVe/0SAAAp8anhuoHRdrIfFGBWgJ0ujAJxaKJOm0ZMRehMSrUNJo94f6lKdQAAKfGiXx8DZit5AgADRlI2xoAQIDAgHgBAUAgnKNGWWE6qfORKwBzZkE3SbweVQTfssTCSXUd8ZS3azWqh0ZfkoBrB2WlXhhLDE+Pm1oC82fiMh2fu+ktRjwLyVrAg8MX0YYoYYEQAoLAeGIAM0Bsg8kuNCXixkcVYAFx0hpoLLdCYa1caxyJoGq9/okBfEp7mJ7p3/xL9HlN5+w0ib1jvNNsvB+ySMlgZibad1GFzLh0q1PUGBoe5ieue9BbsVLRENoj1IFe3ZeBryPOBlNTRi7MVvRUAAA3aAAHAYBAd8HAdViAAioWoxZMTVqjEz8xEP8QSW4AyorIq+/8UCfgJNM0gMPpgjz0AAAAAAAAAAAAAAAAAAAD4p+pQAaM4c3aZHJSy0F4AgA7zuZAqJxsqAciTilI8/iTnGEeq62piAAHtRKd6wOcJwQOThwAwkBsWgAzQGyDyS40JeLGRxVgAXHSGmgst0JhrVxrHImgar3+iUABFQtRiyYmrVGJn5iIf4gktwBlRWRV9/4oE/ASaZpAYfTBHnoAAYSYDQAAFPjU8N1BMxW8gTACAFtD4p+pQAaM4c3aZHJSy0F4AgA7zuZAqJxsqAciTilI8/iTnGEeq62piAAHtRKd6wOcJwQOThwAwkAmyWThWGAE/MfYd8/locz2KCBc6ZRFQsTITW89oBO3rJtNvV4fE1MAhOHaL8RABmgNkHklxoS8WMjirAAuOkNNBZboTDWrjWORNA1Xv9EkACdQZ2DE4gAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIABvyYbkEEwSYBgAAAAAAAIAAAAAAAO5PNSg+1BpnnaqhnojBcWdZ+wqfccJ/fUK1KOen//8pEDQNxwaDoEu",
        "transaction_id": {
          "@type": "internal.transactionId",
          "lt": "46117914000001",
          "hash": "8R5O0EmQPx7SfGNG8hC0/OeGII229QD23BqDZFUU9nA="
        },
        "fee": "3296125",
        "storage_fee": "125",
        "other_fee": "3296000",
        "in_msg": {
          "@type": "raw.message",
          "source": "",
          "destination": "EQBmgNkHklxoS8WMjirAAuOkNNBZboTDWrjWORNA1Xv9Ejm0",
          "value": "0",
          "fwd_fee": "0",
          "ihr_fee": "0",
          "created_lt": "0",
          "body_hash": "tGDq3Y4mgE4kxnExg+qCjK7/qmpYnK+RWGu0RzIYW/Q=",
          "msg_data": {
            "@type": "msg.dataRaw",
            "body": "te6cckECAwEAAQ8AAZy+JT3MT3Tv/iX6PKbz9hpE3rHeabZeD9kkZLAzE207qMLmXDpVqeoMDQ9zE9c96C3YqWiIbRHqQK9uy8DXkecDKamjF2YreioAABu0AAMBAdViAAioWoxZMTVqjEz8xEP8QSW4AyorIq+/8UCfgJNM0gMPpgjz0AAAAAAAAAAAAAAAAAAAD4p+pQAaM4c3aZHJSy0F4AgA7zuZAqJxsqAciTilI8/iTnGEeq62piAAHtRKd6wOcJwQOThwAwIAmyWThWGAE/MfYd8/locz2KCBc6ZRFQsTITW89oBO3rJtNvV4fE1MAhOHaL8RABmgNkHklxoS8WMjirAAuOkNNBZboTDWrjWORNA1Xv9EkOY8aAY=",
            "init_state": ""
          },
          "message": "viU9zE907/4l+jym8/YaRN6x3mm2Xg/ZJGSwMxNtO6jC5lw6VanqDA0PcxPXPegt2KloiG0R6kCv\nbsvA15HnAympoxdmK3oqAAAbtAAD\n"
        },
        "out_msgs": [
          {
            "@type": "raw.message",
            "source": "EQBmgNkHklxoS8WMjirAAuOkNNBZboTDWrjWORNA1Xv9Ejm0",
            "destination": "EQARULUYsmJq1RiZ-YiH-IJLcAZUVkVff-KBPwEmmaQGH6aC",
            "value": "3240000000",
            "fwd_fee": "602138",
            "ihr_fee": "0",
            "created_lt": "46117914000002",
            "body_hash": "qT1itc3NrlKqjJjCe4ZZVysIaR8THuAhj4o3Z0had/0=",
            "msg_data": {
              "@type": "msg.dataRaw",
              "body": "te6cckEBAgEAigABbQ+KfqUAGjOHN2mRyUstBeAIAO87mQKicbKgHIk4pSPP4k5xhHqutqYgAB7USnesDnCcEDk4cAMBAJslk4VhgBPzH2HfP5aHM9iggXOmURULEyE1vPaATt6ybTb1eHxNTAITh2i/EQAZoDZB5JcaEvFjI4qwALjpDTQWW6Ew1q41jkTQNV7/RJBPnect",
              "init_state": ""
            },
            "message": "D4p+pQAaM4c3aZHJSy0F4AgA7zuZAqJxsqAciTilI8/iTnGEeq62piAAHtRKd6wOcJwQOThwAg==\n"
          }
        ]
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### /portfolio

Get the comprehensive information about the assets/ tokens owned by a user.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/portfolio`

#### Query Parameters

| Name                                      | Type    | Description                                                                          |
| ----------------------------------------- | ------- | ------------------------------------------------------------------------------------ |
| rpc                                       | String  | Remote procedural call URL.                                                          |
| chainId                                   | String  | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                               | String  | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| address<mark style="color:red;">\*</mark> | String  | Public addess of the user.                                                           |
| tokens                                    | String  | Comma-separated value of tokens to get value of. Maximum 10 at a time.               |
| availableOnly                             | Boolean | <p>By default, true. <br>If true, tokens with balance > 0 will be listed.</p>        |

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/chain/portfolio?chainId=1100&address=UQAxmMo2wxu_yQTySoV7u7-Con2csmcBloW0CrflBCQEr-7R
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "native": "496234820",
        "jettons": [
            {
                "name": "GAGARIN",
                "symbol": "GGR",
                "address": "EQDetcmWrfHLPRPVh3LoFvwso0zsjFnpmmXTKWj7s1ycNgu2",
                "balance": "0",
                "USDPrice": "0.09126314435356501"
            },
            {
                "name": "WEMIX",
                "symbol": "oWEMIX",
                "address": "EQCf7Nb341dxOE3N0jimngRxGEV8T3zo-eU2EZVs_nchNhhZ",
                "balance": "0",
                "USDPrice": "NA"
            },
            {
                "name": "Mantle",
                "symbol": "jMNT",
                "address": "EQAEuikLQVh2lDMrV99nTHqFL_TXEyCEJ1xKMuPT60tfvdps",
                "balance": "0",
                "USDPrice": "0.7233562122618723"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### **/**&#x67;etstakepositions

This endpoint fetches the TON staking balance of the address using TON-listed apps and Nominator pool.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getstakepositions`

#### Query Parameters

<table><thead><tr><th width="180">Name</th><th width="99">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>chainId<mark style="color:red;">*</mark></td><td>String</td><td>Refer to the <a href="../../../ids/chain-ids">Chain ID </a>page for details.</td></tr><tr><td>chainSymbol</td><td>String</td><td>Refer to the <a href="../../../ids/chain-ids">Chain ID </a>page for details.</td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>Public addess of the user.</td></tr></tbody></table>

{% tabs %}
{% tab title="Sample Request" %}

```url
https://api.expand.network/chain/getstakepositions?address=UQB4JObGeYc-wG2nxsmbzBVfICAm_BoAFAQk-iJGm7jEdw44&chainId=1100
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": {
    "activeStake": "3019411596649599",
    "stakePositions": [
      {
        "pool": "Bemo liquid staking",
        "balance": "719225507420430"
      },
      {
        "pool": "Nominator Pools",
        "balance": "2300186089229169"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}
