API

REST/JSON (not JSON-RPC). Base URL: https://api.trxwatt.com. Amounts are in sun (1 TRX = 1,000,000 sun) unless the field ends in Trx. Endpoints marked auth require an X-API-Key header when the server has API_KEYS set — generate a wallet-bound key on the Settings page (or POST /v1/keys). Errors are { "error": "..." }.

Seller staking / withdraw / claim happen on-chain via TronLink, not through this API.

GET/v1/price

Quote a rental. Price is a fraction of the live burn price, so it always beats burning TRX.

periodmust be "1h" — 1-hour rentals only
energyAmount15,000 – 200,000,000 (≈65,000 per USDT transfer)
curl 'https://api.trxwatt.com/v1/price?period=1h&energyAmount=65000'
// { "totalTrx": 2.6, "totalSun": 2600000, "burnAlternativeSun": 6500000, "savingsPct": 60, ... }
POST/v1/ordersauth

Create + open a rental order (operator delegates pooled Energy to the destination).

destinationAddressaddress that receives Energy (the USDT sender)
periodmust be "1h" — 1-hour rentals only
energyAmountinteger
preActivatebool — activate a fresh address first
curl -X POST https://api.trxwatt.com/v1/orders \
  -H 'X-API-Key: <key>' \
  -H 'Content-Type: application/json' \
  -d '{"destinationAddress":"T...","period":"1h","energyAmount":65000}'
GET/v1/orders/{id}

Fetch an order. Includes energyAmount, priceSun, feeSun (platform cut), status (QUOTED → ACTIVE → CLOSED / FAILED / CANCELLED), openTx/closeTx.

curl 'https://api.trxwatt.com/v1/orders/1'
POST/v1/activateauth

Pre-activate a fresh TRON address (~1 TRX one-time account-creation cost).

curl -X POST https://api.trxwatt.com/v1/activate \
  -H 'X-API-Key: <key>' \
  -H 'Content-Type: application/json' \
  -d '{"address":"T..."}'
POST/v1/coupon

Validate and claim a coupon code for free Energy. Returns ok, message, and energyAmount on success.

codecoupon code (e.g. FREETRIAL)
addressTRON address the free Energy will be delegated to
curl -X POST https://api.trxwatt.com/v1/coupon \
  -H 'X-API-Key: <key>' \
  -H 'Content-Type: application/json' \
  -d '{"code":"FREETRIAL","address":"T..."}'
GET/v1/pool

Live market snapshot: burn price, energy/TRX/day, available energy, utilization, 24h activity.

curl 'https://api.trxwatt.com/v1/pool'
GET/v1/config

Static pricing params (platform fee bps, rent-fraction curve, energy min/max) so clients can reproduce /v1/price quotes locally — e.g. the seller earnings estimator.

curl 'https://api.trxwatt.com/v1/config'
GET/v1/seller/{addr}

Per-seller earnings (reporting mirror; the contract is the source of truth).

curl 'https://api.trxwatt.com/v1/seller/T...'
GET/v1/buyer/{addr}/orders

A wallet's rental orders, newest first (powers the dashboard 'Rentals' tab).

curl 'https://api.trxwatt.com/v1/buyer/T.../orders'
GET/v1/purchases

Recent completed rentals across all buyers, newest first — paginated and date-filterable.

limitpage size (default 10, max 100)
offsetrows to skip (pagination)
fromunix millis — only purchases at/after this time (optional)
tounix millis — only purchases at/before this time (optional)
curl 'https://api.trxwatt.com/v1/purchases?limit=10&offset=0'
// { "items": [ { "id":1, "energyAmount":65000, "priceSun":3250000, ... } ], "total": 42 }
POST/v1/keys

Issue (or rotate) a programmatic API key bound to a wallet. Rotating invalidates the previous key. Testnet trusts the posted address; production requires a wallet signature.

addressyour TRON (base58) address
curl -X POST https://api.trxwatt.com/v1/keys \
  -H 'X-API-Key: <key>' \
  -H 'Content-Type: application/json' \
  -d '{"address":"T..."}'
GET/v1/keys/{addr}

The current API key for an address (apiKey is null if none has been issued).

curl 'https://api.trxwatt.com/v1/keys/T...'
// { "address": "T...", "apiKey": "twk_..." }