1. 获取 API 密钥
注册并在 tronrental.com/dashboard/api 创建 API 密钥。2. 查询价格
curl https://api.tronrental.com/v1/prices
{
"energy_trx": { "1h": "1.79", "1d": "..." },
"energy_sun": { "1h": "27.54", "1d": "..." },
"energy_volume": 65000,
"bandwidth_trx": { "1h": "1.54", "1d": "..." },
"bandwidth_volume": 350,
"trx_usd_rate": "0.234",
"burn_cost_trx": "6.5",
"savings_percent": "72.5"
}
3. 充值 TRX
查看您的充值地址:curl https://api.tronrental.com/v1/account/deposit \
-H "X-API-Key: your_api_key"
deposit_address。充值将自动到账。
4. 购买能量
curl -X POST https://api.tronrental.com/v1/energy/buy \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"address": "TRecipientAddress...",
"energy_amount": 65000,
"duration_hours": 1
}'
{
"order_id": 1234,
"address": "TRecipientAddress...",
"energy_amount": 65000,
"duration_hours": 1,
"price_trx": "2.75",
"status": "pending"
}
5. 验证
查看您的订单状态:curl https://api.tronrental.com/v1/orders \
-H "X-API-Key: your_api_key"
65,000 能量足以完成一笔向已持有 USDT 地址的转账。
对于首次接收 USDT 的地址,请使用 131,000 能量。
代码示例
import requests
API_KEY = "your_api_key"
BASE = "https://api.tronrental.com/v1"
headers = {"X-API-Key": API_KEY}
# Buy energy
resp = requests.post(f"{BASE}/energy/buy", headers=headers, json={
"address": "TRecipientAddress...",
"energy_amount": 65000,
"duration_hours": 1,
})
print(resp.json())