¿Por qué alquilar energía?
Cada transferencia USDT (TRC-20) en TRON requiere energía. Sin ella, la red quema tu TRX:
- 65,000 energía × 100 SUN = 6.43 TRX (~$1.60) — el destinatario tiene USDT
- 131,000 energía × 100 SUN = 13.28 TRX (~$3.30) — el destinatario no tiene USDT
Alquilar energía vía API cuesta ~1.80 TRX por 65K y ~3.60 TRX por 131K. Eso es 72% más barato.
Con 50 transferencias al día, ahorras ~230 TRX diarios — aproximadamente $1,700/mes. Difícil discutir con los números.
Lo que necesitarás
- Cuenta en tronrental.com
- Clave API (Panel → API → Crear clave)
- TRX en tu saldo (Panel → Depósito)
- 5 minutos
Inicio rápido: primera compra en 3 pasos
Paso 1 — Consulta el precio
curl https://api.tronrental.com/v1/prices{
"energy_price_sun": 33,
"energy_price_trx_per_65k": "2.12",
"energy_price_trx_per_131k": "4.24",
"burn_cost_trx": "6.43",
"savings_percent": "67.0"
}Los precios son dinámicos, se actualizan cada 60 segundos. energy_price_sun es el precio por unidad de energía. Los otros campos están precalculados por conveniencia.
Paso 2 — Compra energía
curl -X POST https://api.tronrental.com/v1/energy/buy \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"target_address": "TRecipient...", "energy_amount": 65000, "duration": "1h"}'{
"order_id": 1842,
"status": "pending",
"energy_amount": 65000,
"price_trx": "2.12",
"target_address": "TRecipient..."
}La energía se delega a target_address — puede ser tu propia dirección o la de otra persona.
Paso 3 — Confirma el pedido
curl https://api.tronrental.com/v1/orders/1842 \
-H "X-API-Key: YOUR_API_KEY"{
"order_id": 1842,
"status": "filled",
"energy_amount": 65000,
"tx_hash": "a1b2c3..."
}Cuando el estado cambie a "filled" — la energía ha sido delegada. Ya puedes enviar tu transferencia USDT.
Lo mismo en Python
import httpx
API_KEY = "your_api_key"
BASE = "https://api.tronrental.com/v1"
HEADERS = {"X-API-Key": API_KEY}
async def buy_energy(target_address: str, amount: int = 65_000) -> dict:
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{BASE}/energy/buy",
headers=HEADERS,
json={"target_address": target_address, "energy_amount": amount, "duration": "1h"},
)
resp.raise_for_status()
return resp.json()Lo mismo en JavaScript
const API_KEY = "your_api_key";
const BASE = "https://api.tronrental.com/v1";
async function buyEnergy(targetAddress, amount = 65000) {
const resp = await fetch(`${BASE}/energy/buy`, {
method: "POST",
headers: {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
target_address: targetAddress,
energy_amount: amount,
duration: "1h",
}),
});
if (!resp.ok) throw new Error(`API error: ${resp.status}`);
return resp.json();
}¿Cuánta energía comprar?
| Escenario | Energía | Por qué |
|---|---|---|
| El destinatario tiene USDT | 65,000 | Transferencia estándar |
| El destinatario no tiene USDT | 131,000 | La primera transferencia a esta dirección cuesta el doble |
¿No estás seguro? Verifica antes de comprar:
curl "https://api.tronrental.com/v1/tools/check-energy?address=TRecipient..."{
"has_usdt": true,
"energy_needed": 64285,
"rental_cost_trx": "2.12"
}Límites: mínimo 32,000 de energía por pedido, máximo 5,000,000.
Alquiler de bandwidth
Además de la energía, TRON usa bandwidth para todas las transacciones. Cada dirección activada recibe 600 bandwidth gratis al día — suficiente para 1 transferencia USDT. A partir de la segunda transferencia, la red quema TRX por bandwidth (~0.35 TRX).
Si tu servicio realiza múltiples transferencias al día desde una dirección — alquilar bandwidth es más económico.
Precios
curl https://api.tronrental.com/v1/bandwidth/prices{
"price_per_day_trx": "9.6",
"min_volume": 350,
"max_volume": 100000,
"fixed_fee_trx": "0.2"
}Fórmula: (volumen / 1000) × 0.4 TRX + 0.2 TRX comisión fija.
Compra
curl -X POST https://api.tronrental.com/v1/bandwidth/buy \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"target_address": "TRecipient...", "volume": 350, "duration": "1h"}'350 bandwidth = 1 transferencia USDT. Mínimo 350, máximo 100,000.
Ejemplo completo: comprar energía → enviar USDT
Patrón del mundo real — compra energía para la dirección del remitente, espera la delegación, luego envía USDT:
import asyncio
import httpx
API_KEY = "your_api_key"
BASE = "https://api.tronrental.com/v1"
HEADERS = {"X-API-Key": API_KEY}
async def buy_energy_and_wait(target: str, amount: int = 65_000) -> str:
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{BASE}/energy/buy",
headers=HEADERS,
json={"target_address": target, "energy_amount": amount, "duration": "1h"},
)
data = resp.json()
if resp.status_code == 400:
raise Exception(f"Purchase failed: {data.get('detail', data)}")
resp.raise_for_status()
order_id = data["order_id"]
for _ in range(10):
await asyncio.sleep(3)
check = await client.get(f"{BASE}/orders/{order_id}", headers=HEADERS)
order = check.json()
if order["status"] == "filled":
return order["tx_hash"]
raise TimeoutError(f"Order {order_id} not filled after 30s")
async def send_usdt_with_energy(sender: str, recipient: str, amount_usdt: float):
tx_hash = await buy_energy_and_wait(sender, amount=65_000)
print(f"Energy delegated: {tx_hash}")
# ... your USDT transfer logic here (tronpy, tronweb, etc.)Manejo de errores
| Estado HTTP | Qué significa | Qué hacer |
|---|---|---|
| 400 | Solicitud incorrecta (dirección inválida, saldo insuficiente) | Lee el mensaje de error, corrige y reintenta |
| 429 | Límite de tasa excedido (100 req/min) | Espera y reintenta con retroceso exponencial |
| 5xx | Error del servidor | Reintenta con retroceso exponencial |
Preguntas frecuentes
¿Qué tan rápido se delega la energía?
Normalmente 3–5 segundos. La energía se delega en la cadena en el siguiente bloque.
¿Qué pasa si compro energía pero no hago una transferencia?
La energía expira después de 1 hora. El costo del alquiler no se reembolsa — estás pagando por la delegación, no por el uso.
¿Hay un límite de tasa?
100 solicitudes por minuto por clave API. Más que suficiente para la mayoría de los casos de uso.
¿Puedo comprar energía para la dirección de otra persona?
Sí. Establece target_address a cualquier dirección TRON válida. No necesitas ser su propietario.
¿Dónde está la documentación completa?
docs.tronrental.com — todos los endpoints, esquemas de solicitud/respuesta, configuración de webhooks y más.