文档目录

Promo — API reference

该文档正文目前仅提供英文版本;导航栏、搜索框和按钮已适配您的当前语言。

The tenergy.app promo token: an address we dropped the token on claims one free energy grant, by signing a message (no transaction, so its free bandwidth stays for the transfer) or by forwarding the token. Mainnet only.

MethodPathSummary
GET/v1/promoThe promo token’s current terms
POST/v1/promo/redeem/challengeThe message to sign to claim the promo grant
POST/v1/promo/redeemClaim the promo grant with the signed challenge
POST/v1/promo/dev/challengeThe message to sign to claim a tenergy.dev promo code
POST/v1/promo/dev/claimClaim the wallet’s personal tenergy.dev promo code
GET/v1/promo/redemptions/{address}An address’s claim and its grant

Base URL https://api.tenergy.me/v1, or https://api-nile.tenergy.me/v1 on Nile (Environments). Every request below is signed as in Authentication unless its Auth line says otherwise.

The promo token’s current terms

GET /v1/promo · getPromo

Auth: Public — no credentials.

Whether the promo is open now, today’s cap and what is left of it, the grant, the token and the address a holder may forward it to. state: off on a network with no promo (Nile); every other field is then null. Cached for 15 s.

Responses

StatusMeaning
200The terms.
429Too many requests.
500Something broke on our side.

Response fields (Promo)

FieldTypeRequiredDescription
networkenum: mainnet, nileyes
stateenum: active, cap_reached_today, not_started, ended, offyesoff: no promo on this network; every field below is then null.
starts_atstring (date-time) | nullyes
ends_atstring (date-time) | nullyes
cap_per_dayinteger | nullyesGrants per UTC day.
left_todayinteger | nullyes
resets_atstring (date-time) | nullyesThe next UTC midnight.
grantobject | nullyes
grant.resourceenum: energyyes
grant.amountintegeryes
grant.duration_secondsintegeryes
tokenobject | nullyes
token.idstringyesThe TRC10 token id.
token.namestringyes
forward_addressstring | nullyesForward any amount of the token here instead of signing (the page asks for exactly 1).

The message to sign to claim the promo grant

POST /v1/promo/redeem/challenge · createPromoRedeemChallenge

Auth: Public — no credentials.

The address challenge (see POST /accounts/challenge) under purpose promo_redeem. The claim is checked BEFORE anything is signed — 3038 promo_not_eligible, 3039 promo_already_redeemed, 3040 promo_redeem_unavailable — so a wallet is never asked to sign for nothing.

Request body

JSON, required.

FieldTypeRequiredDescription
addressstringyesBase58Check TRON address (starts with T, 34 characters).

Responses

StatusMeaning
201Challenge issued.
400Malformed request — bad JSON, unknown field, wrong type.
403Authenticated, but this key is not allowed to do it.
409The request contradicts the current state of the object.
429Too many requests.
500Something broke on our side.

Response fields (AccountChallenge)

FieldTypeRequiredDescription
noncestringyesSingle-use
addressstringyesBase58Check TRON address (starts with T, 34 characters).
purposeenum: signup, login, recovery, link, promo_redeem, promo_dev_code
messagestringyesThe exact string to sign, TIP-191 personal-sign style. Domain-bound and human-readable, so that a person signing it in a wallet can see what it says. Sign these bytes verbatim — do not re-wrap, trim or re-encode them.
issued_atstring (date-time)yes
expires_atstring (date-time)yesTen minutes after issue. An expired nonce gives 1010 challenge_invalid.

Claim the promo grant with the signed challenge

POST /v1/promo/redeem · redeemPromo

Auth: Public — no credentials.

One grant per address, whichever way it claims (signature or forwarding the token). A refused claim records nothing. The grant is delegated within about a minute: poll GET /promo/redemptions/{address}.

Request body

JSON (AccountChallengeVerifyRequest), required.

FieldTypeRequiredDescription
addressstringyesBase58Check TRON address (starts with T, 34 characters).
noncestringyes
signaturestringyesHex signature over message. Must recover address; 0x prefix optional.

Responses

StatusMeaning
201Claimed; the grant is on its way.
400Malformed request — bad JSON, unknown field, wrong type.
401Missing, malformed or rejected credentials.
403Authenticated, but this key is not allowed to do it.
409The request contradicts the current state of the object.
429Too many requests.
500Something broke on our side.

Response fields (PromoRedeemResult)

