Energy

Get energy price

post

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 volume must 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
  }
Authorizations
X-API-KEYstringRequired

API key for authentication

Body
daysstring · enumRequiredPossible values:
volumenumber · min: 65000 · max: 4000000RequiredExample: 65000
Responses
200

Preliminary cost

application/json
post
/api/v1/precountOrder
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
}

Buy energy

post

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 volume must 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"
} ```
Authorizations
X-API-KEYstringRequired

API key for authentication

Body
daysstring · enumOptional

Energy rental period

Default: 1hExample: 1hPossible values:
volumenumber · min: 65000 · max: 4000000Optional

Amount of energy to buy

Default: 65000Example: 65000
targetstringRequired

Wallet address to receive energy

Example: TVVX6svz6vXGVACeH9jNMk5M3dH5SvcT71
Responses
200

Order created successfully

application/json
post
/api/v1/buyenergy
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"
}

Get amount of energy needed to send transaction

post

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.

Authorizations
X-API-KEYstringRequired

API key for authentication

Body

Array of TRON addresses to check energy cost

targetsstring[]Required
Responses
200

Order created successfully

application/json
post
/api/v1/cost
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