为什么要租赁能量?
TRON上的每笔USDT (TRC-20) 转账都需要能量。如果没有能量,网络会燃烧您的TRX:
- 65,000能量 × 100 SUN = 6.43 TRX(约$1.60) — 收款方已持有USDT
- 131,000能量 × 100 SUN = 13.28 TRX(约$3.30) — 收款方未持有USDT
通过API租赁能量仅需约1.80 TRX(65K)和约3.60 TRX(131K)。便宜72%。
每天50笔转账,每天节省约230 TRX — 大约每月$1,700。数字不会说谎。
您需要准备什么
- tronrental.com账户
- API密钥(控制面板 → API → 创建密钥)
- 余额中的TRX(控制面板 → 充值)
- 5分钟
快速开始:3步完成首次购买
步骤1 — 查看价格
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"
}价格是动态的,每60秒更新一次。energy_price_sun是每单位能量的价格。其他字段是为方便起见预先计算的。
步骤2 — 购买能量
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..."
}能量被委托到target_address — 可以是您自己的地址或其他人的地址。
步骤3 — 确认订单
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..."
}当状态变为"filled"时 — 能量已完成委托。现在可以发送您的USDT转账了。
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()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();
}需要购买多少能量?
| 场景 | 能量 | 原因 |
|---|---|---|
| 收款方已持有USDT | 65,000 | 标准转账 |
| 收款方未持有USDT | 131,000 | 首次向该地址转账,费用为2倍 |
不确定?购买前先检查:
curl "https://api.tronrental.com/v1/tools/check-energy?address=TRecipient..."{
"has_usdt": true,
"energy_needed": 64285,
"rental_cost_trx": "2.12"
}限制:每笔订单最少32,000能量,最多5,000,000。
租赁带宽
除了能量,TRON的所有交易还使用带宽。每个已激活的地址每天获得600免费带宽 — 足够1笔USDT转账。从第二笔转账开始,网络会燃烧TRX作为带宽费用(约0.35 TRX)。
如果您的服务每天从同一地址进行多笔转账 — 租赁带宽更划算。
价格
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"
}公式:(数量 / 1000) × 0.4 TRX + 0.2 TRX 固定费用。
购买
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带宽 = 1笔USDT转账。最少350,最多100,000。
完整示例:购买能量 → 发送USDT
实际场景 — 为发送方地址购买能量,等待委托完成,然后发送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.)错误处理
| HTTP状态码 | 含义 | 处理方式 |
|---|---|---|
| 400 | 错误请求(无效地址、余额不足) | 阅读错误信息,修复后重试 |
| 429 | 超过速率限制(100请求/分钟) | 等待后使用退避策略重试 |
| 5xx | 服务器错误 | 使用指数退避策略重试 |
常见问题
能量委托有多快?
通常3-5秒。能量在下一个区块中完成链上委托。
如果我购买了能量但没有进行转账怎么办?
能量在1小时后过期。租赁费用不予退还 — 您支付的是委托服务,而非使用量。
有速率限制吗?
每个API密钥每分钟100个请求。对于大多数使用场景来说绰绰有余。
可以为别人的地址购买能量吗?
可以。将target_address设置为任何有效的TRON地址。您不需要拥有该地址。
完整文档在哪里?
docs.tronrental.com — 所有端点、请求/响应模式、webhook设置等更多内容。