For the complete documentation index, see llms.txt. This page is also available as Markdown.
Sell Resources
Manually sell Energy or Bandwidth on TronSave by matching active buy orders with a signed on-chain delegate transaction.
The Sell Resources API lets a resource provider manually fill open buy orders on TronSave. The seller fetches active orders, builds and signs an on-chain DelegateResourceContract transaction, then submits the signed transaction to TronSave for order matching and payout.
Whitelist required. The Sell API is restricted to whitelisted wallets. Log in to TronSave and send your wallet address to support so it can be added to the whitelist. Once whitelisted, use the API Key generated from that wallet address to call the Sell endpoints.
TronSave API Key (must belong to a whitelisted address). See Authentication.
Query parameters
Name
Type
Description
page
Integer
Page index, starting from 0. Default: 0
pageSize
Integer
Number of orders per page. Default: 10
Response
Example response
Request examples
Step 2: Sell the resource
Submits a signed delegate transaction to fill the chosen order.
POSThttps://api.tronsave.io/v2/orders/sell-manual
Rate limit: 2 requests per 1 second.
Headers
Name
Type
Description
apikey*
String
TronSave API Key (must belong to a whitelisted address). See Authentication.
Request body
Name
Type
Description
orderId*
string
Order ID from the id field in Step 1.
paymentAddress
string
TRON address to receive payment for the sell order. If not provided, the payment is sent to the delegator address.
isAllowSellForLockedDelegator
boolean
false (default) β do not sell to a target address currently locked on-chain.
true β sell to all target addresses.
signedTx*
object
Signed transaction. Note that it is a JSON object.
Request body example
Response (success)
Response (error)
Both Sell endpoints require a valid apikey header that belongs to a whitelisted address. Authentication and validation failures return one of the bodies below.
401 Unauthorized β missing API key (no apikey header):
401 Unauthorized β invalid API key:
400 Bad Request β schema validation (a required field is missing or invalid; the message names the offending field, e.g. orderId or signedTx):
404 Not Found β wrong route/path:
Business-logic failures (for example, the chosen order can no longer be fulfilled, or the signed transaction does not match the order) return the standard TronSave envelope with error: true and a descriptive message:
Rate limits: the global default is 15 requests/second; the Sell Resources endpoints are limited to 2β3 requests/second (3 req/s for active-global, 2 req/s for sell-manual). Exceeding the limit returns {"error": true, "message": "Rate limit reached"}.
Request examples
End-to-end example: building the signed transaction
The signed transaction in Step 2 is a TRON DelegateResourceContract that delegates resource from your wallet (the delegator) to the order's receiver. The example below uses TronWeb to fetch active orders, pick the highest-priced one, derive the freeze rate, build and sign the delegate transaction, and submit it.
This example targets the Nile testnet. The TronSave base URL https://api-dev.tronsave.io and TronWeb full host https://api.nileex.io are for testing. For mainnet, use https://api.tronsave.io and https://api.trongrid.io.
{
"error": false,
"message": "Success",
"data": {
"data": [
{
"id": string, // Order identifier β use as orderId in Step 2
"receiver": string, // TRON address that receives the delegated resource
"resourceAmount": number,// the amount of resource
"resourceType": string, // the resource type is "ENERGY" or "BANDWIDTH"
"remainAmount": number, // the remaining amount that can be matched by the system
"orderType": string, // type of order is "NORMAL" or "EXTEND"
"price": number, // price unit is equal to SUN
"durationSec": number, // rent duration, duration unit is equal to seconds
"status": string, // the order status, either Active or Completed
"allowPartialFill": boolean, // Allow the order to be filled partially or not
"payoutAmount": number, // Total payout of this order (SUN)
"fulfilledPercent": number, // The percent that shows filling processing. 0-100
"createdAt": 1778467289
}
],
"total": 3
}
}