Skip to main content
To withdraw staked TRX on the TRON network via the Staking API:
  1. Create an undelegate request: remove your votes and unfreeze your TRX.
  2. Create a withdrawal request to claim unfrozen TRX.
  3. Sign and send the transaction to the network.
1

Create undelegate request

To initiate the token undelegation, send a POST request to /api/v1/tron/{network}/staking/undelegate.Example request:
  • delegatorAddress — delegator account address.
  • amount — amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).
  • resource — type of resources to be used for freezing TRX:
    • BANDWIDTH — for regular transactions on the TRON chain.
    • ENERGY — for using smart contracts or running DApps.
Example response:
  • delegatorAddress — delegator account address.
  • amount — amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).
  • resource — type of resources used for processing the freeze transaction: BANDWIDTH or ENERGY.
  • unsignedTransaction — original unsigned transaction object returned by tronWeb.
    • visible — internal SDK parameter; always set to false.
    • txID — hash of the transaction.
    • raw_data_hex — raw payload of the unsigned transaction in the hexadecimal format.
    • raw_data — full decoded transaction structure with all the fields and metadata:
      • contract — list of TRON contracts:
        • parameter.type_url — TRON protocol contract, e.g., type.googleapis.com/protocol.UnfreezeBalanceV2Contract.
        • parameter.value.owner_address — TRON account address in the hexadecimal format.
        • parameter.value.unfreeze_balance — amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).
        • parameter.value.resource — resource type: BANDWIDTH or ENERGY.
      • ref_block_bytes, ref_block_hash — hash and references of the block in which the transaction has been included.
      • expiration — timestamp of the transaction expiration in ms since last epoch.
      • timestamp — timestamp of the transaction in ms since last epoch.
  • createdAt — timestamp of the transaction in the ISO 8601 format.
  • unsignedTransactionSerialized — unsigned serialized transaction in Base64 encrypted format ready for signing.
  • voteAccount — address of the Super Representative for voting.
2

Sign and send transaction

Use unsignedTransactionSerialized to sign and send the signed transaction to the TRON network.By broadcasting this transaction, you’re resetting all votes.Note that there is a protocol freeze period before the corresponding TRX tokens will be unlocked. You can verify the withdrawal by several options:
3

Create withdraw request

To initiate the token withdrawal, send a POST request to /api/v1/tron/{network}/staking/withdraw.
  • delegatorAddress — delegator account address.
Example response:
  • delegatorAddress — delegator account address.
  • unsignedTransaction — original unsigned transaction object returned by tronWeb.
    • visible — internal SDK parameter; always set to false.
    • txID — hash of the transaction.
    • raw_data_hex — raw payload of the unsigned transaction in the hexadecimal format.
    • raw_data — full decoded transaction structure with all the fields and metadata:
      • contract — list of TRON contracts:
        • parameter.value.owner_address— TRON account address in the hexadecimal format.
        • parameter.type_url— TRON protocol contract, e.g., type.googleapis.com/protocol.WithdrawExpireUnfreezeContract.
        • type— TRON protocol contract type
      • ref_block_bytes, ref_block_hash — hash and references of the block in which the transaction has been included.
      • expiration — timestamp of the transaction expiration in ms since last epoch.
      • timestamp — timestamp of the transaction in ms since last epoch.
  • unsignedTransactionSerialized — unsigned serialized transaction in Base64 encrypted format ready for signing.
  • createdAt — timestamp of the transaction in the ISO 8601 format.
4

Sign and send transaction

Use unsignedTransactionSerialized to sign and send the signed transaction to the TRON network.