java-tron HTTP API¶
This directory documents the FullNode HTTP endpoints under framework/src/main/java/org/tron/core/services/http/. One markdown file per endpoint, named after the last segment of the URL (e.g. /wallet/getnodeinfo → getnodeinfo.md).
The following categories are intentionally not covered:
- Exchange (DEX) endpoints
- Market (order book) endpoints
- Shielded (anonymous transaction) endpoints
Common conventions¶
- Method: a few pure-query endpoints accept
GET, but most POST endpoints only acceptPOSTwith a JSON body. visible: whentrue, addresses are base58check strings and text fields (URL, descriptions, etc.) are UTF-8 strings; whenfalse(default), they are hex strings.- Builder endpoints return an unsigned
protocol.Transaction. The caller signs it locally and broadcasts it via/wallet/broadcasttransactionor/wallet/broadcasthex. permission_id: optional on builder endpoints; selects whichPermissionto use for multi-sig accounts.- Amount unit: TRC-10 amounts use the issuer-defined precision; every other amount is in sun (1 TRX = 1e6 sun).
XSS security note
Although the HTTP API reduces the risk of the browser parsing responses directly as HTML by setting Content-Type to application/json, this does not fully eliminate XSS. Some endpoints do not strictly validate their inputs, and responses may echo user-controlled content (especially when visible=true, where fields such as addresses and memos may be returned verbatim as UTF-8 strings). Before rendering any data returned by the API into a page, handle it safely according to the output context.
The correct approach is to choose the encoding that matches where the data is placed: in an HTML text context, use HTML entity encoding (e.g. < → <, > → >, " → "), or rely on your front-end framework's default output escaping (such as React JSX or Vue template escaping). Only use encodeURIComponent() and similar URL-encoding methods when the data is placed into a URL parameter. Note that encodeURIComponent() / escape() are URL encoding (or legacy encoding) and cannot replace output escaping in an HTML context.
For more guidance, see the OWASP XSS Prevention Cheat Sheet.
Error responses¶
In the vast majority of cases the HTTP status is 200 — business errors are conveyed in the response body, so the client must parse the body to determine success or failure. Known exceptions:
- When an endpoint is explicitly disabled via the node's
disabledApiList,HttpApiAccessFilterreturns HTTP 404 with body{"Error": "this API is unavailable due to config"}. - When the node runs in lite fullnode mode and
openHistoryQueryWhenLiteFNis not enabled,LiteFnQueryHttpFilterreturns HTTP 200 for ~24 historical-query endpoints (getblockbynum/gettransactionbyid/gettransactioninfobyid/gettransactioninfobyblocknum/getblockbyid/getblockbylatestnum/getblockbylimitnext/gettransactioncountbyblocknum, etc.) but the body is the bare stringthis API is closed because this node is a lite fullnode(not JSON) — a naiveJSON.parsewill throw, so clients must check the prefix as a string first. - Network-layer errors produced by the servlet container or a reverse proxy (502, 504, connection refused, etc.) are out of scope for this document.
Account¶
| Endpoint | Description |
|---|---|
/wallet/getaccount |
Query an account by address |
/wallet/getaccountbalance |
Query an account's balance at a specific block |
/wallet/getaccountnet |
Query an account's bandwidth resources |
/wallet/getaccountresource |
Query bandwidth + energy + TronPower |
/wallet/createaccount |
Create an on-chain account (costs 1 TRX) |
/wallet/updateaccount |
Update an account's name |
/wallet/accountpermissionupdate |
Configure multi-sig permissions |
/wallet/validateaddress |
Validate an address |
Block / transaction query¶
| Endpoint | Description |
|---|---|
/wallet/getnowblock |
Latest block |
/wallet/getblock |
Generic block query (by num or hash) |
/wallet/getblockbynum |
Block by height |
/wallet/getblockbyid |
Block by hash |
/wallet/getblockbylimitnext |
Blocks in a range |
/wallet/getblockbylatestnum |
The most recent N blocks |
/wallet/getblockbalance |
Per-account balance changes within a block |
/wallet/gettransactioncountbyblocknum |
Transaction count in a block |
/wallet/gettransactionbyid |
Transaction by txid |
/wallet/gettransactioninfobyid |
Transaction receipt by txid |
/wallet/gettransactioninfobyblocknum |
Transaction receipts by block |
/wallet/getpendingsize |
Pending pool size |
/wallet/gettransactionfrompending |
Single pending transaction |
/wallet/gettransactionlistfrompending |
All pending transaction IDs |
Transaction build / broadcast¶
| Endpoint | Description |
|---|---|
/wallet/createtransaction |
Build a TRX transfer transaction |
/wallet/getsignweight |
Current multi-sig weight |
/wallet/getapprovedlist |
Addresses that have already signed |
/wallet/broadcasttransaction |
Broadcast a signed transaction (JSON) |
/wallet/broadcasthex |
Broadcast a signed transaction (hex) |
TRC-10 asset¶
| Endpoint | Description |
|---|---|
/wallet/createassetissue |
Issue a TRC-10 token |
/wallet/updateasset |
Update a TRC-10's description / URL / limits |
/wallet/transferasset |
Transfer TRC-10 |
/wallet/participateassetissue |
Participate in a TRC-10 fundraising |
/wallet/unfreezeasset |
Unfreeze TRC-10 frozen by the issuer |
/wallet/getassetissuebyid |
Look up a TRC-10 by id (recommended) |
/wallet/getassetissuebyname |
Look up a TRC-10 by name (errors on duplicates) |
/wallet/getassetissuelistbyname |
All TRC-10s with a given name |
/wallet/getassetissuebyaccount |
TRC-10s issued by an account |
/wallet/getassetissuelist |
All TRC-10s on the network |
/wallet/getpaginatedassetissuelist |
Paginated TRC-10 list |
Smart contract¶
| Endpoint | Description |
|---|---|
/wallet/deploycontract |
Deploy a contract |
/wallet/triggersmartcontract |
Trigger a contract (write) |
/wallet/triggerconstantcontract |
Read-only contract call |
/wallet/estimateenergy |
Estimate energy usage of a call |
/wallet/getcontract |
Contract metadata |
/wallet/getcontractinfo |
Full contract runtime info |
/wallet/clearabi |
Clear a contract's ABI |
/wallet/updatesetting |
Change the user-energy percentage |
/wallet/updateenergylimit |
Change the deployer's energy limit |
Witness / governance¶
| Endpoint | Description |
|---|---|
/wallet/createwitness |
Apply to become an SR candidate |
/wallet/updatewitness |
Update an SR's URL |
/wallet/listwitnesses |
All SR candidates |
/wallet/getpaginatednowwitnesslist |
Paginated SR list |
/wallet/votewitnessaccount |
Vote for SRs |
/wallet/getBrokerage |
An SR's current brokerage rate |
/wallet/updateBrokerage |
Update an SR's brokerage |
/wallet/getReward |
Claimable rewards for an account |
/wallet/withdrawbalance |
Withdraw block production rewards / dividends |
/wallet/proposalcreate |
Create a chain-parameter proposal |
/wallet/proposalapprove |
Vote on a proposal as an SR |
/wallet/proposaldelete |
Withdraw your own proposal |
/wallet/listproposals |
List of proposals |
/wallet/getproposalbyid |
Proposal by ID |
/wallet/getpaginatedproposallist |
Paginated proposal list |
/wallet/getchainparameters |
Current chain parameters |
/wallet/getnextmaintenancetime |
Next maintenance period time |
Stake 1.0 (unfreeze and query only)¶
After proposal #70 UNFREEZE_DELAY_DAYS was approved (already active on mainnet), new V1 freezes are rejected by the chain; the unfreeze and query endpoints are kept to handle outstanding positions.
| Endpoint | Description |
|---|---|
/wallet/freezebalance |
Freeze TRX for resources (V1, chain rejects new requests) |
/wallet/unfreezebalance |
Unfreeze matured resources (V1, still usable for legacy positions) |
/wallet/getdelegatedresource |
Query delegation records (V1, read-only) |
/wallet/getdelegatedresourceaccountindex |
Query delegation counterparty addresses (V1, read-only) |
Stake 2.0¶
| Endpoint | Description |
|---|---|
/wallet/freezebalancev2 |
Freeze TRX for resources |
/wallet/unfreezebalancev2 |
Initiate unfreeze (14-day waiting period) |
/wallet/withdrawexpireunfreeze |
Withdraw matured unfreezes |
/wallet/cancelallunfreezev2 |
Cancel all unmatured unfreezes |
/wallet/delegateresource |
Delegate resources to another account |
/wallet/undelegateresource |
Undelegate resources from another account |
/wallet/getdelegatedresourcev2 |
Query delegation records |
/wallet/getdelegatedresourceaccountindexv2 |
Query delegation counterparty addresses |
/wallet/getcandelegatedmaxsize |
Current maximum delegatable amount |
/wallet/getavailableunfreezecount |
Remaining unfreeze count |
/wallet/getcanwithdrawunfreezeamount |
Withdrawable unfreeze amount at a given time |
Node / pricing / tools¶
| Endpoint | Description |
|---|---|
/wallet/getnodeinfo |
Node status (also /monitor/getnodeinfo) |
/wallet/listnodes |
Known peers (also /net/listnodes) |
/wallet/getenergyprices |
Historical energy unit prices |
/wallet/getbandwidthprices |
Historical bandwidth unit prices |
/wallet/getburntrx |
Cumulative burned TRX |