# Unfreeze account balance

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/unfreezebalance

Unfreezes a previously frozen TRON account balance to restore access to tokens. The unfreeze operation must specify the resource type originally frozen.


Reference: https://www.alchemy.com/docs/chains/tron/tron-http-api-endpoints/tron-http-api-endpoints/unfreeze-account-balance

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/unfreezebalance \
  --header 'Content-Type: application/json' \
  --data '{
  "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
  "resource": "BANDWIDTH",
  "visible": true
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    owner_address: 'TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g',
    resource: 'BANDWIDTH',
    visible: true
  })
};

fetch('https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/unfreezebalance', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/unfreezebalance"

payload = {
    "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
    "resource": "BANDWIDTH",
    "visible": True
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/unfreezebalance"

	payload := strings.NewReader("{\n  \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\",\n  \"resource\": \"BANDWIDTH\",\n  \"visible\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/unfreezebalance")
  .header("Content-Type", "application/json")
  .body("{\n  \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\",\n  \"resource\": \"BANDWIDTH\",\n  \"visible\": true\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://tron-mainnet.g.alchemy.com/v2/docs-demo/wallet/unfreezebalance");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\",\n  \"resource\": \"BANDWIDTH\",\n  \"visible\": true\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /wallet/unfreezebalance
method: POST
operation:
  summary: Unfreeze account balance
  description: |
    Unfreezes a previously frozen TRON account balance to restore access to tokens. The unfreeze operation must specify the resource type originally frozen.
  tags:
    - Tron HTTP API Endpoints
  security:
    - apiKey: []
  requestBody:
    required: true
    content:
      application/json:
        schema:
          type: object
          required:
            - owner_address
            - resource
          properties:
            owner_address:
              type: string
              description: Base58 address of the account performing the unfreeze.
              example: TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g
            resource:
              type: string
              description: Resource type to unfreeze. Can be `BANDWIDTH` or `ENERGY`.
              example: BANDWIDTH
            visible:
              type: boolean
              description: Indicates if the address is base58 (true) or hex (false).
              example: true
  responses:
    '200':
      description: Unsigned transaction object for unfreezing balance.
      content:
        application/json:
          schema:
            type: object
            properties:
              visible:
                type: boolean
              txID:
                type: string
              raw_data:
                type: object
              raw_data_hex:
                type: string
                description: Hex-encoded raw transaction.
          examples:
            response:
              value:
                visible: true
                txID: a1b2c3d4e5f6g7h8i9j0
                raw_data:
                  contract:
                    - parameter:
                        value:
                          owner_address: TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g
                          resource: BANDWIDTH
                        type_url: type.googleapis.com/protocol.UnfreezeBalanceContract
                      type: UnfreezeBalanceContract
                  ref_block_bytes: abcd
                  ref_block_hash: 12345678abcdef12
                  expiration: 1762267590000
                  timestamp: 1762267531387
                raw_data_hex: 0a02abcd220812345678abcdef1240f0dad5faa4335a...
```
