# Tron Staking

Instructions: <https://help.allnodes.com/en/articles/8610811-tron-staking-api>

## Get votes

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/staking`

This endpoint allows you to get a list of all your votes for Tron validators.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description         |
| ------------------------------------------------ | ------ | ------------------- |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "TRX"       |
| action<mark style="color:red;">\*</mark>         | string | Must be "votes"     |
| address<mark style="color:red;">\*</mark>        | string | Your wallet address |

{% tabs %}
{% tab title="200: OK " %}

```
[
  {
    voteAddress: string;
    voteCount: number;
  }
]
```

{% endtab %}
{% endtabs %}

## Freeze coins

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/staking`

This endpoint allows you to get a serialized unsigned transaction to freeze coins before staking.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description                |
| ------------------------------------------------ | ------ | -------------------------- |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "TRX"              |
| action<mark style="color:red;">\*</mark>         | string | Must be "freeze"           |
| address<mark style="color:red;">\*</mark>        | string | Your wallet address        |
| amount<mark style="color:red;">\*</mark>         | number | Amount to freeze (integer) |

{% tabs %}
{% tab title="200: OK Serialized transaction successfully generated." %}

```
{
  visible: boolean;
  txID: string;
  raw_data_hex: string;
  raw_data: object;
}
```

{% endtab %}
{% endtabs %}

## Delegate coins

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/staking`

This endpoint allows you to get a serialized unsigned transaction for delegating staked coins to Allnodes validator.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "TRX"                |
| action<mark style="color:red;">\*</mark>         | string | Must be "delegate"           |
| address<mark style="color:red;">\*</mark>        | string | Your wallet address          |
| amount<mark style="color:red;">\*</mark>         | number | Amount to delegate (integer) |

{% tabs %}
{% tab title="200: OK Serialized transaction successfully generated." %}

```
{
  visible: boolean;
  txID: string;
  raw_data_hex: string;
  raw_data: object;
}
```

{% endtab %}
{% endtabs %}

## Undelegate coins

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/staking`

This endpoint allows you to get a serialized unsigned transaction for undelegating staked coins from Allnodes validator.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description                    |
| ------------------------------------------------ | ------ | ------------------------------ |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "TRX"                  |
| action<mark style="color:red;">\*</mark>         | string | Must be "undelegate"           |
| address<mark style="color:red;">\*</mark>        | string | Your wallet address            |
| amount<mark style="color:red;">\*</mark>         | number | Amount to undelegate (integer) |

{% tabs %}
{% tab title="200: OK Serialized transaction successfully generated." %}

```
{
  visible: boolean;
  txID: string;
  raw_data_hex: string;
  raw_data: object;
}
```

{% endtab %}
{% endtabs %}

## Unfreeze coins

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/staking`

This endpoint allows you to get a serialized unsigned transaction to unfreeze coins after undelegating.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description                  |
| ------------------------------------------------ | ------ | ---------------------------- |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "TRX"                |
| action<mark style="color:red;">\*</mark>         | string | Must be "unfreeze"           |
| address<mark style="color:red;">\*</mark>        | string | Your wallet address          |
| amount<mark style="color:red;">\*</mark>         | number | Amount to unfreeze (integer) |

{% tabs %}
{% tab title="200: OK Serialized transaction successfully generated." %}

```
{
  visible: boolean;
  txID: string;
  raw_data_hex: string;
  raw_data: object;
}
```

{% endtab %}
{% endtabs %}

## Claim rewards

<mark style="color:green;">`POST`</mark> `https://www.allnodes.com/api/v1/staking`

This endpoint allows you to get a serialized unsigned transaction for claiming rewards.

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer TOKEN |

#### Request Body

| Name                                             | Type   | Description               |
| ------------------------------------------------ | ------ | ------------------------- |
| currencySymbol<mark style="color:red;">\*</mark> | string | Must be "TRX"             |
| action<mark style="color:red;">\*</mark>         | string | Must be "claim"           |
| address<mark style="color:red;">\*</mark>        | string | Your wallet address       |
| amount<mark style="color:red;">\*</mark>         | number | Amount to claim (integer) |

{% tabs %}
{% tab title="200: OK Serialized transaction successfully generated." %}

```
{
  visible: boolean;
  txID: string;
  raw_data_hex: string;
  raw_data: object;
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.allnodes.com/trx/staking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
