/wallet/unfreezebalancev2 - Tron

This endpoint builds an unsigned Stake 2.0 transaction that unstakes previously staked TRX. After an unstake, the TRX enters a waiting period before it can be withdrawn.

Parameters

ParameterTypeRequiredDescription
owner_addressstringYesStaking account address
unfreeze_balanceintegerYesAmount of staked TRX to unstake, in SUN
resourcestringYesResource to release: ENERGY or BANDWIDTH
visiblebooleanNoAccept and return addresses in base58 format

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/unfreezebalancev2' \
--header 'Content-Type: application/json' \
--data-raw '{
  "owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
  "unfreeze_balance": 1000000000,
  "resource": "ENERGY",
  "visible": true
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/unfreezebalancev2',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "unfreeze_balance": 1000000000, "resource": "ENERGY", "visible": true})
    }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/unfreezebalancev2',
    headers={'Content-Type': 'application/json'},
    json={"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "unfreeze_balance": 1000000000, "resource": "ENERGY", "visible": true}
)

print(response.json())

Response

json{
  "txID": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62",
  "raw_data": {
    "contract": [
      {
        "type": "UnfreezeBalanceV2Contract"
      }
    ]
  },
  "raw_data_hex": "0a02..."
}

Response Parameters

FieldTypeDescription
txIDstringThe transaction id of the unsigned unstaking transaction
raw_dataobjectThe UnfreezeBalanceV2Contract and metadata
raw_data_hexstringHex serialization used as the signing payload

Use Cases

  • Release Stake: Begin unstaking TRX previously staked for resources
  • Liquidity Recovery: Free staked TRX after resource needs drop
  • Resource Rebalance: Move stake between Energy and Bandwidth
  • Wallet Flows: Build an unstake for user-initiated withdrawals

Error Handling

HTTP StatusMessageDescription
200OKThe request succeeded; some TRON errors are returned in the 200 body as an Error field
400Bad requestThe request body is malformed or a required field is missing
500Internal errorThe node failed to process the request