FieldTypeRequiredDescription
addressstringyesBase58Check TRON address (starts with T, 34 characters).
methodenum: signature, forwardyes
redeemed_atstring (date-time)yes
statusenum: granting, delegated, failedyesfailed: no energy could be delegated; an operator sees it. A grant is never made twice.
energyintegeryes
expires_atstring (date-time) | nullyesWhen the delegation ends
has_accountbooleanyesThe wallet already opens an account (its own, or one it is linked to). The page offers “go to the dashboard”; otherwise “create an account with this wallet” or “sign in another way”.
wallet_ticketobjectyesThe signature just checked, usable ONCE within ten minutes: POST /session/wallet-ticket signs in with this wallet; after signing in another way, POST /session/identities/wallet/ticket links it. Keep it in memory only; never in a URL or storage.
wallet_ticket.tokenstringyes
wallet_ticket.expires_atstring (date-time)yes

The message to sign to claim a tenergy.dev promo code

POST /v1/promo/dev/challenge · createPromoDevChallenge

Auth: Public — no credentials.

For a wallet we dropped the tenergy.dev token on, on Nile. Checked before anything is signed: 3038 promo_not_eligible when Nile has no such drop; 3040 promo_redeem_unavailable (state off) where this promo is not set up; 5003 chain_unavailable when the Nile drop log cannot be read. A wallet that already has its code may sign again to see it. Purpose promo_dev_code.

Request body

JSON, required.

FieldTypeRequiredDescription
addressstringyesBase58Check TRON address (starts with T, 34 characters).

Responses

StatusMeaning
201Challenge issued.
400Malformed request — bad JSON, unknown field, wrong type.
403Authenticated, but this key is not allowed to do it.
409The request contradicts the current state of the object.
429Too many requests.
500Something broke on our side.

Response fields (AccountChallenge)

FieldTypeRequiredDescription
noncestringyesSingle-use
addressstringyesBase58Check TRON address (starts with T, 34 characters).
purposeenum: signup, login, recovery, link, promo_redeem, promo_dev_code
messagestringyesThe exact string to sign, TIP-191 personal-sign style. Domain-bound and human-readable, so that a person signing it in a wallet can see what it says. Sign these bytes verbatim — do not re-wrap, trim or re-encode them.
issued_atstring (date-time)yes
expires_atstring (date-time)yesTen minutes after issue. An expired nonce gives 1010 challenge_invalid.

Claim the wallet’s personal tenergy.dev promo code

POST /v1/promo/dev/claim · claimPromoDevCode

Auth: Public — no credentials.

One personal code per wallet: a 3 % routing fee for 30 days from when an account enters it (POST /account/promo), to be entered by activate_by. The lower of the code and the account’s volume tier applies. 201 when issued now, 200 with the same code on any later claim. Never energy: a fee acts only on paid orders.

Request body

JSON (AccountChallengeVerifyRequest), required.

FieldTypeRequiredDescription
addressstringyesBase58Check TRON address (starts with T, 34 characters).
noncestringyes
signaturestringyesHex signature over message. Must recover address; 0x prefix optional.

Responses

StatusMeaning
200The code issued earlier.
201Issued now.
400Malformed request — bad JSON, unknown field, wrong type.
401Missing, malformed or rejected credentials.
403Authenticated, but this key is not allowed to do it.
409The request contradicts the current state of the object.
429Too many requests.
500Something broke on our side.

Response fields (PromoDevCode)

FieldTypeRequiredDescription
codestringyes
fee_pctnumberyes
duration_daysintegeryesCounted from when an account enters the code.
activate_bystring (date-time) | nullyesThe last moment the code can be entered.
usedbooleanyesAn account has entered it already (single use).

An address’s claim and its grant

GET /v1/promo/redemptions/{address} · getPromoRedemption

Auth: Public — no credentials.

Parameters

NameInTypeRequiredDescription
addresspathstringyes

Responses

StatusMeaning
200The claim.
400Malformed request — bad JSON, unknown field, wrong type.
404No such object, or it belongs to another account. The two are not distinguished.
429Too many requests.
500Something broke on our side.

Response fields (PromoRedemption)

FieldTypeRequiredDescription
addressstringyesBase58Check TRON address (starts with T, 34 characters).
methodenum: signature, forwardyes
redeemed_atstring (date-time)yes
statusenum: granting, delegated, failedyesfailed: no energy could be delegated; an operator sees it. A grant is never made twice.
energyintegeryes
expires_atstring (date-time) | nullyesWhen the delegation ends

    ↑ ↓ 切换 · Enter 打开 · Esc 关闭