Energy
Request for preliminary calculation of energy purchase cost. The user provides an authentication token, as well as the parameters: energy usage period days and energy volume volume. A preliminary cost estimate is returned in the response.
Limits:
Energy duration period (Possible values: 1h, 1d, 3d, 7d, 14d)
Energy volume
volumemust be at least 65K and no more than 2M.Energy cannot be transferred to inactive wallets.
Usage example:
POST https://api.tronex.energy/api/v1/precountOrder
Content-Type: application/json
X-API-KEY: authentication_token
{
"days": "1d",
"volume": 65000
}API key for authentication
65000Preliminary cost
Bad request error
Unauthorized error
POST /api/v1/precountOrder HTTP/1.1
Host: api.tronex.energy
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"days": "1h",
"volume": 65000
}{
"duration": "1h",
"volume": 65000,
"price": 100,
"summa": 6.5
}Request to purchase energy with parameters: Energy duration period, Energy volume, and target address. The user provides an authentication token in the request header and sends a JSON payload. The response returns the status of the operation.
Limits:
Energy duration period (Possible values: 1h, 1d, 3d, 7d, 14d)
Energy volume
volumemust be at least 65K and no more than 2M.Energy cannot be transferred to inactive wallets.
Usage example:
POST https://api.tronex.energy/api/v1/buyenergy
Content-Type: application/json
X-API-KEY: authentication_token
{
"days": "1d",
"volume": 65000,
"target": "TVVX6svz6vXGVACeH9jNMk5M3dH5SvcT71"
} ```API key for authentication
Energy rental period
1hExample: 1hPossible values: Amount of energy to buy
65000Example: 65000Wallet address to receive energy
TVVX6svz6vXGVACeH9jNMk5M3dH5SvcT71Order created successfully
Bad request error
Unauthorized error
Insufficient funds error
POST /api/v1/buyenergy HTTP/1.1
Host: api.tronex.energy
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 74
{
"days": "1h",
"volume": 65000,
"target": "TVVX6svz6vXGVACeH9jNMk5M3dH5SvcT71"
}{
"days": "1h",
"volume": 65000,
"price": 100,
"summa": 6.5,
"target": "TVVX6svz6vXGVACeH9jNMk5M3dH5SvcT71",
"order_id": 123456,
"status": "Pending",
"txid": "8a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3"
}The method is used to get the amount of energy needed to send a transaction to the TRON network. The user must provide a valid authentication token in header and an array of TRON addresses in the request body.
API key for authentication
Array of TRON addresses to check energy cost
Order created successfully
Unauthorized error
POST /api/v1/cost HTTP/1.1
Host: api.tronex.energy
X-API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 87
{
"targets": [
"TVVX6svz6vXGVACeH9jNMk5M3dH5SvcT71",
"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
]
}{
"data": [
{
"address": "TVVX6svz6vXGVACeH9jNMk5M3dH5SvcT71",
"need_energy": 65000
},
{
"address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"need_energy": 130000
}
]
}Last updated