Energy API
Nine endpoints, from quote to reconciliation
Every endpoint authenticates with an HMAC-SHA256 signature. The base URL is https://api.rolthe.com/v1.
https://api.rolthe.com/v1/energy/accountGet account
Balance, available balance and related figures for the current account.
Response example
{
"success": true,
"code": 10000,
"message": "ok",
"data": {
"user_id": 1,
"username": "user@example.com",
"balance": 100.5,
"available_balance": 95.5,
"frozen_amount": 5.0,
"pending_orders_count": 2,
"recharge_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
}
}Response fields
| Field | Type | Description |
|---|---|---|
balance | number | Total account balance (TRX) |
available_balance | number | Available balance (TRX) |
frozen_amount | number | Frozen amount (held by in-flight orders) |
recharge_address | string | Deposit address |
/energy/priceGet price
The current energy rental price.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
rent_time | number | No | Rental duration in hours. Accepted values: 0.08 (5 min), 0.17 (10 min), 1 (1 hour) |
Response example
{
"success": true,
"code": 10000,
"message": "ok",
"data": {
"price_65k_1hour": 1.86,
"price_per_10k": 0.286154,
"energy_per_transfer": 65000,
"min_energy": 32000,
"max_energy": 5000000,
"rent_time": 1
}
}/energy/buyBuy energy
Buy a given amount of energy for a given address.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
target_address | string | Yes | The TRON address that receives the energy |
energy_amount | number | No | Amount of energy, 65000 by default |
rent_time | number | No | Rental duration in hours, 1 by default |
Request example
curl -X POST "https://api.rolthe.com/v1/energy/buy" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-Timestamp: 1704067200" \
-H "X-Signature: YOUR_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
"target_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
"energy_amount": 65000,
"rent_time": 1
}'Response example
{
"success": true,
"code": 10000,
"message": "ok",
"data": {
"order_id": "EN240102ABC123",
"tx_hash": "abc123...",
"cost": 3.0
}
}/energy/auto-buyAuto buy
The system works out how much energy is needed from from_address and to_address.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from_address | string | Yes | Sender address (the one that receives the energy) |
to_address | string | Yes | Recipient address (used to detect a first-time transfer) |
rent_time | number | No | Rental duration in hours, 1 by default |
Note
A first USDT transfer to a given address costs more energy than later ones. This endpoint works that out for you, so you do not buy the smallest bracket and come up short.
/energy/buy-countBuy by transaction count
Energy priced by number of transfers — convenient for batch payouts.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
target_address | string | Yes | The TRON address that receives the energy |
count | number | No | Number of transfers, 1 by default |
rent_time | number | No | Rental duration in hours, 1 by default |
/energy/smart-buySmart buy
The full sequence in one call: check activation state → activate if needed → estimate energy precisely → buy.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
receiver_address | string | Yes | The address that receives the energy (the USDT sender) |
to_address | string | Yes | The address that receives the USDT (checked for activation) |
from_address | string | No | The from address used for the simulated transfer; defaults to receiver_address |
rent_time | number | No | Rental duration in hours, 1 by default. Supports 0.25 (15m), 1 (1h), 24 (1d) |
Response example
{
"success": true,
"code": 10000,
"message": "ok",
"data": {
"order_id": "EN240102ABC123",
"activated": true,
"energy_amount": 64300,
"cost": 3.0
}
}/energy/check-addressCheck address
Given a TRON address, report whether it needs activation and how many transfers’ worth of energy is required. Useful to tell the user before you charge them.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | Yes | The TRON address to check |
Response example
{
"success": true,
"code": 10000,
"message": "ok",
"data": {
"address": "THQvaTNagbBi5HRPxPMYSAh2kJDagEsq4V",
"is_activated": false,
"need_activate": true,
"transfer_count": 2
}
}/energy/activateActivate address
Activate an inactive TRON address. Inactive addresses cannot receive an energy delegation.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | Yes | The TRON address to activate |
Response example
{
"success": true,
"order_id": "AC240102XYZ789",
"tx_hash": "def456...",
"cost": 1.1,
"message": "Address activated"
}/energy/order/{order_id}Get order
Full detail for a single order by its ID.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
order_id | string | Yes | Order ID (path parameter) |
Response fields
| Field | Type | Description |
|---|---|---|
status | string | pending / processing / success / failed / cancelled |
tx_hash | string | On-chain transaction hash of the energy delegation; only set once the order succeeds |