Docs menu

Environments

There are two environments, on two hosts. An account, its ledger, its keys and its webhook secrets belong to exactly one of them — nothing spans both.

Before you begin

MainnetNile testnet
Base URLhttps://api.tenergy.me/v1https://api-nile.tenergy.me/v1
Key prefixak_live_… / sk_live_…ak_test_… / sk_test_…
BalanceCredited by a real depositCredited by a deposit of Nile TRX from the public faucet
network in GET /v1/prices and webhook payloadsmainnetnile

A key sent to the other environment’s host is refused with 1012 key_environment_mismatch before it is looked up.

Check which one you are talking to

GET /v1/prices is public and names its network, so a client can assert the environment before it spends anything.

curl -s https://api-nile.tenergy.me/v1/prices | grep -o '"network":"[a-z]*"'
const prices = await (await fetch("https://api-nile.tenergy.me/v1/prices")).json();
if (prices.network !== "nile") throw new Error(`expected nile, got ${prices.network}`);
import json, urllib.request

with urllib.request.urlopen("https://api-nile.tenergy.me/v1/prices") as res:
    prices = json.load(res)
assert prices["network"] == "nile", prices["network"]

Try it on Nile

The runnable TypeScript quickstart (examples/ts-quickstart, see SDKs) targets Nile by default.

  1. Run npm install && RECEIVER_ADDRESS=T… npm start with no TENERGY_KEY set. It signs up with a generated wallet and prints an ak_test_… key, its secret and the account’s Nile deposit address. Save the key and secret to .env.
  2. Get Nile TRX from the public faucet: nileex.io/join/getJoinPage.
  3. Send it to the Nile deposit address from step 1. It is credited after 19 confirmations, about a minute.
  4. Run npm start again. It finds the balance and places a 65,000-energy 1h order for RECEIVER_ADDRESS.
  5. The order reaches active; the script prints the settled order.

What Nile cannot prove

Nile is not an identical testnet. Rehearse the API’s shape there; prove behaviour on mainnet.

NileMainnet
Provider executionThrough ITRX only — the other providers have no testnetThe full cascade
SupplyA small fixed inventory; a large order may fail with 5001 insufficient_supplyThe live supply
Maximum delegate lock5 days (getMaxDelegateLockPeriod 144,000 blocks)30 days (864,000 blocks)
Unfreeze delay1 day14 days (getUnfreezeDelayDays)
Unstake pipelineCannot be exercisedRuns

Webhook deliveries from Nile are signed with the Nile endpoint’s own secret. A receiver serving both environments picks the secret by environment — by network in the payload or by the URL the request arrived at — never by event type.

Next steps

    ↑ ↓ to move · Enter to open · Esc to close