# 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 %}
