# UnfreezeBalanceV2

Unstake some TRX staked in Stake2.0, release the corresponding amount of bandwidth or energy, and voting rights (TP).

This method will use `30` [Compute Units](https://docs.validationcloud.io/v1/about/billing).

***

Unlock the TRX staked at the Stake 2.0 stage through this interface. After unstaking, the user needs to wait for 14 days before calling the [/wallet/withdrawexpireunfreeze](https://developers.tron.network/reference/withdrawexpireunfreeze) interface to withdraw the funds of this unstaking.

When executing unstaking, if there is a previously unstaked funds that has passed the lock-up period, then this unstaking operation will also withdraw the unstaked funds that has passed the lock-up period to the account at the same time. You can query the amount of funds withdrawn in this transaction through [gettransactioninfobyid](https://developers.tron.network/reference/gettransactioninfobyid) API.

## **Parameters**

* `owner_address` - String, required - Owner address, default hexString
* `unfreeze_balance` - int64, required - The amount of TRX to unstake, in sun
* `resource` - String, required - TRX stake type, 'BANDWIDTH' or 'ENERGY'
* `Permission_id` - int32 - Optional, for multi-signature use
* `visible` - Boolean - Optional. Specifies whether the address is in Base58 format (default: false).

## **Returns**

Transaction object - JSON object: Unsigned transaction, please refer to the [Transaction](https://developers.tron.network/docs/tron-protocol-transaction) chapter for the fields contained in it. Since the transaction type is `UnfreezeBalanceV2Contract`, the fields contained in `raw_data.contract[0].parameter.value` in the transaction are as follows:

| Field             | Type   | Description                 |
| ----------------- | ------ | --------------------------- |
| owner\_address    | string | Account address             |
| resource          | string | Resource type               |
| unfreeze\_balance | int64  | Unstake amount, unit is sun |

```json
// Result
{
  "visible": true,
  "txID": "473bbb59203742c76b1ecbf2e0a5bc3962f37167ece01261d6680c9c8fcbe290",
  "raw_data": {
    "contract": [
      {
        "parameter": {
          "value": {
            "resource": "ENERGY",
            "frozen_balance": 10000000,
            "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g"
          },
          "type_url": "type.googleapis.com/protocol.FreezeBalanceV2Contract"
        },
        "type": "FreezeBalanceV2Contract"
      }
    ],
    "ref_block_bytes": "5abf",
    "ref_block_hash": "137f27cb4608aa7d",
    "expiration": 1756821201000,
    "timestamp": 1756821142996
  },
  "raw_data_hex": "0a025abf2208137f27cb4608aa7d40e8c0d0d590335a5a083612560a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121e0a1541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e1080ade204180170d4fbccd59033"
}
```

{% tabs %}
{% tab title="mainnet" %}

```bash
curl https://mainnet.tron.validationcloud.io/v1/<YOUR_API_KEY_HERE>/wallet/unfreezebalancev2 \
    -X POST \
    -H "Content-Type: application/json" \
    -d '
{
  "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
  "unfreeze_balance": 1000000,
  "resource": "BANDWIDTH",
  "visible": true
}
'
```

{% endtab %}
{% endtabs %}
