入门指南

要获取 API 密钥,请在 仪表板 注册。

完整文档 →
API 接口
GET /calculate-order-price

请求能量的预计租金和可租用的能量数量。

请求 URL
https://api.tronenergyrent.com/calculate-order-price?period=[RENTAL_DURATION]&energyAmount=[ENERGY_AMOUNT]
请求参数 类型 必填 描述
period string 租赁时长。以下选项之一:
"1h" – 1 小时
"1d" – 1 天
"3d" – 3 天
"30d" – 30 天
energyAmount int 需要租赁的 TRON 能量数量(最少 15000 单位)。
preActivateDestinationAddress int 在 TRON 网络中,地址必须先激活才能接收能量。如果您希望计算包含 TRON 地址激活的能量租赁费用,请发送 preActivateDestinationAddress=1;否则请设置为 "0" 或忽略此参数。
响应示例
{
  "status": "SUCCESS",
  "errorCode": null,
  "errorDescription": null,
  "requestId": "9d13d94d-4",
  "payload": {
    "availableEnergy": 75820891,
    "totalEnergy": 561779790,
    "minimumOrderEnergy": 15000,
    "maximumOrderEnergy": 200000000,
    "totalPriceSun": 2860000,
    "totalPriceTrx": 2.86,
    "explanation": "The price for each unit of energy is 44 SUN. The final price is calculated as 65000 ENERGY × 44 SUN = 2860000 SUN (2.860000 TRX)."
  }
}
GET /place-order

请求租用指定 TRON 钱包的能量。

请求 URL
https://api.tronenergyrent.com/place-order?apiKey=[YOUR_API_KEY]&period=[RENTAL_DURATION]&energyAmount=[ENERGY_AMOUNT]&destinationAddress=[WALLET]
请求参数 类型 必填 描述
apiKey string 您在 控制面板 中的 API 密钥
period string 租赁时长。以下选项之一:
"1h" – 1 小时
"1d" – 1 天
"3d" – 3 天
"30d" – 30 天
energyAmount int 需要租赁的 TRON 能量数量(最少 15000 单位)。
destinationAddress string 您希望接收能量的目标 TRON 地址
preActivateDestinationAddress int 在 TRON 网络中,地址必须先激活才能接收能量。
如果您希望在接收能量之前激活地址,
请设置 preActivateDestinationAddress=1,否则设置为 "0" 或忽略此参数。
如果设置为 "1",将从您的余额中扣除 1.5 TRX 的激活费用
响应示例
{
  "status": "SUCCESS",
  "errorCode": null,
  "errorDescription": null,
  "requestId": "2651eacd-2428",
  "payload": {
    "orderId": "128de799-501e-44b2-8d6f-1fa825c2deed",
    "totalPriceSun": 5662800,
    "totalPriceTrx": 5.6628,
    "state": "PAID_BY_USER"
  }
}