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.

Selling is a two-step flow:

  1. Get active orders β€” list open buy orders you can fill.

  2. Sell the resource β€” submit a signed delegate transaction against a chosen order.

Step 1: Get active orders

Returns the global list of active buy orders available for matching.

GET https://api.tronsave.io/v2/orders/active-global

Rate limit: 3 requests per 1 second.

Headers

Name
Type
Description

apikey *

String

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.

POST https://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.

Next steps

Last updated