入門指南

要取得 API 金鑰,請在儀表板註冊。

完整文件 →

能量租賃 API 端點

GET /calculate-energy-price

查詢能量的預估租賃費用及目前可租用的能量數量。

請求 URL
https://api.tronenergyrent.com/calculate-energy-price?period=[RENTAL_DURATION]&energyAmount=[ENERGY_AMOUNT]
請求參數 類型 必填 說明
period string 是 租期。以下選項之一:
"1h":1 小時
"1d":1 天
"3d":3 天
"30d":30 天
energyAmount int 是 需要租賃的 TRON 能量數量(最少 15,000 單位)。
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-energy-order

為指定的 TRON 錢包租用能量。

請求 URL
https://api.tronenergyrent.com/place-energy-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 能量數量(最少 15,000 單位)。
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"
  }
}

bandwidth 租賃 API 端點

GET /calculate-bandwidth-price

查詢 bandwidth 的預估租賃費用及目前可租用的 bandwidth 數量。

請求 URL
https://api.tronenergyrent.com/calculate-bandwidth-price?period=[RENTAL_DURATION]&bandwidthAmount=[BANDWIDTH_AMOUNT]
請求參數 類型 必填 說明
period string 是 租期。以下選項之一:
"1h":1 小時
"1d":1 天
"3d":3 天
"30d":30 天
bandwidthAmount int 是 需要租賃的 TRON bandwidth 數量(最少 1,000 單位)。
preActivateDestinationAddress int 否 在 TRON 網路中,地址必須先啟用才能接收 bandwidth。如果您希望計算包含 TRON 地址啟用的 bandwidth 租賃費用,請傳送 preActivateDestinationAddress=1;否則請設定為 "0" 或忽略此參數。
回應範例
{
  "status": "SUCCESS",
  "errorCode": null,
  "errorDescription": null,
  "requestId": "464879de-43",
  "payload": {
    "availableBandwidth": 283260,
    "totalBandwidth": 1977490,
    "minimumOrderBandwidth": 1000,
    "maximumOrderBandwidth": 20000,
    "totalPriceSun": 637000,
    "totalPriceTrx": 0.637,
    "explanation": "The price for each unit of bandwidth is 637 SUN. The final price is calculated as (1000 BANDWIDTH × 637 SUN) = 637000 SUN (0.637000 TRX)."
  }
}
GET /place-bandwidth-order

為指定的 TRON 錢包租用 bandwidth。

請求 URL
https://api.tronenergyrent.com/place-bandwidth-order?apiKey=[YOUR_API_KEY]&period=[RENTAL_DURATION]&bandwidthAmount=[BANDWIDTH_AMOUNT]&destinationAddress=[WALLET]
請求參數 類型 必填 說明
apiKey string 是 您在儀表板中的 API 金鑰
period string 是 租期。以下選項之一:
"1h":1 小時
"1d":1 天
"3d":3 天
"30d":30 天
bandwidthAmount int 是 需要租賃的 TRON bandwidth 數量(最少 1,000 單位)。
destinationAddress string 是 您希望接收 bandwidth 的目標 TRON 地址
preActivateDestinationAddress int 否 在 TRON 網路中,地址必須先啟用才能接收 bandwidth。
如果您希望在接收 bandwidth 之前啟用地址,
請設定 preActivateDestinationAddress=1,否則設定為 "0" 或忽略此參數。
如果設定為 "1",將從您的餘額中扣除 1.5 TRX 的啟用費用。
回應範例
{
  "status": "SUCCESS",
  "errorCode": null,
  "errorDescription": null,
  "requestId": "2fb29976-17",
  "payload": {
    "orderId": "81a6ccd3-9d4c-41d3-b03c-34e78c2eed8f",
    "totalPriceSun": 637000,
    "totalPriceTrx": 0.637,
    "state": "PAID_BY_USER"
  }
}