freezebalance - Tron

freezebalance. Creates a transaction to freeze TRX in exchange for bandwidth or energy (legacy model).

freezebalance - tron [Value: 20CU]
Creates a transaction to freeze TRX in exchange for bandwidth or energy (legacy model).
Use cases

Use cases

  • Freeze TRX for bandwidth or energy under the legacy (pre-Stake 2.0) model
Constraints

Constraints

  • Superseded by freezebalancev2 (Stake 2.0) for new integrations
  • Frozen TRX is locked for the full frozen_duration before it can be unfrozen
Get started
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
     --url https://lb.drpc.live/tron/{API-KEY}/wallet/freezebalance \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "frozen_balance": 1, "frozen_duration": 1, "resource": "example", "receiver_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "visible": true}'
Copy
Response
200
{
  "visible": false,
  "txID": "<computed from raw_data>",
  "raw_data": {
    "contract": [
      {
        "parameter": {
          "value": {
              "owner_address":   "41dd791d6b49e190062d650e6a23c575510d35f2f9",
              "frozen_balance":  1000000000,
              "frozen_duration": 3,
              "resource":        "BANDWIDTH"
          },
          "type_url": "type.googleapis.com/protocol.FreezeBalanceContract"
        },
        "type": "FreezeBalanceContract"
      }
    ],
    "ref_block_bytes": "<latest solidified block at construction time>",
    "ref_block_hash":  "<latest solidified block at construction time>",
    "expiration":      "<timestamp + 60_000>",
    "timestamp":       "<construction moment>"
  },
  "raw_data_hex": "<protobuf encoding of raw_data>"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
owner_addressstring
[Required] The account address freezing TRX
frozen_balanceinteger
[Required] Amount of TRX to freeze, in sun
frozen_durationinteger
[Required] Freeze duration in days (typically 3)
resourcestring
[Required] Resource to receive: BANDWIDTH or ENERGY
receiver_addressstring
Optional address to delegate the resulting resource to
visibleboolean
When true, addresses are base58check strings; when false (default), hex strings
Permission_idinteger
Multi-sig permission ID

Response

200
Creates a transaction to freeze TRX in exchange for bandwidth or energy (legacy model).

Response params

object
visibleboolean
Indicates whether addresses in this transaction are represented in base58 format (true) or hex format (false).
txIDstring
The unique transaction hash (transaction ID), computed as the SHA256 of raw_data.
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
contractarray_of_objects
The list of contract instructions to be executed by this transaction.
object
parameterobject
The typed payload describing the specific contract call being made.
object
valueobject
The decoded fields of the contract — here, a Stake 1.0 request to freeze TRX for a resource.
object
owner_addressstring
The address freezing its TRX balance, in hex format.
frozen_balanceinteger
The amount of TRX, in sun, to freeze for the specified resource.
frozen_durationinteger
The number of days this balance will remain locked before it can be unfrozen.
resourcestring
The resource type being staked for, either BANDWIDTH or ENERGY.
type_urlstring
The fully qualified protobuf type identifier describing which contract schema `value` should be decoded with.
typestring
The human-readable name of the contract type being executed (here, FreezeBalanceContract).
ref_block_bytesstring
The last two bytes of the reference block number, taken from the latest solidified block at the time the transaction was built, used for replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, taken from the same solidified block, paired with ref_block_bytes for replay protection.
expirationinteger
Unix timestamp, in ms, after which this transaction is no longer valid; typically set to the construction timestamp plus 60,000 ms.
timestampinteger
Unix timestamp, in ms, marking the moment the transaction was constructed.
raw_data_hexstring
The hex-encoded protobuf serialization of raw_data, used as the actual payload to sign and broadcast.